|
@@ -13,6 +13,7 @@ import com.usky.fire.domain.DemPoliceRecord;
|
|
|
import com.usky.fire.mapper.DemPoliceRecordMapper;
|
|
|
import com.usky.fire.service.DemPoliceInfoService;
|
|
|
import com.usky.fire.service.DemPoliceRecordService;
|
|
|
+import com.usky.fire.service.vo.DemPoliceRecordExportVO;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -32,81 +33,132 @@ import java.util.Map;
|
|
|
*/
|
|
|
@Service
|
|
|
public class DemPoliceRecordServiceImpl extends AbstractCrudService<DemPoliceRecordMapper, DemPoliceRecord> implements DemPoliceRecordService {
|
|
|
+//
|
|
|
+// @Autowired
|
|
|
+// private DemPoliceInfoService demPoliceInfoService;
|
|
|
|
|
|
- @Autowired
|
|
|
- private DemPoliceInfoService demPoliceInfoService;
|
|
|
-
|
|
|
- @Override
|
|
|
- public CommonPage<Object> policeRecordList(String caseCode, String branch, Integer id, Integer pageNum, Integer pageSize) {
|
|
|
- List<Object> list = new ArrayList<>();
|
|
|
- IPage<DemPoliceRecord> page = new Page<>(pageNum, pageSize);
|
|
|
- LambdaQueryWrapper<DemPoliceRecord> queryWrapper = Wrappers.lambdaQuery();
|
|
|
- queryWrapper.eq(DemPoliceRecord::getDeleteFlag, "0")
|
|
|
- .orderByDesc(DemPoliceRecord::getId);
|
|
|
- page = this.page(page, queryWrapper);
|
|
|
- if (CollectionUtils.isNotEmpty(page.getRecords())) {
|
|
|
- List<String> policeIdList = new ArrayList<>();
|
|
|
- for (int i = 0; i < page.getRecords().size(); i++) {
|
|
|
- policeIdList.add(page.getRecords().get(i).getCaseInfoId());
|
|
|
- }
|
|
|
- if (CollectionUtils.isNotEmpty(policeIdList)) {
|
|
|
- LambdaQueryWrapper<DemPoliceInfo> queryWrapper1 = Wrappers.lambdaQuery();
|
|
|
- queryWrapper1.select(DemPoliceInfo::getId, DemPoliceInfo::getCaseCode, DemPoliceInfo::getBranch,
|
|
|
- DemPoliceInfo::getTimeSlot, DemPoliceInfo::getArea, DemPoliceInfo::getCaseType,
|
|
|
- DemPoliceInfo::getFilingDate, DemPoliceInfo::getFilingTime, DemPoliceInfo::getHandleObject,
|
|
|
- DemPoliceInfo::getCaseStatus, DemPoliceInfo::getCaseNature, DemPoliceInfo::getDispatchVehicle,
|
|
|
- DemPoliceInfo::getPoliceId)
|
|
|
- .in(DemPoliceInfo::getPoliceId, policeIdList)
|
|
|
- .like(StringUtils.isNotBlank(branch), DemPoliceInfo::getBranch, branch)
|
|
|
- .like(StringUtils.isNotBlank(caseCode), DemPoliceInfo::getCaseCode, caseCode);
|
|
|
- List<DemPoliceInfo> list1 = demPoliceInfoService.list(queryWrapper1);
|
|
|
- for (int i = 0; i < page.getRecords().size(); i++) {
|
|
|
- for (int j = 0; j < list1.size(); j++) {
|
|
|
- if (page.getRecords().get(i).getCaseInfoId().equals(list1.get(j).getPoliceId())) {
|
|
|
- Map<String, Object> map = new HashMap<>();
|
|
|
- map.put("id", page.getRecords().get(i).getId());
|
|
|
- map.put("handleStartTime", page.getRecords().get(i).getHandleStartTime());
|
|
|
- map.put("handleEndTime", page.getRecords().get(i).getHandleEndTime());
|
|
|
- map.put("id1", list1.get(j).getId());
|
|
|
- map.put("caseCode", list1.get(j).getCaseCode());
|
|
|
- map.put("branch", list1.get(j).getBranch());
|
|
|
- map.put("timeSlot", list1.get(j).getTimeSlot());
|
|
|
- map.put("area", list1.get(j).getArea());
|
|
|
- map.put("caseType", list1.get(j).getCaseType());
|
|
|
- map.put("filingDate", list1.get(j).getFilingDate());
|
|
|
- map.put("filingTime", list1.get(j).getFilingTime());
|
|
|
- map.put("handleObject", list1.get(j).getHandleObject());
|
|
|
- map.put("caseStatus", list1.get(j).getCaseStatus());
|
|
|
- map.put("caseNature", list1.get(j).getCaseNature());
|
|
|
- map.put("dispatchVehicle", list1.get(j).getDispatchVehicle());
|
|
|
- list.add(map);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- return new CommonPage<>(list, page.getTotal(), pageSize, pageNum);
|
|
|
- }
|
|
|
+// @Override
|
|
|
+// public CommonPage<Object> policeRecordList(String caseCode, String branch, Integer id, Integer pageNum, Integer pageSize) {
|
|
|
+// List<Object> list = new ArrayList<>();
|
|
|
+// IPage<DemPoliceRecord> page = new Page<>(pageNum, pageSize);
|
|
|
+// LambdaQueryWrapper<DemPoliceRecord> queryWrapper = Wrappers.lambdaQuery();
|
|
|
+// queryWrapper.eq(DemPoliceRecord::getDeleteFlag, "0")
|
|
|
+// .orderByDesc(DemPoliceRecord::getId);
|
|
|
+// page = this.page(page, queryWrapper);
|
|
|
+// if (CollectionUtils.isNotEmpty(page.getRecords())) {
|
|
|
+// List<String> policeIdList = new ArrayList<>();
|
|
|
+// for (int i = 0; i < page.getRecords().size(); i++) {
|
|
|
+// policeIdList.add(page.getRecords().get(i).getCaseInfoId());
|
|
|
+// }
|
|
|
+// if (CollectionUtils.isNotEmpty(policeIdList)) {
|
|
|
+// LambdaQueryWrapper<DemPoliceInfo> queryWrapper1 = Wrappers.lambdaQuery();
|
|
|
+// queryWrapper1.select(DemPoliceInfo::getId, DemPoliceInfo::getCaseCode, DemPoliceInfo::getBranch,
|
|
|
+// DemPoliceInfo::getTimeSlot, DemPoliceInfo::getArea, DemPoliceInfo::getCaseType,
|
|
|
+// DemPoliceInfo::getFilingDate, DemPoliceInfo::getFilingTime, DemPoliceInfo::getHandleObject,
|
|
|
+// DemPoliceInfo::getCaseStatus, DemPoliceInfo::getCaseNature, DemPoliceInfo::getDispatchVehicle,
|
|
|
+// DemPoliceInfo::getPoliceId)
|
|
|
+// .in(DemPoliceInfo::getPoliceId, policeIdList)
|
|
|
+// .like(StringUtils.isNotBlank(branch), DemPoliceInfo::getBranch, branch)
|
|
|
+// .like(StringUtils.isNotBlank(caseCode), DemPoliceInfo::getCaseCode, caseCode);
|
|
|
+// List<DemPoliceInfo> list1 = demPoliceInfoService.list(queryWrapper1);
|
|
|
+// for (int i = 0; i < page.getRecords().size(); i++) {
|
|
|
+// for (int j = 0; j < list1.size(); j++) {
|
|
|
+// if (page.getRecords().get(i).getCaseInfoId().equals(list1.get(j).getPoliceId())) {
|
|
|
+// Map<String, Object> map = new HashMap<>();
|
|
|
+// map.put("id", page.getRecords().get(i).getId());
|
|
|
+// map.put("handleStartTime", page.getRecords().get(i).getHandleStartTime());
|
|
|
+// map.put("handleEndTime", page.getRecords().get(i).getHandleEndTime());
|
|
|
+// map.put("id1", list1.get(j).getId());
|
|
|
+// map.put("caseCode", list1.get(j).getCaseCode());
|
|
|
+// map.put("branch", list1.get(j).getBranch());
|
|
|
+// map.put("timeSlot", list1.get(j).getTimeSlot());
|
|
|
+// map.put("area", list1.get(j).getArea());
|
|
|
+// map.put("caseType", list1.get(j).getCaseType());
|
|
|
+// map.put("filingDate", list1.get(j).getFilingDate());
|
|
|
+// map.put("filingTime", list1.get(j).getFilingTime());
|
|
|
+// map.put("handleObject", list1.get(j).getHandleObject());
|
|
|
+// map.put("caseStatus", list1.get(j).getCaseStatus());
|
|
|
+// map.put("caseNature", list1.get(j).getCaseNature());
|
|
|
+// map.put("dispatchVehicle", list1.get(j).getDispatchVehicle());
|
|
|
+// list.add(map);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// return new CommonPage<>(list, page.getTotal(), pageSize, pageNum);
|
|
|
+// }
|
|
|
+//
|
|
|
+// @Override
|
|
|
+// public List<DemPoliceRecordExportVO> policeRecordListExport(String caseCode, String branch){
|
|
|
+// List<DemPoliceRecordExportVO> list = new ArrayList<>();
|
|
|
+// LambdaQueryWrapper<DemPoliceRecord> queryWrapper = Wrappers.lambdaQuery();
|
|
|
+// queryWrapper.select(DemPoliceRecord::getCaseInfoId, DemPoliceRecord::getHandleStartTime, DemPoliceRecord::getHandleEndTime)
|
|
|
+// .eq(DemPoliceRecord::getDeleteFlag, "0")
|
|
|
+// .orderByDesc(DemPoliceRecord::getId).last("limit 1000");
|
|
|
+// List<DemPoliceRecord> list1 = this.list(queryWrapper);
|
|
|
+// if (CollectionUtils.isNotEmpty(list1)) {
|
|
|
+// List<String> policeIdList = new ArrayList<>();
|
|
|
+// for (int i = 0; i < list1.size(); i++) {
|
|
|
+// policeIdList.add(list1.get(i).getCaseInfoId());
|
|
|
+// }
|
|
|
+// if (CollectionUtils.isNotEmpty(policeIdList)) {
|
|
|
+// LambdaQueryWrapper<DemPoliceInfo> queryWrapper1 = Wrappers.lambdaQuery();
|
|
|
+// queryWrapper1.select(DemPoliceInfo::getId, DemPoliceInfo::getCaseCode, DemPoliceInfo::getBranch,
|
|
|
+// DemPoliceInfo::getTimeSlot, DemPoliceInfo::getArea, DemPoliceInfo::getCaseType,
|
|
|
+// DemPoliceInfo::getFilingDate, DemPoliceInfo::getFilingTime, DemPoliceInfo::getHandleObject,
|
|
|
+// DemPoliceInfo::getCaseStatus, DemPoliceInfo::getCaseNature, DemPoliceInfo::getDispatchVehicle,
|
|
|
+// DemPoliceInfo::getPoliceId)
|
|
|
+// .in(DemPoliceInfo::getPoliceId, policeIdList)
|
|
|
+// .like(StringUtils.isNotBlank(branch), DemPoliceInfo::getBranch, branch)
|
|
|
+// .like(StringUtils.isNotBlank(caseCode), DemPoliceInfo::getCaseCode, caseCode);
|
|
|
+// List<DemPoliceInfo> list2 = demPoliceInfoService.list(queryWrapper1);
|
|
|
+// for (int i = 0; i < list1.size(); i++) {
|
|
|
+// for (int j = 0; j < list2.size(); j++) {
|
|
|
+// if (list1.get(i).getCaseInfoId().equals(list2.get(j).getPoliceId())) {
|
|
|
+// DemPoliceRecordExportVO demPoliceRecordExportVO = new DemPoliceRecordExportVO();
|
|
|
+// demPoliceRecordExportVO.setCaseCode(list2.get(j).getCaseCode());
|
|
|
+// demPoliceRecordExportVO.setHandleStartTime(list1.get(i).getHandleStartTime());
|
|
|
+// demPoliceRecordExportVO.setHandleEndTime(list1.get(i).getHandleEndTime());
|
|
|
+// demPoliceRecordExportVO.setBranch(list2.get(j).getBranch());
|
|
|
+// demPoliceRecordExportVO.setTimeSlot(list2.get(j).getTimeSlot());
|
|
|
+// demPoliceRecordExportVO.setArea(list2.get(j).getArea());
|
|
|
+// demPoliceRecordExportVO.setCaseType(list2.get(j).getCaseType());
|
|
|
+// demPoliceRecordExportVO.setFilingDate(list2.get(j).getFilingDate());
|
|
|
+// demPoliceRecordExportVO.setFilingTime(list2.get(j).getFilingTime());
|
|
|
+// demPoliceRecordExportVO.setHandleObject(list2.get(j).getHandleObject());
|
|
|
+// demPoliceRecordExportVO.setCaseStatus(list2.get(j).getCaseStatus());
|
|
|
+// demPoliceRecordExportVO.setCaseNature(list2.get(j).getCaseNature());
|
|
|
+// demPoliceRecordExportVO.setDispatchVehicle(list2.get(j).getDispatchVehicle());
|
|
|
+// list.add(demPoliceRecordExportVO);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// return list;
|
|
|
+// }
|
|
|
|
|
|
@Transactional
|
|
|
- @Override
|
|
|
- public void updatePoliceRecord(DemPoliceRecord demPoliceRecord) {
|
|
|
- this.updateById(demPoliceRecord);
|
|
|
- DemPoliceInfo demPoliceInfo = new DemPoliceInfo();
|
|
|
- demPoliceInfo.setId(demPoliceRecord.getId1());
|
|
|
- demPoliceInfo.setCaseCode(demPoliceRecord.getCaseCode());
|
|
|
- demPoliceInfo.setBranch(demPoliceRecord.getBranch());
|
|
|
- demPoliceInfo.setTimeSlot(demPoliceRecord.getTimeSlot());
|
|
|
- demPoliceInfo.setArea(demPoliceRecord.getArea());
|
|
|
- demPoliceInfo.setCaseType(demPoliceRecord.getCaseType());
|
|
|
- demPoliceInfo.setFilingDate(demPoliceRecord.getFilingDate());
|
|
|
- demPoliceInfo.setFilingTime(demPoliceRecord.getFilingTime());
|
|
|
- demPoliceInfo.setHandleObject(demPoliceRecord.getHandleObject());
|
|
|
- demPoliceInfo.setCaseStatus(demPoliceRecord.getCaseStatus());
|
|
|
- demPoliceInfo.setCaseNature(demPoliceRecord.getCaseNature());
|
|
|
- demPoliceInfo.setDispatchVehicle(demPoliceRecord.getDispatchVehicle());
|
|
|
- demPoliceInfoService.updateById(demPoliceInfo);
|
|
|
- }
|
|
|
+// @Override
|
|
|
+// public void updatePoliceRecord(DemPoliceRecord demPoliceRecord) {
|
|
|
+// this.updateById(demPoliceRecord);
|
|
|
+// DemPoliceInfo demPoliceInfo = new DemPoliceInfo();
|
|
|
+// demPoliceInfo.setId(demPoliceRecord.getId1());
|
|
|
+// demPoliceInfo.setCaseCode(demPoliceRecord.getCaseCode());
|
|
|
+// demPoliceInfo.setBranch(demPoliceRecord.getBranch());
|
|
|
+// demPoliceInfo.setTimeSlot(demPoliceRecord.getTimeSlot());
|
|
|
+// demPoliceInfo.setArea(demPoliceRecord.getArea());
|
|
|
+// demPoliceInfo.setCaseType(demPoliceRecord.getCaseType());
|
|
|
+// demPoliceInfo.setFilingDate(demPoliceRecord.getFilingDate());
|
|
|
+// demPoliceInfo.setFilingTime(demPoliceRecord.getFilingTime());
|
|
|
+// demPoliceInfo.setHandleObject(demPoliceRecord.getHandleObject());
|
|
|
+// demPoliceInfo.setCaseStatus(demPoliceRecord.getCaseStatus());
|
|
|
+// demPoliceInfo.setCaseNature(demPoliceRecord.getCaseNature());
|
|
|
+// demPoliceInfo.setDispatchVehicle(demPoliceRecord.getDispatchVehicle());
|
|
|
+// demPoliceInfoService.updateById(demPoliceInfo);
|
|
|
+// }
|
|
|
|
|
|
@Override
|
|
|
public void delPoliceRecord(Integer id) {
|