| | |
| | | import com.example.jz.dao.GroupDao; |
| | | import com.example.jz.dao.GroupUserDao; |
| | | import com.example.jz.dao.ReportDao; |
| | | import com.example.jz.dao.UserDao; |
| | | import com.example.jz.modle.dto.AddReportDto; |
| | | import com.example.jz.modle.dto.ReportParamDto; |
| | | import com.example.jz.modle.entity.Group; |
| | | import com.example.jz.modle.entity.GroupUser; |
| | | import com.example.jz.modle.entity.Report; |
| | | import com.example.jz.modle.entity.User; |
| | | import com.example.jz.modle.vo.ReportListVo; |
| | | import com.example.jz.dao.*; |
| | | import com.example.jz.modle.entity.*; |
| | |
| | | import com.example.jz.service.MinIOService; |
| | | import com.example.jz.service.ReportService; |
| | | import lombok.SneakyThrows; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | aaa.getRecords().stream().forEach(x -> x.setIdcard(x.getIdcard().replaceAll("(?<=[\\d]{3})\\d(?=[\\d]{4})", "*"))); |
| | | return aaa; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public Boolean addReport(AddReportDto addReportDto) { |
| | | User user = userDao.selectOne(new LambdaQueryWrapper<User>(User.class).eq(User::getUserIdcard, addReportDto.getIdcard())); |
| | | if (user == null) { |
| | | // 如果用户不存在 则添加用户 |
| | | user = new User().setUserIdcard(addReportDto.getIdcard()).setUserMobile(addReportDto.getMobile()).setRealName(addReportDto.getReporterName()) |
| | | .setModifyTime(new Date()).setUserRegtime(new Date()).setPic(addReportDto.getPic()); |
| | | userDao.insert(user); |
| | | } |
| | | // 添加报案信息 |
| | | Report report = new Report(); |
| | | BeanUtils.copyProperties(addReportDto, report); |
| | | report |
| | | .setUserId(user.getId()) |
| | | .setCtime(new Date()) |
| | | .setStatus(0) |
| | | .setReportMethod("现场录入") |
| | | .setIsCommission("0").setReportTime(new Date()); |
| | | return reportDao.insert(report) > 0; |
| | | } |
| | | } |
| | | |