Ver código fonte

新增执法过错表结构及实体实现类

xuxiaodong 2 meses atrás
pai
commit
587bcde450

+ 24 - 0
zfjg-api/zfjg-api-manage/src/main/java/com/zfjg/manage/api/domain/other/WCheckItem.java

@@ -0,0 +1,24 @@
+package com.zfjg.manage.api.domain.other;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class WCheckItem {
+    @ApiModelProperty("情形名称")
+    private String name;
+
+    @ApiModelProperty("过错项目")
+    private List<WItemOption> items;
+
+    @Data
+    public static class WItemOption {
+        @ApiModelProperty("检查项名称")
+        private String name;
+
+        @ApiModelProperty("是否被勾选")
+        private String isSelected;
+    }
+}

+ 62 - 0
zfjg-api/zfjg-api-manage/src/main/java/com/zfjg/manage/api/domain/other/WReport.java

@@ -0,0 +1,62 @@
+package com.zfjg.manage.api.domain.other;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author xuxiaodong
+ * @since 2024-11-20
+ */
+@Getter
+@Setter
+@TableName(value = "w_report", autoResultMap = true)
+@ApiModel(value = "WReport对象", description = "")
+public class WReport implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    private Long id;
+
+    @ApiModelProperty("执法机构")
+    private String orgId;
+
+    @ApiModelProperty("执法机构名称")
+    private String orgName;
+
+    @ApiModelProperty("过错责任人")
+    private String wUser;
+
+    @ApiModelProperty("过错责任人ID")
+    private String cUser;
+
+    @ApiModelProperty("情形名称")
+    private String tName;
+
+    @ApiModelProperty("检查项")
+    @TableField(typeHandler = FastjsonTypeHandler.class)
+    private List<WCheckItem> cItem;
+
+    @ApiModelProperty("处理方式")
+    private String dDo;
+
+    @ApiModelProperty("上传文件")
+    private String fDown;
+
+    private LocalDateTime createTime;
+
+    private LocalDateTime updateTime;
+}

+ 34 - 0
zfjg-api/zfjg-api-manage/src/main/java/com/zfjg/manage/api/dto/other/WReportDto.java

@@ -0,0 +1,34 @@
+package com.zfjg.manage.api.dto.other;
+
+import com.zfjg.manage.api.domain.other.WCheckItem;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class WReportDto {
+    @ApiModelProperty("新增ID不传, 更新必传ID")
+    private Long id;
+
+    @ApiModelProperty("执法机构")
+    private String orgId;
+
+    @ApiModelProperty("执法机构名称")
+    private String orgName;
+
+    @ApiModelProperty("过错责任人")
+    private String wUser;
+
+    @ApiModelProperty("过错责任人ID")
+    private String cUser;
+
+    @ApiModelProperty("过错项")
+    private List<WCheckItem> cItem;
+
+    @ApiModelProperty("处理方式(以逗号分割处理方式)")
+    private String dDo;
+
+    @ApiModelProperty("上传文件(多文件以逗号分割)")
+    private String fDown;
+}

+ 22 - 0
zfjg-api/zfjg-api-manage/src/main/java/com/zfjg/manage/api/dto/other/WReportQuery.java

@@ -0,0 +1,22 @@
+package com.zfjg.manage.api.dto.other;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.time.LocalDateTime;
+
+@Data
+public class WReportQuery {
+    private String orgId;
+
+    private String username;
+
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime startTime;
+
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime endTime;
+}

+ 15 - 0
zfjg-api/zfjg-api-manage/src/main/java/com/zfjg/manage/api/vo/other/WReportDetailVO.java

@@ -0,0 +1,15 @@
+package com.zfjg.manage.api.vo.other;
+
+import com.zfjg.manage.api.domain.other.WReport;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class WReportDetailVO {
+    private Integer wCount;
+
+    private String years;
+
+    private List<WReport> wReports;
+}

+ 33 - 0
zfjg-api/zfjg-api-manage/src/main/java/com/zfjg/manage/api/vo/other/WReportVo.java

@@ -0,0 +1,33 @@
+package com.zfjg.manage.api.vo.other;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+public class WReportVo {
+    private Long id;
+
+    @ApiModelProperty("执法机构")
+    private String orgId;
+
+    @ApiModelProperty("执法机构名称")
+    private String orgName;
+
+    @ApiModelProperty("过错责任人")
+    private String wUser;
+
+    @ApiModelProperty("检查人")
+    private String cUser;
+
+    @ApiModelProperty("不当履行职责次数")
+    private Integer dCount;
+
+    @ApiModelProperty("未履行职责次数")
+    private Integer nCount;
+
+    @ApiModelProperty("违法履行职责次数")
+    private Integer wCount;
+
+    @ApiModelProperty("处理次数")
+    private Integer aCount;
+}

+ 41 - 0
zfjg-modules/zfjg-manage/src/main/java/com/zfjg/manage/controller/other/WReportController.java

@@ -0,0 +1,41 @@
+package com.zfjg.manage.controller.other;
+
+import com.zfjg.common.core.domain.R;
+import com.zfjg.common.core.utils.ServletUtils;
+import com.zfjg.manage.api.dto.other.WReportDto;
+import com.zfjg.manage.service.enforce.report.ReportService;
+import com.zfjg.manage.service.other.WReportBizService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import javax.annotation.Resource;
+
+/**
+ * <p>
+ * 前端控制器
+ * </p>
+ *
+ * @author xuxiaodong
+ * @since 2024-11-20
+ */
+@Api(value = "执法过错调查", tags = "执法过错调查")
+@Controller
+@RequestMapping("/wReport")
+public class WReportController {
+    @Resource
+    private WReportBizService wReportBizService;
+
+    @ApiOperation(value = "新增")
+    @PostMapping("/add")
+    public R<String> getAppQrCode(@RequestBody WReportDto reportDto) {
+        String apkUrl = wReportBizService.addReport(reportDto);
+        return R.ok(apkUrl);
+    }
+
+
+}

+ 0 - 1
zfjg-modules/zfjg-manage/src/main/java/com/zfjg/manage/controller/statistics/StatisticsController.java

@@ -1,6 +1,5 @@
 package com.zfjg.manage.controller.statistics;
 
-import com.alibaba.fastjson.JSON;
 import com.zfjg.common.core.domain.R;
 import com.zfjg.manage.api.dto.statistics.CommonQueryDto;
 import com.zfjg.manage.api.dto.statistics.EnforceAverageTimeDto;

+ 16 - 0
zfjg-modules/zfjg-manage/src/main/java/com/zfjg/manage/mapper/other/WReportMapper.java

@@ -0,0 +1,16 @@
+package com.zfjg.manage.mapper.other;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zfjg.manage.api.domain.other.WReport;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author xuxiaodong
+ * @since 2024-11-20
+ */
+public interface WReportMapper extends BaseMapper<WReport> {
+
+}

+ 59 - 0
zfjg-modules/zfjg-manage/src/main/java/com/zfjg/manage/service/impl/other/WReportServiceImpl.java

@@ -0,0 +1,59 @@
+package com.zfjg.manage.service.impl.other;
+
+import cn.hutool.core.util.IdUtil;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.zfjg.common.core.utils.bean.BeanUtils;
+import com.zfjg.common.core.web.page.TableInfo;
+import com.zfjg.manage.api.domain.other.WReport;
+import com.zfjg.manage.api.dto.other.WReportDto;
+import com.zfjg.manage.api.dto.other.WReportQuery;
+import com.zfjg.manage.api.vo.other.WReportDetailVO;
+import com.zfjg.manage.mapper.other.WReportMapper;
+import com.zfjg.manage.service.other.IWReportService;
+import com.zfjg.manage.service.other.WReportBizService;
+import org.springframework.beans.BeansException;
+import org.springframework.stereotype.Service;
+
+import java.time.LocalDateTime;
+
+/**
+ * <p>
+ * 服务实现类
+ * </p>
+ *
+ * @author xuxiaodong
+ * @since 2024-11-20
+ */
+@Service
+public class WReportServiceImpl extends ServiceImpl<WReportMapper, WReport> implements IWReportService, WReportBizService {
+    @Override
+    public String addReport(WReportDto reportDto) {
+        try {
+            WReport wReport = new WReport();
+            BeanUtils.copyProperties(reportDto, wReport);
+            LocalDateTime currentTime = LocalDateTime.now();
+            wReport.setId(IdUtil.getSnowflake(1, 1).nextId());
+            wReport.setCreateTime(currentTime);
+            wReport.setUpdateTime(currentTime);
+            this.save(wReport);
+            return "ok";
+        } catch (Exception e) {
+            return "error";
+        }
+    }
+
+    @Override
+    public String updateReport(WReportDto reportDto) {
+        return "";
+    }
+
+    @Override
+    public WReportDetailVO reportDetail(String orgId) {
+        return null;
+    }
+
+    @Override
+    public TableInfo<?> listReport(WReportQuery wReportQuery) {
+        return null;
+    }
+}

+ 16 - 0
zfjg-modules/zfjg-manage/src/main/java/com/zfjg/manage/service/other/IWReportService.java

@@ -0,0 +1,16 @@
+package com.zfjg.manage.service.other;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.zfjg.manage.api.domain.other.WReport;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author xuxiaodong
+ * @since 2024-11-20
+ */
+public interface IWReportService extends IService<WReport> {
+
+}

+ 36 - 0
zfjg-modules/zfjg-manage/src/main/java/com/zfjg/manage/service/other/WReportBizService.java

@@ -0,0 +1,36 @@
+package com.zfjg.manage.service.other;
+
+import com.zfjg.common.core.web.page.TableInfo;
+import com.zfjg.manage.api.dto.other.WReportDto;
+import com.zfjg.manage.api.dto.other.WReportQuery;
+import com.zfjg.manage.api.vo.other.WReportDetailVO;
+
+public interface WReportBizService {
+    /**
+     * 新增过错信息
+     *
+     * @param reportDto 参数
+     * @return 返回
+     */
+    String addReport(WReportDto reportDto);
+
+
+    /**
+     * 更新过错信息
+     *
+     * @param reportDto 参数
+     * @return 返回
+     */
+    String updateReport(WReportDto reportDto);
+
+
+    /**
+     * 查看详情
+     */
+    WReportDetailVO reportDetail(String orgId);
+
+    /**
+     * 列表
+     */
+    TableInfo<?> listReport(WReportQuery wReportQuery);
+}