浏览代码

Merge remote-tracking branch 'origin/master'

lyq 8 月之前
父节点
当前提交
b9715024ae
共有 38 个文件被更改,包括 2944 次插入98 次删除
  1. 53 0
      lawenforcement-ui/src/api/lawenforcement/case.js
  2. 15 0
      lawenforcement-ui/src/api/lawenforcement/record.js
  3. 81 0
      lawenforcement-ui/src/views/components/DepartmentSelect.vue
  4. 58 0
      lawenforcement-ui/src/views/components/EnforcementUserSelect.vue
  5. 470 0
      lawenforcement-ui/src/views/lawenforcement/case/index.vue
  6. 158 41
      lawenforcement-ui/src/views/lawenforcement/record/index.vue
  7. 349 0
      lawenforcement-ui/src/views/lawenforcement/register/index.vue
  8. 2 1
      src/main/java/com/sooka/sponest/lawenforcement/device/controller/DeviceController.java
  9. 5 3
      src/main/java/com/sooka/sponest/lawenforcement/device/service/impl/DeviceServiceImpl.java
  10. 101 0
      src/main/java/com/sooka/sponest/lawenforcement/lawCase/controller/LawenforcementCaseController.java
  11. 145 0
      src/main/java/com/sooka/sponest/lawenforcement/lawCase/domain/LawenforcementAttach.java
  12. 126 0
      src/main/java/com/sooka/sponest/lawenforcement/lawCase/domain/LawenforcementCase.java
  13. 113 0
      src/main/java/com/sooka/sponest/lawenforcement/lawCase/domain/LawenforcementCaseLog.java
  14. 70 0
      src/main/java/com/sooka/sponest/lawenforcement/lawCase/mapper/LawenforcementAttachMapper.java
  15. 78 0
      src/main/java/com/sooka/sponest/lawenforcement/lawCase/mapper/LawenforcementCaseLogMapper.java
  16. 62 0
      src/main/java/com/sooka/sponest/lawenforcement/lawCase/mapper/LawenforcementCaseMapper.java
  17. 60 0
      src/main/java/com/sooka/sponest/lawenforcement/lawCase/service/ILawenforcementCaseLogService.java
  18. 70 0
      src/main/java/com/sooka/sponest/lawenforcement/lawCase/service/ILawenforcementCaseService.java
  19. 90 0
      src/main/java/com/sooka/sponest/lawenforcement/lawCase/service/impl/LawenforcementCaseLogServiceImpl.java
  20. 239 0
      src/main/java/com/sooka/sponest/lawenforcement/lawCase/service/impl/LawenforcementCaseServiceImpl.java
  21. 6 0
      src/main/java/com/sooka/sponest/lawenforcement/person/mapper/LawenforcementPersonMapper.java
  22. 6 1
      src/main/java/com/sooka/sponest/lawenforcement/record/controller/LawenforcementRecordController.java
  23. 15 1
      src/main/java/com/sooka/sponest/lawenforcement/record/domain/LawenforcementRecord.java
  24. 2 0
      src/main/java/com/sooka/sponest/lawenforcement/record/service/ILawenforcementRecordService.java
  25. 55 13
      src/main/java/com/sooka/sponest/lawenforcement/record/service/impl/LawenforcementRecordServiceImpl.java
  26. 6 0
      src/main/java/com/sooka/sponest/lawenforcement/user/controller/LawenforcementUserController.java
  27. 1 0
      src/main/java/com/sooka/sponest/lawenforcement/user/domain/LawenforcementUser.java
  28. 2 0
      src/main/java/com/sooka/sponest/lawenforcement/user/mapper/LawenforcementUserMapper.java
  29. 2 0
      src/main/java/com/sooka/sponest/lawenforcement/user/service/ILawenforcementUserService.java
  30. 5 0
      src/main/java/com/sooka/sponest/lawenforcement/user/service/impl/LawenforcementUserServiceImpl.java
  31. 29 0
      src/main/java/com/sooka/sponest/lawenforcement/utils/DataConstants.java
  32. 33 33
      src/main/resources/logback.xml
  33. 108 0
      src/main/resources/mapper/lawenforcement/LawenforcementAttachMapper.xml
  34. 99 0
      src/main/resources/mapper/lawenforcement/LawenforcementCaseLogMapper.xml
  35. 131 0
      src/main/resources/mapper/lawenforcement/LawenforcementCaseMapper.xml
  36. 28 0
      src/main/resources/mapper/lawenforcement/LawenforcementPersonMapper.xml
  37. 62 5
      src/main/resources/mapper/lawenforcement/LawenforcementRecordMapper.xml
  38. 9 0
      src/main/resources/mapper/lawenforcement/LawenforcementUserMapper.xml

+ 53 - 0
lawenforcement-ui/src/api/lawenforcement/case.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询案件列表
+export function listCase(query) {
+  return request({
+    url: '/sooka-sponest-lawenforcement/case/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询案件详细
+export function getCase(id) {
+  return request({
+    url: '/sooka-sponest-lawenforcement/case/' + id,
+    method: 'get'
+  })
+}
+
+// 新增案件
+export function addCase(data) {
+  return request({
+    url: '/sooka-sponest-lawenforcement/case',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改案件
+export function updateCase(data) {
+  return request({
+    url: '/sooka-sponest-lawenforcement/case',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除案件
+export function delCase(id) {
+  return request({
+    url: '/sooka-sponest-lawenforcement/case/' + id,
+    method: 'delete'
+  })
+}
+
+//按部门查询日子
+export function getCaseLog(data) {
+  return request({
+    url: '/sooka-sponest-lawenforcement/case/getCaseLog',
+    method: 'post',
+    data: data
+  })
+}

+ 15 - 0
lawenforcement-ui/src/api/lawenforcement/record.js

@@ -65,3 +65,18 @@ export function addRecordLog(data){
     data: data
   })
 }
+
+export function getUserListByDeptId(deptId){
+  return request({
+    url: '/sooka-sponest-lawenforcement/user/getUserListByDeptId/' + deptId,
+    methor: 'get'
+  })
+}
+//派发事件
+export function distributeRecord(data) {
+  return request({
+    url: '/sooka-sponest-lawenforcement/record/distributeRecord',
+    method: 'post',
+    data: data
+  })
+}

+ 81 - 0
lawenforcement-ui/src/views/components/DepartmentSelect.vue

@@ -0,0 +1,81 @@
+<template>
+  <div>
+    <el-cascader
+      v-model="localedDepts"
+      :options="deptOptions"
+      :props="cascaderProps"
+      clearable
+      :show-all-levels="false"
+      @change="handleChange"
+    ></el-cascader>
+  </div>
+</template>
+
+<script>
+export default {
+  props: {
+    deptOptions: {
+      type: Array,
+      required: true,
+    },
+    reset: {
+      type: Boolean,
+      default: false
+    },
+    selectedDepts: {
+      type: Array,
+      default: []
+    }
+  },
+  data() {
+    return {
+      localedDepts: [],
+      cascaderProps: {
+        value: 'id',
+        label: 'label',
+        children: 'children',
+        multiple: true,
+        checkStrictly: true, // 允许选择任意一级
+      },
+    };
+  },
+  mounted() {
+    this.localedDepts = [...this.selectedDepts];
+  },
+  watch: {
+    selectedDepts: {
+      handler(newVal) {
+        this.localedDepts = [...newVal];
+        console.log("更新数据===》",this.localedDepts)
+      },
+      immediate: true // 立即调用 handler 函数
+    },
+    reset(newVal) {
+      if (newVal) {
+        // 当 reset 为 true 时,清空选中的部门
+        this.localedDepts = [];
+      }
+    }
+  },
+  methods: {
+    handleChange(selectedIds) {
+      console.log(selectedIds);
+      let pushIds = [];
+      for (let selectedId of selectedIds) {
+        pushIds.push(selectedId[selectedId.length - 1]);
+      }
+      this.$emit('selection-change', pushIds);
+    },
+    /*updateSelectedDepts(newVal) {
+      this.localedDepts = [...newVal];
+      console.log("子组件更新后的数据:", this.localedDepts);
+    }*/
+  },
+};
+</script>
+
+<style scoped>
+.el-cascader {
+  width: 100%;
+}
+</style>

+ 58 - 0
lawenforcement-ui/src/views/components/EnforcementUserSelect.vue

@@ -0,0 +1,58 @@
+<template>
+  <div>
+    <el-select v-model="localUserList" multiple placeholder="请选择">
+      <el-option
+        v-for="user in userList"
+        :key="user.userId"
+        :label="user.nickName"
+        :value="user.certificateNumber"
+      ></el-option>
+    </el-select>
+  </div>
+</template>
+
+<script>
+export default {
+  props: {
+    userList: {
+      type: Array,
+      required: true,
+    },
+    reset: {
+      type: Boolean,
+      default: false
+    },
+    selectedUserList:{
+      type: Array,
+      required: false,
+      default: []
+    }
+  },
+  data() {
+    return {
+      localUserList: []
+    };
+  },
+  watch: {
+    // 监听 selectedUserList 的变化,如果需要可以通知父组件
+    localUserList(newValue) {
+      console.log("变化===》",newValue)
+      this.$emit('user-selected', newValue);
+    },
+    selectedUserList(newValue){
+      this.localUserList = newValue
+      this.$emit('user-selected', newValue);
+      console.log("接受到的选中执法人为",this.localUserList)
+    },
+    userList(newValue){
+      console.log(newValue)
+    },
+    reset(newVal) {
+      if (newVal) {
+        // 当 reset 为 true 时,清空选中的部门
+        this.localUserList = [];
+      }
+    }
+  },
+};
+</script>

+ 470 - 0
lawenforcement-ui/src/views/lawenforcement/case/index.vue

@@ -0,0 +1,470 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="案件名称" prop="caseName">
+        <el-input
+          v-model="queryParams.caseName"
+          placeholder="请输入案件名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="案件编号" prop="caseNumber">
+        <el-input
+          v-model="queryParams.caseNumber"
+          placeholder="请输入案件编号"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-table v-loading="loading" :data="caseList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center"/>
+      <el-table-column label="案件名称" align="center" prop="caseName"/>
+      <el-table-column label="案件编号" align="center" prop="caseNumber"/>
+      <el-table-column label="处罚对象" align="center" prop="punishTarget">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.lawenforcement_punish_target" :value="scope.row.punishTarget"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="处罚情形" align="center" prop="punishType">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.lawenforcement_punish_type" :value="scope.row.punishType"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="案件描述" align="center" prop="describe"/>
+      <el-table-column label="状态" align="center" prop="state">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.lawenforcement_caseState" :value="scope.row.state"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['lawenforcement:case:query']"
+          >详情
+          </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-plus"
+            @click="register(scope.row)"
+          >立案
+          </el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 详情 -->
+    <el-dialog :title="title" :visible.sync="open" width="1200px" class="form-style">
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-form-item label="案件名称" prop="caseName">
+              <el-input v-model="form.caseName" placeholder="请输入案件名称" disabled/>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="案件编号" prop="caseNumber">
+              <el-input v-model="form.caseNumber" placeholder="请输入案件编号" disabled/>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-form-item label="处罚对象" prop="punishTarget">
+              <el-select v-model="form.punishTarget" placeholder="请选择处罚对象" filterable disabled>
+                <el-option
+                  v-for="dict in dict.type.lawenforcement_punish_target"
+                  :key="dict.value"
+                  :label="dict.label"
+                  :value="dict.value"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="处罚情形" prop="punishType">
+              <el-select v-model="form.punishType" placeholder="请选择处罚情形" filterable disabled>
+                <el-option
+                  v-for="dict in dict.type.lawenforcement_punish_type"
+                  :key="dict.value"
+                  :label="dict.label"
+                  :value="dict.value"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-form-item label="上报单位" prop="deptName">
+              <el-input v-model="form.deptName" disabled/>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="上报人" prop="createName">
+              <el-input v-model="form.createName" disabled/>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-form-item label="上报时间" prop="createTime">
+              <el-input v-model="form.createTime" disabled/>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="状态" prop="state">
+              <el-select v-model="form.state" filterable disabled>
+                <el-option
+                  v-for="dict in dict.type.lawenforcement_caseState"
+                  :key="dict.value"
+                  :label="dict.label"
+                  :value="dict.value"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="20">
+          <el-col :span="24">
+            <el-form-item label="案件描述" prop="describe">
+              <el-input type="textarea" v-model="form.describe" placeholder="请输入案件描述" disabled/>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="20">
+          <el-col :span="24">
+            <el-col :span="8">
+              <el-card style="height: 350px;">
+                <div class="form-item-title">1.法制审核机构出具的审核意见书</div>
+                <br>
+                <el-form-item label="附件" label-width="50px" prop="dataOne">
+                  <fileUpload v-model="dataOne"></fileUpload>
+                </el-form-item>
+                <el-form-item label="说明" label-width="50px" prop="describe">
+                  <el-input type="textarea" v-model="describe1" disabled/>
+                </el-form-item>
+              </el-card>
+            </el-col>
+            <el-col :span="8">
+              <el-card style="height: 350px;">
+                <div class="form-item-title">2.落实行政处罚裁量基准和包容审慎监管执法“四张清单”相关材料</div>
+                <el-form-item label="附件" label-width="50px" prop="dataTwo">
+                  <fileUpload v-model="dataTwo"></fileUpload>
+                </el-form-item>
+                <el-form-item label="说明" label-width="50px" prop="describe">
+                  <el-input type="textarea" v-model="describe2" disabled/>
+                </el-form-item>
+              </el-card>
+            </el-col>
+            <el-col :span="8">
+              <el-card style="height: 350px;">
+                <div class="form-item-title">3.落实行政处罚裁量基准和包容审慎监管执法“四张清单”相关材料</div>
+                <el-form-item label="附件" label-width="50px" prop="dataTwo">
+                  <fileUpload v-model="dataThree"></fileUpload>
+                </el-form-item>
+                <el-form-item label="说明" label-width="50px" prop="describe">
+                  <el-input type="textarea" v-model="describe3" disabled/>
+                </el-form-item>
+              </el-card>
+            </el-col>
+          </el-col>
+        </el-row>
+      </el-form>
+      <el-table v-loading="loading" :data="logList" @selection-change="handleSelectionChange">
+        <el-table-column label="操作人" align="center" prop="createName"/>
+        <el-table-column label="操作时间" align="center" prop="createTime"/>
+        <el-table-column label="所属部门" align="center" prop="deptName"/>
+        <el-table-column label="操作内容" align="center" prop="content"/>
+        <el-table-column label="状态" align="center" prop="state">
+          <template slot-scope="scope">
+            <dict-tag :options="dict.type.lawenforcement_caseState" :value="scope.row.state"/>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div slot="footer" class="dialog-footer">
+        <el-button v-if="type!='1'&&form.state=='state_1'" type="primary" @click="acceptance('state_2')">受理
+        </el-button>
+        <el-button v-if="type!='1'&&form.state=='state_1'" @click="noAcceptance('state_3')">不予受理</el-button>
+        <el-button v-if="type!='1'&&form.state=='state_2'&&this.logNum==0" type="primary"
+                   @click="acceptance('state_5')">通 过
+        </el-button>
+        <el-button v-if="type!='1'&&form.state=='state_2'&&this.logNum==0" @click="noAcceptance('state_4')">不通过
+        </el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+
+    <el-dialog :title="title" :visible.sync="open1" width="600px" height="500px" class="form-style">
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="说明" prop="content">
+          <el-input type="textarea" v-model="form.content" placeholder="请输入说明"/>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submit">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+
+
+    <!--立案-->
+    <el-dialog :visible.sync="dialogVisible" :title="title" width="1200px" class="form-style">
+      <register @send-ok="sendOk" ref="register" :caseNumber="caseName"/>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+
+
+  </div>
+</template>
+
+<script>
+import {listCase, getCase, getCaseLog, updateCase, addCase} from "@/api/lawenforcement/case";
+import register from "@/views/lawenforcement/register/index.vue";
+import form from "element-ui/packages/form";
+import fileUpload from '@/views/components/FileUpload/index.vue';
+
+export default {
+  name: "Case",
+  computed: {
+    form() {
+      return form
+    }
+  },
+  components: {register, fileUpload},
+  dicts: ['lawenforcement_punish_target', 'lawenforcement_punish_type', 'lawenforcement_caseState'],
+  data() {
+    return {
+      dataOne: null,
+      dataTwo: null,
+      dataThree: null,
+      describe1: null,
+      describe2: null,
+      describe3: null,
+
+      // 遮罩层
+      loading: true,
+      dialogVisible: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      caseName: "",
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      type: 0,
+      // 案件表格数据
+      caseList: [],
+      //日志列表
+      logList: [],
+      logNum: null,
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      open1: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        createName: null,
+        updateName: null,
+        deptId: null,
+        deptName: null,
+        recordId: null,
+        caseName: null,
+        caseNumber: null,
+        punishTarget: null,
+        punishType: null,
+        describe: null,
+        dataOne: null,
+        uploadOne: null,
+        dataTwo: null,
+        uploadTwo: null,
+        dataThree: null,
+        uploadThree: null,
+        state: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {}
+    };
+  },
+  created() {
+    this.queryParams.state = this.$route.query.state;
+    this.type = this.$route.query.type;
+    this.getList();
+  },
+  methods: {
+    /** 查询案件列表 */
+    getList() {
+      this.loading = true;
+      listCase(this.queryParams).then(response => {
+        this.caseList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    //立案
+    register(row) {
+      this.dialogVisible = true;
+      this.title = "立案";
+      this.caseName = row.caseName;
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs.register.submitForm();
+    },
+    sendOk() {
+      debugger
+      this.dialogVisible = false;
+      this.getList();
+      this.$refs.register.reset();
+    },
+    // 按部门查看日志
+    getCaseLog(row) {
+      this.form.deptId = this.$store.state.user.dept.deptId;
+      this.form.id = row.id;
+      getCaseLog(this.form).then(response => {
+        this.logNum = response.data;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.open1 = false;
+      this.dialogVisible = false;
+      this.$refs.register.reset()
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        createBy: null,
+        createName: null,
+        createTime: null,
+        updateBy: null,
+        updateName: null,
+        updateTime: null,
+        deptId: null,
+        deptName: null,
+        recordId: null,
+        caseName: null,
+        caseNumber: null,
+        punishTarget: null,
+        punishType: null,
+        describe: null,
+        dataOne: null,
+        uploadOne: null,
+        dataTwo: null,
+        uploadTwo: null,
+        dataThree: null,
+        uploadThree: null,
+        state: this.queryParams.state
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length !== 1
+      this.multiple = !selection.length
+    },
+    /** 详情 */
+    handleUpdate(row) {
+      this.getCaseLog(row);
+      this.reset();
+      const id = row.id || this.ids
+      getCase(id).then(response => {
+        this.form = response.data;
+        this.logList = response.data.logList
+        this.dataOne = response.data.fileList[0].attachPath
+        this.dataTwo = response.data.fileList[1].attachPath
+        this.dataThree = response.data.fileList[2].attachPath
+        this.describe1 = response.data.fileList[0].describe
+        this.describe2 = response.data.fileList[1].describe
+        this.describe3 = response.data.fileList[2].describe
+        this.open = true;
+        this.title = "案件详情";
+      });
+    },
+    /** 受理 */
+    acceptance(state) {
+      this.form.state = state;
+      updateCase(this.form).then(response => {
+        if (state == 'state_2') {
+          this.$modal.msgSuccess("受理成功");
+        }
+        if (state == 'state_5') {
+          this.$modal.msgSuccess("通过成功");
+        }
+        this.open = false;
+        this.getList();
+      });
+    },
+    /* 不予受理 */
+    noAcceptance(state) {
+      this.form.state = state;
+      this.open1 = true;
+      if (state == 'state_3') {
+        this.title = "不予受理";
+      }
+      if (state == 'state_4') {
+        this.title = "不通过";
+      }
+    },
+    submit() {
+      updateCase(this.form).then(response => {
+        if (this.form.state == 'state_3') {
+          this.$modal.msgSuccess("不予受理");
+        }
+        if (this.form.state == 'state_4') {
+          this.$modal.msgSuccess("不通过");
+        }
+        this.open1 = false;
+        this.open = false;
+        this.getList();
+      });
+    }
+  }
+};
+</script>

+ 158 - 41
lawenforcement-ui/src/views/lawenforcement/record/index.vue

@@ -97,7 +97,7 @@
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
-            v-if="scope.row.recordStatus === 'lawenforcement_type_1' || scope.row.recordStatus === 'lawenforcement_type_3'"
+            v-if="scope.row.recordStatus === 'lawenforcement_type_1' && scope.row.createMethod === 1"
             size="mini"
             type="text"
             icon="el-icon-paper-plus"
@@ -105,7 +105,7 @@
           >派发
           </el-button>
           <el-button
-            v-if="scope.row.recordStatus === 'lawenforcement_type_6'"
+            v-if="scope.row.recordStatus === 'lawenforcement_type_3'  || (scope.row.recordStatus === 'lawenforcement_type_1' && scope.row.createMethod !== 1)"
             size="mini"
             type="text"
             icon="el-icon-paper-plus"
@@ -262,25 +262,34 @@
     <el-dialog :visible.sync="dialogVisible" title="派发任务">
       <el-form :model="form">
         <el-form-item label="选择部门">
-<!--          <el-select v-model="dispatchForm.department" placeholder="请选择部门">
-            <el-option
-              v-for="item in departments"
-              :key="item.id"
-              :label="item.name"
-              :value="item.id"
-            />
-          </el-select>-->
+          <DepartmentSelect
+            ref="departmentSelect"
+            :deptOptions="deptOptions"
+            :selectedDepts="selectedDepts"
+            :reset="reset"
+            @selection-change="handleDeptSelectionChange"
+          />
         </el-form-item>
 
         <el-form-item label="选择人员">
-<!--          <el-select v-model="dispatchForm.person" placeholder="请选择人员">
+          <EnforcementUserSelect
+            ref="enforcementUserSelect"
+            :userList="userList"
+            :selectedUserList="selectedUserList"
+            :reset="reset"
+            @user-selected="handleUserSelected"
+          />
+        </el-form-item>
+
+        <el-form-item v-if="useredList != null" label="主办人员">
+          <el-select v-model="mainPerson" placeholder="请选择" @change="seeMainPerson">
             <el-option
-              v-for="item in personnel"
-              :key="item.id"
-              :label="item.name"
-              :value="item.id"
-            />
-          </el-select>-->
+              v-for="user in useredList"
+              :key="user.userId"
+              :label="user.nickName"
+              :value="user.certificateNumber"
+            ></el-option>
+          </el-select>
         </el-form-item>
       </el-form>
       <div slot="footer">
@@ -316,18 +325,23 @@
 
 <script>
 import {
-  addRecord, addRecordLog,
+  addRecord,
+  addRecordLog,
   delRecord,
+  distributeRecord,
   getDeivceList,
-  getPersonsList,
   getRecord,
+  getUserListByDeptId,
   listRecord,
   updateRecord
 } from "@/api/lawenforcement/record";
-import dict from "@/utils/dict";
+import {treeselect} from "@/api/system/dept";
+import DepartmentSelect from "@/views/components/DepartmentSelect.vue";
+import EnforcementUserSelect from "@/views/components/EnforcementUserSelect.vue";
 
 export default {
   name: "Record",
+  components: {EnforcementUserSelect, DepartmentSelect},
   dicts: [
     'lawenforcement_type'
   ],
@@ -335,6 +349,7 @@ export default {
     return {
       // 遮罩层
       loading: true,
+      mainPerson: null,
       // 选中数组
       ids: [],
       // 非单个禁用
@@ -353,6 +368,12 @@ export default {
       open: false,
       dialogVisible: false,
       bindDialogVisible: false,
+      // 部门树选项
+      deptOptions: [],
+      //人员集合
+      userList: [],
+      //选中的执法人员集合
+      useredList: [],
       // 查询参数
       queryParams: {
         pageNum: 1,
@@ -364,11 +385,18 @@ export default {
       // 表单校验
       rules: {},
       // 执法设备列表
-      deviceList: []
+      deviceList: [],
+      // 选中的执法人员
+      selectedUserList: [],
+      // 选中的执法部门
+      selectedDepts: [],
+      departmentMap: {},
+
     };
   },
   created() {
     this.getList();
+    this.getTreeselectToDept();
   },
   methods: {
     /** 查询任务数据列表 */
@@ -503,48 +531,137 @@ export default {
         ...this.queryParams
       }, `record_${new Date().getTime()}.xlsx`)
     },
+    /** 获取部门列表 页面初始化执行 */
+    getTreeselectToDept() {
+      treeselect().then(response => {
+        this.deptOptions = response.data;
+      });
+    },
+    findPath(targetId) {
+      // 转换为 key-value 类型的数据结构
+      this.departmentMap = this.flattenToMap(this.deptOptions);
+      let path = this.getPathFromMap(targetId).reverse();
+      this.selectedDepts.push(path) // 获取路径并反转
+    },
+    flattenToMap(data, parentId = null) {
+      return data.reduce((map, node) => {
+        map[node.id] = { ...node, parentId }; // 将节点添加到 map 中
+        if (node.children) {
+          Object.assign(map, this.flattenToMap(node.children, node.id)); // 递归处理子节点
+        }
+        return map;
+      }, {});
+    },
+    getPathFromMap(targetId) {
+      const path = [];
+      let currentId = targetId;
+      while (currentId) {
+        const node = this.departmentMap[currentId];
+        if (node) {
+          path.push(node.id); // 将部门标签加入路径
+          currentId = node.parentId; // 获取父节点 ID
+        } else {
+          break;
+        }
+      }
+      return path;
+    },
+
     /** 派发按钮事件*/
     showDispatchDialog(row) {
-      // getPersonsList(row).then(res=>{
-        console.log("派发工单")
-        // res.data
-        this.dialogVisible = true;
-      // })
+      //获取工单详情信息
+      getRecord(row.id).then(res => {
+        this.form = res.data
+        let personList = res.data.personList;
+        this.mainPerson = res.data.mainPerson
+        let path = []
+        personList.forEach(person=>{
+          this.findPath(person.deptId)
+          path.push(person.deptId)
+          this.selectedUserList.push(person.certificateNumber)
+        })
+        this.handleDeptSelectionChange(path)
+      })
+      //打开派发弹窗
+      this.dialogVisible = true;
+      this.$nextTick(() => {
+        this.$refs.departmentSelect.localedDepts = [...this.selectedDepts];
+      });
+    },
+    /** 选中执法部门回调 */
+    handleDeptSelectionChange(selectedIds) {
+      getUserListByDeptId(selectedIds).then(res => {
+        this.userList = res.data
+      })
+
+    },
+    /** 选中的执法人员回调事件 */
+    handleUserSelected(selectedUsersIds) {
+      console.log("--->",selectedUsersIds)
+      let usered = [];
+      selectedUsersIds.forEach(userId => {
+        console.log(this.userList)
+        // 在userList中查找对应的用户对象
+        const user = this.userList.find(user => user.certificateNumber === userId);
+        // 如果找到了用户对象,则将其添加到selectedUserList中
+        if (user) {
+          usered.push(user)
+        }
+      });
+      // 在这里处理选中的用户对象
+      this.useredList = usered;
+      console.log("这里处理选中的用户对象", this.useredList)
+      this.form.personList = usered;
+    },
+    /** 选中的主办人员回调 */
+    seeMainPerson(userId) {
+      this.form.mainPerson = userId
     },
     /** 派发工单提交 */
     handleDispatch() {
       // 处理派发逻辑,这里可以写你的逻辑,比如保存数据或者提交请求
-      console.log("派发信息");
-      this.dialogVisible = false;
+      distributeRecord(this.form).then(res => {
+        console.log("派发成功");
+        this.dialogVisible = false;
+      })
+
     },
 
-    /** 绑定设备事件 */
-    showBindDeviceDialog(row){
+    /** 绑定设备按钮事件 */
+    showBindDeviceDialog(row) {
       /* 根据部门id获取执法设备 */
-      getDeivceList().then(res=>{
+      getDeivceList().then(res => {
         this.deviceList = res.data
         this.form.id = row.id
         this.form.jobName = row.jobName
         this.bindDialogVisible = true;
       })
-
     },
-
     /** 选中设备事件 */
-    onDeviceChange(value){
+    onDeviceChange(value) {
       const selectedDevice = this.deviceList.find(item => item.cameraCode === value);
       this.form.deviceName = selectedDevice ? selectedDevice.cameraName : ''; // 更新设备名称
-      // this.form.deviceId = selectedDevice.cameraCode
     },
-
     /** 绑定设备提交 */
-    submitBindHandle(){
-      console.log(this.form)
-      this.bindDialogVisible = false;
-      addRecordLog(this.form).then(res=>{
-        console.log(res)
+    submitBindHandle() {
+      this.form.recordStatus = "lawenforcement_type_6"
+      addRecordLog(this.form).then(res => {
+        this.bindDialogVisible = false;
       })
     }
+  },
+  watch: {
+    dialogVisible(newVal) {
+      this.mainPerson = "";
+      // this.reset();
+      if (newVal) {
+        // 打开弹窗时重置子组件
+        this.reset = true;
+      } else {
+        // 关闭弹窗时不重置子组件
+        this.reset = false;
+      }
+    }
   }
 };
 </script>

+ 349 - 0
lawenforcement-ui/src/views/lawenforcement/register/index.vue

@@ -0,0 +1,349 @@
+<template>
+  <div class="app-container">
+
+    <!-- 立案 -->
+    <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+      <el-row :gutter="20">
+        <el-col :span="12">
+          <el-form-item label="案件名称" prop="caseName">
+            <el-input v-model="form.caseName" placeholder="请输入案件名称"/>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="案件编号" prop="caseNumber">
+            <el-input v-model="caseNumber" placeholder="请输入案件编号" disabled/>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-row :gutter="20">
+        <el-col :span="12">
+          <el-form-item label="处罚对象" prop="punishTarget">
+            <el-select v-model="form.punishTarget" placeholder="请选择处罚对象" filterable>
+              <el-option
+                v-for="dict in dict.type.lawenforcement_punish_target"
+                :key="dict.value"
+                :label="dict.label"
+                :value="dict.value"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="处罚情形" prop="punishType">
+            <el-select v-model="form.punishType" placeholder="请选择处罚情形" filterable>
+              <el-option
+                v-for="dict in dict.type.lawenforcement_punish_type"
+                :key="dict.value"
+                :label="dict.label"
+                :value="dict.value"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-row :gutter="20">
+        <el-col :span="24">
+          <el-form-item label="案件描述" prop="describe">
+            <el-input type="textarea" v-model="form.describe" placeholder="请输入案件描述"/>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-row :gutter="20">
+        <el-col :span="24">
+          <el-col :span="8">
+            <el-card style="height: 350px;">
+              <div class="form-item-title">1.法制审核机构出具的审核意见书</div>
+              <br>
+              <el-form-item label="附件" label-width="50px" prop="dataOne">
+                <fileUpload :fileType = "fileType" :limit = "1" v-model="form.dataOne" :setFileName="setDataOne"
+                            :removeFileName="removeDataOne"></fileUpload>
+              </el-form-item>
+              <el-form-item label="说明" label-width="50px" prop="describeOne">
+                <el-input type="textarea" v-model="form.describeOne" placeholder="请输入材料说明"/>
+              </el-form-item>
+            </el-card>
+          </el-col>
+          <el-col :span="8">
+            <el-card style="height: 350px;">
+              <div class="form-item-title">2.落实行政处罚裁量基准和包容审慎监管执法“四张清单”相关材料</div>
+              <el-form-item label="附件" label-width="50px" prop="dataTwo">
+                <fileUpload :fileType = "fileType" v-model="form.dataTwo" :setFileName="setDataTwo"
+                            :removeFileName="removeDataTwo"></fileUpload>
+              </el-form-item>
+              <el-form-item label="说明" label-width="50px" prop="describeTwo">
+                <el-input type="textarea" v-model="form.describeTwo" placeholder="请输入材料说明"/>
+              </el-form-item>
+            </el-card>
+          </el-col>
+          <el-col :span="8">
+            <el-card style="height: 350px;">
+              <div class="form-item-title">3.落实行政处罚裁量基准和包容审慎监管执法“四张清单”相关材料</div>
+              <el-form-item label="附件" label-width="50px" prop="dataThree">
+                <fileUpload :fileType = "fileType" v-model="form.dataThree" :setFileName="setDataThree"
+                            :removeFileName="removeDataThree"></fileUpload>
+              </el-form-item>
+              <el-form-item label="说明" label-width="50px" prop="describeThree">
+                <el-input type="textarea" v-model="form.describeThree" placeholder="请输入材料说明"/>
+              </el-form-item>
+            </el-card>
+          </el-col>
+        </el-col>
+      </el-row>
+    </el-form>
+  </div>
+</template>
+
+<script>
+import {listCase, getCase, delCase, updateCase, addCase} from "@/api/lawenforcement/case";
+import fileUpload from '@/views/components/FileUpload/index.vue';
+
+export default {
+  components: {fileUpload},
+  props:['caseNumber'],
+  name: "register",
+  dicts: ['lawenforcement_punish_target', 'lawenforcement_punish_type'],
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      fileNamesOne: null,
+      fileNamesTwo: null,
+      fileNamesThree: null,
+      fileType: ['pdf','jpg','jpeg','png'],
+      describeList: [],
+      // 案件表格数据
+      caseList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        createName: null,
+        updateName: null,
+        deptId: null,
+        deptName: null,
+        recordId: null,
+        caseName: null,
+        caseNumber: null,
+        punishTarget: null,
+        punishType: null,
+        describe: null,
+        dataOne: null,
+        uploadOne: null,
+        dataTwo: null,
+        uploadTwo: null,
+        dataThree: null,
+        uploadThree: null,
+        state: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        caseName: [
+          {required: true, message: "案件名称不能为空", trigger: "blur"}
+        ],
+        punishTarget: [
+          {required: true, message: "处罚对象不能为空", trigger: "blur"}
+        ],
+        punishType: [
+          {required: true, message: "处罚情形不能为空", trigger: "blur"}
+        ],
+        describe: [
+          {required: true, message: "案件描述不能为空", trigger: "blur"}
+        ],
+        describeOne: [
+          {validator: (rule, value, callback) => {
+            if (value || this.form.dataOne) {
+              callback();
+            } else {
+              callback(new Error('请上传文件或填写说明'));
+            }
+          }, trigger: "blur"}
+        ],
+        describeTwo: [
+          {validator: (rule, value, callback) => {
+            if (value || this.form.dataTwo) {
+              callback();
+            } else {
+              callback(new Error('请上传文件或填写说明'));
+            }
+          }, trigger: "blur"}
+        ],
+        describeThree: [
+          {validator: (rule, value, callback) => {
+            if (value || this.form.dataThree) {
+              callback();
+            } else {
+              callback(new Error('请上传文件或填写说明'));
+            }
+          }, trigger: "blur"}
+        ],
+      }
+    };
+  },
+  created() {
+  },
+  methods: {
+    /** 查询案件列表 */
+    getList() {
+      this.loading = true;
+      listCase(this.queryParams).then(response => {
+        this.caseList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    setDataOne(fileName) {
+      this.fileNamesOne = fileName;
+    },
+    removeDataOne(index) {
+      this.fileNamesOne = null;
+      let fileurls = that.form.fileUrlOne.split(",")
+      fileurls.splice(index, 1)
+      this.form.fileUrlOne = fileurls.toString()
+    },
+    setDataTwo(fileName) {
+      this.fileNamesTwo = fileName;
+    },
+    removeDataTwo(index) {
+      this.fileNamesTwo = null;
+      let fileurls = that.form.fileUrlTwo.split(",")
+      fileurls.splice(index, 1)
+      this.form.fileUrlTwo = fileurls.toString()
+    },
+    setDataThree(fileName) {
+      this.fileNamesThree = fileName;
+    },
+    removeDataThree(index) {
+      this.fileNamesThree = null;
+      let fileurls = that.form.fileUrlThree.split(",")
+      fileurls.splice(index, 1)
+      this.form.fileUrlThree = fileurls.toString()
+    },
+    // 取消按钮
+    cancel() {
+      this.dialogVisible = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        createBy: null,
+        createName: null,
+        createTime: null,
+        updateBy: null,
+        updateName: null,
+        updateTime: null,
+        deptId: null,
+        deptName: null,
+        recordId: null,
+        caseName: null,
+        caseNumber: null,
+        punishTarget: null,
+        punishType: null,
+        describe: null,
+        dataOne: null,
+        uploadOne: null,
+        dataTwo: null,
+        uploadTwo: null,
+        dataThree: null,
+        uploadThree: null,
+        describeOne: null,
+        describeTwo: null,
+        describeThree: null,
+        state: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length !== 1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加案件";
+    },
+    /** 详情 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getCase(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "案件详情";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          this.form.caseNumber = this.caseNumber
+          if (this.fileNamesOne != null)this.form.fileNamesOne = this.fileNamesOne;
+          if (this.fileNamesTwo != null)this.form.fileNamesTwo = this.fileNamesTwo;
+          if (this.fileNamesThree != null)this.form.fileNamesThree = this.fileNamesThree;
+          if (this.form.id != null) {
+            updateCase(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addCase(this.form).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+          this.$emit('send-ok');
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$modal.confirm('是否确认删除案件编号为"' + ids + '"的数据项?').then(function () {
+        return delCase(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {
+      });
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('lawenforcement/case/export', {
+        ...this.queryParams
+      }, `case_${new Date().getTime()}.xlsx`)
+    }
+  }
+};
+</script>

+ 2 - 1
src/main/java/com/sooka/sponest/lawenforcement/device/controller/DeviceController.java

@@ -32,7 +32,7 @@ public class DeviceController extends BaseController {
     private final String CLOSE = "0";
 
     /**
-     * 实时接受设备开关机状态集合
+     * 实时接受设备开关机状态集合(每分钟一次全部设备状态集合)
      * @param arr
      * @return
      */
@@ -78,6 +78,7 @@ public class DeviceController extends BaseController {
      */
     @PostMapping("/close")
     public AjaxResult close(@RequestBody DeviceBO bo){
+        log.debug("{}设备关机",bo.getCode());
         //设备关机先尝试删除定时任务
         deviceService.cancelTask(bo.getCode());
         //设置任务结束时间和任务状态为完成

+ 5 - 3
src/main/java/com/sooka/sponest/lawenforcement/device/service/impl/DeviceServiceImpl.java

@@ -2,11 +2,13 @@ package com.sooka.sponest.lawenforcement.device.service.impl;
 
 import com.sooka.sponest.lawenforcement.device.domain.DeviceBO;
 import com.sooka.sponest.lawenforcement.device.service.IDeviceService;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 
 import java.util.concurrent.*;
 
 @Service
+@Slf4j
 public class DeviceServiceImpl implements IDeviceService {
 
     // 用于存储定时任务的Map,key为deviceCode
@@ -23,7 +25,7 @@ public class DeviceServiceImpl implements IDeviceService {
      */
     @Override
     public void open(DeviceBO bo) {
-        System.out.println("设备开启");
+        log.info("设备开启:{}",bo.getCode());
         String deviceCode = bo.getCode();
 
         ScheduledFuture<?> future = scheduledTasks.get(deviceCode);
@@ -31,7 +33,7 @@ public class DeviceServiceImpl implements IDeviceService {
         if(future == null || future.isCancelled() || openedDevice.contains(deviceCode)){
             // 创建一个新的定时任务
             Runnable task = () -> {
-                System.out.println("设备开启超过六十分钟: " + deviceCode);
+                log.debug("设备开启超过六十分钟: {}" , deviceCode);
                 /*
                  *  此处发送开机未执法告警
                  */
@@ -41,7 +43,7 @@ public class DeviceServiceImpl implements IDeviceService {
             ScheduledFuture<?> futureNew = scheduler.schedule(task, 2, TimeUnit.MINUTES);
             scheduledTasks.put(deviceCode, futureNew);
         }else{
-            System.out.println(" 设备已开启定时任务!或正在执行工单任务!不开启定时任务");
+            log.debug("{} 设备已开启定时任务!或正在执行工单任务!不开启定时任务",bo.getCode());
         }
 
     }

+ 101 - 0
src/main/java/com/sooka/sponest/lawenforcement/lawCase/controller/LawenforcementCaseController.java

@@ -0,0 +1,101 @@
+package com.sooka.sponest.lawenforcement.lawCase.controller;
+
+import com.ruoyi.common.core.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.web.controller.BaseController;
+import com.ruoyi.common.core.web.domain.AjaxResult;
+import com.ruoyi.common.core.web.page.TableDataInfo;
+import com.ruoyi.common.log.annotation.Log;
+import com.ruoyi.common.log.enums.BusinessType;
+import com.ruoyi.common.security.annotation.RequiresPermissions;
+import com.sooka.sponest.lawenforcement.lawCase.domain.LawenforcementCase;
+import com.sooka.sponest.lawenforcement.lawCase.service.ILawenforcementCaseService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+/**
+ * 案件Controller
+ *
+ * @author 韩福成
+ * @date 2024-10-10
+ */
+@RestController
+@RequestMapping("/case")
+public class LawenforcementCaseController extends BaseController {
+    @Autowired
+    private ILawenforcementCaseService lawenforcementCaseService;
+
+    /**
+     * 查询案件列表
+     */
+    @RequiresPermissions("lawenforcement:case:list")
+    @GetMapping("/list")
+    public TableDataInfo list(LawenforcementCase lawenforcementCase) {
+        startPage();
+        List<LawenforcementCase> list = lawenforcementCaseService.selectLawenforcementCaseList(lawenforcementCase);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出案件列表
+     */
+    @RequiresPermissions("lawenforcement:case:export")
+    @Log(title = "案件", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, LawenforcementCase lawenforcementCase) {
+        List<LawenforcementCase> list = lawenforcementCaseService.selectLawenforcementCaseList(lawenforcementCase);
+        ExcelUtil<LawenforcementCase> util = new ExcelUtil<LawenforcementCase>(LawenforcementCase.class);
+        util.exportExcel(response, list, "案件数据");
+    }
+
+    /**
+     * 获取案件详细信息
+     */
+    @RequiresPermissions("lawenforcement:case:query")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") String id) {
+        return AjaxResult.success(lawenforcementCaseService.selectLawenforcementCaseById(id));
+    }
+
+    /**
+     * 新增案件
+     */
+    @Log(title = "案件", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody LawenforcementCase lawenforcementCase) {
+        return toAjax(lawenforcementCaseService.insertLawenforcementCase(lawenforcementCase));
+    }
+
+    /**
+     * 修改案件
+     */
+    @RequiresPermissions("lawenforcement:case:edit")
+    @Log(title = "案件", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody LawenforcementCase lawenforcementCase) {
+        return toAjax(lawenforcementCaseService.updateLawenforcementCase(lawenforcementCase));
+    }
+
+    /**
+     * 删除案件
+     */
+    @RequiresPermissions("lawenforcement:case:remove")
+    @Log(title = "案件", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable String[] ids) {
+        return toAjax(lawenforcementCaseService.deleteLawenforcementCaseByIds(ids));
+    }
+
+    /*
+    * 按部门查看日志
+    *
+    * @author 韩福成
+    * @date 2024/10/11 下午2:47
+    */
+    @PostMapping(value = "/getCaseLog")
+    public AjaxResult getCaseLog(@RequestBody LawenforcementCase lawenforcementCase) {
+        return AjaxResult.success(lawenforcementCaseService.getCaseLog(lawenforcementCase));
+    }
+}

+ 145 - 0
src/main/java/com/sooka/sponest/lawenforcement/lawCase/domain/LawenforcementAttach.java

@@ -0,0 +1,145 @@
+package com.sooka.sponest.lawenforcement.lawCase.domain;
+
+import com.ruoyi.common.core.annotation.Excel;
+import com.ruoyi.common.core.web.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * 附件对象 lawenforcement_attach
+ *
+ * @author 韩福成
+ * @date 2024-10-12
+ */
+public class LawenforcementAttach extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键id
+     */
+    private Long id;
+
+    /**
+     * 业务id
+     */
+    @Excel(name = "业务id")
+    private String busId;
+
+    /**
+     * 附件名称
+     */
+    @Excel(name = "附件名称")
+    private String fileName;
+
+    /**
+     * 附件路径
+     */
+    @Excel(name = "附件路径")
+    private String attachPath;
+
+    /**
+     * 说明
+     */
+    @Excel(name = "说明")
+    private String describe;
+
+    /**
+     * 排序
+     */
+    @Excel(name = "排序")
+    private Long attachSorts;
+
+    /**
+     * 创建人
+     */
+    @Excel(name = "创建人")
+    private String createName;
+
+    /**
+     * 更新人
+     */
+    @Excel(name = "更新人")
+    private String updateName;
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setBusId(String busId) {
+        this.busId = busId;
+    }
+
+    public String getBusId() {
+        return busId;
+    }
+
+    public void setFileName(String fileName) {
+        this.fileName = fileName;
+    }
+
+    public String getFileName() {
+        return fileName;
+    }
+
+    public void setAttachPath(String attachPath) {
+        this.attachPath = attachPath;
+    }
+
+    public String getAttachPath() {
+        return attachPath;
+    }
+
+    public void setDescribe(String describe) {
+        this.describe = describe;
+    }
+
+    public String getDescribe() {
+        return describe;
+    }
+
+    public void setAttachSorts(Long attachSorts) {
+        this.attachSorts = attachSorts;
+    }
+
+    public Long getAttachSorts() {
+        return attachSorts;
+    }
+
+    public void setCreateName(String createName) {
+        this.createName = createName;
+    }
+
+    public String getCreateName() {
+        return createName;
+    }
+
+    public void setUpdateName(String updateName) {
+        this.updateName = updateName;
+    }
+
+    public String getUpdateName() {
+        return updateName;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("id", getId())
+                .append("busId", getBusId())
+                .append("fileName", getFileName())
+                .append("attachPath", getAttachPath())
+                .append("describe", getDescribe())
+                .append("attachSorts", getAttachSorts())
+                .append("createTime", getCreateTime())
+                .append("createBy", getCreateBy())
+                .append("createName", getCreateName())
+                .append("updateTime", getUpdateTime())
+                .append("updateBy", getUpdateBy())
+                .append("updateName", getUpdateName())
+                .toString();
+    }
+}

+ 126 - 0
src/main/java/com/sooka/sponest/lawenforcement/lawCase/domain/LawenforcementCase.java

@@ -0,0 +1,126 @@
+package com.sooka.sponest.lawenforcement.lawCase.domain;
+
+import com.ruoyi.common.core.annotation.Excel;
+import com.ruoyi.common.datascope.base.domain.BaseBusinessEntity;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import javax.validation.constraints.NotBlank;
+import java.util.List;
+
+/**
+ * 案件对象 lawenforcement_case
+ *
+ * @author 韩福成
+ * @date 2024-10-10
+ */
+@Data
+public class LawenforcementCase extends BaseBusinessEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键id
+     */
+    private String id;
+
+    /**
+     * 部门id
+     */
+    @Excel(name = "部门id")
+    private Long deptId;
+
+    /**
+     * 部门名称
+     */
+    @Excel(name = "部门名称")
+    private String deptName;
+
+    /**
+     * 工单id
+     */
+    @Excel(name = "工单id")
+    private String recordId;
+
+    /**
+     * 案件名称
+     */
+    @Excel(name = "案件名称")
+    private String caseName;
+
+    /**
+     * 案件编号
+     */
+    @Excel(name = "案件编号")
+    private String caseNumber;
+
+    /**
+     * 处罚对象
+     */
+    @Excel(name = "处罚对象")
+    private String punishTarget;
+
+    /**
+     * 处罚情形
+     */
+    @Excel(name = "处罚情形")
+    private String punishType;
+
+    /**
+     * 案件描述
+     */
+    @Excel(name = "案件描述")
+    private String describe;
+
+    /**
+     * 状态
+     */
+    @Excel(name = "状态")
+    private String state;
+
+    private String content;
+
+    //日志列表
+    private List<LawenforcementCaseLog> logList;
+
+    //文件列表
+    private List<LawenforcementAttach> fileList;
+
+    //文件名
+    private String fileNamesOne;
+    private String fileNamesTwo;
+    private String fileNamesThree;
+
+    //文件路径
+    private String dataOne;
+    private String dataTwo;
+    private String dataThree;
+
+    //说明
+    private String describeOne;
+    private String describeTwo;
+    private String describeThree;
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("id", getId())
+                .append("createBy", getCreateBy())
+                .append("createName", getCreateName())
+                .append("createTime", getCreateTime())
+                .append("updateBy", getUpdateBy())
+                .append("updateName", getUpdateName())
+                .append("updateTime", getUpdateTime())
+                .append("deptId", getDeptId())
+                .append("deptName", getDeptName())
+                .append("recordId", getRecordId())
+                .append("caseName", getCaseName())
+                .append("caseNumber", getCaseNumber())
+                .append("punishTarget", getPunishTarget())
+                .append("punishType", getPunishType())
+                .append("describe", getDescribe())
+                .append("state", getState())
+                .toString();
+    }
+}

+ 113 - 0
src/main/java/com/sooka/sponest/lawenforcement/lawCase/domain/LawenforcementCaseLog.java

@@ -0,0 +1,113 @@
+package com.sooka.sponest.lawenforcement.lawCase.domain;
+
+import com.ruoyi.common.core.annotation.Excel;
+import com.ruoyi.common.core.web.domain.BaseEntity;
+import com.ruoyi.common.datascope.base.domain.BaseBusinessEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * 案件日志对象 lawenforcement_case_log
+ *
+ * @author 韩福成
+ * @date 2024-10-11
+ */
+public class LawenforcementCaseLog extends BaseBusinessEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键id
+     */
+    private String id;
+
+    /**
+     * 案件id
+     */
+    @Excel(name = "案件id")
+    private String caseId;
+
+    /**
+     * 部门id
+     */
+    @Excel(name = "部门id")
+    private Long deptId;
+
+    /**
+     * 部门名称
+     */
+    @Excel(name = "部门名称")
+    private String deptName;
+
+    /**
+     * 操作内容
+     */
+    @Excel(name = "操作内容")
+    private String content;
+
+    /**
+     * 状态
+     */
+    @Excel(name = "状态")
+    private String state;
+
+    public String getDeptName() {
+        return deptName;
+    }
+
+    public void setDeptName(String deptName) {
+        this.deptName = deptName;
+    }
+
+    public Long getDeptId() {
+        return deptId;
+    }
+
+    public void setDeptId(Long deptId) {
+        this.deptId = deptId;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setCaseId(String caseId) {
+        this.caseId = caseId;
+    }
+
+    public String getCaseId() {
+        return caseId;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+    public String getContent() {
+        return content;
+    }
+
+    public void setState(String state) {
+        this.state = state;
+    }
+
+    public String getState() {
+        return state;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("id", getId())
+                .append("createBy", getCreateBy())
+                .append("createName", getCreateName())
+                .append("createTime", getCreateTime())
+                .append("caseId", getCaseId())
+                .append("content", getContent())
+                .append("state", getState())
+                .toString();
+    }
+}

+ 70 - 0
src/main/java/com/sooka/sponest/lawenforcement/lawCase/mapper/LawenforcementAttachMapper.java

@@ -0,0 +1,70 @@
+package com.sooka.sponest.lawenforcement.lawCase.mapper;
+
+import com.sooka.sponest.lawenforcement.lawCase.domain.LawenforcementAttach;
+
+import java.util.List;
+
+/**
+ * 附件Mapper接口
+ *
+ * @author 韩福成
+ * @date 2024-10-12
+ */
+public interface LawenforcementAttachMapper
+{
+    /**
+     * 查询附件
+     *
+     * @param id 附件主键
+     * @return 附件
+     */
+    public LawenforcementAttach selectLawenforcementAttachById(Long id);
+
+    /**
+     * 查询附件列表
+     *
+     * @param lawenforcementAttach 附件
+     * @return 附件集合
+     */
+    public List<LawenforcementAttach> selectLawenforcementAttachList(LawenforcementAttach lawenforcementAttach);
+
+    /**
+     * 新增附件
+     *
+     * @param lawenforcementAttach 附件
+     * @return 结果
+     */
+    public int insertLawenforcementAttach(LawenforcementAttach lawenforcementAttach);
+
+    /**
+     * 修改附件
+     *
+     * @param lawenforcementAttach 附件
+     * @return 结果
+     */
+    public int updateLawenforcementAttach(LawenforcementAttach lawenforcementAttach);
+
+    /**
+     * 删除附件
+     *
+     * @param id 附件主键
+     * @return 结果
+     */
+    public int deleteLawenforcementAttachById(Long id);
+
+    /**
+     * 批量删除附件
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteLawenforcementAttachByIds(Long[] ids);
+
+    /*
+    * 按业务id删除
+    *
+    * @author 韩福成
+    * @date 2024/10/12 上午10:44
+    */
+    public int deleteByBusId(String busId);
+}

+ 78 - 0
src/main/java/com/sooka/sponest/lawenforcement/lawCase/mapper/LawenforcementCaseLogMapper.java

@@ -0,0 +1,78 @@
+package com.sooka.sponest.lawenforcement.lawCase.mapper;
+
+import com.sooka.sponest.lawenforcement.lawCase.domain.LawenforcementCase;
+import com.sooka.sponest.lawenforcement.lawCase.domain.LawenforcementCaseLog;
+
+import java.util.List;
+
+/**
+ * 案件日志Mapper接口
+ *
+ * @author 韩福成
+ * @date 2024-10-11
+ */
+public interface LawenforcementCaseLogMapper {
+    /**
+     * 查询案件日志
+     *
+     * @param id 案件日志主键
+     * @return 案件日志
+     */
+    public LawenforcementCaseLog selectLawenforcementCaseLogById(String id);
+
+    /**
+     * 查询案件日志列表
+     *
+     * @param lawenforcementCaseLog 案件日志
+     * @return 案件日志集合
+     */
+    public List<LawenforcementCaseLog> selectLawenforcementCaseLogList(LawenforcementCaseLog lawenforcementCaseLog);
+
+    /**
+     * 新增案件日志
+     *
+     * @param lawenforcementCaseLog 案件日志
+     * @return 结果
+     */
+    public int insertLawenforcementCaseLog(LawenforcementCaseLog lawenforcementCaseLog);
+
+    /**
+     * 修改案件日志
+     *
+     * @param lawenforcementCaseLog 案件日志
+     * @return 结果
+     */
+    public int updateLawenforcementCaseLog(LawenforcementCaseLog lawenforcementCaseLog);
+
+    /**
+     * 删除案件日志
+     *
+     * @param id 案件日志主键
+     * @return 结果
+     */
+    public int deleteLawenforcementCaseLogById(String id);
+
+    /**
+     * 批量删除案件日志
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteLawenforcementCaseLogByIds(String[] ids);
+
+    /*
+    * 按案件id查询
+    *
+    * @author 韩福成
+    * @date 2024/10/11 上午10:06
+    */
+    public List<LawenforcementCaseLog> getLogByCaseId(String caseId);
+
+    /*
+    * 按部门查询日志
+    *
+    * @author 韩福成
+    * @date 2024/10/11 下午2:51
+    */
+    public int getCaseLog(LawenforcementCase lawenforcementCase);
+}

+ 62 - 0
src/main/java/com/sooka/sponest/lawenforcement/lawCase/mapper/LawenforcementCaseMapper.java

@@ -0,0 +1,62 @@
+package com.sooka.sponest.lawenforcement.lawCase.mapper;
+
+
+import com.sooka.sponest.lawenforcement.lawCase.domain.LawenforcementCase;
+
+import java.util.List;
+
+/**
+ * 案件Mapper接口
+ *
+ * @author 韩福成
+ * @date 2024-10-10
+ */
+public interface LawenforcementCaseMapper {
+    /**
+     * 查询案件
+     *
+     * @param id 案件主键
+     * @return 案件
+     */
+    public LawenforcementCase selectLawenforcementCaseById(String id);
+
+    /**
+     * 查询案件列表
+     *
+     * @param lawenforcementCase 案件
+     * @return 案件集合
+     */
+    public List<LawenforcementCase> selectLawenforcementCaseList(LawenforcementCase lawenforcementCase);
+
+    /**
+     * 新增案件
+     *
+     * @param lawenforcementCase 案件
+     * @return 结果
+     */
+    public int insertLawenforcementCase(LawenforcementCase lawenforcementCase);
+
+    /**
+     * 修改案件
+     *
+     * @param lawenforcementCase 案件
+     * @return 结果
+     */
+    public int updateLawenforcementCase(LawenforcementCase lawenforcementCase);
+
+    /**
+     * 删除案件
+     *
+     * @param id 案件主键
+     * @return 结果
+     */
+    public int deleteLawenforcementCaseById(String id);
+
+    /**
+     * 批量删除案件
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteLawenforcementCaseByIds(String[] ids);
+}

+ 60 - 0
src/main/java/com/sooka/sponest/lawenforcement/lawCase/service/ILawenforcementCaseLogService.java

@@ -0,0 +1,60 @@
+package com.sooka.sponest.lawenforcement.lawCase.service;
+
+import java.util.List;
+import com.sooka.sponest.lawenforcement.lawCase.domain.LawenforcementCaseLog;
+
+/**
+ * 案件日志Service接口
+ *
+ * @author 韩福成
+ * @date 2024-10-11
+ */
+public interface ILawenforcementCaseLogService {
+    /**
+     * 查询案件日志
+     *
+     * @param id 案件日志主键
+     * @return 案件日志
+     */
+    public LawenforcementCaseLog selectLawenforcementCaseLogById(String id);
+
+    /**
+     * 查询案件日志列表
+     *
+     * @param lawenforcementCaseLog 案件日志
+     * @return 案件日志集合
+     */
+    public List<LawenforcementCaseLog> selectLawenforcementCaseLogList(LawenforcementCaseLog lawenforcementCaseLog);
+
+    /**
+     * 新增案件日志
+     *
+     * @param lawenforcementCaseLog 案件日志
+     * @return 结果
+     */
+    public int insertLawenforcementCaseLog(LawenforcementCaseLog lawenforcementCaseLog);
+
+    /**
+     * 修改案件日志
+     *
+     * @param lawenforcementCaseLog 案件日志
+     * @return 结果
+     */
+    public int updateLawenforcementCaseLog(LawenforcementCaseLog lawenforcementCaseLog);
+
+    /**
+     * 批量删除案件日志
+     *
+     * @param ids 需要删除的案件日志主键集合
+     * @return 结果
+     */
+    public int deleteLawenforcementCaseLogByIds(String[] ids);
+
+    /**
+     * 删除案件日志信息
+     *
+     * @param id 案件日志主键
+     * @return 结果
+     */
+    public int deleteLawenforcementCaseLogById(String id);
+}

+ 70 - 0
src/main/java/com/sooka/sponest/lawenforcement/lawCase/service/ILawenforcementCaseService.java

@@ -0,0 +1,70 @@
+package com.sooka.sponest.lawenforcement.lawCase.service;
+
+
+import com.sooka.sponest.lawenforcement.lawCase.domain.LawenforcementCase;
+
+import java.util.List;
+
+/**
+ * 案件Service接口
+ *
+ * @author 韩福成
+ * @date 2024-10-10
+ */
+public interface ILawenforcementCaseService {
+    /**
+     * 查询案件
+     *
+     * @param id 案件主键
+     * @return 案件
+     */
+    public LawenforcementCase selectLawenforcementCaseById(String id);
+
+    /**
+     * 查询案件列表
+     *
+     * @param lawenforcementCase 案件
+     * @return 案件集合
+     */
+    public List<LawenforcementCase> selectLawenforcementCaseList(LawenforcementCase lawenforcementCase);
+
+    /**
+     * 新增案件
+     *
+     * @param lawenforcementCase 案件
+     * @return 结果
+     */
+    public int insertLawenforcementCase(LawenforcementCase lawenforcementCase);
+
+    /**
+     * 修改案件
+     *
+     * @param lawenforcementCase 案件
+     * @return 结果
+     */
+    public int updateLawenforcementCase(LawenforcementCase lawenforcementCase);
+
+    /**
+     * 批量删除案件
+     *
+     * @param ids 需要删除的案件主键集合
+     * @return 结果
+     */
+    public int deleteLawenforcementCaseByIds(String[] ids);
+
+    /**
+     * 删除案件信息
+     *
+     * @param id 案件主键
+     * @return 结果
+     */
+    public int deleteLawenforcementCaseById(String id);
+
+    /*
+    * 按部门查看日志
+    *
+    * @author 韩福成
+    * @date 2024/10/11 下午2:49
+    */
+    public int getCaseLog(LawenforcementCase lawenforcementCase);
+}

+ 90 - 0
src/main/java/com/sooka/sponest/lawenforcement/lawCase/service/impl/LawenforcementCaseLogServiceImpl.java

@@ -0,0 +1,90 @@
+package com.sooka.sponest.lawenforcement.lawCase.service.impl;
+
+import com.ruoyi.common.core.utils.DateUtils;
+import com.ruoyi.common.datascope.base.service.BaseService;
+import com.sooka.sponest.lawenforcement.lawCase.domain.LawenforcementCaseLog;
+import com.sooka.sponest.lawenforcement.lawCase.mapper.LawenforcementCaseLogMapper;
+import com.sooka.sponest.lawenforcement.lawCase.service.ILawenforcementCaseLogService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 案件日志Service业务层处理
+ *
+ * @author 韩福成
+ * @date 2024-10-11
+ */
+@Service
+public class LawenforcementCaseLogServiceImpl extends BaseService implements ILawenforcementCaseLogService {
+    @Autowired
+    private LawenforcementCaseLogMapper lawenforcementCaseLogMapper;
+
+    /**
+     * 查询案件日志
+     *
+     * @param id 案件日志主键
+     * @return 案件日志
+     */
+    @Override
+    public LawenforcementCaseLog selectLawenforcementCaseLogById(String id) {
+        return lawenforcementCaseLogMapper.selectLawenforcementCaseLogById(id);
+    }
+
+    /**
+     * 查询案件日志列表
+     *
+     * @param lawenforcementCaseLog 案件日志
+     * @return 案件日志
+     */
+    @Override
+    public List<LawenforcementCaseLog> selectLawenforcementCaseLogList(LawenforcementCaseLog lawenforcementCaseLog) {
+        return lawenforcementCaseLogMapper.selectLawenforcementCaseLogList(lawenforcementCaseLog);
+    }
+
+    /**
+     * 新增案件日志
+     *
+     * @param lawenforcementCaseLog 案件日志
+     * @return 结果
+     */
+    @Override
+    public int insertLawenforcementCaseLog(LawenforcementCaseLog lawenforcementCaseLog) {
+        lawenforcementCaseLog.setCreateTime(DateUtils.getNowDate());
+        return lawenforcementCaseLogMapper.insertLawenforcementCaseLog(lawenforcementCaseLog);
+    }
+
+    /**
+     * 修改案件日志
+     *
+     * @param lawenforcementCaseLog 案件日志
+     * @return 结果
+     */
+    @Override
+    public int updateLawenforcementCaseLog(LawenforcementCaseLog lawenforcementCaseLog) {
+        return lawenforcementCaseLogMapper.updateLawenforcementCaseLog(lawenforcementCaseLog);
+    }
+
+    /**
+     * 批量删除案件日志
+     *
+     * @param ids 需要删除的案件日志主键
+     * @return 结果
+     */
+    @Override
+    public int deleteLawenforcementCaseLogByIds(String[] ids) {
+        return lawenforcementCaseLogMapper.deleteLawenforcementCaseLogByIds(ids);
+    }
+
+    /**
+     * 删除案件日志信息
+     *
+     * @param id 案件日志主键
+     * @return 结果
+     */
+    @Override
+    public int deleteLawenforcementCaseLogById(String id) {
+        return lawenforcementCaseLogMapper.deleteLawenforcementCaseLogById(id);
+    }
+}

+ 239 - 0
src/main/java/com/sooka/sponest/lawenforcement/lawCase/service/impl/LawenforcementCaseServiceImpl.java

@@ -0,0 +1,239 @@
+package com.sooka.sponest.lawenforcement.lawCase.service.impl;
+
+import com.ruoyi.common.core.utils.DateUtils;
+import com.ruoyi.common.core.utils.SpringUtils;
+import com.ruoyi.common.core.utils.StringUtils;
+import com.ruoyi.common.core.utils.uuid.IdUtils;
+import com.ruoyi.common.datascope.annotation.DataScopeMutiDept;
+import com.ruoyi.common.datascope.base.service.BaseService;
+import com.ruoyi.common.security.utils.SecurityUtils;
+import com.ruoyi.system.api.RemoteConfigService;
+import com.sooka.sponest.lawenforcement.lawCase.domain.LawenforcementAttach;
+import com.sooka.sponest.lawenforcement.lawCase.domain.LawenforcementCase;
+import com.sooka.sponest.lawenforcement.lawCase.domain.LawenforcementCaseLog;
+import com.sooka.sponest.lawenforcement.lawCase.mapper.LawenforcementAttachMapper;
+import com.sooka.sponest.lawenforcement.lawCase.mapper.LawenforcementCaseLogMapper;
+import com.sooka.sponest.lawenforcement.lawCase.mapper.LawenforcementCaseMapper;
+import com.sooka.sponest.lawenforcement.lawCase.service.ILawenforcementCaseService;
+import com.sooka.sponest.lawenforcement.utils.DataConstants;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+
+/**
+ * 案件Service业务层处理
+ *
+ * @author 韩福成
+ * @date 2024-10-10
+ */
+@Service
+public class LawenforcementCaseServiceImpl extends BaseService implements ILawenforcementCaseService {
+    @Autowired
+    private LawenforcementCaseMapper lawenforcementCaseMapper;
+
+    @Autowired
+    private LawenforcementCaseLogMapper lawenforcementCaseLogMapper;
+
+    @Autowired
+    private LawenforcementAttachMapper lawenforcementAttachMapper;
+
+    /**
+     * 查询案件
+     *
+     * @param id 案件主键
+     * @return 案件
+     */
+    @Override
+    public LawenforcementCase selectLawenforcementCaseById(String id) {
+        LawenforcementCase lawenforcementCase = lawenforcementCaseMapper.selectLawenforcementCaseById(id);
+        List<LawenforcementCaseLog> logList = lawenforcementCaseLogMapper.getLogByCaseId(id);
+        LawenforcementAttach attach = new LawenforcementAttach();
+        attach.setBusId(id);
+        List<LawenforcementAttach> fileList = lawenforcementAttachMapper.selectLawenforcementAttachList(attach);
+        for (LawenforcementAttach file : fileList) {
+            StringBuilder newDiles = new StringBuilder();
+            String fileurl = SpringUtils.getBean(RemoteConfigService.class).remotegetConfigKey(DataConstants.DOWNLOAD_URL).getData();
+            String filename = file.getFileName();
+            String group = file.getAttachPath().substring(0, file.getAttachPath().indexOf('/'));
+            newDiles.append(fileurl).append("Download?fileName=").append(filename).append("&&group=").append(group).append("&&path=").append(file.getAttachPath().substring(file.getAttachPath().indexOf('/') + 1)).append("+").append(filename);
+            file.setAttachPath(newDiles.toString());
+        }
+        lawenforcementCase.setLogList(logList);
+        lawenforcementCase.setFileList(fileList);
+        return lawenforcementCase;
+    }
+
+    /**
+     * 查询案件列表
+     *
+     * @param lawenforcementCase 案件
+     * @return 案件
+     */
+    @DataScopeMutiDept(deptAlias = "d")
+    @Override
+    public List<LawenforcementCase> selectLawenforcementCaseList(LawenforcementCase lawenforcementCase) {
+        setSookaDataBase(lawenforcementCase);
+        return lawenforcementCaseMapper.selectLawenforcementCaseList(lawenforcementCase);
+    }
+
+    /**
+     * 新增案件
+     *
+     * @param lawenforcementCase 案件
+     * @return 结果
+     */
+    @Override
+    public int insertLawenforcementCase(LawenforcementCase lawenforcementCase) {
+        //新增案件
+        lawenforcementCase.setId(IdUtils.simpleUUID());
+        lawenforcementCase.setCreateBy(SecurityUtils.getUserId().toString());
+        lawenforcementCase.setCreateTime(DateUtils.getNowDate());
+        lawenforcementCase.setCreateName(SecurityUtils.getLoginUser().getSysUser().getNickName());
+        lawenforcementCase.setDeptId(SecurityUtils.getLoginUser().getSysUser().getDeptId());
+        lawenforcementCase.setDeptName(SecurityUtils.getLoginUser().getSysUser().getDeptNames());
+        lawenforcementCase.setState("state_1");
+        int inserted = lawenforcementCaseMapper.insertLawenforcementCase(lawenforcementCase);
+        //新增案件日志
+        LawenforcementCaseLog lawenforcementCaseLog = new LawenforcementCaseLog();
+        lawenforcementCaseLog.setId(IdUtils.simpleUUID());
+        lawenforcementCaseLog.setCreateBy(SecurityUtils.getUserId().toString());
+        lawenforcementCaseLog.setCreateTime(DateUtils.getNowDate());
+        lawenforcementCaseLog.setCreateName( SecurityUtils.getLoginUser().getSysUser().getNickName());
+        lawenforcementCaseLog.setDeptId(SecurityUtils.getLoginUser().getSysUser().getDeptId());
+        lawenforcementCaseLog.setDeptName(SecurityUtils.getLoginUser().getSysUser().getDeptNames());
+        lawenforcementCaseLog.setCaseId(lawenforcementCase.getId());
+        lawenforcementCaseLog.setState("state_1");
+        lawenforcementCaseLog.setContent(lawenforcementCase.getContent());
+        lawenforcementCaseLogMapper.insertLawenforcementCaseLog(lawenforcementCaseLog);
+        //附件
+        lawenforcementAttachMapper.deleteByBusId(lawenforcementCase.getId());//删掉旧数据
+        if (StringUtils.isNotEmpty(lawenforcementCase.getFileNamesOne())||StringUtils.isNotEmpty(lawenforcementCase.getDescribeOne())){
+            LawenforcementAttach centerdataTFile = new LawenforcementAttach();
+            centerdataTFile.setBusId(lawenforcementCase.getId());
+            centerdataTFile.setFileName(lawenforcementCase.getFileNamesOne());
+            String fileUrl = getString(lawenforcementCase.getDataOne());
+            centerdataTFile.setAttachPath(fileUrl);
+            centerdataTFile.setAttachSorts(1L);
+            centerdataTFile.setDescribe(lawenforcementCase.getDescribeOne());
+            centerdataTFile.setCreateBy(SecurityUtils.getUserId().toString());
+            centerdataTFile.setCreateTime(DateUtils.getNowDate());
+            centerdataTFile.setCreateName(SecurityUtils.getLoginUser().getSysUser().getNickName());
+            lawenforcementAttachMapper.insertLawenforcementAttach(centerdataTFile);
+        }
+        if (StringUtils.isNotEmpty(lawenforcementCase.getFileNamesTwo())||StringUtils.isNotEmpty(lawenforcementCase.getDescribeTwo())){
+            LawenforcementAttach centerdataTFile = new LawenforcementAttach();
+            centerdataTFile.setBusId(lawenforcementCase.getId());
+            centerdataTFile.setFileName(lawenforcementCase.getFileNamesTwo());
+            String fileUrl = getString(lawenforcementCase.getDataTwo());
+            centerdataTFile.setAttachPath(fileUrl);
+            centerdataTFile.setAttachSorts(2L);
+            centerdataTFile.setDescribe(lawenforcementCase.getDescribeTwo());
+            centerdataTFile.setCreateBy(SecurityUtils.getUserId().toString());
+            centerdataTFile.setCreateTime(DateUtils.getNowDate());
+            centerdataTFile.setCreateName(SecurityUtils.getLoginUser().getSysUser().getNickName());
+            lawenforcementAttachMapper.insertLawenforcementAttach(centerdataTFile);
+        }
+        if (StringUtils.isNotEmpty(lawenforcementCase.getFileNamesThree())||StringUtils.isNotEmpty(lawenforcementCase.getDescribeThree())){
+            LawenforcementAttach centerdataTFile = new LawenforcementAttach();
+            centerdataTFile.setBusId(lawenforcementCase.getId());
+            centerdataTFile.setFileName(lawenforcementCase.getFileNamesThree());
+            String fileUrl = getString(lawenforcementCase.getDataThree());
+            centerdataTFile.setAttachPath(fileUrl);
+            centerdataTFile.setAttachSorts(3L);
+            centerdataTFile.setDescribe(lawenforcementCase.getDescribeThree());
+            centerdataTFile.setCreateBy(SecurityUtils.getUserId().toString());
+            centerdataTFile.setCreateTime(DateUtils.getNowDate());
+            centerdataTFile.setCreateName(SecurityUtils.getLoginUser().getSysUser().getNickName());
+            lawenforcementAttachMapper.insertLawenforcementAttach(centerdataTFile);
+        }
+        return inserted;
+    }
+
+    private static String getString(String file) {
+        String fileUrl = null;
+        if (file.indexOf('+') > -1 || file.indexOf("&&") > -1) {
+            if (file.indexOf('+') > -1) {
+                fileUrl = file.substring(0, file.indexOf('+'));
+            } else {
+                fileUrl = file;
+            }
+            String[] fileurls = fileUrl.split("&&");
+            fileUrl = fileurls[1].substring(fileurls[1].indexOf('=') + 1) + "/" + fileurls[2].substring(fileurls[2].indexOf('=') + 1);
+        } else {
+            fileUrl = file;
+        }
+        return fileUrl;
+    }
+
+    /**
+     * 修改案件
+     *
+     * @param lawenforcementCase 案件
+     * @return 结果
+     */
+    @Override
+    public int updateLawenforcementCase(LawenforcementCase lawenforcementCase) {
+        LawenforcementCaseLog lawenforcementCaseLog = new LawenforcementCaseLog();
+        lawenforcementCaseLog.setId(IdUtils.simpleUUID());
+        lawenforcementCaseLog.setCreateBy(SecurityUtils.getUserId().toString());
+        lawenforcementCaseLog.setCreateTime(DateUtils.getNowDate());
+        lawenforcementCaseLog.setCreateName( SecurityUtils.getLoginUser().getSysUser().getNickName());
+        lawenforcementCaseLog.setDeptId(SecurityUtils.getLoginUser().getSysUser().getDeptId());
+        lawenforcementCaseLog.setDeptName(SecurityUtils.getLoginUser().getSysUser().getDeptNames());
+        lawenforcementCaseLog.setCaseId(lawenforcementCase.getId());
+        lawenforcementCaseLog.setState(lawenforcementCase.getState());
+        lawenforcementCaseLog.setContent(lawenforcementCase.getContent());
+        int inserted = lawenforcementCaseLogMapper.insertLawenforcementCaseLog(lawenforcementCaseLog);
+        if (lawenforcementCase.getState().equals("state_5")){
+            List<LawenforcementCaseLog> logList = lawenforcementCaseLogMapper.getLogByCaseId(lawenforcementCase.getId());
+            long count = logList.stream().filter(obj -> obj.getState().equals("state_5")).count();
+            if (count>=5){
+                lawenforcementCase.setUpdateBy(SecurityUtils.getUserId());
+                lawenforcementCase.setUpdateTime(DateUtils.getNowDate());
+                lawenforcementCase.setUpdateName( SecurityUtils.getLoginUser().getSysUser().getNickName());
+                return lawenforcementCaseMapper.updateLawenforcementCase(lawenforcementCase);
+            }
+            return inserted;
+        }else {
+            lawenforcementCase.setUpdateBy(SecurityUtils.getUserId());
+            lawenforcementCase.setUpdateTime(DateUtils.getNowDate());
+            lawenforcementCase.setUpdateName( SecurityUtils.getLoginUser().getSysUser().getNickName());
+            return lawenforcementCaseMapper.updateLawenforcementCase(lawenforcementCase);
+        }
+    }
+
+    /**
+     * 批量删除案件
+     *
+     * @param ids 需要删除的案件主键
+     * @return 结果
+     */
+    @Override
+    public int deleteLawenforcementCaseByIds(String[] ids) {
+        return lawenforcementCaseMapper.deleteLawenforcementCaseByIds(ids);
+    }
+
+    /**
+     * 删除案件信息
+     *
+     * @param id 案件主键
+     * @return 结果
+     */
+    @Override
+    public int deleteLawenforcementCaseById(String id) {
+        return lawenforcementCaseMapper.deleteLawenforcementCaseById(id);
+    }
+
+    /*
+    * 按部门查看日志
+    *
+    * @author 韩福成
+    * @date 2024/10/11 下午2:50
+    */
+    @Override
+    public int getCaseLog(LawenforcementCase lawenforcementCase) {
+        return lawenforcementCaseLogMapper.getCaseLog(lawenforcementCase);
+    }
+}

+ 6 - 0
src/main/java/com/sooka/sponest/lawenforcement/person/mapper/LawenforcementPersonMapper.java

@@ -58,4 +58,10 @@ public interface LawenforcementPersonMapper {
      * @return 结果
      */
     int deleteLawenforcementPersonByIds(String[] ids);
+
+    void insertLawenforcementPersonToList(List<LawenforcementPerson> personList);
+
+    void deleteLawenforcementPersonByRecordId(String id);
+
+    List<LawenforcementPerson> selectPersonByRecordId(String id);
 }

+ 6 - 1
src/main/java/com/sooka/sponest/lawenforcement/record/controller/LawenforcementRecordController.java

@@ -103,8 +103,13 @@ public class LawenforcementRecordController extends BaseController {
         return SpringUtils.getBean(RemoteDeviceService.class).selectByCameraId(visuForestCloudCameraBO);
     }
 
-    @PostMapping("addRecordLog")
+    @PostMapping("/addRecordLog")
     public AjaxResult addRecordLog(@RequestBody LawenforcementRecord record){
         return toAjax(lawenforcementRecordService.addRecordLog(record));
     }
+
+    @PostMapping("/distributeRecord")
+    public AjaxResult distributeRecord(@RequestBody LawenforcementRecord record){
+        return toAjax(lawenforcementRecordService.distributeRecord(record));
+    }
 }

+ 15 - 1
src/main/java/com/sooka/sponest/lawenforcement/record/domain/LawenforcementRecord.java

@@ -2,11 +2,15 @@ package com.sooka.sponest.lawenforcement.record.domain;
 
 import com.ruoyi.common.core.annotation.Excel;
 import com.ruoyi.common.core.web.domain.BaseEntity;
+import com.sooka.sponest.lawenforcement.user.domain.LawenforcementUser;
 import lombok.Getter;
 import lombok.Setter;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 
+import java.util.List;
+import java.util.Map;
+
 /**
  * 任务数据对象 lawenforcement_record
  *
@@ -15,7 +19,7 @@ import org.apache.commons.lang3.builder.ToStringStyle;
  */
 @Setter
 @Getter
-public class LawenforcementRecord extends BaseEntity {
+public class LawenforcementRecord{
     private static final long serialVersionUID = 1L;
 
     /**
@@ -256,9 +260,19 @@ public class LawenforcementRecord extends BaseEntity {
      */
     @Excel(name = "设备名称")
     private String deviceName;
+    private String createTime;
+    private String createBy;
+    private String remark;
 
     private String recordStatus;
 
+    //执法主办人执法证号
+    private String mainPerson;
+
+    //执法人集合
+    private List<LawenforcementUser> personList;
+
+
     @Override
     public String toString() {
         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

+ 2 - 0
src/main/java/com/sooka/sponest/lawenforcement/record/service/ILawenforcementRecordService.java

@@ -66,4 +66,6 @@ public interface ILawenforcementRecordService {
     int addRecordLog(LawenforcementRecord record);
 
     void updateRecordLogEndTime(DeviceBO bo);
+
+    int distributeRecord(LawenforcementRecord record);
 }

+ 55 - 13
src/main/java/com/sooka/sponest/lawenforcement/record/service/impl/LawenforcementRecordServiceImpl.java

@@ -1,13 +1,18 @@
 package com.sooka.sponest.lawenforcement.record.service.impl;
 
+import com.alibaba.nacos.common.utils.UuidUtils;
 import com.ruoyi.common.core.utils.DateUtils;
 import com.ruoyi.common.core.utils.uuid.IdUtils;
 import com.sooka.sponest.lawenforcement.device.domain.DeviceBO;
 import com.sooka.sponest.lawenforcement.device.service.IDeviceService;
+import com.sooka.sponest.lawenforcement.person.domain.LawenforcementPerson;
+import com.sooka.sponest.lawenforcement.person.mapper.LawenforcementPersonMapper;
+import com.sooka.sponest.lawenforcement.person.service.ILawenforcementPersonService;
 import com.sooka.sponest.lawenforcement.record.domain.LawenforcementRecord;
 import com.sooka.sponest.lawenforcement.record.domain.LawenforcementRecordLog;
 import com.sooka.sponest.lawenforcement.record.mapper.LawenforcementRecordMapper;
 import com.sooka.sponest.lawenforcement.record.service.ILawenforcementRecordService;
+import com.sooka.sponest.lawenforcement.user.domain.LawenforcementUser;
 import org.apache.commons.collections4.MapUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -16,6 +21,7 @@ import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * 任务数据Service业务层处理
@@ -26,11 +32,14 @@ import java.util.Map;
 @Service
 public class LawenforcementRecordServiceImpl implements ILawenforcementRecordService {
     @Autowired
-    private LawenforcementRecordMapper lawenforcementRecordMapper;
+    private LawenforcementRecordMapper recordMapper;
 
     @Autowired
     private IDeviceService deviceService;
 
+    @Autowired
+    private LawenforcementPersonMapper personMapper;
+
     /**
      * 查询任务数据
      *
@@ -39,7 +48,14 @@ public class LawenforcementRecordServiceImpl implements ILawenforcementRecordSer
      */
     @Override
     public LawenforcementRecord selectLawenforcementRecordById(String id) {
-        return lawenforcementRecordMapper.selectLawenforcementRecordById(id);
+        LawenforcementRecord record = recordMapper.selectLawenforcementRecordById(id);
+        List<LawenforcementUser> personList = record.getPersonList();
+        personList.forEach(person->{
+            if("1".equals(person.getIsMainPerson())){
+                record.setMainPerson(person.getCertificateNumber());
+            }
+        });
+        return record;
     }
 
     /**
@@ -50,7 +66,7 @@ public class LawenforcementRecordServiceImpl implements ILawenforcementRecordSer
      */
     @Override
     public List<LawenforcementRecord> selectLawenforcementRecordList(LawenforcementRecord lawenforcementRecord) {
-        return lawenforcementRecordMapper.selectLawenforcementRecordList(lawenforcementRecord);
+        return recordMapper.selectLawenforcementRecordList(lawenforcementRecord);
     }
 
     /**
@@ -61,8 +77,7 @@ public class LawenforcementRecordServiceImpl implements ILawenforcementRecordSer
      */
     @Override
     public int insertLawenforcementRecord(LawenforcementRecord lawenforcementRecord) {
-        lawenforcementRecord.setCreateTime(DateUtils.getNowDate());
-        return lawenforcementRecordMapper.insertLawenforcementRecord(lawenforcementRecord);
+        return recordMapper.insertLawenforcementRecord(lawenforcementRecord);
     }
 
     /**
@@ -73,7 +88,7 @@ public class LawenforcementRecordServiceImpl implements ILawenforcementRecordSer
      */
     @Override
     public int updateLawenforcementRecord(LawenforcementRecord lawenforcementRecord) {
-        return lawenforcementRecordMapper.updateLawenforcementRecord(lawenforcementRecord);
+        return recordMapper.updateLawenforcementRecord(lawenforcementRecord);
     }
 
     /**
@@ -84,7 +99,7 @@ public class LawenforcementRecordServiceImpl implements ILawenforcementRecordSer
      */
     @Override
     public int deleteLawenforcementRecordByIds(String[] ids) {
-        return lawenforcementRecordMapper.deleteLawenforcementRecordByIds(ids);
+        return recordMapper.deleteLawenforcementRecordByIds(ids);
     }
 
     /**
@@ -95,7 +110,7 @@ public class LawenforcementRecordServiceImpl implements ILawenforcementRecordSer
      */
     @Override
     public int deleteLawenforcementRecordById(String id) {
-        return lawenforcementRecordMapper.deleteLawenforcementRecordById(id);
+        return recordMapper.deleteLawenforcementRecordById(id);
     }
 
     @Override
@@ -106,12 +121,12 @@ public class LawenforcementRecordServiceImpl implements ILawenforcementRecordSer
     @Override
     public int addRecordLog(LawenforcementRecord record) {
         //更新工单数据中的设备id和设备名称,以及任务开始时间
-        int i = lawenforcementRecordMapper.updateLawenforcementRecord(record);
-        Map<String, String> personCode = lawenforcementRecordMapper.getPersonCode(record.getId());
+        int i = recordMapper.updateLawenforcementRecord(record);
+        Map<String, String> personCode = recordMapper.getPersonCode(record.getId());
 
         LawenforcementRecordLog lawenforcementRecordLog = new LawenforcementRecordLog(IdUtils.fastSimpleUUID(), MapUtils.getString(personCode, "personCode"),record.getId(),record.getDeviceId(),new Date(),null);
         //将工单执行记录,写入到日志表中:数据id、任务id、执法人编号、设备编号、开始时间
-        lawenforcementRecordMapper.addRecordLog(lawenforcementRecordLog);
+        recordMapper.addRecordLog(lawenforcementRecordLog);
         //绑定设备后关闭定时任务
         deviceService.cancelTask(lawenforcementRecordLog.getDeviceId());
         deviceService.setOpenedDevice(lawenforcementRecordLog.getDeviceId());
@@ -121,11 +136,38 @@ public class LawenforcementRecordServiceImpl implements ILawenforcementRecordSer
     @Override
     public void updateRecordLogEndTime(DeviceBO bo) {
         //设置任务完成状态
-        lawenforcementRecordMapper.updateRecordStatus(bo);
+        recordMapper.updateRecordStatus(bo);
         //设置任务结束时间
-        lawenforcementRecordMapper.updateRecordLogEndTime(bo);
+        recordMapper.updateRecordLogEndTime(bo);
         //从正在执行任务的设备集合中移除信息
         deviceService.removeOpenedDevice(bo.getCode());
     }
 
+    @Override
+    public int distributeRecord(LawenforcementRecord record) {
+        List<LawenforcementUser> userList = record.getPersonList();
+        String id = record.getId();
+        // 使用 Stream API 来创建 LawenforcementPerson 列表
+        List<LawenforcementPerson> personList = userList.stream()
+                .map(user -> {
+                    LawenforcementPerson person = new LawenforcementPerson();
+                    person.setId(IdUtils.fastSimpleUUID());
+                    person.setPersonId(user.getUserId());
+                    person.setPersonName(user.getNickName());
+                    person.setPersonCode(user.getCertificateNumber());
+                    person.setPersonPhone(user.getPhonenumber());
+                    person.setDeptId(user.getDeptId());
+                    person.setDeptName(user.getDeptName());
+                    person.setPersonType("0");
+                    person.setRecordId(id);
+                    person.setMainPerson(person.getPersonCode().equals(record.getMainPerson())?"1":"0");
+                    return person;
+                })
+                .collect(Collectors.toList()); // 收集结果 into a List
+        if(!personMapper.selectPersonByRecordId(id).isEmpty()){
+            personMapper.deleteLawenforcementPersonByRecordId(id);
+        }
+        personMapper.insertLawenforcementPersonToList(personList);
+        return recordMapper.updateLawenforcementRecord(record);
+    }
 }

+ 6 - 0
src/main/java/com/sooka/sponest/lawenforcement/user/controller/LawenforcementUserController.java

@@ -88,4 +88,10 @@ public class LawenforcementUserController extends BaseController {
     public AjaxResult remove(@PathVariable String[] userIds) {
         return toAjax(lawenforcementUserService.deleteLawenforcementUserByUserIds(userIds));
     }
+
+    @GetMapping("/getUserListByDeptId/{deptId}")
+    public AjaxResult getUserListByDeptId(@PathVariable("deptId") String[] deptId){
+        System.out.println("deptId = " + deptId);
+        return AjaxResult.success(lawenforcementUserService.getUserListByDeptId(deptId));
+    }
 }

+ 1 - 0
src/main/java/com/sooka/sponest/lawenforcement/user/domain/LawenforcementUser.java

@@ -82,6 +82,7 @@ public class LawenforcementUser extends BaseEntity {
     private String sex;
     private String deptId;
     private String deptName;
+    private String isMainPerson;
 
     @Override
     public String toString() {

+ 2 - 0
src/main/java/com/sooka/sponest/lawenforcement/user/mapper/LawenforcementUserMapper.java

@@ -58,4 +58,6 @@ public interface LawenforcementUserMapper {
      * @return 结果
      */
     public int deleteLawenforcementUserByUserIds(String[] userIds);
+
+    List<LawenforcementUser> getUserListByDeptId(String[] deptId);
 }

+ 2 - 0
src/main/java/com/sooka/sponest/lawenforcement/user/service/ILawenforcementUserService.java

@@ -58,4 +58,6 @@ public interface ILawenforcementUserService {
      * @return 结果
      */
     public int deleteLawenforcementUserByUserId(String userId);
+
+    List<LawenforcementUser> getUserListByDeptId(String[] deptId);
 }

+ 5 - 0
src/main/java/com/sooka/sponest/lawenforcement/user/service/impl/LawenforcementUserServiceImpl.java

@@ -84,4 +84,9 @@ public class LawenforcementUserServiceImpl implements ILawenforcementUserService
     public int deleteLawenforcementUserByUserId(String userId) {
         return lawenforcementUserMapper.deleteLawenforcementUserByUserId(userId);
     }
+
+    @Override
+    public List<LawenforcementUser> getUserListByDeptId(String[] deptId) {
+        return lawenforcementUserMapper.getUserListByDeptId(deptId);
+    }
 }

+ 29 - 0
src/main/java/com/sooka/sponest/lawenforcement/utils/DataConstants.java

@@ -0,0 +1,29 @@
+package com.sooka.sponest.lawenforcement.utils;
+
+/**
+ * 数据中心常量池
+ */
+public class DataConstants {
+
+    private DataConstants() {
+        throw new IllegalStateException("Utility class");
+    }
+
+    public static final String FILE_URL = "fileUrl";
+
+    public static final String DOWNLOAD_URL = "downloadUrl";
+
+    public static final String ERROR_MSG = "数据已存在!";
+
+    public static final String MONTH = "month";
+
+    public static final String DAY = "day";
+
+    public static final String YEAR = "year";
+
+    public static final String CREATE_TIME = "create_time";
+
+    public static final String TITLE = "title";
+
+    public static final String CONTACTS ="contacts";
+}

+ 33 - 33
src/main/resources/logback.xml

@@ -1,35 +1,35 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <configuration scan="true" scanPeriod="60 seconds" debug="false">
     <!-- 日志存放路径 -->
-	<property name="log.path" value="logs/center-lawenforcement" />
-   <!-- 日志输出格式 -->
-	<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
+    <property name="log.path" value="logs/center-lawenforcement"/>
+    <!-- 日志输出格式 -->
+    <property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
 
     <!-- 控制台输出 -->
-	<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
+    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
         <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
             <level>INFO</level>
         </filter>
-		<encoder>
-			<pattern>${log.pattern}</pattern>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
             <charset>UTF-8</charset>
-		</encoder>
-	</appender>
+        </encoder>
+    </appender>
 
     <!-- 系统日志输出 -->
-	<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
-	    <file>${log.path}/info.log</file>
+    <appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}/info.log</file>
         <!-- 循环政策:基于时间创建日志文件 -->
-		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
             <!-- 日志文件名格式 -->
-			<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
-			<!-- 日志最大的历史 60天 -->
-			<maxHistory>60</maxHistory>
-		</rollingPolicy>
-		<encoder>
-			<pattern>${log.pattern}</pattern>
-		</encoder>
-		<filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
+            <!-- 日志最大的历史 60天 -->
+            <maxHistory>60</maxHistory>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
             <!-- 过滤的级别 -->
             <level>INFO</level>
             <!-- 匹配时的操作:接收(记录) -->
@@ -37,16 +37,16 @@
             <!-- 不匹配时的操作:拒绝(不记录) -->
             <onMismatch>DENY</onMismatch>
         </filter>
-	</appender>
+    </appender>
 
     <appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
-	    <file>${log.path}/error.log</file>
+        <file>${log.path}/error.log</file>
         <!-- 循环政策:基于时间创建日志文件 -->
         <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
             <!-- 日志文件名格式 -->
             <fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
-			<!-- 日志最大的历史 60天 -->
-			<maxHistory>60</maxHistory>
+            <!-- 日志最大的历史 60天 -->
+            <maxHistory>60</maxHistory>
         </rollingPolicy>
         <encoder>
             <pattern>${log.pattern}</pattern>
@@ -54,21 +54,21 @@
         <filter class="ch.qos.logback.classic.filter.LevelFilter">
             <!-- 过滤的级别 -->
             <level>ERROR</level>
-			<!-- 匹配时的操作:接收(记录) -->
+            <!-- 匹配时的操作:接收(记录) -->
             <onMatch>ACCEPT</onMatch>
-			<!-- 不匹配时的操作:拒绝(不记录) -->
+            <!-- 不匹配时的操作:拒绝(不记录) -->
             <onMismatch>DENY</onMismatch>
         </filter>
     </appender>
 
     <!-- 系统模块日志级别控制  -->
-	<logger name="com.sooka.sponest.lawenforcement" level="info" />
-	<!-- Spring日志级别控制  -->
-	<logger name="org.springframework" level="warn" />
+    <logger name="com.sooka.sponest.lawenforcement" level="info"/>
+    <!-- Spring日志级别控制  -->
+    <logger name="org.springframework" level="warn"/>
     <!--系统操作日志-->
-	<root level="info">
-		<appender-ref ref="console" />
-        <appender-ref ref="file_info" />
-        <appender-ref ref="file_error" />
-	</root>
+    <root level="info">
+        <appender-ref ref="console"/>
+        <appender-ref ref="file_info"/>
+        <appender-ref ref="file_error"/>
+    </root>
 </configuration>

+ 108 - 0
src/main/resources/mapper/lawenforcement/LawenforcementAttachMapper.xml

@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.sooka.sponest.lawenforcement.lawCase.mapper.LawenforcementAttachMapper">
+
+    <resultMap type="LawenforcementAttach" id="LawenforcementAttachResult">
+        <result property="id"    column="id"    />
+        <result property="busId"    column="bus_id"    />
+        <result property="fileName"    column="file_name"    />
+        <result property="attachPath"    column="attach_path"    />
+        <result property="describe"    column="describe"    />
+        <result property="attachSorts"    column="attach_sorts"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createName"    column="create_name"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateName"    column="update_name"    />
+    </resultMap>
+
+    <sql id="selectLawenforcementAttachVo">
+        select id, bus_id, file_name, attach_path, `describe`, attach_sorts, create_time, create_by, create_name, update_time, update_by, update_name from lawenforcement_attach
+    </sql>
+
+    <select id="selectLawenforcementAttachList" parameterType="LawenforcementAttach" resultMap="LawenforcementAttachResult">
+        <include refid="selectLawenforcementAttachVo"/>
+        <where>
+            <if test="busId != null  and busId != ''"> and bus_id = #{busId}</if>
+            <if test="fileName != null  and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
+            <if test="attachPath != null  and attachPath != ''"> and attach_path = #{attachPath}</if>
+            <if test="describe != null  and describe != ''"> and describe = #{describe}</if>
+            <if test="attachSorts != null "> and attach_sorts = #{attachSorts}</if>
+            <if test="createName != null  and createName != ''"> and create_name like concat('%', #{createName}, '%')</if>
+            <if test="updateName != null  and updateName != ''"> and update_name like concat('%', #{updateName}, '%')</if>
+        </where>
+    </select>
+
+    <select id="selectLawenforcementAttachById" parameterType="Long" resultMap="LawenforcementAttachResult">
+        <include refid="selectLawenforcementAttachVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertLawenforcementAttach" parameterType="LawenforcementAttach">
+        insert into lawenforcement_attach
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="busId != null">bus_id,</if>
+            <if test="fileName != null">file_name,</if>
+            <if test="attachPath != null">attach_path,</if>
+            <if test="describe != null">`describe`,</if>
+            <if test="attachSorts != null">attach_sorts,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createName != null">create_name,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateName != null">update_name,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
+            <if test="busId != null">#{busId},</if>
+            <if test="fileName != null">#{fileName},</if>
+            <if test="attachPath != null">#{attachPath},</if>
+            <if test="describe != null">#{describe},</if>
+            <if test="attachSorts != null">#{attachSorts},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createName != null">#{createName},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateName != null">#{updateName},</if>
+         </trim>
+    </insert>
+
+    <update id="updateLawenforcementAttach" parameterType="LawenforcementAttach">
+        update lawenforcement_attach
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="busId != null">bus_id = #{busId},</if>
+            <if test="fileName != null">file_name = #{fileName},</if>
+            <if test="attachPath != null">attach_path = #{attachPath},</if>
+            <if test="describe != null">describe = #{describe},</if>
+            <if test="attachSorts != null">attach_sorts = #{attachSorts},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createName != null">create_name = #{createName},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateName != null">update_name = #{updateName},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteLawenforcementAttachById" parameterType="Long">
+        delete from lawenforcement_attach where id = #{id}
+    </delete>
+
+    <delete id="deleteLawenforcementAttachByIds" parameterType="String">
+        delete from lawenforcement_attach where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+
+    <delete id="deleteByBusId" parameterType="String">
+        delete from lawenforcement_attach where bus_id = #{busId}
+    </delete>
+</mapper>

+ 99 - 0
src/main/resources/mapper/lawenforcement/LawenforcementCaseLogMapper.xml

@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.sooka.sponest.lawenforcement.lawCase.mapper.LawenforcementCaseLogMapper">
+
+    <resultMap type="LawenforcementCaseLog" id="LawenforcementCaseLogResult">
+        <result property="id"    column="id"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createName"    column="create_name"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="deptId"    column="dept_id"    />
+        <result property="deptName"    column="dept_name"    />
+        <result property="caseId"    column="case_id"    />
+        <result property="content"    column="content"    />
+        <result property="state"    column="state"    />
+    </resultMap>
+
+    <sql id="selectLawenforcementCaseLogVo">
+        select id, create_by, create_name, create_time,dept_id, dept_name, case_id, content, state from lawenforcement_case_log
+    </sql>
+
+    <select id="selectLawenforcementCaseLogList" parameterType="LawenforcementCaseLog" resultMap="LawenforcementCaseLogResult">
+        <include refid="selectLawenforcementCaseLogVo"/>
+        <where>
+            <if test="createName != null  and createName != ''"> and create_name like concat('%', #{createName}, '%')</if>
+            <if test="caseId != null  and caseId != ''"> and case_id = #{caseId}</if>
+            <if test="content != null  and content != ''"> and content = #{content}</if>
+            <if test="state != null  and state != ''"> and state = #{state}</if>
+        </where>
+    </select>
+
+    <select id="selectLawenforcementCaseLogById" parameterType="String" resultMap="LawenforcementCaseLogResult">
+        <include refid="selectLawenforcementCaseLogVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertLawenforcementCaseLog" parameterType="LawenforcementCaseLog">
+        insert into lawenforcement_case_log
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null and id != ''">id,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createName != null">create_name,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="deptId != null">dept_id,</if>
+            <if test="deptName != null">dept_name,</if>
+            <if test="caseId != null">case_id,</if>
+            <if test="content != null">content,</if>
+            <if test="state != null">state,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null and id != ''">#{id},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createName != null">#{createName},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="deptId != null">#{deptId},</if>
+            <if test="deptName != null">#{deptName},</if>
+            <if test="caseId != null">#{caseId},</if>
+            <if test="content != null">#{content},</if>
+            <if test="state != null">#{state},</if>
+         </trim>
+    </insert>
+
+    <update id="updateLawenforcementCaseLog" parameterType="LawenforcementCaseLog">
+        update lawenforcement_case_log
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createName != null">create_name = #{createName},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="deptId != null">dept_id = #{deptId},</if>
+            <if test="deptName != null">dept_name = #{deptName},</if>
+            <if test="caseId != null">case_id = #{caseId},</if>
+            <if test="content != null">content = #{content},</if>
+            <if test="state != null">state = #{state},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteLawenforcementCaseLogById" parameterType="String">
+        delete from lawenforcement_case_log where id = #{id}
+    </delete>
+
+    <delete id="deleteLawenforcementCaseLogByIds" parameterType="String">
+        delete from lawenforcement_case_log where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+
+    <select id="getLogByCaseId" parameterType="String" resultMap="LawenforcementCaseLogResult">
+        <include refid="selectLawenforcementCaseLogVo"/>
+        where case_id = #{id} order by create_time desc
+    </select>
+
+    <select id="getCaseLog" parameterType="LawenforcementCase" resultType="java.lang.Integer">
+        select count(id) from lawenforcement_case_log
+        where dept_id = #{deptId} and case_id = #{id} and (state = 'state_4' or state = 'state_5')
+    </select>
+</mapper>

+ 131 - 0
src/main/resources/mapper/lawenforcement/LawenforcementCaseMapper.xml

@@ -0,0 +1,131 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.sooka.sponest.lawenforcement.lawCase.mapper.LawenforcementCaseMapper">
+
+    <resultMap type="LawenforcementCase" id="LawenforcementCaseResult">
+        <result property="id"    column="id"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createName"    column="create_name"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateName"    column="update_name"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="deptId"    column="dept_id"    />
+        <result property="deptName"    column="dept_name"    />
+        <result property="recordId"    column="record_id"    />
+        <result property="caseName"    column="case_name"    />
+        <result property="caseNumber"    column="case_number"    />
+        <result property="punishTarget"    column="punish_target"    />
+        <result property="punishType"    column="punish_type"    />
+        <result property="describe"    column="describe"    />
+        <result property="dataOne"    column="data_one"    />
+        <result property="uploadOne"    column="upload_one"    />
+        <result property="dataTwo"    column="data_two"    />
+        <result property="uploadTwo"    column="upload_two"    />
+        <result property="dataThree"    column="data_three"    />
+        <result property="uploadThree"    column="upload_three"    />
+        <result property="state"    column="state"    />
+    </resultMap>
+
+    <sql id="selectLawenforcementCaseVo">
+        select a.id, a.create_by, a.create_name, a.create_time, a.update_by, a.update_name, a.update_time, a.dept_id, a.dept_name, a.record_id, a.case_name, a.case_number,
+               a.punish_target, a.punish_type, a.describe, a.state from lawenforcement_case a
+    </sql>
+
+    <select id="selectLawenforcementCaseList" parameterType="LawenforcementCase" resultMap="LawenforcementCaseResult">
+        <include refid="selectLawenforcementCaseVo"/>
+        left join ${database_system}.sys_dept d on d.dept_id = a.dept_id
+        <where>
+            <if test="deptName != null  and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
+            <if test="recordId != null  and recordId != ''"> and record_id = #{recordId}</if>
+            <if test="caseName != null  and caseName != ''"> and case_name like concat('%', #{caseName}, '%')</if>
+            <if test="caseNumber != null  and caseNumber != ''"> and case_number like concat('%', #{caseNumber}, '%') </if>
+            <if test="punishTarget != null  and punishTarget != ''"> and punish_target = #{punishTarget}</if>
+            <if test="punishType != null  and punishType != ''"> and punish_type = #{punishType}</if>
+            <if test="describe != null  and describe != ''"> and `describe` = #{describe}</if>
+            <if test="state != null  and state != ''"> and state = #{state}</if>
+            ${params.dataScope}
+        </where>
+        order by a.create_time desc
+    </select>
+
+    <select id="selectLawenforcementCaseById" parameterType="String" resultMap="LawenforcementCaseResult">
+        <include refid="selectLawenforcementCaseVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertLawenforcementCase" parameterType="LawenforcementCase">
+        insert into lawenforcement_case
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null and id != ''">id,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createName != null">create_name,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateName != null">update_name,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="deptId != null">dept_id,</if>
+            <if test="deptName != null">dept_name,</if>
+            <if test="recordId != null">record_id,</if>
+            <if test="caseName != null">case_name,</if>
+            <if test="caseNumber != null">case_number,</if>
+            <if test="punishTarget != null">punish_target,</if>
+            <if test="punishType != null">punish_type,</if>
+            <if test="describe != null">`describe`,</if>
+            <if test="state != null">state,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null and id != ''">#{id},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createName != null">#{createName},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateName != null">#{updateName},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="deptId != null">#{deptId},</if>
+            <if test="deptName != null">#{deptName},</if>
+            <if test="recordId != null">#{recordId},</if>
+            <if test="caseName != null">#{caseName},</if>
+            <if test="caseNumber != null">#{caseNumber},</if>
+            <if test="punishTarget != null">#{punishTarget},</if>
+            <if test="punishType != null">#{punishType},</if>
+            <if test="describe != null">#{describe},</if>
+            <if test="state != null">#{state},</if>
+         </trim>
+    </insert>
+
+    <update id="updateLawenforcementCase" parameterType="LawenforcementCase">
+        update lawenforcement_case
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createName != null">create_name = #{createName},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateName != null">update_name = #{updateName},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="deptId != null">dept_id = #{deptId},</if>
+            <if test="deptName != null">dept_name = #{deptName},</if>
+            <if test="recordId != null">record_id = #{recordId},</if>
+            <if test="caseName != null">case_name = #{caseName},</if>
+            <if test="caseNumber != null">case_number = #{caseNumber},</if>
+            <if test="punishTarget != null">punish_target = #{punishTarget},</if>
+            <if test="punishType != null">punish_type = #{punishType},</if>
+            <if test="describe != null">`describe` = #{describe},</if>
+            <if test="state != null">state = #{state},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteLawenforcementCaseById" parameterType="String">
+        delete from lawenforcement_case where id = #{id}
+    </delete>
+
+    <delete id="deleteLawenforcementCaseByIds" parameterType="String">
+        delete from lawenforcement_case where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 28 - 0
src/main/resources/mapper/lawenforcement/LawenforcementPersonMapper.xml

@@ -120,4 +120,32 @@
             #{id}
         </foreach>
     </delete>
+
+    <select id="selectPersonByRecordId" parameterType="string" resultMap="LawenforcementPersonResult">
+        select * from lawenforcement_person where record_id = #{id}
+    </select>
+
+    <delete id="deleteLawenforcementPersonByRecordId" parameterType="string">
+        delete from lawenforcement_person where record_id = #{id}
+    </delete>
+
+    <insert id="insertLawenforcementPersonToList" parameterType="list">
+        insert into lawenforcement_person
+            (id, person_id, random_id, person_name, person_code, person_phone, dept_id, dept_name, person_type, main_person, remark, record_id)
+        values
+        <foreach collection="list" open="(" separator="),(" close=")" item="item">
+            #{item.id},
+            #{item.personId},
+            #{item.randomId},
+            #{item.personName},
+            #{item.personCode},
+            #{item.personPhone},
+            #{item.deptId},
+            #{item.deptName},
+            #{item.personType},
+            #{item.mainPerson},
+            #{item.remark},
+            #{item.recordId}
+        </foreach>
+    </insert>
 </mapper>

+ 62 - 5
src/main/resources/mapper/lawenforcement/LawenforcementRecordMapper.xml

@@ -49,6 +49,14 @@
         <result property="deviceId" column="device_id"/>
         <result property="deviceName" column="device_name"/>
         <result property="recordStatus" column="record_status"/>
+        <collection property="personList" resultMap="LawenforcementUserResult"/>
+    </resultMap>
+
+    <resultMap id="LawenforcementUserResult" type="LawenforcementUser">
+        <result property="certificateNumber" column="person_code"/>
+        <result property="isMainPerson" column="main_person"/>
+        <result property="deptId" column="user_dept_id"/>
+        <result property="deptName" column="user_dept_name"/>
     </resultMap>
 
     <sql id="selectLawenforcementRecordVo">
@@ -85,7 +93,7 @@
                result_time,
                result_person_id,
                status,
-               FROM_UNIXTIME(create_time / 1000) AS create_time,
+               create_time,
                create_by,
                is_last,
                job_id,
@@ -108,8 +116,57 @@
     </select>
 
     <select id="selectLawenforcementRecordById" parameterType="String" resultMap="LawenforcementRecordResult">
-        <include refid="selectLawenforcementRecordVo"/>
-        where id = #{id}
+        select lr.id,
+               lr.job_type,
+               lr.creator_id,
+               lr.creator_name,
+               lr.dept_id,
+               lr.dept_name,
+               lr.area_id,
+               lr.job_name,
+               lr.check_type,
+               lr.check_object_type,
+               lr.check_object_id,
+               lr.check_object_code,
+               lr.check_object_name,
+               lr.check_object_phone,
+               lr.check_start_time,
+               lr.check_end_time,
+               lr.subitem_count,
+               lr.remark,
+               lr.verify,
+               lr.unable_verify_reason,
+               lr.scan_id,
+               lr.scan_name,
+               lr.scan_time,
+               lr.verify_people_id,
+               lr.verify_people_name,
+               lr.verify_time,
+               lr.evaluation,
+               lr.evaluation_content,
+               lr.evaluation_time,
+               lr.result,
+               lr.result_time,
+               lr.result_person_id,
+               lr.status,
+               lr.create_time,
+               lr.create_by,
+               lr.is_last,
+               lr.job_id,
+               lr.last_job_type,
+               lr.source,
+               lr.create_method,
+               lr.is_cross_dept,
+               lr.device_id,
+               lr.device_name,
+               lr.record_status,
+               lp.person_code,
+               lp.main_person,
+               lp.dept_id user_dept_id,
+               lp.dept_name user_dept_name
+        from lawenforcement_record lr
+        LEFT JOIN lawenforcement_person lp on lr.id = lp.record_id
+        where lr.id = #{id}
     </select>
 
     <insert id="insertLawenforcementRecord" parameterType="LawenforcementRecord">
@@ -296,7 +353,7 @@
     </select>
 
     <update id="updateRecordLogEndTime" parameterType="DeviceBO">
-        update lawenforcement_record_log set end_time = NOW() WHERE device_id = #{deviceCode} and end_time is null
+        update lawenforcement_record_log set end_time = NOW() WHERE device_id = #{code} and end_time is null
     </update>
 
     <update id="updateRecordStatus" parameterType="DeviceBO">
@@ -305,7 +362,7 @@
         where id = (
             select record_id
             from lawenforcement_record_log
-            where device_id = #{deviceCode} and end_time is null
+            where device_id = #{code} and end_time is null
         )
     </update>
 </mapper>

+ 9 - 0
src/main/resources/mapper/lawenforcement/LawenforcementUserMapper.xml

@@ -123,4 +123,13 @@
             #{userId}
         </foreach>
     </delete>
+
+    <select id="getUserListByDeptId" parameterType="string" resultMap="LawenforcementUserResult">
+        select user_id, nick_name, phonenumber, certificate_number, dept_id, dept_name
+        from lawenforcement_user
+        where dept_id in
+        <foreach item="deptId" collection="array" open="(" separator="," close=")">
+            #{deptId}
+        </foreach>
+    </select>
 </mapper>