|
@@ -0,0 +1,82 @@
|
|
|
+package com.usky.fire.service.impl;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.usky.common.core.bean.CommonPage;
|
|
|
+import com.usky.common.mybatis.core.AbstractCrudService;
|
|
|
+import com.usky.fire.domain.DemLawSituation;
|
|
|
+import com.usky.fire.mapper.DemLawSituationMapper;
|
|
|
+import com.usky.fire.service.DemLawSituationService;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+/**
|
|
|
+ * <p>
|
|
|
+ * 行政处罚情况表 服务实现类
|
|
|
+ * </p>
|
|
|
+ *
|
|
|
+ * @author JCB
|
|
|
+ * @since 2022-09-27
|
|
|
+ */
|
|
|
+@Service
|
|
|
+public class DemLawSituationServiceImpl extends AbstractCrudService<DemLawSituationMapper, DemLawSituation> implements DemLawSituationService {
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public CommonPage<Object> lawSituationList(String punishedPerson, String legalRepresentative, Integer id, Integer pageNum, Integer pageSize) {
|
|
|
+ List<Object> list = new ArrayList<>();
|
|
|
+ IPage<DemLawSituation> page = new Page<>(pageNum, pageSize);
|
|
|
+ LambdaQueryWrapper<DemLawSituation> queryWrapper = Wrappers.lambdaQuery();
|
|
|
+ queryWrapper.select(DemLawSituation::getId, DemLawSituation::getPunishedPerson, DemLawSituation::getCounterpartType,
|
|
|
+ DemLawSituation::getLegalRepresentative, DemLawSituation::getDocumentType, DemLawSituation::getDocumentNumber,
|
|
|
+ DemLawSituation::getPunishmentDecisionNumber, DemLawSituation::getPunishmentBasis, DemLawSituation::getPunishmentType,
|
|
|
+ DemLawSituation::getPunishmentContent, DemLawSituation::getPenaltyAmount, DemLawSituation::getPunishmentDecisionTime,
|
|
|
+ DemLawSituation::getPunishmentValidityDate, DemLawSituation::getPublicityDeadline, DemLawSituation::getPunishmentAuthority)
|
|
|
+ .eq(DemLawSituation::getEnable, 0)
|
|
|
+ .eq(id != null & id != 0, DemLawSituation::getId, id)
|
|
|
+ .like(StringUtils.isNotBlank(punishedPerson), DemLawSituation::getPunishedPerson, punishedPerson)
|
|
|
+ .like(StringUtils.isNotBlank(legalRepresentative), DemLawSituation::getLegalRepresentative, legalRepresentative)
|
|
|
+ .orderByDesc(DemLawSituation::getId);
|
|
|
+ page = this.page(page, queryWrapper);
|
|
|
+ for (int i = 0; i < page.getRecords().size(); i++) {
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ map.put("id", page.getRecords().get(i).getId());
|
|
|
+ map.put("punishedPerson", page.getRecords().get(i).getPunishedPerson());
|
|
|
+ map.put("counterpartType", page.getRecords().get(i).getCounterpartType());
|
|
|
+ map.put("legalRepresentative", page.getRecords().get(i).getLegalRepresentative());
|
|
|
+ map.put("documentType", page.getRecords().get(i).getDocumentType());
|
|
|
+ map.put("documentNumber", page.getRecords().get(i).getDocumentNumber());
|
|
|
+ map.put("punishmentDecisionNumber", page.getRecords().get(i).getPunishmentDecisionNumber());
|
|
|
+ map.put("punishmentBasis", page.getRecords().get(i).getPunishmentBasis());
|
|
|
+ map.put("punishmentType", page.getRecords().get(i).getPunishmentType());
|
|
|
+ map.put("punishmentContent", page.getRecords().get(i).getPunishmentContent());
|
|
|
+ map.put("penaltyAmount", page.getRecords().get(i).getPenaltyAmount());
|
|
|
+ map.put("punishmentDecisionTime", page.getRecords().get(i).getPunishmentDecisionTime());
|
|
|
+ map.put("punishmentValidityDate", page.getRecords().get(i).getPunishmentValidityDate());
|
|
|
+ map.put("publicityDeadline", page.getRecords().get(i).getPublicityDeadline());
|
|
|
+ map.put("punishmentAuthority", page.getRecords().get(i).getPunishmentAuthority());
|
|
|
+ list.add(map);
|
|
|
+ }
|
|
|
+ return new CommonPage<>(list, page.getTotal(), pageSize, pageNum);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void updateLawSituation(DemLawSituation demLawSituation) {
|
|
|
+ this.updateById(demLawSituation);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void delLawSituation(Integer id) {
|
|
|
+ DemLawSituation demLawSituation = new DemLawSituation();
|
|
|
+ demLawSituation.setId(id);
|
|
|
+ demLawSituation.setEnable(1);
|
|
|
+ this.updateById(demLawSituation);
|
|
|
+ }
|
|
|
+
|
|
|
+}
|