Explorar o código

Merge remote-tracking branch 'origin/master'

ysm hai 10 meses
pai
achega
8e6f3af398
Modificáronse 63 ficheiros con 12402 adicións e 14526 borrados
  1. 1 1
      fhKeeper/formulahousekeeper/customerBuler-crm/src/App.vue
  2. 274 211
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/component/information.vue
  3. 1 1
      fhKeeper/formulahousekeeper/customerBuler-crm/vite.config.ts
  4. 11396 12912
      fhKeeper/formulahousekeeper/management-crm/crm.log
  5. 16 4
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/BusinessOpportunityController.java
  6. 19 3
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/ClueController.java
  7. 5 5
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/CustomController.java
  8. 9 4
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/BusinessItemProduct.java
  9. 2 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/Clue.java
  10. 4 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/Custom.java
  11. 2 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/dto/TaskDto.java
  12. 5 1
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/mapper/ActionLogMapper.java
  13. 6 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/mapper/BusinessOpportunityMapper.java
  14. 4 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/mapper/ClueMapper.java
  15. 1 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/BusinessOpportunityService.java
  16. 5 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/ClueService.java
  17. 103 58
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/BusinessOpportunityServiceImpl.java
  18. 23 2
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/ClueServiceImpl.java
  19. 11 1
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/ContactsServiceImpl.java
  20. 21 13
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/CustomServiceImpl.java
  21. 21 3
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/TaskServiceImpl.java
  22. 97 70
      fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/BusinessOpportunityMapper.xml
  23. 29 3
      fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/ClueMapper.xml
  24. 90 53
      fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/CustomMapper.xml
  25. 6 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ReportController.java
  26. 37 5
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ReportLogController.java
  27. 6 6
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java
  28. 7 8
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java
  29. 11 15
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ProjectMapper.xml
  30. 5 0
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/ReportController.java
  31. 29 20
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/WxCorpInfoController.java
  32. 6 0
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/entity/Plan.java
  33. 0 118
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/entity/SimpleFinance.java
  34. 0 45
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/entity/SimpleProjectime.java
  35. 0 105
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/entity/SimpleReport.java
  36. 0 16
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/mapper/SimpleFinanceMapper.java
  37. 0 16
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/mapper/SimpleProjectimeMapper.java
  38. 0 16
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/mapper/SimpleReportMapper.java
  39. 2 0
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/ReportService.java
  40. 0 16
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/SimpleFinanceService.java
  41. 0 16
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/SimpleProjectimeService.java
  42. 0 29
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/SimpleReportService.java
  43. 14 14
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/PlanServiceImpl.java
  44. 2 2
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/ProductServiceImpl.java
  45. 62 2
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java
  46. 0 20
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/SimpleFinanceServiceImpl.java
  47. 0 20
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/SimpleProjectimeServiceImpl.java
  48. 0 591
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/SimpleReportServiceImpl.java
  49. 27 19
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/task/TimingTask.java
  50. 2 1
      fhKeeper/formulahousekeeper/management-workshop/src/main/resources/mapper/PlanMapper.xml
  51. 0 28
      fhKeeper/formulahousekeeper/management-workshop/src/main/resources/mapper/SimpleFinanceMapper.xml
  52. 0 18
      fhKeeper/formulahousekeeper/management-workshop/src/main/resources/mapper/SimpleProjectimeMapper.xml
  53. 0 24
      fhKeeper/formulahousekeeper/management-workshop/src/main/resources/mapper/SimpleReportMapper.xml
  54. BIN=BIN
      fhKeeper/formulahousekeeper/management-workshop/workshop_print.2024-06-24.log.gz
  55. 1 1
      fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/statisticsView/statisticsDetail.vue
  56. 1 1
      fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/workView/fillReport.vue
  57. 12 2
      fhKeeper/formulahousekeeper/timesheet-workshop/src/views/plan/orderInsert.vue
  58. 5 3
      fhKeeper/formulahousekeeper/timesheet/src/i18n/en.json
  59. 2 0
      fhKeeper/formulahousekeeper/timesheet/src/i18n/zh.json
  60. 2 1
      fhKeeper/formulahousekeeper/timesheet/src/views/financeAudit/financeAudit.vue
  61. 2 1
      fhKeeper/formulahousekeeper/timesheet/src/views/project/cost.vue
  62. 1 1
      fhKeeper/formulahousekeeper/timesheet/src/views/settings/timetype.vue
  63. 15 1
      fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

+ 1 - 1
fhKeeper/formulahousekeeper/customerBuler-crm/src/App.vue

@@ -72,7 +72,7 @@ body,
 .layouts {
   width: 100%;
   height: 100%;
-  /* overflow: hidden; */
+  overflow: hidden;
   min-width: 800px;
 }
 * {

+ 274 - 211
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/component/information.vue

@@ -1,270 +1,333 @@
 <template>
-    <div class="information pl-4 pr-4 pt-3 pb-3">
-        <div class="flex justify-between">
-            <div class="title">基本信息</div>
-            <div>
-                <el-button type="primary" @click="claimCustomer()" v-if="!information.inchargerName">认领</el-button>
-                <el-button type="primary" @click="transferCli()">转移</el-button>
-                <el-button type="primary" v-permission="['customerEdit']" @click="editCustomer()">编辑</el-button>
-            </div>
+  <div class="information pl-4 pr-4 pt-3 pb-3">
+    <div class="flex justify-between">
+      <div class="title">基本信息</div>
+      <div>
+        <el-button type="primary" @click="claimCustomer()" v-if="!information.inchargerName"
+          >认领</el-button
+        >
+        <el-button type="primary" @click="transferCli()">转移</el-button>
+        <el-button type="primary" v-permission="['customerEdit']" @click="editCustomer()"
+          >编辑</el-button
+        >
+      </div>
+    </div>
+    <div class="form flex flex-wrap justify-between">
+      <div class="formItem flex pt-2 pb-1">
+        <div class="w-20 text-right text-gray-500">客户名称:</div>
+        <div class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap ml-1" v-ellipsis-tooltip>
+          {{ information.customName }}
+        </div>
+      </div>
+      <div class="formItem flex pt-2 pb-1">
+        <div class="w-22 text-right text-gray-500">客户来源:</div>
+        <div class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap ml-1">
+          {{ information.customSourceValue }}
+        </div>
+      </div>
+      <div class="formItem flex pt-2 pb-1">
+        <div class="w-22 text-right text-gray-500">电话号码:</div>
+        <div class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap ml-1" v-ellipsis-tooltip>
+          {{ information.telPhone }}
+        </div>
+      </div>
+      <div class="formItem flex pt-2 pb-1">
+        <div class="w-22 text-right text-gray-500">邮箱:</div>
+        <div class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap ml-1" v-ellipsis-tooltip>
+          {{ information.email }}
+        </div>
+      </div>
+      <div class="formItem flex pt-2 pb-1">
+        <div class="w-22 text-right text-gray-500">客户行业:</div>
+        <div class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap ml-1">
+          {{ information.customerIndustryValue }}
+        </div>
+      </div>
+      <div class="formItem flex pt-2 pb-1">
+        <div class="w-22 text-right text-gray-500">客户级别:</div>
+        <div class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap ml-1">
+          {{ information.customerLevelValue }}
         </div>
-        <div class="form flex flex-wrap justify-between">
-            <div class="formItem flex pt-2 pb-1">
-                <div class="w-20 text-right text-gray-500">客户名称:</div>
-                <div class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap ml-1" v-ellipsis-tooltip>{{
-                    information.customName }}</div>
-            </div>
-            <div class="formItem flex pt-2 pb-1">
-                <div class="w-22 text-right text-gray-500">客户来源:</div>
-                <div class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap ml-1">{{
-                    information.customSourceValue }}
-                </div>
-            </div>
-            <div class="formItem flex pt-2 pb-1">
-                <div class="w-22 text-right text-gray-500">电话号码:</div>
-                <div class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap ml-1" v-ellipsis-tooltip>{{
-                    information.companyPhone }}
-                </div>
-            </div>
-            <div class="formItem flex pt-2 pb-1">
-                <div class="w-22 text-right text-gray-500">邮箱:</div>
-                <div class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap ml-1" v-ellipsis-tooltip>{{
-                    information.email }}</div>
-            </div>
-            <div class="formItem flex pt-2 pb-1">
-                <div class="w-22 text-right text-gray-500">客户行业:</div>
-                <div class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap ml-1">{{
-                    information.customerIndustryValue }}</div>
-            </div>
-            <div class="formItem flex pt-2 pb-1">
-                <div class="w-22 text-right text-gray-500">客户级别:</div>
-                <div class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap ml-1">{{
-                    information.customerLevelValue
-                }}</div>
-            </div>
-            <div class="formItem flex pt-2 pb-1">
-                <div class="w-22 text-right text-gray-500">客户地址:</div>
-                <div class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap ml-1">{{ information.address }}</div>
-            </div>
-            <div class="formItem flex pt-2 pb-1">
-                <div class="w-22 text-right text-gray-500">负责人:</div>
-                <div class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap ml-1">{{ information.inchargerName }}
-                </div>
-            </div>
-            <div class="formItem flex pt-2 pb-1">
-                <div class="w-22 text-right text-gray-500">创建人:</div>
-                <div class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap ml-1">{{ information.creatorName }}
-                </div>
-            </div>
-            <div class="formItem flex pt-2 pb-1">
-                <div class="w-22 text-right text-gray-500">创建时间:</div>
-                <div class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap ml-1">{{ information.newCreateTime }}
-                </div>
-            </div>
-            <div class="formItem flex pt-2 pb-1" style="width: 100%;">
-                <div class="w-22 text-right text-gray-500">备注:</div>
-                <div class="flex-1 ml-1 text " v-ellipsis-tooltip>
-                    {{ information.customDesc }}
-                </div>
-            </div>
+      </div>
+      <div class="formItem flex pt-2 pb-1">
+        <div class="w-22 text-right text-gray-500">客户地址:</div>
+        <div class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap ml-1">
+          {{ information.address }}
         </div>
+      </div>
+      <div class="formItem flex pt-2 pb-1">
+        <div class="w-22 text-right text-gray-500">负责人:</div>
+        <div class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap ml-1">
+          {{ information.inchargerName }}
+        </div>
+      </div>
+      <div class="formItem flex pt-2 pb-1">
+        <div class="w-22 text-right text-gray-500">创建人:</div>
+        <div class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap ml-1">
+          {{ information.creatorName }}
+        </div>
+      </div>
+      <div class="formItem flex pt-2 pb-1">
+        <div class="w-22 text-right text-gray-500">创建时间:</div>
+        <div class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap ml-1">
+          {{ information.newCreateTime }}
+        </div>
+      </div>
+      <div class="formItem flex pt-2 pb-1" style="width: 100%">
+        <div class="w-22 text-right text-gray-500">备注:</div>
+        <div class="flex-1 ml-1 text" v-ellipsis-tooltip>
+          {{ information.customDesc }}
+        </div>
+      </div>
+    </div>
 
-        <!-- 弹窗 -->
-        <el-dialog v-model="allVisible.transferCustomerVisible" width="600" :show-close="false" top="10vh">
-            <template #header="{ close, titleId, titleClass }">
-                <div class="flex justify-between items-center border-b pb-3 dialog-header">
-                    <h4 :id="titleId">{{ '转移客户' }}</h4>
-                    <div>
-                        <el-button type="primary" :loading="allLoading.transferCustomerLoading"
-                            @click="transferCustomer()">转移</el-button>
-                        <el-button @click="allVisible.transferCustomerVisible = false">取消</el-button>
-                    </div>
-                </div>
-            </template>
-            <div class="scroll-bar m-6">
-                <div class="flex mb-4">
-                    <div class="w-20 flex items-center justify-end pr-4">转移至:</div>
-                    <el-select v-model="transferValue" placeholder="请选择" class="flex1">
-                        <el-option v-for="item in transferOptions" :key="item.id" :label="item.name" :value="item.id" />
-                    </el-select>
-                </div>
-                <div class="pl-3 text-[#e94a4a]">转移后,将看不到此客户</div>
-            </div>
-        </el-dialog>
+    <!-- 弹窗 -->
+    <el-dialog
+      v-model="allVisible.transferCustomerVisible"
+      width="600"
+      :show-close="false"
+      top="10vh"
+    >
+      <template #header="{ close, titleId, titleClass }">
+        <div class="flex justify-between items-center border-b pb-3 dialog-header">
+          <h4 :id="titleId">{{ '转移客户' }}</h4>
+          <div>
+            <el-button
+              type="primary"
+              :loading="allLoading.transferCustomerLoading"
+              @click="transferCustomer()"
+              >转移</el-button
+            >
+            <el-button @click="allVisible.transferCustomerVisible = false">取消</el-button>
+          </div>
+        </div>
+      </template>
+      <div class="scroll-bar m-6">
+        <div class="flex mb-4">
+          <div class="w-20 flex items-center justify-end pr-4">转移至:</div>
+          <el-select v-model="transferValue" placeholder="请选择" class="flex1">
+            <el-option
+              v-for="item in transferOptions"
+              :key="item.id"
+              :label="item.name"
+              :value="item.id"
+            />
+          </el-select>
+        </div>
+        <div class="pl-3 text-[#e94a4a]">转移后,将看不到此客户</div>
+      </div>
+    </el-dialog>
 
-        <el-dialog v-model="allVisible.editCustomerVisible" width="1000" :show-close="false" top="10vh">
-            <template #header="{ close, titleId, titleClass }">
-                <div class="flex justify-between items-center border-b pb-3 dialog-header">
-                    <h4 :id="titleId">{{ '编辑客户' }}</h4>
-                    <div>
-                        <el-button type="primary" @click="saveCustomer()"
-                            :loading="allLoading.saveLading">保存</el-button>
-                        <el-button @click="closeVisible('editCustomerVisible')">取消</el-button>
-                    </div>
-                </div>
-            </template>
-            <div class="h-[60vh] overflow-y-auto scroll-bar pt-3" v-loading="allLoading.generateFormDataLoading">
-                <GenerateForm ref="generateForm" :data="generateFormData" :value="generateFormValue"
-                    :key="generateFormKey" />
-            </div>
-        </el-dialog>
-    </div>
+    <el-dialog v-model="allVisible.editCustomerVisible" width="1000" :show-close="false" top="10vh">
+      <template #header="{ close, titleId, titleClass }">
+        <div class="flex justify-between items-center border-b pb-3 dialog-header">
+          <h4 :id="titleId">{{ '编辑客户' }}</h4>
+          <div>
+            <el-button type="primary" @click="saveCustomer()" :loading="allLoading.saveLading"
+              >保存</el-button
+            >
+            <el-button @click="closeVisible('editCustomerVisible')">取消</el-button>
+          </div>
+        </div>
+      </template>
+      <div
+        class="h-[60vh] overflow-y-auto scroll-bar pt-3"
+        v-loading="allLoading.generateFormDataLoading"
+      >
+        <GenerateForm
+          ref="generateForm"
+          :data="generateFormData"
+          :value="generateFormValue"
+          :key="generateFormKey"
+        />
+      </div>
+    </el-dialog>
+  </div>
 </template>
 <script lang="ts" setup>
 import { confirmAction } from '@/utils/tools';
-import { ref, reactive, onMounted, onUnmounted, defineExpose, inject, watchEffect } from 'vue'
+import { ref, reactive, onMounted, onUnmounted, defineExpose, inject, watchEffect } from 'vue';
 import { GenerateForm } from '@zmjs/form-design';
-import { useStore } from '@/store/index'
+import { useStore } from '@/store/index';
 import { get, post } from '@/utils/request';
 import { GETPERSONNEL, URL_CLAIM, URL_EDITSAVE, URL_TEMPLALE } from '../api';
 import { formatDate } from '@/utils/times';
 
 const emits = defineEmits(['refreshData']);
-const { userInfo } = useStore()
+const { userInfo } = useStore();
 const props = defineProps<{
-    data: any
-}>()
+  data: any;
+}>();
 const generateFormData = ref({
-    config: {},
-    list: []
-}) // 自定义表单数据
-const generateFormValue = ref({})
-const generateForm = ref<typeof GenerateForm>()
-const generateFormKey = ref(1)
-const globalPopup = inject<GlobalPopup>('globalPopup')
-const information = ref<any>({})
-const transferValue = ref('')
-const transferOptions = ref<personnelInterface[]>([])
+  config: {},
+  list: []
+}); // 自定义表单数据
+const generateFormValue = ref({});
+const generateForm = ref<typeof GenerateForm>();
+const generateFormKey = ref(1);
+const globalPopup = inject<GlobalPopup>('globalPopup');
+const information = ref<any>({});
+const transferValue = ref('');
+const transferOptions = ref<personnelInterface[]>([]);
 
 const allLoading = reactive({
-    editBusinessLoading: false,
-    saveLading: false,
-    transferCustomerLoading: false,
-    saveContactLoading: false,
-    generateFormDataLoading: false
-})
+  editBusinessLoading: false,
+  saveLading: false,
+  transferCustomerLoading: false,
+  saveContactLoading: false,
+  generateFormDataLoading: false
+});
 const allVisible = reactive({
-    transferCustomerVisible: false,
-    editCustomerVisible: false
-})
+  transferCustomerVisible: false,
+  editCustomerVisible: false
+});
 
 function saveCustomer() {
-    generateForm.value?.getData().then((res: any) => {
-        allLoading.saveLading = true
-        let formVal = { ...generateFormValue.value, ...res }
-        delete formVal.createTime
-        post(URL_EDITSAVE, { ...formVal }).then((_res) => {
-            globalPopup?.showSuccess('操作成功')
-            closeVisible('editCustomerVisible')
-            emits('refreshData')
-        }).finally(() => {
-            allLoading.saveLading = false
+  generateForm.value
+    ?.getData()
+    .then((res: any) => {
+      allLoading.saveLading = true;
+      let formVal = { ...generateFormValue.value, ...res };
+      delete formVal.createTime;
+      post(URL_EDITSAVE, { ...formVal })
+        .then((_res) => {
+          globalPopup?.showSuccess('操作成功');
+          closeVisible('editCustomerVisible');
+          emits('refreshData');
         })
-    }).catch((_err: any) => {
-        console.log(_err)
-        globalPopup?.showError('请填写完整')
+        .finally(() => {
+          allLoading.saveLading = false;
+        });
     })
+    .catch((_err: any) => {
+      console.log(_err);
+      globalPopup?.showError('请填写完整');
+    });
 }
 
 function transferCli() {
-    transferValue.value
-    showVisible('transferCustomerVisible')
+  transferValue.value;
+  showVisible('transferCustomerVisible');
 }
 
 function transferCustomer() {
-    const ids = information.value?.id
-    const inchargerId = information.value?.inchargerName ? transferValue.value : userInfo.id
-    if (!inchargerId) {
-        globalPopup?.showWarning('请选择转移的人员')
-        return
-    }
-    allLoading.transferCustomerLoading = true
-    post(URL_CLAIM, { ids, inchargerId }).then((res) => {
-        if (res.code == 'ok') {
-            globalPopup?.showSuccess('操作成功')
-            allVisible.transferCustomerVisible = false
-            emits('refreshData')
-        }
-    }).finally(() => {
-        allLoading.transferCustomerLoading = false
+  const ids = information.value?.id;
+  const inchargerId = information.value?.inchargerName ? transferValue.value : userInfo.id;
+  if (!inchargerId) {
+    globalPopup?.showWarning('请选择转移的人员');
+    return;
+  }
+  allLoading.transferCustomerLoading = true;
+  post(URL_CLAIM, { ids, inchargerId })
+    .then((res) => {
+      if (res.code == 'ok') {
+        globalPopup?.showSuccess('操作成功');
+        allVisible.transferCustomerVisible = false;
+        emits('refreshData');
+      }
     })
+    .finally(() => {
+      allLoading.transferCustomerLoading = false;
+    });
 }
 
 function claimCustomer() {
-    confirmAction(`确定认领【${information.value.customName}】商机吗?`).then(() => {
-        transferCustomer()
-    })
+  confirmAction(`确定认领【${information.value.customName}】商机吗?`).then(() => {
+    transferCustomer();
+  });
 }
 
 function editCustomer() {
-    const { id, companyPhone, customName, inchargerId, createTime, customSourceId, customerIndustryId, customerLevelId, email, telPhone, customDesc } = information.value
-    const formVal = {
-        id, customName, inchargerId, customerIndustryId, customerLevelId, email, customSourceId,
-        createTime: formatDate(new Date(createTime)),
-        telPhone, companyPhone,
-        customDesc
-    }
-    generateFormValue.value = formVal
-    allLoading.generateFormDataLoading = true
-    showVisible('editCustomerVisible')
-    setTimeout(() => {
-        generateForm.value && generateForm.value?.reset()
-        generateFormKey.value++
-        allLoading.generateFormDataLoading = false
-    }, 500)
+  const {
+    id,
+    companyPhone,
+    customName,
+    inchargerId,
+    createTime,
+    customSourceId,
+    customerIndustryId,
+    customerLevelId,
+    email,
+    telPhone,
+    customDesc
+  } = information.value;
+  const formVal = {
+    id,
+    customName,
+    inchargerId,
+    customerIndustryId,
+    customerLevelId,
+    email,
+    customSourceId,
+    createTime: formatDate(new Date(createTime)),
+    telPhone,
+    companyPhone,
+    customDesc
+  };
+  generateFormValue.value = formVal;
+  allLoading.generateFormDataLoading = true;
+  showVisible('editCustomerVisible');
+  setTimeout(() => {
+    generateForm.value && generateForm.value?.reset();
+    generateFormKey.value++;
+    allLoading.generateFormDataLoading = false;
+  }, 500);
 }
 
 function showVisible(type: keyof typeof allVisible) {
-    allVisible[type] = true
+  allVisible[type] = true;
 }
 
 function closeVisible(type: keyof typeof allVisible) {
-    allVisible[type] = false
+  allVisible[type] = false;
 }
 
 async function getSystemField() {
-    const { data } = await post(GETPERSONNEL, {})
-    transferOptions.value = data.map((item: any) => {
-        const { id, name, phone, jobNumber } = item
-        return {
-            id, name, phone, jobNumber
-        }
-    })
-    const res = await get(URL_TEMPLALE)
-    generateFormData.value = JSON.parse(res.data[0].config)
+  const { data } = await post(GETPERSONNEL, {});
+  transferOptions.value = data.map((item: any) => {
+    const { id, name, phone, jobNumber } = item;
+    return {
+      id,
+      name,
+      phone,
+      jobNumber
+    };
+  });
+  const res = await get(URL_TEMPLALE);
+  generateFormData.value = JSON.parse(res.data[0].config);
 }
 
 watchEffect(() => {
-    const { data } = props
-    information.value = data
-})
+  const { data } = props;
+  information.value = data;
+});
 
 // 生命周期钩子
 onMounted(() => {
-    getSystemField()
+  getSystemField();
 });
 </script>
 <style scoped lang="scss">
 .information {
-    .title {
-        font-size: 18px;
-        color: #000
-    }
+  .title {
+    font-size: 18px;
+    color: #000;
+  }
 
-    .form {
-        .formItem {
-            width: 48%;
-        }
+  .form {
+    .formItem {
+      width: 48%;
+    }
 
-        .text {
-            display: -webkit-box;
-            /* Safari */
-            -webkit-line-clamp: 2;
-            /* number of lines to show */
-            -webkit-box-orient: vertical;
-            overflow: hidden;
-            line-height: 1.5;
-        }
+    .text {
+      display: -webkit-box;
+      /* Safari */
+      -webkit-line-clamp: 2;
+      /* number of lines to show */
+      -webkit-box-orient: vertical;
+      overflow: hidden;
+      line-height: 1.5;
     }
+  }
 }
-</style>
+</style>

+ 1 - 1
fhKeeper/formulahousekeeper/customerBuler-crm/vite.config.ts

@@ -3,7 +3,7 @@ import vue from '@vitejs/plugin-vue';
 
 import { resolve } from 'path';
 
-const target = 'http://192.168.2.142:10010';
+const target = 'http://192.168.2.28:10010';
 // const target = "http://127.0.0.1:10010";
 // const target = "http://192.168.2.178:10010";
 // const target = 'http://47.101.180.183:10010';

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 11396 - 12912
fhKeeper/formulahousekeeper/management-crm/crm.log


+ 16 - 4
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/BusinessOpportunityController.java

@@ -54,17 +54,27 @@ public class BusinessOpportunityController {
     @Resource
     private BusinessOpportunityService bOservice;
     @Resource
+    private BusinessOpportunityMapper boMapper;
+    @Resource
     private BusinessOpportunityMapper businessOpportunityMapper;
 
     @RequestMapping("getAll")
     public Object getAll(HttpServletRequest request) {
         User user = userMapper.selectById(request.getHeader("Token"));
+        List<BusinessOpportunity> list = new ArrayList<>();
+        boolean isAll = sysFunctionService.hasPriviledge(user.getRoleId(), "查看全部商机");
+        boolean isNotAll = sysFunctionService.hasPriviledge(user.getRoleId(), "查看负责部门商机");
+        if (isAll) {
+            list = boMapper.getAllList(user.getCompanyId());
+        } else if (isNotAll) {
+            list = boMapper.getAllList1(user);
+        } else {
+            list = boMapper.getAllList2(user);
+        }
         HttpRespMsg msg = new HttpRespMsg();
-        msg.setMsg("操作成功");
-        msg.setData(
-                businessOpportunityMapper.selectList(new QueryWrapper<BusinessOpportunity>().eq("company_id", user.getCompanyId()))
-        );
+        msg.setData(list);
         return msg;
+
     }
 
 
@@ -214,6 +224,7 @@ public class BusinessOpportunityController {
             bOservice.insert(bo);
         }else {
             //修改
+            bo.setEditTime(new Date());
             bOservice.update(bo,user.getId());
 
         }
@@ -289,6 +300,7 @@ public class BusinessOpportunityController {
         HashMap<Object, Object> r = new HashMap<>();
         User user = userMapper.selectById(request.getHeader("Token"));
         bo.setIsDelete(1);
+        bo.setPageIndex((bo.getPageIndex()-1) * bo.getPageFrom());
         bo.setUserId(user.getId());
         bo.setCompanyId(user.getCompanyId());
         setNull(bo);

+ 19 - 3
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/ClueController.java

@@ -59,9 +59,25 @@ public class ClueController {
         User user = userMapper.selectById(request.getHeader("Token"));
         HttpRespMsg msg = new HttpRespMsg();
         msg.setMsg("操作成功");
-        msg.setData(
-                clueMapper.selectList(new QueryWrapper<Clue>().eq("company_id", user.getCompanyId()))
-        );
+
+        Clue clue = new Clue();
+        clue.setCompanyId(user.getCompanyId());
+        clue.setUserId(user.getId());
+        clue.setIsDelete(0);
+        boolean isAll = sysFunctionService.hasPriviledge(user.getRoleId(), "查看全部线索");
+        boolean isNotAll = sysFunctionService.hasPriviledge(user.getRoleId(), "查看负责部门线索");
+        List<Clue> list = new ArrayList<>();
+        if (isAll) {
+            //查看全部线索
+            list = clueService.getAllList(clue);
+        } else if (isNotAll) {
+            //查看负责部门线索 找出所处部门下所有的负责人
+            list = clueService.getAllList1(clue);
+        } else {
+            // 查看负责人为 自己 和 null的数据
+            list = clueService.getAllList2(clue, user);
+        }
+        msg.setData(list);
         return msg;
     }
 

+ 5 - 5
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/CustomController.java

@@ -94,10 +94,10 @@ public class CustomController {
         return customService.getInfo(custom, request);
     }
 
-    @RequestMapping("getLog")
-    public HttpRespMsg getLog(Custom custom, HttpServletRequest request) {
-        return customService.getInfo(custom, request);
-    }
+//    @RequestMapping("getLog")
+//    public HttpRespMsg getLog(Custom custom, HttpServletRequest request) {
+//        return customService.getInfo(custom, request);
+//    }
 
     @RequestMapping("/importData")
     public HttpRespMsg importData(MultipartFile multipartFile){
@@ -173,7 +173,7 @@ public class CustomController {
             }
             dataList.add(item);
         }
-        String fileName="商机表导出_"+ System.currentTimeMillis();
+        String fileName="客户表导出_"+ System.currentTimeMillis();
         return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName,dataList,path);
     }
 

+ 9 - 4
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/BusinessItemProduct.java

@@ -74,11 +74,16 @@ public class BusinessItemProduct extends Model<BusinessItemProduct> {
      */
     @TableField("total_price")
     private BigDecimal totalPrice;
+    /**
+     * 商机售价
+     */
+    @TableField("selling_price")
+    private BigDecimal sellingPrice;
 
 
-    @Override
-    protected Serializable pkVal() {
-        return this.id;
-    }
+//    @Override
+//    protected Serializable pkVal() {
+//        return this.id;
+//    }
 
 }

+ 2 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/Clue.java

@@ -168,6 +168,8 @@ public class Clue extends Model<Clue> {
     private List<Task> taskList;
     @TableField(exist = false)
     private Integer isDesc;
+    @TableField(exist = false)
+    private String userId;
 
 
     @Override

+ 4 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/Custom.java

@@ -254,7 +254,11 @@ public class Custom extends Model<Custom> {
     private List<ActionLog> actionLogs;
     @TableField(exist = false)
     private List<Contacts> contactsList;
+    @TableField(exist = false)
+    private Integer isDesc;
 
+    @TableField(exist = false)
+    private List<Task> tasks;
 
     @Override
     protected Serializable pkVal() {

+ 2 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/dto/TaskDto.java

@@ -13,6 +13,8 @@ import java.time.LocalDate;
 @Data
 @Accessors(chain = true)
 public class TaskDto extends Task {
+    private Integer businessOpportunityId;
+    private Integer customerId;
     private Integer pageIndex;
     private Integer pageSize;
 

+ 5 - 1
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/mapper/ActionLogMapper.java

@@ -18,5 +18,9 @@ import java.util.List;
 public interface ActionLogMapper extends BaseMapper<ActionLog> {
 
     @Select("select a.*,u.`name` userName from action_log a left join `user` u on a.user_id = u.id where code = 'clue' and item_id = #{id}")
-    List<ActionLog> selectByInfoList(Clue clue1);
+    List<ActionLog> selectByInfoList(Integer id);
+    @Select("select a.*,u.`name` userName from action_log a left join `user` u on a.user_id = u.id where code = 'business' and item_id = #{id}")
+    List<ActionLog> selectByInfoListBusiness(Integer id);
+    @Select("select a.*,u.`name` userName from action_log a left join `user` u on a.user_id = u.id where code = 'custom' and item_id = #{id}")
+    List<ActionLog> selectByInfoListCustom(Integer id);
 }

+ 6 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/mapper/BusinessOpportunityMapper.java

@@ -2,6 +2,7 @@ package com.management.platform.mapper;
 
 import com.management.platform.entity.BusinessOpportunity;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.management.platform.entity.User;
 import com.management.platform.util.HttpRespMsg;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.web.multipart.MultipartFile;
@@ -37,4 +38,9 @@ public interface BusinessOpportunityMapper extends BaseMapper<BusinessOpportunit
 
     List<Map<String, Object>> getDataStage(Integer companyId, String startDate, String endDate, String userId,@Param("list") List<String> targetUserIds);
 
+    List<BusinessOpportunity> getAllList(Integer companyId);
+
+    List<BusinessOpportunity> getAllList1(User user);
+
+    List<BusinessOpportunity> getAllList2(User user);
 }

+ 4 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/mapper/ClueMapper.java

@@ -41,4 +41,8 @@ public interface ClueMapper extends BaseMapper<Clue> {
 
     Map<String, Object> getDataSummary(Integer companyId, String startDate, String endDate, String userId,@Param("list") List<String> targetUserIds);
 
+    List<Clue> getAllList(Clue clue);
+    List<Clue> getAlllist1(Clue clue);
+
+    List<Clue> getAllList2(Clue clue);
 }

+ 1 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/BusinessOpportunityService.java

@@ -67,4 +67,5 @@ public interface BusinessOpportunityService extends IService<BusinessOpportunity
     void saveReason(BusinessOpportunity bo, User user);
 
     void saveStage(BusinessOpportunity bo, User user);
+
 }

+ 5 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/ClueService.java

@@ -29,6 +29,7 @@ public interface ClueService extends IService<Clue> {
 
     List<Clue> getList(Clue clue);
     List<Clue> getList1(Clue clue, User user);
+    List<Clue> getAllList1(Clue clue);
     List<Clue> getList2(Clue clue, User user);
 
     Integer getTotal(Clue clue);
@@ -56,4 +57,8 @@ public interface ClueService extends IService<Clue> {
     HttpRespMsg importData(MultipartFile multipartFile);
 
     HttpRespMsg exportData(Clue clue) throws Exception;
+
+    List<Clue> getAllList(Clue clue);
+
+    List<Clue> getAllList2(Clue clue, User user);
 }

+ 103 - 58
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/BusinessOpportunityServiceImpl.java

@@ -39,6 +39,7 @@ import java.lang.reflect.Method;
 import java.math.BigDecimal;
 import java.net.URLEncoder;
 import java.util.*;
+import java.util.stream.Collectors;
 
 
 /**
@@ -61,6 +62,8 @@ public class BusinessOpportunityServiceImpl extends ServiceImpl<BusinessOpportun
     @Resource
     private TaskMapper taskMapper;
     @Resource
+    private ProductMapper productMapper;
+    @Resource
     private ActionLogMapper actionLogMapper;
     @Resource
     private BusinessItemProductMapper bipMapper;
@@ -78,6 +81,7 @@ public class BusinessOpportunityServiceImpl extends ServiceImpl<BusinessOpportun
 
     @Resource
     private SysDictMapper sysDictMapper;
+
     @Override
     public List<BusinessOpportunity> getAll(BusinessOpportunity bo) {
         return bOMapper.selectAllList(bo);
@@ -91,11 +95,46 @@ public class BusinessOpportunityServiceImpl extends ServiceImpl<BusinessOpportun
     @Override
     public BusinessOpportunity getInfo(BusinessOpportunity bo, User user) {
         BusinessOpportunity businessOpportunity = bOMapper.selectByIdToInfo(bo.getId());
-        businessOpportunity.setActionLogList(actionLogMapper.selectList(new QueryWrapper<ActionLog>().eq("item_id", bo.getId()).eq("code", "business")));
-        businessOpportunity.setUploadFilePList(uploadFileMapper.selectByInfoList("business",bo.getId()));
-        businessOpportunity.setTaskList(taskMapper.selectList(new QueryWrapper<Task>().eq("business_opportunity_id",bo.getId())));
+        businessOpportunity.setActionLogList(actionLogMapper.selectByInfoListBusiness(bo.getId()));
+        businessOpportunity.setUploadFilePList(uploadFileMapper.selectByInfoList("business", bo.getId()));
+        List<Task> tasks = taskMapper.selectList(new QueryWrapper<Task>().eq("business_opportunity_id", bo.getId()));
+        for (Task task : tasks) {
+            String executorId = task.getExecutorId();
+            if (executorId != null && executorId != ""){
+                List<String> list = Arrays.asList(executorId.split(","));
+                List<User> users = userMapper.selectList(new QueryWrapper<User>().in("id", list));
+                List<String> executorNamesList = users.stream()
+                        .map(User::getName)
+                        .collect(Collectors.toList());
+                task.setExecutorNames(executorNamesList);
+            }
+        }
+        businessOpportunity.setTaskList(tasks);
         List<BusinessItemProduct> businessItemProducts = bipMapper.selectList(new QueryWrapper<BusinessItemProduct>().eq("business_id", bo.getId()));
-        if (businessItemProducts.size() > 0){
+        if (businessItemProducts.size() > 0) {
+
+            List<Integer> productIds = businessItemProducts.stream()
+                    .map(BusinessItemProduct::getProductId)
+                    .collect(Collectors.toList());
+            List<Product> products = productMapper.selectList(new QueryWrapper<Product>().in("id", productIds));
+            List<SysDict> sysDicts = sysDictMapper.selectList(new QueryWrapper<SysDict>().eq("code", "ProductType").or().eq("code", "ProductUnit"));
+            for (BusinessItemProduct businessItemProduct : businessItemProducts) {
+                for (Product product : products) {
+                    if(businessItemProduct.getProductId().equals(product.getId())){
+                        businessItemProduct.setProductName(product.getProductName());
+                        for (SysDict sysDict : sysDicts) {
+                            if (product.getType().equals(sysDict.getId())){
+                                businessItemProduct.setProductType(sysDict.getName());
+                            }
+                            if (product.getUnit().equals(sysDict.getId())){
+                                businessItemProduct.setUnit(sysDict.getName());
+                            }
+                        }
+                    }
+                }
+            }
+
+
             BigDecimal finalPrice = new BigDecimal(0);
             BigDecimal discountedPrice = new BigDecimal(0);
             for (BusinessItemProduct businessItemProduct : businessItemProducts) {
@@ -107,7 +146,7 @@ public class BusinessOpportunityServiceImpl extends ServiceImpl<BusinessOpportun
                 // 折后价格
                 discountedPrice = discountedPrice.add(price.multiply(divide));
             }
-            BigDecimal divide = discountedPrice.divide(finalPrice,2,BigDecimal.ROUND_UP);
+            BigDecimal divide = discountedPrice.divide(finalPrice, 2, BigDecimal.ROUND_UP);
             // 整单折扣率
             businessOpportunity.setFinalPrice(divide.multiply(new BigDecimal(100)));
         }
@@ -140,18 +179,17 @@ public class BusinessOpportunityServiceImpl extends ServiceImpl<BusinessOpportun
     @Transactional(rollbackFor = Exception.class)
     public void insert(BusinessOpportunity bo) {
         setNull(bo);
-        bo.setCreateTime(new Date());
         bOMapper.insert(bo);
         List<BusinessItemProduct> businessItemProducts = JSONArray.parseArray(bo.getBusinessItemProductList(), BusinessItemProduct.class);
         for (BusinessItemProduct businessItemProduct : businessItemProducts) {
             businessItemProduct.setBusinessId(bo.getId());
-//            businessItemProduct.setId(null);
             bipMapper.insert(businessItemProduct);
         }
         ActionLog actionLog = new ActionLog();
         actionLog.setUserId(bo.getUserId());
         actionLog.setItemId(bo.getId());
         actionLog.setCode("business");
+        actionLog.setCreatTime(new Date());
         actionLog.setName("创建了商机");
         actionLogMapper.insert(actionLog);
     }
@@ -161,7 +199,7 @@ public class BusinessOpportunityServiceImpl extends ServiceImpl<BusinessOpportun
     public void update(BusinessOpportunity bo, String userId) {
         setNull(bo);
         bOMapper.updateById(bo);
-        bipMapper.delete(new QueryWrapper<BusinessItemProduct>().eq("business_id",bo.getId()));
+        bipMapper.delete(new QueryWrapper<BusinessItemProduct>().eq("business_id", bo.getId()));
         List<BusinessItemProduct> businessItemProducts = JSONArray.parseArray(bo.getBusinessItemProductList(), BusinessItemProduct.class);
         for (BusinessItemProduct businessItemProduct : businessItemProducts) {
             businessItemProduct.setBusinessId(bo.getId());
@@ -219,13 +257,12 @@ public class BusinessOpportunityServiceImpl extends ServiceImpl<BusinessOpportun
     private String path;
 
 
-
     @Override
     @Transactional(rollbackFor = Exception.class)
     public HttpRespMsg saveProduct(BusinessOpportunity bo, User user) {
         HttpRespMsg msg = new HttpRespMsg();
         msg.setMsg("操作成功");
-        biMapper.delete(new QueryWrapper<BusinessItemProduct>().eq("business_id",bo.getId()));
+        biMapper.delete(new QueryWrapper<BusinessItemProduct>().eq("business_id", bo.getId()));
         List<BusinessItemProduct> businessItemProducts = JSONArray.parseArray(bo.getBusinessItemProductList(), BusinessItemProduct.class);
         for (BusinessItemProduct businessItemProduct : businessItemProducts) {
             biMapper.insert(businessItemProduct);
@@ -241,6 +278,7 @@ public class BusinessOpportunityServiceImpl extends ServiceImpl<BusinessOpportun
 
     @Value(value = "${upload.file}")
     private String filePath;
+
     @Override
     public Object uploadFile(BusinessOpportunity bo, HttpServletRequest request, MultipartFile file) {
         User user = userMapper.selectById(request.getHeader("token"));
@@ -316,7 +354,7 @@ public class BusinessOpportunityServiceImpl extends ServiceImpl<BusinessOpportun
         try {
             ServletOutputStream os = response.getOutputStream();
             UploadFile uploadFile = uploadFileMapper.selectById(file.getId());
-            if (uploadFile == null ){
+            if (uploadFile == null) {
                 msg.setError("文件未找到");
                 return msg;
             }
@@ -354,7 +392,10 @@ public class BusinessOpportunityServiceImpl extends ServiceImpl<BusinessOpportun
 
     @Override
     public Object reFileName(UploadFile uploadFile, HttpServletRequest request) {
-        return uploadFileMapper.update(null, new UpdateWrapper<UploadFile>().eq("id", uploadFile.getId()).set("name", uploadFile.getName()));
+        uploadFileMapper.update(null, new UpdateWrapper<UploadFile>().eq("item_id", uploadFile.getId()).eq("code", "business").set("name", uploadFile.getName()));
+        HttpRespMsg httpRespMsg = new HttpRespMsg();
+        httpRespMsg.setMsg("操作成功");
+        return httpRespMsg;
     }
 
     @Override
@@ -378,12 +419,12 @@ public class BusinessOpportunityServiceImpl extends ServiceImpl<BusinessOpportun
 
     @Override
     public Map<String, Object> getDataSummary(Integer companyId, String startDate, String endDate, String userId, List<String> targetUserIds) {
-        return bOMapper.getDataSummary(companyId,startDate,endDate,userId,targetUserIds);
+        return bOMapper.getDataSummary(companyId, startDate, endDate, userId, targetUserIds);
     }
 
     @Override
     public List<Map<String, Object>> getDataStage(Integer companyId, String startDate, String endDate, String userId, List<String> targetUserIds) {
-        return bOMapper.getDataStage(companyId,startDate,endDate,userId,targetUserIds);
+        return bOMapper.getDataStage(companyId, startDate, endDate, userId, targetUserIds);
     }
 
     @Override
@@ -393,7 +434,7 @@ public class BusinessOpportunityServiceImpl extends ServiceImpl<BusinessOpportun
 
     @Override
     public HttpRespMsg importData(MultipartFile multipartFile) {
-        HttpRespMsg msg=new HttpRespMsg();
+        HttpRespMsg msg = new HttpRespMsg();
         String fileName = multipartFile.getOriginalFilename();
         File file = new File(fileName == null ? "file" : fileName);
         User user = userMapper.selectById(request.getHeader("token"));
@@ -421,15 +462,15 @@ public class BusinessOpportunityServiceImpl extends ServiceImpl<BusinessOpportun
             int rowNum = sheet.getLastRowNum();
             //获取当前表单模板 校验规则
             SysForm sysForm = sysFormMapper.selectOne(new LambdaQueryWrapper<SysForm>().eq(SysForm::getCode, "Thread").eq(SysForm::getCompanyId, companyId).eq(SysForm::getIsCurrent, 1));
-            if(sysForm==null){
+            if (sysForm == null) {
                 msg.setError("当前模块未配置自定义模板,需先完成配置");
                 return msg;
             }
             String config = sysForm.getConfig();
             JSONObject configOb = JSON.parseObject(config);
             JSONArray configObJSONArray = configOb.getJSONArray("list");
-            List<String> userNameList=new ArrayList<>();
-            HttpRespMsg respMsg=new HttpRespMsg();
+            List<String> userNameList = new ArrayList<>();
+            HttpRespMsg respMsg = new HttpRespMsg();
             for (int rowIndex = 0; rowIndex <= rowNum; rowIndex++) {
                 XSSFRow row = sheet.getRow(rowIndex);
                 if (row == null) {
@@ -445,33 +486,34 @@ public class BusinessOpportunityServiceImpl extends ServiceImpl<BusinessOpportun
                     JSONObject item = configObJSONArray.getJSONObject(i);
                     String modelName = item.getString("model");
                     XSSFCell cell = row.getCell(i);
-                    if(cell!=null){
-                        switch (item.getString("type")){
+                    if (cell != null) {
+                        switch (item.getString("type")) {
 //                            case "time":cell.setCellType(CellType.NUMERIC);
 //                                break;
-                            default:cell.setCellType(CellType.STRING);
+                            default:
+                                cell.setCellType(CellType.STRING);
                         }
                     }
-                    if(modelName.equals("inchargerId")){
+                    if (modelName.equals("inchargerId")) {
                         System.out.println("=====");
                         System.out.println(modelName);
                         System.out.println(cell.toString());
-                        if(!StringUtils.isEmpty(cell.getStringCellValue())){
+                        if (!StringUtils.isEmpty(cell.getStringCellValue())) {
                             userNameList.add(cell.getStringCellValue());
                         }
                     }
 
                 }
             }
-            System.out.println("参与搜索的人员列表"+userNameList + userNameList.size());
-            if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1&&userNameList.size()>0){
-                respMsg = wxCorpInfoService.getBatchSearchUserInfo(wxCorpInfo, userNameList,null);
-                if(respMsg.code.equals("0")){
-                    msg.setError("姓名为["+String.valueOf(respMsg.data)+"]的人员存在重复,请使用工号!");
+            System.out.println("参与搜索的人员列表" + userNameList + userNameList.size());
+            if (wxCorpInfo != null && wxCorpInfo.getSaasSyncContact() == 1 && userNameList.size() > 0) {
+                respMsg = wxCorpInfoService.getBatchSearchUserInfo(wxCorpInfo, userNameList, null);
+                if (respMsg.code.equals("0")) {
+                    msg.setError("姓名为[" + String.valueOf(respMsg.data) + "]的人员存在重复,请使用工号!");
                     return msg;
                 }
             }
-            List<User> targetUserList= (List<User>) respMsg.data;
+            List<User> targetUserList = (List<User>) respMsg.data;
             //直接忽略空行 从row1开始
             for (int rowIndex = 1; rowIndex <= rowNum; rowIndex++) {
                 XSSFRow row = sheet.getRow(rowIndex);
@@ -484,7 +526,7 @@ public class BusinessOpportunityServiceImpl extends ServiceImpl<BusinessOpportun
                 }
                 //获取到当前行的列数据
                 int cellNum = row.getLastCellNum();
-                BusinessOpportunity bo =new BusinessOpportunity();
+                BusinessOpportunity bo = new BusinessOpportunity();
                 bo.setCompanyId(companyId);
                 bo.setCreateTime(new Date());
                 bo.setCreatorId(user.getId());
@@ -492,65 +534,66 @@ public class BusinessOpportunityServiceImpl extends ServiceImpl<BusinessOpportun
                     JSONObject item = configObJSONArray.getJSONObject(i);
                     String modelName = item.getString("model");
                     String className = modelName.substring(0, 1).toUpperCase() + modelName.substring(1);
-                    String getter="get"+className;
-                    String setter="set"+className;
+                    String getter = "get" + className;
+                    String setter = "set" + className;
                     XSSFCell cell = row.getCell(i);
-                    if(cell!=null){
-                        switch (item.getString("type")){
+                    if (cell != null) {
+                        switch (item.getString("type")) {
 //                            case "time":cell.setCellType(CellType.NUMERIC);
 //                                break;
-                            default:cell.setCellType(CellType.STRING);
+                            default:
+                                cell.setCellType(CellType.STRING);
                         }
                     }
                     //校验当前列是否为必填
                     JSONObject options = item.getJSONObject("options");
                     JSONObject rules = options.getJSONObject("rules");
                     Boolean required = rules.getBoolean("required");
-                    if(required){
-                        if(StringUtils.isEmpty(cell.getStringCellValue())){
-                            msg.setError(item.getString("label")+"值不能为空值");
+                    if (required) {
+                        if (StringUtils.isEmpty(cell.getStringCellValue())) {
+                            msg.setError(item.getString("label") + "值不能为空值");
                             return msg;
                         }
                     }
-                    if(modelName.equals("inchargerId")){
-                        if(!StringUtils.isEmpty(cell.getStringCellValue())){
+                    if (modelName.equals("inchargerId")) {
+                        if (!StringUtils.isEmpty(cell.getStringCellValue())) {
                             String userName = cell.getStringCellValue();
                             Optional<User> first;
-                            if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
+                            if (wxCorpInfo != null && wxCorpInfo.getSaasSyncContact() == 1) {
                                 Optional<User> optional = targetUserList.stream().filter(tl -> tl.getName().equals(userName)).findFirst();
-                                first= userList.stream().filter(u ->(u.getJobNumber()!=null&&u.getJobNumber().equals(userName))||(optional.isPresent()&&u.getCorpwxUserid()!=null&&u.getCorpwxUserid().equals(optional.get().getCorpwxUserid()))).findFirst();
-                            }else {
-                                first= userList.stream().filter(u -> u.getName().equals(userName)||(u.getJobNumber()!=null&&u.getJobNumber().equals(userName))).findFirst();
+                                first = userList.stream().filter(u -> (u.getJobNumber() != null && u.getJobNumber().equals(userName)) || (optional.isPresent() && u.getCorpwxUserid() != null && u.getCorpwxUserid().equals(optional.get().getCorpwxUserid()))).findFirst();
+                            } else {
+                                first = userList.stream().filter(u -> u.getName().equals(userName) || (u.getJobNumber() != null && u.getJobNumber().equals(userName))).findFirst();
                             }
                             if (first.isPresent()) {
                                 bo.setInchargerId(first.get().getId());
                             } else {
-                                msg.setError("负责人["+userName+"]在系统中不存在");
+                                msg.setError("负责人[" + userName + "]在系统中不存在");
                                 return msg;
                             }
                         }
-                    }else if(modelName.equals("contactsId")){
-                        if(!StringUtils.isEmpty(cell.getStringCellValue())){
+                    } else if (modelName.equals("contactsId")) {
+                        if (!StringUtils.isEmpty(cell.getStringCellValue())) {
                             String userName = cell.getStringCellValue();
                             Optional<User> first;
-                            if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
+                            if (wxCorpInfo != null && wxCorpInfo.getSaasSyncContact() == 1) {
                                 Optional<User> optional = targetUserList.stream().filter(tl -> tl.getName().equals(userName)).findFirst();
-                                first= userList.stream().filter(u ->(u.getJobNumber()!=null&&u.getJobNumber().equals(userName))||(optional.isPresent()&&u.getCorpwxUserid()!=null&&u.getCorpwxUserid().equals(optional.get().getCorpwxUserid()))).findFirst();
-                            }else {
-                                first= userList.stream().filter(u -> u.getName().equals(userName)||(u.getJobNumber()!=null&&u.getJobNumber().equals(userName))).findFirst();
+                                first = userList.stream().filter(u -> (u.getJobNumber() != null && u.getJobNumber().equals(userName)) || (optional.isPresent() && u.getCorpwxUserid() != null && u.getCorpwxUserid().equals(optional.get().getCorpwxUserid()))).findFirst();
+                            } else {
+                                first = userList.stream().filter(u -> u.getName().equals(userName) || (u.getJobNumber() != null && u.getJobNumber().equals(userName))).findFirst();
                             }
                             if (first.isPresent()) {
                                 bo.setContactsId(Integer.parseInt(first.get().getId()));
                             } else {
-                                msg.setError("负责人["+userName+"]在系统中不存在");
+                                msg.setError("负责人[" + userName + "]在系统中不存在");
                                 return msg;
                             }
                         }
-                    }else {
-                        if(!StringUtils.isEmpty(cell.getStringCellValue())){
+                    } else {
+                        if (!StringUtils.isEmpty(cell.getStringCellValue())) {
                             Class<Clue> clueClass = Clue.class;
-                            Method method = clueClass.getMethod(setter,String.class);
-                            method.invoke(bo,cell.getStringCellValue());
+                            Method method = clueClass.getMethod(setter, String.class);
+                            method.invoke(bo, cell.getStringCellValue());
                         }
                     }
 
@@ -577,6 +620,7 @@ public class BusinessOpportunityServiceImpl extends ServiceImpl<BusinessOpportun
         bOMapper.update(bo, new UpdateWrapper<BusinessOpportunity>().eq("id", bo.getId()).set("contacts_id", bo.getContactsId()));
         ActionLog al = new ActionLog();
         al.setCode("business");
+        al.setCreatTime(new Date());
         al.setName("关联了联系人");
         al.setUserId(user.getId());
         al.setItemId(bo.getId());
@@ -596,10 +640,11 @@ public class BusinessOpportunityServiceImpl extends ServiceImpl<BusinessOpportun
 
     @Override
     public void saveStage(BusinessOpportunity bo, User user) {
-        bOMapper.update(bo, new UpdateWrapper<BusinessOpportunity>().eq("id", bo.getId()).set("Stage_Id", bo.getStageId()));
+        bOMapper.update(bo, new UpdateWrapper<BusinessOpportunity>().eq("id", bo.getId()).set("Stage_Id", bo.getStageId()).set("edit_time",new Date()));
         ActionLog al = new ActionLog();
         al.setCode("business");
-        al.setName("推进了阶段至"+bo.getStageValue());
+        al.setName("推进了阶段至" + bo.getStageValue());
+        al.setCreatTime(new Date());
         al.setUserId(user.getId());
         al.setItemId(bo.getId());
         actionLogMapper.insert(al);

+ 23 - 2
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/ClueServiceImpl.java

@@ -152,6 +152,7 @@ public class ClueServiceImpl extends ServiceImpl<ClueMapper, Clue> implements Cl
             log.setCode("clue");
             log.setUserId(userId);
             log.setCreatTime(new Date());
+            actionLogMapper.insert(log);
         }
         UpdateWrapper<Clue> updateWrapper = new UpdateWrapper<>();
         updateWrapper.in("id", ids);
@@ -173,6 +174,11 @@ public class ClueServiceImpl extends ServiceImpl<ClueMapper, Clue> implements Cl
         return clueMapper.list1(clue, user.getId());
     }
 
+    @Override
+    public List<Clue> getAllList1(Clue clue) {
+         return clueMapper.getAlllist1(clue);
+    }
+
     @Override
     public List<Clue> getList2(Clue clue, User user) {
         return clueMapper.list2(clue, user.getId());
@@ -188,7 +194,7 @@ public class ClueServiceImpl extends ServiceImpl<ClueMapper, Clue> implements Cl
     @Override
     public Clue getInfo(Clue clue) {
         Clue clue1 = clueMapper.selectById2Info(clue.getId());
-        clue1.setClueLogList(actionLogMapper.selectByInfoList(clue1));
+        clue1.setClueLogList(actionLogMapper.selectByInfoList(clue1.getId()));
         clue1.setFiles(uploadFileMapper.selectByInfoList("clue", clue1.getId()));
         List<Task> tasks = taskMapper.selectList(new QueryWrapper<Task>().in("clue_id", clue.getId()));
         for (Task task : tasks) {
@@ -220,6 +226,7 @@ public class ClueServiceImpl extends ServiceImpl<ClueMapper, Clue> implements Cl
             log.setCode("clue");
             log.setUserId(userId);
             log.setCreatTime(new Date());
+            actionLogMapper.insert(log);
         }
 
         UpdateWrapper<Clue> updateWrapper = new UpdateWrapper<>();
@@ -359,7 +366,10 @@ public class ClueServiceImpl extends ServiceImpl<ClueMapper, Clue> implements Cl
 
     @Override
     public Object reFileName(UploadFile uploadFile, HttpServletRequest request) {
-        return uploadFileMapper.update(null, new UpdateWrapper<UploadFile>().eq("id", uploadFile.getId()).set("name", uploadFile.getName()));
+        uploadFileMapper.update(null, new UpdateWrapper<UploadFile>().eq("item_id", uploadFile.getId()).eq("code", "clue").set("name", uploadFile.getName()));
+        HttpRespMsg httpRespMsg = new HttpRespMsg();
+        httpRespMsg.setMsg("操作成功");
+        return httpRespMsg;
     }
 
     @Override
@@ -648,5 +658,16 @@ public class ClueServiceImpl extends ServiceImpl<ClueMapper, Clue> implements Cl
         return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName,dataList,path);
     }
 
+    @Override
+    public List<Clue> getAllList(Clue clue) {
+        return clueMapper.getAllList(clue);
+    }
+
+    @Override
+    public List<Clue> getAllList2(Clue clue, User user) {
+        return clueMapper.getAllList2(clue);
+
+    }
+
 
 }

+ 11 - 1
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/ContactsServiceImpl.java

@@ -84,6 +84,8 @@ public class ContactsServiceImpl extends ServiceImpl<ContactsMapper, Contacts> i
 
     @Resource
     private StageMapper stageMapper;
+    @Resource
+    private ActionLogMapper logMapper;
 
     @Value(value = "${upload.path}")
     private String path;
@@ -127,7 +129,15 @@ public class ContactsServiceImpl extends ServiceImpl<ContactsMapper, Contacts> i
                 .setCreateTime(LocalDateTime.now())
                 .setCreatorId(user.getId());
         contactsMapper.insert(contacts);
-
+        if (contacts.getCustomId() != null){
+            ActionLog actionLog = new ActionLog();
+            actionLog.setCreatTime(new Date())
+            .setUserId(user.getId())
+            .setCode("custom")
+            .setName("新建了相关联系人")
+            .setItemId(contacts.getCustomId());
+            logMapper.insert(actionLog);
+        }
         ContactsLog contactsLog = new ContactsLog();
         contactsLog.setContactsId(contacts.getId())
                 .setOperateId(user.getId())

+ 21 - 13
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/CustomServiceImpl.java

@@ -39,6 +39,7 @@ import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.net.URLEncoder;
 import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -88,6 +89,9 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
     @Autowired
     private ContactsMapper contactsMapper;
 
+    @Autowired
+    private TaskMapper taskMapper;
+
     @Override
     public HttpRespMsg insertAndUpdate(Custom custom, HttpServletRequest request) {
         HttpRespMsg msg = new HttpRespMsg();
@@ -116,7 +120,7 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
             ActionLog actionLog = new ActionLog();
             actionLog.setCode("custom");
             actionLog.setCreatTime(new Date());
-            actionLog.setName("创建了客户");
+            actionLog.setName("编辑了客户");
             actionLog.setItemId(custom.getId());
             actionLog.setUserId(user.getId());
             actionLogMapper.insert(actionLog);
@@ -127,7 +131,7 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
                 return msg;
             }
             if (customMapper.selectCount(new QueryWrapper<Custom>().eq("tel_phone", custom.getTelPhone())) > 0) {
-//                msg.setError("电话号码重复了");
+                msg.setError("电话号码重复了");
                 return msg;
             }
 
@@ -143,7 +147,7 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
             ActionLog actionLog = new ActionLog();
             actionLog.setCode("custom");
             actionLog.setCreatTime(new Date());
-            actionLog.setName("编辑了客户");
+            actionLog.setName("新建了客户");
             actionLog.setUserId(user.getId());
             actionLog.setItemId(custom.getId());
             actionLogMapper.insert(actionLog);
@@ -222,20 +226,24 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
         Custom custom1 = customMapper.getInfo(custom.getId());
 
         // 附件列表
-        custom1.setFiles(uploadFileMapper.selectList(new QueryWrapper<UploadFile>().eq("code", "custom").eq("item_id",custom1.getId())));
+        custom1.setFiles(uploadFileMapper.selectByInfoList("custom",custom1.getId()));
         //商机列表
         custom1.setBusinessOpportunitys(businessOpportunityMapper.selectList(new QueryWrapper<BusinessOpportunity>().eq("customer_id",custom1.getId())));
         //操作记录
-        custom1.setActionLogs(actionLogMapper.selectList(new QueryWrapper<ActionLog>().eq("code","custom").eq("item_id",custom1.getId())));
-//        List<CustomItemContacts> contacts = customItemContactsMapper.selectList(new QueryWrapper<CustomItemContacts>().eq("contacts_id", custom1.getId()));
-//        List<Integer> ids = new ArrayList<>();
-//        for (CustomItemContacts contact : contacts) {
-//            ids.add(contact.getCustomId());
-//        }
-//        if (ids.size() > 0){
-//            List<Contacts> cs = contactsMapper.selectListByIds(ids);
-//            custom1.setContactsList(cs);
+        List<ActionLog> actionLogs = actionLogMapper.selectByInfoListCustom(custom.getId());
+//        List<String> userIds = actionLogs.stream().map(ActionLog::getUserId).collect(Collectors.toList());
+//        System.out.println(userIds.toString());
+//        List<User> ids = userMapper.selectList(new QueryWrapper<User>().in("id", userIds));
+//        for (ActionLog actionLog : actionLogs) {
+//            for (User id : ids) {
+//                if(actionLog.getUserId().equals(id)){
+//                    actionLog.setUserName(id.getName());
+//                }
+//            }
 //        }
+        List<Task> tasks = taskMapper.selectList(new QueryWrapper<Task>().in("custom_id", custom1.getId()));
+        custom1.setTasks(tasks);
+        custom1.setActionLogs(actionLogs);
         //联系人
         custom1.setContacts(contactsMapper.selectList((new QueryWrapper<Contacts>().eq("custom_id",custom1.getId()))));
         //订单

+ 21 - 3
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/TaskServiceImpl.java

@@ -102,6 +102,9 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
     @Resource
     private ClueMapper clueMapper;
 
+    @Resource
+    private ActionLogMapper logMapper;
+
     @Resource
     private ContactsMapper contactsMapper;
 
@@ -172,9 +175,24 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
         taskLog.setUserName(user.getName());
         taskLog.setCompanyId(user.getCompanyId());
         taskLogMapper.insert(taskLog);
-
-
-
+        if (taskDto.getBusinessOpportunityId() != null){
+            ActionLog actionLog = new ActionLog();
+            actionLog.setCreatTime(new Date());
+            actionLog.setUserId(userId);
+            actionLog.setCode("business");
+            actionLog.setName("新建了相关任务");
+            actionLog.setItemId(taskDto.getBusinessOpportunityId());
+            logMapper.insert(actionLog);
+        }
+        if (taskDto.getCustomId() != null){
+            ActionLog actionLog = new ActionLog();
+            actionLog.setCreatTime(new Date());
+            actionLog.setUserId(userId);
+            actionLog.setCode("custom");
+            actionLog.setName("新建了相关任务");
+            actionLog.setItemId(taskDto.getCustomId());
+            logMapper.insert(actionLog);
+        }
         return httpRespMsg;
     }
 

+ 97 - 70
fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/BusinessOpportunityMapper.xml

@@ -36,7 +36,7 @@
         (select `name` from  stage where id =  stage_id) stageValue,
         (select custom_name from custom where id = customer_id) customerName,
         (select `name` from contacts where id = contacts_id) contactsName,
-        (select `name` from `user` where id = contacts_id) inchargerName,
+        (select `name` from `user` where id = incharger_id) inchargerName,
         (select `name` from `user` where id = creator_id) creatorName,
         (SELECT sum(total) from business_product WHERE business_id = id) total
         from business_opportunity
@@ -100,68 +100,68 @@
         (select `name` from  stage where id =  stage_id) stageValue,
         (select custom_name from custom where id = customer_id) customerName,
         (select `name` from contacts where id = contacts_id) contactsName,
-        (select `name` from `user` where id = contacts_id) inchargerName,
+        (select `name` from `user` where id = incharger_id) inchargerName,
         (select `name` from `user` where id = creator_id) creatorName,
         (SELECT sum(total) from business_product WHERE business_id = id)
         from business_opportunity
-        where company_id = #{companyId}
-        and is_delete = #{isDelete}
+        where company_id = #{bo.companyId}
+        and is_delete = #{bo.isDelete}
         and (incharger_id in
         (SELECT id from `user` WHERE department_id = (SELECT department_id from `user` WHERe id = #{userId}))
         or incharger_id is null)
-        <if test="name != null and name != ''">
-            and `name` LIKE CONCAT('%', #{name}, '%')
+        <if test="bo.name != null and bo.name != ''">
+            and `name` LIKE CONCAT('%', #{bo.name}, '%')
         </if>
-        <if test="inchargerId != null ">
-            and incharger_id = #{inchargerId}
+        <if test="bo.inchargerId != null ">
+            and incharger_id = #{bo.inchargerId}
         </if>
-        <if test="startTime != null and endTime != null ">
-            and create_time BETWEEN  #{startTime} and #{endTime}
+        <if test="bo.startTime != null and bo.endTime != null ">
+            and create_time BETWEEN  #{bo.startTime} and #{bo.endTime}
         </if>
-        <if test="contactsName != null and contactsName != ''">
-            and contacts_id in (select id from contacts where `name`LIKE CONCAT('%', #{contactsName}, '%'))
+        <if test="bo.contactsName != null and bo.contactsName != ''">
+            and contacts_id in (select id from contacts where `name`LIKE CONCAT('%', #{bo.contactsName}, '%'))
         </if>
-        <if test="customerName != null and customerName != ''">
-            and customer_id in (select id from custom where `name`LIKE CONCAT('%', #{customerName}, '%'))
+        <if test="bo.customerName != null and bo.customerName != ''">
+            and customer_id in (select id from custom where `name`LIKE CONCAT('%', #{bo.customerName}, '%'))
         </if>
-        <if test="stageId != null ">
-            and stage_id = #{stageId}
+        <if test="bo.stageId != null ">
+            and stage_id = #{bo.stageId}
         </if>
-        <if test="productId != null ">
-            and id in (select business_id from business_product where product_id = #{productId})
+        <if test="bo.productId != null ">
+            and id in (select business_id from business_product where product_id = #{bo.productId})
         </if>
         ORDER BY id DESC
-        limit #{pageIndex},#{pageFrom}
+        limit #{bo.pageIndex},#{bo.pageFrom}
     </select>
     <select id="getTotal1" resultType="java.lang.Integer">
         select
         count(id)
         from business_opportunity
-        where company_id = #{companyId}
-        and is_delete = #{isDelete}
+        where company_id = #{bo.companyId}
+        and is_delete = #{bo.isDelete}
         and (incharger_id in
         (SELECT id from `user` WHERE department_id = (SELECT department_id from `user` WHERe id = #{userId}))
         or incharger_id is null)
-        <if test="name != null and name != ''">
-            and `name` LIKE CONCAT('%', #{name}, '%')
+        <if test="bo.name != null and bo.name != ''">
+            and `name` LIKE CONCAT('%', #{bo.name}, '%')
         </if>
-        <if test="inchargerId != null ">
-            and incharger_id = #{inchargerId}
+        <if test="bo.inchargerId != null ">
+            and incharger_id = #{bo.inchargerId}
         </if>
-        <if test="startTime != null and endTime != null ">
-            and create_time BETWEEN #{startTime} and #{endTime}
+        <if test="bo.startTime != null and bo.endTime != null ">
+            and create_time BETWEEN #{bo.startTime} and #{bo.endTime}
         </if>
-        <if test="contactsName != null and contactsName != ''">
-            and contacts_id in (select id from contacts where `name`LIKE CONCAT('%', #{contactsName}, '%'))
+        <if test="bo.contactsName != null and bo.contactsName != ''">
+            and contacts_id in (select id from contacts where `name`LIKE CONCAT('%', #{bo.contactsName}, '%'))
         </if>
-        <if test="customerName != null and customerName != ''">
-            and customer_id in (select id from custom where `name`LIKE CONCAT('%', #{customerName}, '%'))
+        <if test="bo.customerName != null and bo.customerName != ''">
+            and customer_id in (select id from custom where `name`LIKE CONCAT('%', #{bo.customerName}, '%'))
         </if>
-        <if test="stageId != null ">
-            and stage_id = #{stageId}
+        <if test="bo.stageId != null ">
+            and stage_id = #{bo.stageId}
         </if>
-        <if test="productId != null ">
-            and id in (select business_id from business_product where product_id = #{productId})
+        <if test="bo.productId != null ">
+            and id in (select business_id from business_product where product_id = #{bo.productId})
         </if>
     </select>
     <select id="selectAllList2" resultType="com.management.platform.entity.BusinessOpportunity">
@@ -170,64 +170,64 @@
         (select `name` from  stage where id =  stage_id) stageValue,
         (select custom_name from custom where id = customer_id) customerName,
         (select `name` from contacts where id = contacts_id) contactsName,
-        (select `name` from `user` where id = contacts_id) inchargerName,
+        (select `name` from `user` where id = incharger_id) inchargerName,
         (select `name` from `user` where id = creator_id) creatorName,
         (SELECT sum(total) from business_product WHERE business_id = id)
         from business_opportunity
-        where company_id = #{companyId}
-        and is_delete = #{isDelete}
+        where company_id = #{bo.companyId}
+        and is_delete = #{bo.isDelete}
         and (incharger_id = #{userId} or incharger_id is null)
-        <if test="name != null and name != ''">
-            and `name` LIKE CONCAT('%', #{name}, '%')
+        <if test="bo.name != null and bo.name != ''">
+            and `name` LIKE CONCAT('%', #{bo.name}, '%')
         </if>
-        <if test="inchargerId != null ">
-            and incharger_id = #{inchargerId}
+        <if test="bo.inchargerId != null ">
+            and incharger_id = #{bo.inchargerId}
         </if>
-        <if test="startTime != null and endTime != null ">
-            and create_time BETWEEN  #{startTime} and #{endTime}
+        <if test="bo.startTime != null and bo.endTime != null ">
+            and create_time BETWEEN  #{bo.startTime} and #{bo.endTime}
         </if>
-        <if test="contactsName != null and contactsName != ''">
-            and contacts_id in (select id from contacts where `name`LIKE CONCAT('%', #{contactsName}, '%'))
+        <if test="bo.contactsName != null and bo.contactsName != ''">
+            and contacts_id in (select id from contacts where `name`LIKE CONCAT('%', #{bo.contactsName}, '%'))
         </if>
-        <if test="customerName != null and customerName != ''">
-            and customer_id in (select id from custom where `name`LIKE CONCAT('%', #{customerName}, '%'))
+        <if test="bo.customerName != null and bo.customerName != ''">
+            and customer_id in (select id from custom where `name`LIKE CONCAT('%', #{bo.customerName}, '%'))
         </if>
-        <if test="stageId != null ">
-            and stage_id = #{stageId}
+        <if test="bo.stageId != null ">
+            and stage_id = #{bo.stageId}
         </if>
-        <if test="productId != null ">
-            and id in (select business_id from business_product where product_id = #{productId})
+        <if test="bo.productId != null ">
+            and id in (select business_id from business_product where product_id =#{bo.productId})
         </if>
         ORDER BY id DESC
-        limit #{pageIndex},#{pageFrom}
+        limit #{bo.pageIndex},#{bo.pageFrom}
     </select>
     <select id="getTotal2" resultType="java.lang.Integer">
         select
         count(id)
         from business_opportunity
-        where company_id = #{companyId}
-        and is_delete = #{isDelete}
+        where company_id = #{bo.companyId}
+        and is_delete = #{bo.isDelete}
         and (incharger_id = #{userId} or incharger_id is null)
-        <if test="name != null and name != ''">
-            and `name` LIKE CONCAT('%', #{name}, '%')
+        <if test="bo.name != null and bo.name != ''">
+            and `name` LIKE CONCAT('%', #{bo.name}, '%')
         </if>
-        <if test="inchargerId != null ">
-            and incharger_id = #{inchargerId}
+        <if test="bo.inchargerId != null ">
+            and incharger_id = #{bo.inchargerId}
         </if>
-        <if test="startTime != null and endTime != null ">
-            and create_time BETWEEN #{startTime} and #{endTime}
+        <if test="bo.startTime != null and bo.endTime != null ">
+            and create_time BETWEEN #{bo.startTime} and #{bo.endTime}
         </if>
-        <if test="contactsName != null and contactsName != ''">
-            and contacts_id in (select id from contacts where `name`LIKE CONCAT('%', #{contactsName}, '%'))
+        <if test="bo.contactsName != null and bo.contactsName != ''">
+            and contacts_id in (select id from contacts where `name`LIKE CONCAT('%', #{bo.contactsName}, '%'))
         </if>
-        <if test="customerName != null and customerName != ''">
-            and customer_id in (select id from custom where `name`LIKE CONCAT('%', #{customerName}, '%'))
+        <if test="bo.customerName != null and bo.customerName != ''">
+            and customer_id in (select id from custom where `name`LIKE CONCAT('%', #{bo.customerName}, '%'))
         </if>
-        <if test="stageId != null ">
-            and stage_id = #{stageId}
+        <if test="bo.stageId != null ">
+            and stage_id = #{bo.stageId}
         </if>
-        <if test="productId != null ">
-            and id in (select business_id from business_product where product_id = #{productId})
+        <if test="bo.productId != null ">
+            and id in (select business_id from business_product where product_id = #{bo.productId})
         </if>
     </select>
     <select id="selectByIdToInfo" resultType="com.management.platform.entity.BusinessOpportunity">
@@ -235,7 +235,7 @@
                (select `name` from stage where id = stage_id)          stageValue,
                (select custom_name from custom where id = customer_id) customerName,
                (select `name` from contacts where id = contacts_id)    contactsName,
-               (select `name` from `user` where id = contacts_id)      inchargerName,
+               (select `name` from `user` where id = incharger_id)      inchargerName,
                (select `name` from `user` where id = creator_id)       creatorName,
                (SELECT sum(total) from business_product WHERE business_id = id)
         from business_opportunity
@@ -278,6 +278,33 @@
         </if>
         GROUP BY s.id
     </select>
+    <select id="getAllList" resultType="com.management.platform.entity.BusinessOpportunity">
+        select
+        id,
+        name
+        from business_opportunity
+        where company_id = #{companyId}
+        and is_delete = 0
+    </select>
 
+    <select id="getAllList1" resultType="com.management.platform.entity.BusinessOpportunity">
+        select
+        id,
+        name
+        from business_opportunity
+        where company_id = #{companyId}
+        and is_delete = 0
+        and (incharger_id in
+        (SELECT id from `user` WHERE department_id = (SELECT department_id from `user` WHERe id = #{id}))
+        or incharger_id is null)
+    </select>
 
+    <select id="getAllList2" resultType="com.management.platform.entity.BusinessOpportunity">
+        select id,
+               name
+        from business_opportunity
+        where company_id = #{companyId}
+          and is_delete = 0
+          and (incharger_id = #{id} or incharger_id is null)
+    </select>
 </mapper>

+ 29 - 3
fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/ClueMapper.xml

@@ -86,7 +86,7 @@
         </if>
         ORDER BY
         <choose>
-            <when test="isDesc == null or isDesc == ''">
+            <when test="isDesc == null ">
                 c.id DESC
             </when>
             <when test="isDesc == 0">
@@ -160,7 +160,7 @@
         </if>
         ORDER BY
         <choose>
-            <when test="isDesc == null or isDesc == ''">
+            <when test="isDesc == null">
                 c.id DESC
             </when>
             <when test="isDesc == 0">
@@ -232,7 +232,7 @@
         </if>
         ORDER BY
         <choose>
-            <when test="clue.isDesc == null or clue.isDesc == ''">
+            <when test="clue.isDesc == null ">
                 c.id DESC
             </when>
             <when test="clue.isDesc == 0">
@@ -362,5 +362,31 @@
             </foreach>
         </if>
     </select>
+    <select id="getAllList" resultType="com.management.platform.entity.Clue">
+        select id,
+               clue_name
+        from clue
+        where company_id =#{companyId}
+    </select>
+    <select id="getAlllist1" resultType="com.management.platform.entity.Clue">
+        select id,
+               clue_name
+        from clue c
+                 left join sys_dict sd on c.customer_level_id = sd.id
+        where
+            c.company_id = #{companyId} and is_delete = #{isDelete}
+          and (c.incharger_id in
+               (SELECT id from `user` WHERE department_id = (SELECT department_id from `user` WHERe id = #{userId}))
+            or c.incharger_id is null)
+    </select>
+    <select id="getAllList2" resultType="com.management.platform.entity.Clue">
+        select c.id,
+               c.clue_name
+        from clue c
+                 left join sys_dict sd on c.customer_level_id = sd.id
+        where
+            c.company_id = #{companyId} and c.is_delete = #{isDelete}
+          and (c.incharger_id = #{userId} or c.incharger_id is null)
+    </select>
 
 </mapper>

+ 90 - 53
fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/CustomMapper.xml

@@ -43,48 +43,66 @@
         id, company_id, custom_name, custom_source_id, customer_industry_id, customer_level_id, email, owner_id, custom_code, tel_phone, fax, country_billing, province_billing, city_billing, street_billing, country_delivery, province_delivery, city_delivery, street_delivery, create_time, plate1, plate2, plate3, plate4, plate5, creator_id, custom_desc, is_delete, company_phone, incharger_id, address, close_deal
     </sql>
     <select id="getList" resultType="com.management.platform.entity.Custom">
-        select id,
-        custom_name,
-        email,
-        company_phone,
-        create_time,
-        customer_level_id,
+        select
+        c.id,
+        c.contacts_name,
+        c.custom_name,
+        c.email,
+        c.company_phone,
+        c.create_time,
+        c.customer_level_id,
         (select name from sys_dict where customer_level_id = id and code = 'CustomLevel') customerLevelValue,
-        customer_industry_id,
+        c.customer_industry_id,
         (select name from sys_dict where customer_industry_id = id and code = 'CustomIndustry') customerIndustryValue,
-        custom_source_id,
-        (select name from sys_dict where custom_source_id = id and code = 'CustomSources') customSourceValue,
-        incharger_id,
+        c.custom_source_id,
+        (select name from sys_dict where custom_source_id = id) customSourceValue,
+        c.incharger_id,
         (select `name` from `user` where id = incharger_id) inchargerName,
-        creator_id,
+        c.creator_id,
         (select `name` from `user` where id = creator_id) creatorName
-        from custom
-        where company_id = #{companyId}
-          and is_delete =#{isDelete}
+        from custom c
+        left join sys_dict sd on c.customer_level_id = sd.id
+        where c.company_id = #{companyId}
+          and c.is_delete =#{isDelete}
         <if test="inchargerId != null and inchargerId != ''  ">
-            and incharger_id =#{inchargerId}
+            and c.incharger_id =#{inchargerId}
         </if>
         <if test="startTime != null and endTime != null ">
-            and create_time BETWEEN #{startTime} and #{endTime}
+            and c.create_time BETWEEN #{startTime} and #{endTime}
         </if>
         <if test="customName != null and customName != '' ">
-            and custom_name = #{customName}
+            and c.custom_name LIKE CONCAT('%', #{customName}, '%')
         </if>
         <if test="email != null and email != '' ">
-            and email = #{email}
+            and c.email LIKE CONCAT('%', #{email}, '%')
         </if>
         <if test="companyPhone != null ">
-            and company_phone = #{companyPhone}
+            and c.company_phone = #{companyPhone}
         </if>
         <if test="customerLevelId != null ">
-            and customer_level_id = #{customerLevelId}
+            and c.customer_level_id = #{customerLevelId}
         </if>
         <if test="customSourceId != null ">
-            and custom_source_id = #{customSourceId}
+            and c.custom_source_id = #{customSourceId}
         </if>
           <if test="customerIndustryId != null ">
-            and customer_industry_id = #{customerIndustryId}
-        </if>
+            and c.customer_industry_id = #{customerIndustryId}
+        </if>
+        ORDER BY
+        <choose>
+            <when test="isDesc == null ">
+                c.id DESC
+            </when>
+            <when test="isDesc == 0">
+                sd.seq ASC, c.id DESC
+            </when>
+            <when test="isDesc == 1">
+                sd.seq DESC, c.id DESC
+            </when>
+            <otherwise>
+                c.id DESC
+            </otherwise>
+        </choose>
         Limit #{pageIndex},#{pageFrom}
     </select>
     <select id="getTotal" resultType="java.lang.Integer">
@@ -118,51 +136,67 @@
         </if>
     </select>
     <select id="getList1" resultType="com.management.platform.entity.Custom">
-        select id,
-        custom_name,
-        email,
-        company_phone,
-        create_time,
-        customer_level_id,
+        select c.id,
+        c.custom_name,
+        c.email,
+        c.company_phone,
+        c.create_time,
+        c.customer_level_id,
         (select name from sys_dict where customer_level_id = id and code = 'CustomLevel') customerLevelValue,
-        customer_industry_id,
+        c.customer_industry_id,
         (select name from sys_dict where customer_industry_id = id and code = 'CustomIndustry') customerIndustryValue,
-        custom_source_id,
-        (select name from sys_dict where custom_source_id = id and code = 'CustomSources') customSourceValue,
-        incharger_id,
+        c.custom_source_id,
+        (select name from sys_dict where custom_source_id = id ) customSourceValue,
+        c.incharger_id,
         (select `name` from `user` where id = incharger_id) inchargerName,
-        creator_id,
+        c.creator_id,
         (select `name` from `user` where id = creator_id) creatorName
-        from custom
-        where company_id = #{companyId}
-        and is_delete =#{isDelete}
-        and incharger_id in
-        (SELECT id from `user` WHERE department_id = (SELECT department_id from `user` WHERe id = #{userId}))
-        or incharger_id is null
+        from custom c
+        left join sys_dict sd on c.customer_level_id = sd.id
+        where c.company_id = #{companyId}
+        and c.is_delete =#{isDelete}
+        and c.incharger_id in
+        (SELECT id from `user` WHERE department_id = (SELECT department_id from `user` WHERE id = #{userId}))
+        or c.incharger_id is null
         <if test="inchargerId != null and inchargerId != ''  ">
-            and incharger_id =#{inchargerId}
+            and c.incharger_id =#{inchargerId}
         </if>
         <if test="startTime != null and endTime != null ">
-            and create_time BETWEEN #{startTime} and #{endTime}
+            and c.create_time BETWEEN #{startTime} and #{endTime}
         </if>
         <if test="customName != null and customName != '' ">
-            and custom_name = #{customName}
+            and c.custom_name LIKE CONCAT('%', #{customName}, '%')
         </if>
         <if test="email != null and email != '' ">
-            and email = #{email}
+            and c.email LIKE CONCAT('%', #{email}, '%')
         </if>
         <if test="companyPhone != null ">
-            and company_phone = #{companyPhone}
+            and c.company_phone = #{companyPhone}
         </if>
         <if test="customerLevelId != null ">
-            and customer_level_id = #{customerLevelId}
+            and c.customer_level_id = #{customerLevelId}
         </if>
         <if test="customSourceId != null ">
-            and custom_source_id = #{customSourceId}
+            and c.custom_source_id = #{customSourceId}
         </if>
         <if test="customerIndustryId != null ">
-            and customer_industry_id = #{customerIndustryId}
-        </if>
+            and c.customer_industry_id = #{customerIndustryId}
+        </if>
+        ORDER BY
+        <choose>
+            <when test="isDesc == null ">
+                c.id DESC
+            </when>
+            <when test="isDesc == 0">
+                sd.seq ASC, c.id DESC
+            </when>
+            <when test="isDesc == 1">
+                sd.seq DESC, c.id DESC
+            </when>
+            <otherwise>
+                c.id DESC
+            </otherwise>
+        </choose>
         Limit #{pageIndex},#{pageFrom}
     </select>
     <select id="getTotal1" resultType="java.lang.Integer">
@@ -209,7 +243,7 @@
         customer_industry_id,
         (select name from sys_dict where customer_industry_id = id and code = 'CustomIndustry') customerIndustryValue,
         custom_source_id,
-        (select name from sys_dict where custom_source_id = id and code = 'CustomSources') customSourceValue,
+        (select name from sys_dict where custom_source_id = id ) customSourceValue,
         incharger_id,
         (select `name` from `user` where id = incharger_id) inchargerName,
         creator_id,
@@ -226,10 +260,10 @@
             and create_time BETWEEN #{startTime} and #{endTime}
         </if>
         <if test="customName != null and customName != '' ">
-            and custom_name = #{customName}
+            and custom_name LIKE CONCAT('%', #{customName}, '%')
         </if>
         <if test="email != null and email != '' ">
-            and email = #{email}
+            and email LIKE CONCAT('%', #{email}, '%')
         </if>
         <if test="companyPhone != null ">
             and company_phone = #{companyPhone}
@@ -243,6 +277,7 @@
         <if test="customerIndustryId != null ">
             and customer_industry_id = #{customerIndustryId}
         </if>
+        ORDER BY id desc
         Limit #{pageIndex},#{pageFrom}
     </select>
     <select id="getTotal2" resultType="java.lang.Integer">
@@ -280,10 +315,12 @@
     <select id="getInfo" resultType="com.management.platform.entity.Custom">
         select id,
                custom_name,
+               contacts_name,
                custom_source_id,
                customer_industry_id,
                customer_level_id,
                email,
+               tel_phone,
                address,
                custom_code,
                tel_phone,
@@ -299,7 +336,7 @@
                is_delete,
                (select `name` from sys_dict where customer_level_id = id and code = 'CustomLevel') customerLevelValue,
                (select `name` from sys_dict where customer_industry_id = id and code = 'CustomIndustry') customerIndustryValue,
-               (select `name` from sys_dict where custom_source_id = id and code = 'CustomSources') customSourceValue,
+               (select `name` from sys_dict where custom_source_id = id ) customSourceValue,
                (select `name` from `user` where id = incharger_id) inchargerName,
                (select `name` from `user` where id = creator_id) creatorName
         from custom

+ 6 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ReportController.java

@@ -719,6 +719,12 @@ public class ReportController {
                 }else if(fillMonths ==5){
                     //前一天
                     targetDate=curMonth.minusDays(1);
+                }else if(fillMonths ==6){
+                    //前2天
+                    targetDate=curMonth.minusDays(2);
+                }else if(fillMonths ==7){
+                    //前3天
+                    targetDate=curMonth.minusDays(3);
                 }
 
                 DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");

+ 37 - 5
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ReportLogController.java

@@ -3,8 +3,10 @@ package com.management.platform.controller;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.api.R;
 import com.management.platform.entity.*;
 import com.management.platform.mapper.*;
+import com.management.platform.service.ReportLogDetailService;
 import com.management.platform.service.ReportLogService;
 import com.management.platform.service.ReportService;
 import com.management.platform.util.ExcelUtil;
@@ -66,6 +68,8 @@ public class ReportLogController {
     private String path;
     @Resource
     private ReportService reportService;
+    @Resource
+    private ReportLogDetailService reportLogDetailService;
 
     @RequestMapping("/get")
     public HttpRespMsg get(String creatorId, String createDate) {
@@ -233,6 +237,7 @@ public class ReportLogController {
             StringBuilder sb=new StringBuilder();
             List<Report> needUpdateReportList=new ArrayList<>();
             List<ReportLog> needUpdateReportLogList=new ArrayList<>();
+            List<ReportLogDetail> needUpdateReportLogDetailList=new ArrayList<>();
             for (int rowIndex = 0; rowIndex <= rowNum; rowIndex++) {
                 XSSFRow row = sheet.getRow(rowIndex);
                 if (row == null) {
@@ -294,7 +299,7 @@ public class ReportLogController {
                             return msg;
                         }
                         String creatorId = reports.get(0).getCreatorId();
-                        if(!creatorId.equals(reportLog.getOperatorId())){
+                        if(reportLog.getMsg().contains("审核通过了")){
                             reportLog.setOperateDate(auditDateTime);
                             needUpdateReportLogList.add(reportLog);
                         }
@@ -302,6 +307,15 @@ public class ReportLogController {
                         reports.forEach(r->{
                             r.setProjectAuditTime(finalAuditDateTime);
                         });
+                        List<Integer> details = reports.stream().map(Report::getId).distinct().collect(Collectors.toList());
+                        List<ReportLogDetail> reportLogDetails = reportLogDetailService.list(new LambdaQueryWrapper<ReportLogDetail>().in(ReportLogDetail::getReportId, details));
+                        reportLogDetails.forEach(r->{
+//                            if(r.getMsg()!=null&&r.getMsg().contains("审核通过了")&&!r.getOperatorId().equals(creatorId)){
+                            if(r.getMsg()!=null&&r.getMsg().contains("审核通过了")){
+                                r.setOperateDate(finalAuditDateTime);
+                                needUpdateReportLogDetailList.add(r);
+                            }
+                        });
                         needUpdateReportList.addAll(reports);
                     }
                     if(createTimeCellValue!=null&&!StringUtils.isEmpty(createTimeCellValue)){
@@ -312,14 +326,29 @@ public class ReportLogController {
                             return msg;
                         }
                         String creatorId = reports.get(0).getCreatorId();
-                        if(creatorId.equals(reportLog.getOperatorId())){
-                            reportLog.setOperateDate(createTimeTime);
-                            needUpdateReportLogList.add(reportLog);
-                        }
+                        Integer id = reports.get(0).getId();
+                        List<ReportLog> list = reportLogService.list(new LambdaQueryWrapper<ReportLog>().apply("FIND_IN_SET(" + id + ",report_ids)"));
+                        List<ReportLog> reportLogs = list.stream().filter(l -> l.getMsg().contains("提交了")).collect(Collectors.toList());
+                        LocalDateTime finalCreateTimeTime1 = createTimeTime;
+                        reportLogs.forEach(r->{
+                            if(creatorId.equals(r.getOperatorId())){
+                                r.setOperateDate(finalCreateTimeTime1);
+                                needUpdateReportLogList.add(r);
+                            }
+                        });
                         LocalDateTime finalCreateTimeTime = createTimeTime;
                         reports.forEach(r->{
                             r.setCreateTime(finalCreateTimeTime);
                         });
+                        List<Integer> details = reports.stream().map(Report::getId).distinct().collect(Collectors.toList());
+                        List<ReportLogDetail> reportLogDetails = reportLogDetailService.list(new LambdaQueryWrapper<ReportLogDetail>().in(ReportLogDetail::getReportId, details));
+                        reportLogDetails.forEach(r->{
+//                            if(r.getMsg()!=null&&r.getMsg().contains("提交了")&&r.getOperatorId().equals(creatorId)){
+                            if(r.getMsg()!=null&&r.getMsg().contains("提交了")){
+                                r.setOperateDate(finalCreateTimeTime1);
+                                needUpdateReportLogDetailList.add(r);
+                            }
+                        });
                         needUpdateReportList.addAll(reports);
                     }
                 }else {
@@ -336,6 +365,9 @@ public class ReportLogController {
             if(needUpdateReportLogList.size()>0){
                 reportLogService.updateBatchById(needUpdateReportLogList);
             }
+            if(needUpdateReportLogDetailList.size()>0){
+                reportLogDetailService.updateBatchById(needUpdateReportLogDetailList);
+            }
             if(sb.length()>0){
                 msg.setMsg("更新完成,其中编号["+sb.toString()+"]的填报数据不存在");
             }else {

+ 6 - 6
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java

@@ -13277,8 +13277,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         //需要统计的部门
         List<Integer> targetDeptIds=new ArrayList<>();
         targetDeptIds.add(7458);
-        targetDeptIds.add(7459);
-        targetDeptIds.add(7460);
+        targetDeptIds.add(8696);
+        targetDeptIds.add(8695);
         //需要统计的分组名称
         List<String> targetGroupNameList=new ArrayList<>();
         targetGroupNameList.add("生产部电气");
@@ -13309,8 +13309,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         if(user.getCompanyId()==3092){
             List<String> nameString=new ArrayList<>();
             nameString.add("4");
-            nameString.add("12");
-            nameString.add("14");
+            nameString.add("46");
+            nameString.add("45");
             List<Department> departmentList = departmentMapper.selectList(new LambdaQueryWrapper<Department>().eq(Department::getCompanyId, user.getCompanyId()).in(Department::getDepartmentName, nameString));
             List<Integer> theCollect = departmentList.stream().map(dm -> dm.getDepartmentId()).distinct().collect(Collectors.toList());
             theCollect.add(-1);
@@ -13351,7 +13351,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                 String departmentName = department.get().getDepartmentName();
                 List<Integer> subDeptIds;
                 switch (deptId){
-                    case 7459:
+                    case 8696:
                         //获取此部门下的子部门id列表
                         subDeptIds = getBranchDepartment(deptId, allDeptList);
                         groupNames=new ArrayList<>();
@@ -13406,7 +13406,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                             itemList.add(item);
                         }
                         break;
-                    case 7460:
+                    case 8695:
                         //获取此部门下的子部门id列表
                         subDeptIds = getBranchDepartment(deptId, allDeptList);
                         groupNames=new ArrayList<>();

+ 7 - 8
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -5985,28 +5985,27 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                             if (company.getIsInternational() == 1) {
                                 operateDate = operateDate.plusSeconds(offsetSeconds);
                             }
-							
-								
                             String time = dtf.format(operateDate);
                             String msg= "";
 							if (auditMsg != null) {
 								if(needCorpWxTranslate){
 									Optional<User> first = userList.stream().filter(ul -> ul.getId().equals(audit.getOperatorId())).findFirst();
 									if(first.isPresent()){
-										String corpwxUserId = first.get().getCorpwxUserid();
-										if (!StringUtils.isEmpty(corpwxUserId) && auditMsg.contains(corpwxUserId)) {
+                                        User corpwxUser = first.get();
+										String corpwxUserName = corpwxUser.getName();
+										if (!StringUtils.isEmpty(corpwxUserName) && (auditMsg.contains(corpwxUserName))) {
 											if(auditMsg.contains("提交了")){
 												int i = auditMsg.indexOf("提");
 												String substring = auditMsg.substring(0, i);
-												msg = time+" " + auditMsg.replace(substring,"\\$userName="+corpwxUserId+"$\\");
+												msg = time+" " + auditMsg.replace(substring,"$userName="+corpwxUserName+"$");
 											}else if(auditMsg.contains("审核通过了")){
 												int i = auditMsg.indexOf("审");
 												String substring = auditMsg.substring(0, i);
-												msg = time+" " + auditMsg.replace(substring,"\\$userName="+corpwxUserId+"$\\");
+												msg = time+" " + auditMsg.replace(substring,"$userName="+corpwxUserName+"$");
 											}else if(auditMsg.contains("驳回了")) {
 												int i = auditMsg.indexOf("驳");
 												String substring = auditMsg.substring(0, i);
-												msg = time+" " + auditMsg.replace(substring,"\\$userName="+corpwxUserId+"$\\");
+												msg = time+" " + auditMsg.replace(substring,"$userName="+corpwxUserName+"$");
 											}
 										} else {
 											msg = time+" " + auditMsg;
@@ -6037,7 +6036,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                                 }else {
 									msg = time+" " + auditMsg;
 								}
-							} 
+							}
                             if (!isFirst) {
                                 sb.append("->");
                             } else {

+ 11 - 15
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ProjectMapper.xml

@@ -218,6 +218,7 @@
         left join project b on b.id=a.project_id
         left join report c on c.sub_project_id=a.id
         where a.company_id=#{companyId}
+        and c.state = 1
         <if test="startDate != null and endDate != null">
             and c.create_date between #{startDate} and #{endDate}
         </if>
@@ -242,6 +243,7 @@
         left join project b on b.id=a.project_id
         left join report c on c.sub_project_id=a.id
         where a.company_id=#{companyId}
+        and c.state = 1
         <if test="startDate != null and endDate != null">
             and c.create_date between #{startDate} and #{endDate}
         </if>
@@ -1690,24 +1692,18 @@
     </select>
 
     <select id="selectNearProject" resultType="com.management.platform.entity.Project">
-        select * from project
-        where status = 1 and id in (
+        SELECT * FROM project
+        WHERE STATUS = 1 AND id IN (
             SELECT project_id
-            from (
-                     SELECT project_id
-                     FROM (
-                              SELECT DISTINCT *
-                              FROM report
-                              WHERE creator_id = #{userId}
-                              order by create_time
-                                      DESC
-                          ) p1
+            FROM (
+                     SELECT DISTINCT report.project_id
+                     FROM report
+                     WHERE creator_id = #{userId}
                      GROUP BY project_id
-                     order by create_time
-                             DESC
-                         LIMIT 3
+                     ORDER BY MAX(create_time)
+                             DESC LIMIT 3
                  ) p2
-        )
+        ) AND id IN(SELECT project_id FROM participation WHERE user_id=#{userId})
     </select>
 
     <select id="getFTEData" resultType="java.util.Map">

+ 5 - 0
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/ReportController.java

@@ -1657,5 +1657,10 @@ public class ReportController {
     public HttpRespMsg getUserCommentPlanResult(String pptIds){
         return reportService.getUserCommentPlanResult(pptIds);
     }
+
+    @RequestMapping("/deleteDuplicateData")
+    public HttpRespMsg deleteDuplicateData(Integer companyId, String createDate){
+        return reportService.deleteDuplicateData(companyId, createDate);
+    }
 }
 

+ 29 - 20
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/WxCorpInfoController.java

@@ -252,15 +252,22 @@ public class WxCorpInfoController {
                 BigDecimal price=new BigDecimal(0);
                 //初始化 工作时长
                 double workTime=0;
-                //初始话 工作日期
-                JSONArray sp_record = info.getJSONArray("sp_record");
-                //获取最后一个审批节点
-                JSONObject last_sp_record = sp_record.getJSONObject(sp_record.size() - 1);
-                JSONArray details = last_sp_record.getJSONArray("details");
-                //获取最后详情
-                JSONObject lastDetail = details.getJSONObject(details.size() - 1);
-                long sptime = lastDetail.getLongValue("sptime");
-                LocalDate createDate=LocalDate.now();
+//                //初始话 工作日期
+//                JSONArray sp_record = info.getJSONArray("sp_record");
+//                //获取最后一个审批节点
+//                JSONObject last_sp_record = sp_record.getJSONObject(sp_record.size() - 1);
+//                JSONArray details = last_sp_record.getJSONArray("details");
+//                //获取最后详情
+//                JSONObject lastDetail = details.getJSONObject(details.size() - 1);
+//                long sptime = lastDetail.getLongValue("sptime");
+//                LocalDate createDate=LocalDate.now();
+                long apply_time = info.getLongValue("apply_time");
+                LocalDate createDate;
+                if(apply_time>0){
+                    createDate=  DateTimeUtil.getLocalDateFromUnix(apply_time);
+                }else {
+                    createDate  =LocalDate.now();
+                }
                 //初始化工位
                 Integer deptId=0;
                 for (int i1 = 0; i1 < contents.size(); i1++) {
@@ -289,6 +296,12 @@ public class WxCorpInfoController {
                             plan.setTaskName(text);
                         }
                     }
+                    if(title.getJSONObject(0).getString("text").equals("审批编号")){
+                        if(control.equals("Text")||control.equals("Textarea")){
+                            String text = value.getString("text");
+                            plan.setTaskChangeNoticeNum(text);
+                        }
+                    }
                     //先处理多个人员 公用此单据非工时部分内容
                     if(title.getJSONObject(0).getString("text").equals("参与人员")){
                         if(control.equals("Contact")){
@@ -313,12 +326,6 @@ public class WxCorpInfoController {
                             long s_timestamp = date.getLongValue("s_timestamp");
                             LocalDate localDateFromUnix = DateTimeUtil.getLocalDateFromUnix(s_timestamp);
                             plan.setStartDate(localDateFromUnix);
-                            if(sptime>0){
-                                createDate= DateTimeUtil.getLocalDateFromUnix(sptime);
-                            }else {
-                                createDate=localDateFromUnix;
-                            }
-
                         }
                     }
                     if(title.getJSONObject(0).getString("text").equals("结束时间")){
@@ -327,11 +334,6 @@ public class WxCorpInfoController {
                             long s_timestamp = date.getLongValue("s_timestamp");
                             LocalDate localDateFromUnix = DateTimeUtil.getLocalDateFromUnix(s_timestamp);
                             plan.setEndDate(localDateFromUnix);
-                            if(sptime>0){
-                                createDate= DateTimeUtil.getLocalDateFromUnix(sptime);
-                            }else {
-                                createDate=localDateFromUnix;
-                            }
                         }
                     }
                     if(title.getJSONObject(0).getString("text").equals("工作时长")){
@@ -369,6 +371,13 @@ public class WxCorpInfoController {
                             price=new BigDecimal(new_money);
                         }
                     }
+                    if(title.getJSONObject(0).getString("text").contains("结算总额")){
+                        if(control.equals("Formula")){
+                            JSONObject formula = value.getJSONObject("formula");
+                            double formulaDoubleValue = formula.getDoubleValue("value");
+                            plan.setMoneyOfJob(new BigDecimal(formulaDoubleValue));
+                        }
+                    }
                     if(title.getJSONObject(0).getString("text").equals("备注")){
                         if(control.equals("Text")||control.equals("Textarea")){
                             String text = value.getString("text");

+ 6 - 0
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/entity/Plan.java

@@ -279,6 +279,12 @@ public class Plan extends Model<Plan> {
     @JsonFormat( pattern="yyyy-MM-dd")
     private LocalDate realEndDate;
 
+    /**
+     * 结算总金额
+     */
+    @TableField("settlement_amount")
+    private BigDecimal settlementAmount;
+
     @TableField(exist = false)
     private String  steelStampNumber;
 

+ 0 - 118
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/entity/SimpleFinance.java

@@ -1,118 +0,0 @@
-package com.management.platform.entity;
-
-import java.math.BigDecimal;
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.extension.activerecord.Model;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableField;
-import java.io.Serializable;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.experimental.Accessors;
-
-/**
- * <p>
- * 
- * </p>
- *
- * @author Seyason
- * @since 2021-10-22
- */
-@Data
-@EqualsAndHashCode(callSuper = false)
-@Accessors(chain = true)
-public class SimpleFinance extends Model<SimpleFinance> {
-
-    private static final long serialVersionUID=1L;
-
-    /**
-     * 主键
-     */
-    @TableId(value = "id", type = IdType.AUTO)
-    private Integer id;
-
-    /**
-     * 用户姓名
-     */
-    @TableField("name")
-    private String name;
-
-    /**
-     * 公司id
-     */
-    @TableField("company_id")
-    private Integer companyId;
-
-    /**
-     * 工资
-     */
-    @TableField("month_cost")
-    private BigDecimal monthCost;
-
-    /**
-     * 奖金
-     */
-    @TableField("bonus")
-    private BigDecimal bonus;
-
-    /**
-     * 津贴
-     */
-    @TableField("allowance")
-    private BigDecimal allowance;
-
-    /**
-     * 养老保险
-     */
-    @TableField("insurance_old")
-    private BigDecimal insuranceOld;
-
-    /**
-     * 医疗保险
-     */
-    @TableField("insurance_medical")
-    private BigDecimal insuranceMedical;
-
-    /**
-     * 失业保险
-     */
-    @TableField("insurance_losejob")
-    private BigDecimal insuranceLosejob;
-
-    /**
-     * 住房公积金
-     */
-    @TableField("house_fund")
-    private BigDecimal houseFund;
-
-    /**
-     * 其他
-     */
-    @TableField("others")
-    private BigDecimal others;
-
-    /**
-     * 总成本
-     */
-    @TableField("total_cost")
-    private BigDecimal totalCost;
-
-    /**
-     * 年月
-     */
-    @TableField("ymonth")
-    private String ymonth;
-
-    /**
-     * 该月的时薪
-     */
-    @TableField("hour_cost")
-    private BigDecimal hourCost;
-
-
-    @Override
-    protected Serializable pkVal() {
-        return this.id;
-    }
-
-}

+ 0 - 45
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/entity/SimpleProjectime.java

@@ -1,45 +0,0 @@
-package com.management.platform.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.extension.activerecord.Model;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableField;
-import java.io.Serializable;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.experimental.Accessors;
-
-/**
- * <p>
- * 
- * </p>
- *
- * @author Seyason
- * @since 2021-10-22
- */
-@Data
-@EqualsAndHashCode(callSuper = false)
-@Accessors(chain = true)
-public class SimpleProjectime extends Model<SimpleProjectime> {
-
-    private static final long serialVersionUID=1L;
-
-    @TableId(value = "id", type = IdType.AUTO)
-    private Integer id;
-
-    @TableField("simple_id")
-    private Integer simpleId;
-
-    @TableField("project_name")
-    private String projectName;
-
-    @TableField("time_cost")
-    private Double timeCost;
-
-
-    @Override
-    protected Serializable pkVal() {
-        return this.id;
-    }
-
-}

+ 0 - 105
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/entity/SimpleReport.java

@@ -1,105 +0,0 @@
-package com.management.platform.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.extension.activerecord.Model;
-import java.time.LocalDate;
-import com.baomidou.mybatisplus.annotation.TableId;
-import java.time.LocalDateTime;
-import com.baomidou.mybatisplus.annotation.TableField;
-import java.io.Serializable;
-import java.time.format.DateTimeFormatter;
-import java.util.List;
-
-import com.fasterxml.jackson.annotation.JsonFormat;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.experimental.Accessors;
-import org.springframework.format.annotation.DateTimeFormat;
-
-/**
- * <p>
- * 
- * </p>
- *
- * @author Seyason
- * @since 2021-10-22
- */
-@Data
-@EqualsAndHashCode(callSuper = false)
-@Accessors(chain = true)
-public class SimpleReport extends Model<SimpleReport> {
-
-    private static final long serialVersionUID=1L;
-
-    @TableId(value = "id", type = IdType.AUTO)
-    private Integer id;
-
-    /**
-     * 公司id
-     */
-    @TableField("company_id")
-    private Integer companyId;
-
-    /**
-     * 年月
-     */
-    @TableField("ymonth")
-    private String ymonth;
-
-    /**
-     * 日期
-     */
-    @TableField("report_date")
-    @JsonFormat(pattern = "MM/dd")
-    @DateTimeFormat(pattern = "MM/dd")
-    private LocalDate reportDate;
-
-    /**
-     * 姓名
-     */
-    @TableField("username")
-    private String username;
-
-    /**
-     * 工作岗位
-     */
-    @TableField("position")
-    private String position;
-
-    /**
-     * 部门
-     */
-    @TableField("department")
-    private String department;
-
-    /**
-     * 该日累计时长
-     */
-    @TableField("time_cost")
-    private Double timeCost;
-
-    /**
-     * 创建时间
-     */
-    @TableField("indate")
-    private LocalDateTime indate;
-
-    /**
-     * 上传人id
-     */
-    @TableField("creator_id")
-    private String creatorId;
-
-
-    /**
-     * 报告相关的项目时间表
-     */
-    @TableField(exist = false)
-    private List<SimpleProjectime> projectimeList;
-
-    @Override
-    protected Serializable pkVal() {
-        return this.id;
-    }
-
-}

+ 0 - 16
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/mapper/SimpleFinanceMapper.java

@@ -1,16 +0,0 @@
-package com.management.platform.mapper;
-
-import com.management.platform.entity.SimpleFinance;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-
-/**
- * <p>
- *  Mapper 接口
- * </p>
- *
- * @author Seyason
- * @since 2021-10-22
- */
-public interface SimpleFinanceMapper extends BaseMapper<SimpleFinance> {
-
-}

+ 0 - 16
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/mapper/SimpleProjectimeMapper.java

@@ -1,16 +0,0 @@
-package com.management.platform.mapper;
-
-import com.management.platform.entity.SimpleProjectime;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-
-/**
- * <p>
- *  Mapper 接口
- * </p>
- *
- * @author Seyason
- * @since 2021-10-22
- */
-public interface SimpleProjectimeMapper extends BaseMapper<SimpleProjectime> {
-
-}

+ 0 - 16
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/mapper/SimpleReportMapper.java

@@ -1,16 +0,0 @@
-package com.management.platform.mapper;
-
-import com.management.platform.entity.SimpleReport;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-
-/**
- * <p>
- *  Mapper 接口
- * </p>
- *
- * @author Seyason
- * @since 2021-10-22
- */
-public interface SimpleReportMapper extends BaseMapper<SimpleReport> {
-
-}

+ 2 - 0
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/ReportService.java

@@ -166,4 +166,6 @@ public interface ReportService extends IService<Report> {
     HttpRespMsg getPersonWorkHoursWagesDetailForTemp(String date, String userId, String startDate, String endDate);
 
     HttpRespMsg updateHasDeleteTeamData();
+
+    HttpRespMsg deleteDuplicateData(Integer companyId, String createDate);
 }

+ 0 - 16
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/SimpleFinanceService.java

@@ -1,16 +0,0 @@
-package com.management.platform.service;
-
-import com.management.platform.entity.SimpleFinance;
-import com.baomidou.mybatisplus.extension.service.IService;
-
-/**
- * <p>
- *  服务类
- * </p>
- *
- * @author Seyason
- * @since 2021-10-22
- */
-public interface SimpleFinanceService extends IService<SimpleFinance> {
-
-}

+ 0 - 16
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/SimpleProjectimeService.java

@@ -1,16 +0,0 @@
-package com.management.platform.service;
-
-import com.management.platform.entity.SimpleProjectime;
-import com.baomidou.mybatisplus.extension.service.IService;
-
-/**
- * <p>
- *  服务类
- * </p>
- *
- * @author Seyason
- * @since 2021-10-22
- */
-public interface SimpleProjectimeService extends IService<SimpleProjectime> {
-
-}

+ 0 - 29
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/SimpleReportService.java

@@ -1,29 +0,0 @@
-package com.management.platform.service;
-
-import com.management.platform.entity.SimpleReport;
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.management.platform.util.HttpRespMsg;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.servlet.http.HttpServletRequest;
-
-/**
- * <p>
- *  服务类
- * </p>
- *
- * @author Seyason
- * @since 2021-10-22
- */
-public interface SimpleReportService extends IService<SimpleReport> {
-
-    HttpRespMsg getByMonth(Integer companyId, String yearMonth);
-
-    HttpRespMsg importData(Integer companyId, String yearMonth, MultipartFile file, HttpServletRequest request);
-
-    HttpRespMsg exportData(String yearMonth, Integer companyId, String type, HttpServletRequest request);
-
-    HttpRespMsg getTimeCost(String yearMonth, Integer companyId, String type, HttpServletRequest request);
-
-    HttpRespMsg getReportByMonth(Integer companyId, String yearMonth);
-}

+ 14 - 14
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/PlanServiceImpl.java

@@ -351,20 +351,20 @@ public class PlanServiceImpl extends ServiceImpl<PlanMapper, Plan> implements Pl
         List<PlanProcedureTotal> planProcedureTotals=new ArrayList<>();
         List<PlanProcedureTotal> oldPlanProcedureTotals=new ArrayList<>();
         List<ProdProcedure> list;
-        if(plan.getId()==null){
-            list = procedureList.stream().filter(pl -> pl.getVersionNumber().equals(procedureList.get(0).getVersionNumber())).collect(Collectors.toList());
-            if(plan.getProductSchedulingNum()!=null){
-                if(count(new QueryWrapper<Plan>().eq("product_scheduling_num",plan.getProductSchedulingNum()))>0){
-                    msg.setError("当前排产工单号已存在");
-                    return msg;
-                }
+        if(plan.getPlanType()==0&&plan.getProductSchedulingNum()!=null){
+            if(count(new QueryWrapper<Plan>().ne(plan.getId()!=null,"id",plan.getId()).eq("product_scheduling_num",plan.getProductSchedulingNum()).eq("product_order_num",plan.getProductOrderNum()))>0){
+                msg.setError("当前排产工单号["+plan.getProductSchedulingNum()+"]下生产订单号["+plan.getProductOrderNum()+"]已存在");
+                return msg;
             }
-            if(plan.getTaskChangeNoticeNum()!=null){
-                if(count(new QueryWrapper<Plan>().eq("task_change_notice_num",plan.getTaskChangeNoticeNum()))>0){
-                    msg.setError("当前任务变更通知号已存在");
-                    return msg;
-                }
+        }
+        if(plan.getPlanType()==1&&plan.getTaskChangeNoticeNum()!=null){
+            if(count(new QueryWrapper<Plan>().ne(plan.getId()!=null,"id",plan.getId()).eq("task_change_notice_num",plan.getTaskChangeNoticeNum()))>0){
+                msg.setError("当前任务变更通知号已存在");
+                return msg;
             }
+        }
+        if(plan.getId()==null){
+            list = procedureList.stream().filter(pl -> pl.getVersionNumber().equals(procedureList.get(0).getVersionNumber())).collect(Collectors.toList());
             switch (plan.getPlanType()){
                 case 0:
                     plan.setStartDate(LocalDate.now());
@@ -632,11 +632,11 @@ public class PlanServiceImpl extends ServiceImpl<PlanMapper, Plan> implements Pl
                         if(one!=null){
                             plan.setId(one.getId());
                         }
-                        Optional<Plan> first = needInsertList.stream().filter(nl -> nl.getProductSchedulingNum().equals(productSchedulingNumCell.getStringCellValue())).findFirst();
+                        Optional<Plan> first = needInsertList.stream().filter(nl -> nl.getProductSchedulingNum().equals(productSchedulingNumCell.getStringCellValue())&&nl.getProductOrderNum().equals(productOrderNumCell.getStringCellValue())).findFirst();
                         if(first.isPresent()){
                             throw new Exception("重复的排产工单号"+productSchedulingNumCell.getStringCellValue());
                         }
-                        Integer count = planMapper.selectCount(new LambdaQueryWrapper<Plan>().eq(Plan::getProductSchedulingNum, productSchedulingNumCell.getStringCellValue()));
+                        Integer count = planMapper.selectCount(new LambdaQueryWrapper<Plan>().eq(Plan::getProductSchedulingNum, productSchedulingNumCell.getStringCellValue()).eq(Plan::getProductOrderNum,productOrderNumCell.getStringCellValue()));
                         if(count>0){
                             throw new Exception("已存在的排产工单号"+productSchedulingNumCell.getStringCellValue());
                         }

+ 2 - 2
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/ProductServiceImpl.java

@@ -496,8 +496,8 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
                 List<ProdProcedure> prodProcedures = prodProcedureMapper.selectList(new LambdaQueryWrapper<ProdProcedure>().in(ProdProcedure::getProductId, productIds));
                 List<Plan> planList = planService.list(new LambdaQueryWrapper<Plan>().select(Plan::getId).in(Plan::getProductId, productIds));
                 for (Product product : productList) {
-                    List<ProdProcedure> procedureList = prodProcedures.stream().filter(p -> p.getProductId().equals(product.getId())).collect(Collectors.toList());
-                    List<Plan> plans = planList.stream().filter(p -> p.getProductId().equals(product.getId())).collect(Collectors.toList());
+                    List<ProdProcedure> procedureList = prodProcedures.stream().filter(p ->p.getProductId()!=null&& p.getProductId().equals(product.getId())).collect(Collectors.toList());
+                    List<Plan> plans = planList.stream().filter(p ->p.getProductId()!=null&& p.getProductId().equals(product.getId())).collect(Collectors.toList());
                     plans.forEach(p->{
                         p.setProjectName(product.getProjectName());
                         p.setProjectCode(product.getCode());

+ 62 - 2
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -12,6 +12,7 @@ import com.management.platform.entity.vo.*;
 import com.management.platform.mapper.*;
 import com.management.platform.service.*;
 import com.management.platform.util.*;
+import lombok.Synchronized;
 import org.apache.poi.hssf.usermodel.*;
 import org.apache.poi.ss.usermodel.*;
 import org.apache.poi.ss.util.CellRangeAddress;
@@ -146,8 +147,9 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
     //同一个人的重复提交时间,不得超过1秒
     public static volatile HashMap<String, Long>  userSubmitTime = new HashMap();
 
+    @Synchronized
     @Override
-    public synchronized HttpRespMsg submitReport(Report report, HttpServletRequest request) {
+    public HttpRespMsg submitReport(Report report, HttpServletRequest request) {
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         String token = request.getHeader("TOKEN");
         Long nowTime = System.currentTimeMillis();
@@ -209,6 +211,42 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             httpRespMsg.setError("填报的件数超过了剩余可填报件数:"+(plan.getNum() - allFileProcNum)+", 请联系班组长协调解决");
             return httpRespMsg;
         }
+        //检查钢印号是否已经被同工序里面的其他人报过了
+        if (!StringUtils.isEmpty(report.getSteelNumArray())) {
+            JSONArray steelArray = JSONArray.parseArray(report.getSteelNumArray());
+            List<Report> reports = reportMapper.selectList(new QueryWrapper<Report>().eq("plan_id", plan.getId()).eq("prod_procedure_id", report.getProdProcedureId()).ne("creator_id", token));
+            if (reports.size() > 0) {
+                //循环steelArray;
+                String s = "";
+                for (int j=0;j<steelArray.size();j++) {
+                    String oneSteel = steelArray.getString(j);
+                    boolean find = false;
+                    for (int i = 0; i < reports.size(); i++) {
+                        Report oneReport = reports.get(i);
+                        String steelNumArray = oneReport.getSteelNumArray();
+                        JSONArray oneSteelArray = JSONArray.parseArray(steelNumArray);
+                        for (int p=0;p<oneSteelArray.size();p++) {
+                            if (oneSteelArray.getString(p).equals(oneSteel)) {
+                                find = true;
+                                break;
+                            }
+                        }
+                        if (find) {
+                            break;
+                        }
+                    }
+                    if (find) {
+                        s += oneSteel+",";
+                    }
+                }
+                if (s.length() > 0) {
+                    s = s.substring(0, s.length()-1);
+                    httpRespMsg.setError("钢印号["+s+"]已经被其他人报工, 请选择其他钢印号填报。");
+                    return httpRespMsg;
+                }
+            }
+        }
+
         Integer num = plan.getNum();//总件数
         double addPercent = report.getFinishNum() / num;
         //新版计算报工的工时和价钱;根据填报件数的占比计算工时和价钱
@@ -4341,8 +4379,11 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
         List<LeaveSheet> leaveSheetList = leaveSheetService.list(new LambdaQueryWrapper<LeaveSheet>().le(LeaveSheet::getStartDate, endDate).ge(LeaveSheet::getEndDate, startDate).eq(LeaveSheet::getOwnerId,userId));
         HttpRespMsg httpRespMsg=new HttpRespMsg();
         HashMap map=new HashMap();
+        List<Map<String,Object>> mapList=reportMapper.getPersonWorkHoursWagesDetailForMob(date,userId,user.getCompanyId(),startDate,endDate,checkStatus,detailStatus);
+        map.put("record",mapList);
+        map.put("totalWorkingTime",mapList.stream().filter(i->i.get("working_time")!=null).mapToDouble(mt->Double.valueOf(String.valueOf(mt.get("working_time")))).sum());
+        map.put("totalCost",mapList.stream().filter(i->i.get("cost")!=null).mapToDouble(mt->Double.valueOf(String.valueOf(mt.get("cost")))).sum());
         if(checkStatus!=null && detailStatus==null){
-            List<Map<String,Object>> mapList=reportMapper.getPersonWorkHoursWagesDetailForMob(date,userId,user.getCompanyId(),startDate,endDate,checkStatus,detailStatus);
             DateTimeFormatter dtf=DateTimeFormatter.ofPattern("yyyy-MM-dd");
             DateTimeFormatter dtf1=DateTimeFormatter.ofPattern("yyyyMMdd");
             List<LocalDate> allDateList = getDays(LocalDate.parse(startDate, dtf), LocalDate.parse(endDate, dtf));
@@ -6248,4 +6289,23 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
         reportService.updateBatchById(reportList);
         return msg;
     }
+
+    @Override
+    public HttpRespMsg deleteDuplicateData(Integer companyId, String createDate) {
+        List<Report> dataList = reportMapper.selectList(new QueryWrapper<Report>().eq("create_date", createDate).eq("company_id", companyId).isNotNull("user_procedure_team_id").groupBy("creator_id,user_procedure_team_id").having("count(1) > 1"));
+        HttpRespMsg msg = new HttpRespMsg();
+        if (dataList.size() == 0) {
+            System.out.println(createDate+"无重复报工");
+        }
+        for (Report report : dataList) {
+            List<Report> duplicateData = reportMapper.selectList(new QueryWrapper<Report>().eq("create_date", createDate).eq("company_id", companyId).eq("creator_id", report.getCreatorId()).eq("user_procedure_team_id", report.getUserProcedureTeamId()));
+            System.out.println("找到重复数据,共"+duplicateData.size());
+            if (duplicateData.size() > 1) {
+                for (int i=1; i<duplicateData.size(); i++) {
+                    reportMapper.deleteById(duplicateData.get(i).getId());
+                }
+            }
+        }
+        return msg;
+    }
 }

+ 0 - 20
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/SimpleFinanceServiceImpl.java

@@ -1,20 +0,0 @@
-package com.management.platform.service.impl;
-
-import com.management.platform.entity.SimpleFinance;
-import com.management.platform.mapper.SimpleFinanceMapper;
-import com.management.platform.service.SimpleFinanceService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.springframework.stereotype.Service;
-
-/**
- * <p>
- *  服务实现类
- * </p>
- *
- * @author Seyason
- * @since 2021-10-22
- */
-@Service
-public class SimpleFinanceServiceImpl extends ServiceImpl<SimpleFinanceMapper, SimpleFinance> implements SimpleFinanceService {
-
-}

+ 0 - 20
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/SimpleProjectimeServiceImpl.java

@@ -1,20 +0,0 @@
-package com.management.platform.service.impl;
-
-import com.management.platform.entity.SimpleProjectime;
-import com.management.platform.mapper.SimpleProjectimeMapper;
-import com.management.platform.service.SimpleProjectimeService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.springframework.stereotype.Service;
-
-/**
- * <p>
- *  服务实现类
- * </p>
- *
- * @author Seyason
- * @since 2021-10-22
- */
-@Service
-public class SimpleProjectimeServiceImpl extends ServiceImpl<SimpleProjectimeMapper, SimpleProjectime> implements SimpleProjectimeService {
-
-}

+ 0 - 591
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/SimpleReportServiceImpl.java

@@ -1,591 +0,0 @@
-package com.management.platform.service.impl;
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.management.platform.entity.*;
-import com.management.platform.mapper.*;
-import com.management.platform.service.ExcelExportService;
-import com.management.platform.service.SimpleFinanceService;
-import com.management.platform.service.SimpleProjectimeService;
-import com.management.platform.service.SimpleReportService;
-import com.management.platform.util.ExcelUtil;
-import com.management.platform.util.HttpRespMsg;
-import com.management.platform.util.MessageUtils;
-import org.apache.log4j.LogManager;
-import org.apache.log4j.Logger;
-import org.apache.poi.EncryptedDocumentException;
-import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
-import org.apache.poi.ss.usermodel.CellType;
-import org.apache.poi.xssf.usermodel.XSSFCell;
-import org.apache.poi.xssf.usermodel.XSSFRow;
-import org.apache.poi.xssf.usermodel.XSSFSheet;
-import org.apache.poi.xssf.usermodel.XSSFWorkbook;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.util.StringUtils;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
-import java.io.*;
-import java.math.BigDecimal;
-import java.text.DecimalFormat;
-import java.text.SimpleDateFormat;
-import java.time.LocalDate;
-import java.time.LocalDateTime;
-import java.time.format.DateTimeFormatter;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-/**
- * <p>
- *  服务实现类
- * </p>
- *
- * @author Seyason
- * @since 2021-10-22
- */
-@Service
-@Transactional
-public class SimpleReportServiceImpl extends ServiceImpl<SimpleReportMapper, SimpleReport> implements SimpleReportService {
-    Logger logger = LogManager.getLogger(org.apache.logging.log4j.LogManager.ROOT_LOGGER_NAME);
-    @Resource
-    SimpleFinanceService simpleFinanceService;
-    @Resource
-    SimpleFinanceMapper simpleFinanceMapper;
-    @Resource
-    SimpleReportMapper simpleReportMapper;
-    @Resource
-    SimpleReportService simpleReportService;
-    @Resource
-    SimpleProjectimeMapper simpleProjectimeMapper;
-    @Resource
-    SimpleProjectimeService simpleProjectimeService;
-    @Resource
-    ExcelExportService excelExportService;
-    @Resource
-    UserMapper userMapper;
-    @Resource
-    WxCorpInfoMapper wxCorpInfoMapper;
-    @Value(value = "${upload.path}")
-    private String path;
-
-    @Override
-    public HttpRespMsg getByMonth(Integer companyId, String yearMonth) {
-        HttpRespMsg msg = new HttpRespMsg();
-        List<SimpleFinance> financeList = simpleFinanceMapper.selectList(new QueryWrapper<SimpleFinance>().eq("company_id", companyId).eq("ymonth", yearMonth));
-        msg.data = financeList;
-        return msg;
-    }
-
-    @Override
-    public HttpRespMsg importData(Integer companyId, String yearMonth, MultipartFile multipartFile, HttpServletRequest request) {
-        HttpRespMsg msg = new HttpRespMsg();
-        String token = request.getHeader("TOKEN");
-        //然后处理文件
-        String fileName = multipartFile.getOriginalFilename();
-        File file = new File(fileName == null ? "file" : fileName);
-        InputStream inputStream = null;
-        OutputStream outputStream = null;
-        try {
-            inputStream = multipartFile.getInputStream();
-            outputStream = new FileOutputStream(file);
-            byte[] buffer = new byte[4096];
-            int temp = 0;
-            while ((temp = inputStream.read(buffer, 0, 4096)) != -1) {
-                outputStream.write(buffer, 0, temp);
-            }
-            inputStream.close();
-            outputStream.close();
-            //然后解析表格
-            XSSFWorkbook workbook = new XSSFWorkbook(file);
-
-            //第二个表是员工薪资表
-
-            if (workbook.getNumberOfSheets() < 2) {
-                //msg.setError("表格格式不正确,需要月度工时和月薪薪资两个sheet="+workbook.getNumberOfSheets());
-                msg.setError(MessageUtils.message("report.typeErrorByHourAndSalary",workbook.getNumberOfSheets()));
-            } else {
-                //导入员工薪资表
-                XSSFSheet sheet = workbook.getSheetAt(1);
-                List<SimpleFinance> financeList = new ArrayList<SimpleFinance>();
-
-                //获取月成本列表
-                DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
-                String dateStr = yearMonth+"-01 00:00:00";
-                LocalDateTime startDate = LocalDateTime.parse(dateStr,df);
-                LocalDateTime endDate = LocalDateTime.parse(dateStr,df);
-                endDate = endDate.plusMonths(1);
-
-                SimpleDateFormat sdf = new SimpleDateFormat("yyyy/M/d");
-
-                //需要更新成本的人员数据
-                List<User> updateUserList = new ArrayList<>();
-                LocalDate now = LocalDate.now();
-                String startStr = yearMonth + "-01";
-                String endStr = yearMonth + "-31";
-                //获取人员该月份填写的日报的总时长
-                List<Map<String, Object>> userTimeList = null;
-
-                //由于第一行需要指明列对应的标题
-                int rowNum = sheet.getLastRowNum();
-                for (int rowIndex = 0; rowIndex <= rowNum; rowIndex++) {
-
-                    XSSFRow row = sheet.getRow(rowIndex);
-                    if (row == null) {
-                        continue;
-                    }
-                    if (ExcelUtil.isRowEmpty(row)) {
-                        continue;
-                    }
-                    //姓名	工资	奖金	津贴	养老保险	医疗保险	失业保险	住房公积金	其他
-                    XSSFCell nameCell = row.getCell(0);
-                    XSSFCell salaryCell = row.getCell(1);
-                    XSSFCell bonusCell = row.getCell(2);
-                    XSSFCell allowanceCell = row.getCell(3);
-                    XSSFCell inOldCell = row.getCell(4);
-                    XSSFCell inMedicalCell = row.getCell(5);
-                    XSSFCell inJobCell = row.getCell(6);
-                    XSSFCell houseFundCell = row.getCell(7);
-                    XSSFCell otherCell = row.getCell(8);
-
-
-                    nameCell.setCellType(CellType.STRING);
-                    salaryCell.setCellType(CellType.STRING);
-                    bonusCell.setCellType(CellType.STRING);
-                    allowanceCell.setCellType(CellType.STRING);
-                    inOldCell.setCellType(CellType.STRING);
-                    inMedicalCell.setCellType(CellType.STRING);
-                    inJobCell.setCellType(CellType.STRING);
-                    houseFundCell.setCellType(CellType.STRING);
-                    if (otherCell != null)otherCell.setCellType(CellType.STRING);
-
-                    String name = nameCell.getStringCellValue().trim().replaceAll("\\u00a0", "");
-                    SimpleFinance finance = new SimpleFinance();
-                    if ((name.equals("姓名") || name.equals("name")) && rowIndex == 0) {
-                        //跳过第一行标题
-                        continue;
-                    }
-                    finance.setCompanyId(companyId);
-                    finance.setName(name);
-
-                    BigDecimal total = new BigDecimal(0);
-                    if (salaryCell != null) {
-                        salaryCell.setCellType(CellType.STRING);
-                        String item = salaryCell.getStringCellValue();
-                        BigDecimal value = item != null ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
-                        finance.setMonthCost(value);
-                        total = total.add(value);
-                    }
-
-                    if (bonusCell != null) {
-                        bonusCell.setCellType(CellType.STRING);
-                        String bonusString = bonusCell.getStringCellValue();
-                        BigDecimal bonus = bonusString != null ? new BigDecimal(bonusString.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
-                        finance.setBonus(bonus);
-                        total = total.add(bonus);
-                    }
-                    if (allowanceCell != null) {
-                        allowanceCell.setCellType(CellType.STRING);
-                        String item = allowanceCell.getStringCellValue();
-                        BigDecimal value = item != null ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
-                        finance.setAllowance(value);
-                        total = total.add(value);
-                    }
-                    if (inJobCell != null) {
-                        inJobCell.setCellType(CellType.STRING);
-                        String item = inJobCell.getStringCellValue();
-                        BigDecimal value = item != null ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
-                        finance.setInsuranceLosejob(value);
-                        total = total.add(value);
-                    }
-                    if (inMedicalCell != null) {
-                        inMedicalCell.setCellType(CellType.STRING);
-                        String item = inMedicalCell.getStringCellValue();
-                        BigDecimal value = item != null ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
-                        finance.setInsuranceMedical(value);
-                        total = total.add(value);
-                    }
-                    if (inOldCell != null) {
-                        inOldCell.setCellType(CellType.STRING);
-                        String item = inOldCell.getStringCellValue();
-                        BigDecimal value = item != null ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
-                        finance.setInsuranceOld(value);
-                        total = total.add(value);
-                    }
-                    if (houseFundCell != null) {
-                        houseFundCell.setCellType(CellType.STRING);
-                        String item = houseFundCell.getStringCellValue();
-                        BigDecimal value = item != null ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
-                        finance.setHouseFund(value);
-                        total = total.add(value);
-                    }
-                    if (otherCell != null) {
-                        otherCell.setCellType(CellType.STRING);
-                        String item = otherCell.getStringCellValue();
-                        BigDecimal value = item != null ? new BigDecimal(item.trim().replaceAll("\\u00a0", "")) : BigDecimal.valueOf(0);
-                        finance.setOthers(value);
-                        total = total.add(value);
-                    }
-                    finance.setTotalCost(total);
-
-                    finance.setYmonth(yearMonth);
-                    financeList.add(finance);
-                }
-
-                //获取日报列表
-                sheet = workbook.getSheetAt(0);
-                //由于第一行需要指明列对应的标题
-                rowNum = sheet.getLastRowNum();
-                List<String> projectList = new ArrayList<>();
-                List<SimpleReport> reportList = new ArrayList<>();
-                int projectNameStartIndex = 4;
-                for (int rowIndex = 0; rowIndex <= rowNum; rowIndex++) {
-                    XSSFRow row = sheet.getRow(rowIndex);
-                    if (row == null) {
-                        continue;
-                    }
-                    if (ExcelUtil.isRowEmpty(row)) {
-                        continue;
-                    }
-                    if (rowIndex == 0) {
-                        //第一行是标题,获取项目名称
-                        int pIndex = projectNameStartIndex;
-                        while(pIndex < row.getLastCellNum() && row.getCell(pIndex).getCellTypeEnum() != CellType._NONE &&  row.getCell(pIndex).getCellTypeEnum() != CellType.BLANK) {
-                            row.getCell(pIndex).setCellType(CellType.STRING);
-                            String stringCellValue = row.getCell(pIndex).getStringCellValue();
-                            projectList.add(stringCellValue);
-                            pIndex++;
-                        }
-                    } else {
-                        //数据行
-                        for (int i=1;i<4+projectList.size(); i++) {
-                            row.getCell(i).setCellType(CellType.STRING);
-                        }
-                        String reportDate = sdf.format(row.getCell(0).getDateCellValue());
-                        String username = row.getCell(1).getStringCellValue();
-                        String position = row.getCell(2).getStringCellValue();
-                        String department = row.getCell(3).getStringCellValue();
-                        List<SimpleProjectime> timeCostList = new ArrayList<SimpleProjectime>();
-                        double totalTime = 0;
-                        for (int i=4; i < 4 + projectList.size(); i++) {
-                            String stringCellValue = row.getCell(i).getStringCellValue();
-                            double time = 0;
-                            if (!StringUtils.isEmpty(stringCellValue)) {
-                                time = Double.parseDouble(stringCellValue);
-                                totalTime += time;
-                                SimpleProjectime item = new SimpleProjectime();
-                                item.setProjectName(projectList.get(i-4));
-                                item.setTimeCost(time);
-                                timeCostList.add(item);
-                            }
-                        }
-                        SimpleReport report = new SimpleReport();
-                        report.setYmonth(yearMonth);
-                        report.setUsername(username);
-                        report.setCreatorId(token);
-                        report.setCompanyId(companyId);
-                        report.setDepartment(department);
-                        report.setPosition(position);
-                        report.setReportDate(LocalDate.parse(reportDate, DateTimeFormatter.ofPattern("yyyy/M/d")));
-                        report.setTimeCost(totalTime);
-                        //设置相关的项目时间表
-                        report.setProjectimeList(timeCostList);
-                        //添加到报告列表
-                        reportList.add(report);
-                    }
-                }
-                String[] notFoundNames = reportList.stream().filter(r->{
-                    return !financeList.stream().filter(f->f.getName().equals(r.getUsername())).findAny().isPresent();
-                }).map(SimpleReport::getUsername).collect(Collectors.toList()).toArray(new String[0]);
-                if (notFoundNames.length > 0) {
-                    //msg.setError(convertNameArray(notFoundNames)+" 不存在于薪资表中,请检查后提交");
-                    msg.setError(MessageUtils.message("report.noExist",convertNameArray(notFoundNames)));
-                } else {
-//                    notFoundNames = financeList.stream().filter(r->{
-//                        return !reportList.stream().filter(f->f.getUsername().equals(r.getName())).findAny().isPresent();
-//                    }).map(SimpleFinance::getName).collect(Collectors.toList()).toArray(new String[0]);
-//                    if (notFoundNames.length > 0) {
-//                        msg.setError(convertNameArray(notFoundNames)+" 不存在于工时表中,请检查后提交");
-//                    } else {
-//
-//                    }
-                    //每个人的总工时不能为零
-                    String[] names = reportList.stream().filter(r->r.getTimeCost() == 0).map(SimpleReport::getUsername).collect(Collectors.toList()).toArray(new String[0]);
-                    if (names.length > 0) {
-                        //msg.setError(convertNameArray(names)+" 工时为零,请检查");
-                        msg.setError(MessageUtils.message("report.hoursZero",convertNameArray(names)));
-                    } else {
-                        //人员检查通过,更新finance表中的时薪,方便后续计算
-                        financeList.forEach(f->{
-                            double userTotalTime = reportList.stream().filter(r->r.getUsername().equals(f.getName())).mapToDouble(SimpleReport::getTimeCost).sum();
-                            if (userTotalTime > 0) {
-                                f.setHourCost(f.getTotalCost().divide(new BigDecimal(userTotalTime), 2, BigDecimal.ROUND_UP));
-                            }
-                        });
-
-                        //批量插入
-                        simpleFinanceService.remove(new QueryWrapper<SimpleFinance>().eq("company_id", companyId).eq("ymonth", yearMonth));
-                        simpleFinanceService.saveBatch(financeList);
-                        //插入工时报告表,先删除旧数据
-                        QueryWrapper<SimpleReport> queryWrapper = new QueryWrapper<SimpleReport>().eq("company_id", companyId).eq("ymonth", yearMonth);
-                        simpleReportMapper.delete(queryWrapper);
-                        simpleReportService.saveBatch(reportList);
-                        //再查询出来,进行项目工时存储
-                        List<SimpleReport> queryList = simpleReportMapper.selectList(queryWrapper);
-                        System.out.println("queryList size=="+queryList.size());
-                        List<SimpleProjectime> allTimeList = new ArrayList<>();
-                        reportList.forEach(r->{
-                            Integer id = queryList.stream().filter(q -> q.getUsername().equals(r.getUsername())).findFirst().get().getId();
-                            List<SimpleProjectime> timeList = r.getProjectimeList();
-                            timeList.forEach(t->t.setSimpleId(id));
-                            allTimeList.addAll(timeList);
-                        });
-                        simpleProjectimeService.saveBatch(allTimeList);
-                    }
-                }
-
-            }
-        } catch (IOException e) {
-            e.printStackTrace();
-            //msg.setError("文件处理出错");
-            msg.setError(MessageUtils.message("file.error"));
-            return msg;
-        } catch (NullPointerException e) {
-            e.printStackTrace();
-            //msg.setError("数据格式有误或存在空数据 导入失败");
-            msg.setError(MessageUtils.message("file.dataFormatError"));
-            return msg;
-        }catch (InvalidFormatException e) {
-            e.printStackTrace();
-            //msg.setError("文件格式错误,如果安装了加密软件需要先解密再上传");
-            msg.setError(MessageUtils.message("file.FormatErrorAndDecrypt"));
-            return msg;
-        }catch (EncryptedDocumentException e) {
-            e.printStackTrace();
-            //msg.setError("文件加密状态,需要先解除加密状态再上传");
-            msg.setError(MessageUtils.message("file.encryption"));
-            return msg;
-        } catch (Exception e) {
-            e.printStackTrace();
-            //msg.setError("发生其他错误");
-            msg.setError(MessageUtils.message("other.error"));
-            return msg;
-        } finally {
-            //关闭流
-            try {
-                if (outputStream != null && inputStream != null) {
-                    outputStream.close();
-                    inputStream.close();
-                    System.out.println("流已关闭");
-                }
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-//            file.deleteOnExit();//程序退出时删除临时文件
-            System.out.println(file.delete());
-        }
-        return msg;
-    }
-
-    @Override
-    public HttpRespMsg exportData(String yearMonth, Integer companyId, String type, HttpServletRequest request) {
-        HttpRespMsg timeCost = getTimeCost(yearMonth, companyId, type, request);
-        WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
-        HashMap map = (HashMap)timeCost.data;
-        List<HashMap> costList = (List<HashMap>)map.get("costList");
-        List<List<String>> dataList = new ArrayList<>();
-        List<String> titleList = new ArrayList<>();
-        if ("按项目".equals(type)) {
-            //titleList.add("项目");
-            titleList.add(MessageUtils.message("entry.project"));
-        } else if ("按岗位".equals(type)) {
-            //titleList.add("岗位");
-            titleList.add(MessageUtils.message("excel.post"));
-        } else {
-            //titleList.add("部门");
-            titleList.add(MessageUtils.message("excel.department"));
-        }
-        //titleList.add("工时(h)");
-        titleList.add(MessageUtils.message("entry.workHours")+"(h)");
-        //titleList.add("成本(元)");
-        titleList.add(MessageUtils.message("entry.cost")+"(元)");
-        dataList.add(titleList);
-        //数据
-        double time = 0;
-        BigDecimal cost = new BigDecimal(0);
-        DecimalFormat df = new DecimalFormat("#0.0");
-
-        for (HashMap item : costList) {
-            List<String> data = new ArrayList<>();
-            data.add((String)item.get("name"));
-            data.add(df.format((Double)item.get("workingTime")));
-            time += (double)item.get("workingTime");
-            BigDecimal costItem = (BigDecimal)item.get("cost");
-            costItem.setScale(2, BigDecimal.ROUND_HALF_UP);
-            data.add(costItem.toString());
-            cost = cost.add(costItem);
-            dataList.add(data);
-        }
-        //合计
-        List<String> sumRow = new ArrayList<String>();
-        //sumRow.add("合计");
-        sumRow.add(MessageUtils.message("entry.total"));
-
-        sumRow.add(df.format(time));
-        cost.setScale(2, BigDecimal.ROUND_HALF_UP);
-        sumRow.add(cost.toString());
-
-        dataList.add(sumRow);
-        //生成excel文件导出
-        String fileName = yearMonth+"_"+type+MessageUtils.message("report.report")+"_"+System.currentTimeMillis();
-        try {
-            return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName , dataList, path);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        HttpRespMsg httpRespMsg = new HttpRespMsg();
-        return  httpRespMsg;
-    }
-
-    @Override
-    public HttpRespMsg getTimeCost(String yearMonth, Integer companyId, String type, HttpServletRequest request) {
-        HttpRespMsg msg = new HttpRespMsg();
-        List<SimpleReport> list = simpleReportService.list(new QueryWrapper<SimpleReport>().eq("company_id", companyId).eq("ymonth", yearMonth));
-        if (list.size() == 0) {
-            HashMap map = new HashMap();
-            map.put("costList", new ArrayList<>());
-            map.put("totalMoneyCost", 0);
-            msg.data = map;
-            return msg;
-        }
-        List<Integer> collect = list.stream().map(SimpleReport::getId).collect(Collectors.toList());
-        List<SimpleProjectime> projectimeList = simpleProjectimeMapper.selectList(new QueryWrapper<SimpleProjectime>().in("simple_id", collect));
-        List<String> projectList = projectimeList.stream().map(SimpleProjectime::getProjectName).distinct().collect(Collectors.toList());
-        for (SimpleReport simpleReport : list) {
-            simpleReport.setProjectimeList(projectimeList.stream().filter(p->p.getSimpleId().equals(simpleReport.getId())).collect(Collectors.toList()));
-        }
-        BigDecimal totalMoneyCost = new BigDecimal(0);
-        //按项目核算工时和成本
-        List<SimpleFinance> financeList = simpleFinanceMapper.selectList(new QueryWrapper<SimpleFinance>().eq("company_id", companyId).eq("ymonth", yearMonth));
-
-        int i=1;
-        List<HashMap> resultList = new ArrayList<>();
-        if ("按项目".equals(type)) {
-            //按项目分组
-            for (String name : projectList) {
-                HashMap<String, Object> item = new HashMap<>();
-                item.put("id", i);
-                item.put("name", name);
-                //工时
-                double workingTime = projectimeList.stream().filter(p->p.getProjectName().equals(name)).mapToDouble(SimpleProjectime::getTimeCost).sum();
-                item.put("workingTime", workingTime);
-                //成本
-                BigDecimal totalCost = new BigDecimal(0);
-                for (SimpleProjectime p : projectimeList) {
-                    if (p.getProjectName().equals(name)) {
-                        String username = list.stream().filter(report -> report.getId().equals(p.getSimpleId())).findFirst().get().getUsername();
-                        BigDecimal hourCost = financeList.stream().filter(f -> f.getName().equals(username)).findFirst().get().getHourCost();
-                        BigDecimal result = hourCost.multiply(new BigDecimal(p.getTimeCost()));
-                        totalCost = totalCost.add(result);
-                    }
-                }
-                item.put("cost", totalCost);
-                totalMoneyCost = totalMoneyCost.add(totalCost);
-                i++;
-                resultList.add(item);
-            }
-        } else if ("按岗位".equals(type)) {
-            //按岗位
-            List<String> posList = list.stream().map(SimpleReport::getPosition).distinct().collect(Collectors.toList());
-            for (String pos:posList) {
-                HashMap<String, Object> item = new HashMap<>();
-                item.put("id", i);
-                item.put("name", pos);
-                //工时
-                double workingTime = list.stream().filter(r->r.getPosition().equals(pos)).mapToDouble(SimpleReport::getTimeCost).sum();
-                item.put("workingTime", workingTime);
-                BigDecimal totalCost = new BigDecimal(0);
-                for (SimpleReport r : list) {
-                    if (r.getPosition().equals(pos)) {
-                        String username = r.getUsername();
-                        BigDecimal hourCost = financeList.stream().filter(f -> f.getName().equals(username)).findFirst().get().getHourCost();
-                        BigDecimal result = hourCost.multiply(new BigDecimal(r.getTimeCost()));
-                        totalCost = totalCost.add(result);
-                    }
-                }
-                item.put("cost", totalCost);
-                totalMoneyCost = totalMoneyCost.add(totalCost);
-                i++;
-                resultList.add(item);
-            }
-        } else {
-            //按部门
-            //按岗位
-            List<String> deptList = list.stream().map(SimpleReport::getDepartment).distinct().collect(Collectors.toList());
-            for (String dept:deptList) {
-                HashMap<String, Object> item = new HashMap<>();
-                item.put("id", i);
-                item.put("name", dept);
-                //工时
-                double workingTime = list.stream().filter(r->r.getDepartment().equals(dept)).mapToDouble(SimpleReport::getTimeCost).sum();
-                item.put("workingTime", workingTime);
-                BigDecimal totalCost = new BigDecimal(0);
-                for (SimpleReport r : list) {
-                    if (r.getDepartment().equals(dept)) {
-                        String username = r.getUsername();
-                        BigDecimal hourCost = financeList.stream().filter(f -> f.getName().equals(username)).findFirst().get().getHourCost();
-                        BigDecimal result = hourCost.multiply(new BigDecimal(r.getTimeCost()));
-                        totalCost = totalCost.add(result);
-                    }
-                }
-                item.put("cost", totalCost);
-                totalMoneyCost = totalMoneyCost.add(totalCost);
-                i++;
-                resultList.add(item);
-            }
-        }
-
-        HashMap map = new HashMap();
-        map.put("costList", resultList);
-        map.put("totalMoneyCost", totalMoneyCost);
-        msg.data = map;
-        return msg;
-    }
-
-    @Override
-    public HttpRespMsg getReportByMonth(Integer companyId, String yearMonth) {
-        List<SimpleReport> list = simpleReportService.list(new QueryWrapper<SimpleReport>().eq("company_id", companyId).eq("ymonth", yearMonth));
-        List<String> projectList = new ArrayList<>();
-        if (list.size() > 0) {
-            List<Integer> collect = list.stream().map(SimpleReport::getId).collect(Collectors.toList());
-            List<SimpleProjectime> projectimeList = simpleProjectimeMapper.selectList(new QueryWrapper<SimpleProjectime>().in("simple_id", collect));
-            projectList = projectimeList.stream().map(SimpleProjectime::getProjectName).distinct().collect(Collectors.toList());
-            for (SimpleReport simpleReport : list) {
-                simpleReport.setProjectimeList(projectimeList.stream().filter(p->p.getSimpleId().equals(simpleReport.getId())).collect(Collectors.toList()));
-            }
-        }
-
-        HashMap map = new HashMap();
-        map.put("records", list);
-        map.put("projectList", projectList);
-        HttpRespMsg msg = new HttpRespMsg();
-        msg.data = map;
-        return msg;
-    }
-
-    String convertNameArray(String[] data) {
-        String s = "";
-        for (int i=0;i<data.length; i++) {
-            s += data[i];
-            if (i < data.length-1) {
-                s += ",";
-            }
-        }
-        return s;
-    }
-}

+ 27 - 19
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/task/TimingTask.java

@@ -395,14 +395,20 @@ public class TimingTask {
                 //初始化 工作时长
                 double workTime=0;
                 //初始话 工作日期
-                JSONArray sp_record = info.getJSONArray("sp_record");
-                //获取最后一个审批节点
-                JSONObject last_sp_record = sp_record.getJSONObject(sp_record.size() - 1);
-                JSONArray details = last_sp_record.getJSONArray("details");
-                //获取最后详情
-                JSONObject lastDetail = details.getJSONObject(details.size() - 1);
-                long sptime = lastDetail.getLongValue("sptime");
-                LocalDate createDate=LocalDate.now();
+//                JSONArray sp_record = info.getJSONArray("sp_record");
+//                //获取最后一个审批节点
+//                JSONObject last_sp_record = sp_record.getJSONObject(sp_record.size() - 1);
+//                JSONArray details = last_sp_record.getJSONArray("details");
+//                //获取最后详情
+//                JSONObject lastDetail = details.getJSONObject(details.size() - 1);
+//                long sptime = lastDetail.getLongValue("sptime");
+                long apply_time = info.getLongValue("apply_time");
+                LocalDate createDate;
+                if(apply_time>0){
+                    createDate=  DateTimeUtil.getLocalDateFromUnix(apply_time);
+                }else {
+                    createDate  =LocalDate.now();
+                }
                 //初始化工位
                 Integer deptId=0;
                 for (int i1 = 0; i1 < contents.size(); i1++) {
@@ -431,6 +437,12 @@ public class TimingTask {
                             plan.setTaskName(text);
                         }
                     }
+                    if(title.getJSONObject(0).getString("text").equals("审批编号")){
+                        if(control.equals("Text")||control.equals("Textarea")){
+                            String text = value.getString("text");
+                            plan.setTaskChangeNoticeNum(text);
+                        }
+                    }
                     //先处理多个人员 公用此单据非工时部分内容
                     if(title.getJSONObject(0).getString("text").equals("参与人员")){
                         if(control.equals("Contact")){
@@ -455,12 +467,6 @@ public class TimingTask {
                             long s_timestamp = date.getLongValue("s_timestamp");
                             LocalDate localDateFromUnix = DateTimeUtil.getLocalDateFromUnix(s_timestamp);
                             plan.setStartDate(localDateFromUnix);
-                            if(sptime>0){
-                                createDate= DateTimeUtil.getLocalDateFromUnix(sptime);
-                            }else {
-                                createDate=localDateFromUnix;
-                            }
-
                         }
                     }
                     if(title.getJSONObject(0).getString("text").equals("结束时间")){
@@ -469,11 +475,6 @@ public class TimingTask {
                             long s_timestamp = date.getLongValue("s_timestamp");
                             LocalDate localDateFromUnix = DateTimeUtil.getLocalDateFromUnix(s_timestamp);
                             plan.setEndDate(localDateFromUnix);
-                            if(sptime>0){
-                                createDate= DateTimeUtil.getLocalDateFromUnix(sptime);
-                            }else {
-                                createDate=localDateFromUnix;
-                            }
                         }
                     }
                     if(title.getJSONObject(0).getString("text").equals("工作时长")){
@@ -511,6 +512,13 @@ public class TimingTask {
                             price=new BigDecimal(new_money);
                         }
                     }
+                    if(title.getJSONObject(0).getString("text").contains("结算总额")){
+                        if(control.equals("Formula")){
+                            JSONObject formula = value.getJSONObject("formula");
+                            double formulaDoubleValue = formula.getDoubleValue("value");
+                            plan.setMoneyOfJob(new BigDecimal(formulaDoubleValue));
+                        }
+                    }
                     if(title.getJSONObject(0).getString("text").equals("备注")){
                         if(control.equals("Text")||control.equals("Textarea")){
                             String text = value.getString("text");

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 2 - 1
fhKeeper/formulahousekeeper/management-workshop/src/main/resources/mapper/PlanMapper.xml


+ 0 - 28
fhKeeper/formulahousekeeper/management-workshop/src/main/resources/mapper/SimpleFinanceMapper.xml

@@ -1,28 +0,0 @@
-<?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.management.platform.mapper.SimpleFinanceMapper">
-
-    <!-- 通用查询映射结果 -->
-    <resultMap id="BaseResultMap" type="com.management.platform.entity.SimpleFinance">
-        <id column="id" property="id" />
-        <result column="name" property="name" />
-        <result column="company_id" property="companyId" />
-        <result column="month_cost" property="monthCost" />
-        <result column="bonus" property="bonus" />
-        <result column="allowance" property="allowance" />
-        <result column="insurance_old" property="insuranceOld" />
-        <result column="insurance_medical" property="insuranceMedical" />
-        <result column="insurance_losejob" property="insuranceLosejob" />
-        <result column="house_fund" property="houseFund" />
-        <result column="others" property="others" />
-        <result column="total_cost" property="totalCost" />
-        <result column="ymonth" property="ymonth" />
-        <result column="hour_cost" property="hourCost" />
-    </resultMap>
-
-    <!-- 通用查询结果列 -->
-    <sql id="Base_Column_List">
-        id, name, company_id, month_cost, bonus, allowance, insurance_old, insurance_medical, insurance_losejob, house_fund, others, total_cost, ymonth, hour_cost
-    </sql>
-
-</mapper>

+ 0 - 18
fhKeeper/formulahousekeeper/management-workshop/src/main/resources/mapper/SimpleProjectimeMapper.xml

@@ -1,18 +0,0 @@
-<?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.management.platform.mapper.SimpleProjectimeMapper">
-
-    <!-- 通用查询映射结果 -->
-    <resultMap id="BaseResultMap" type="com.management.platform.entity.SimpleProjectime">
-        <id column="id" property="id" />
-        <result column="simple_id" property="simpleId" />
-        <result column="project_name" property="projectName" />
-        <result column="time_cost" property="timeCost" />
-    </resultMap>
-
-    <!-- 通用查询结果列 -->
-    <sql id="Base_Column_List">
-        id, simple_id, project_name, time_cost
-    </sql>
-
-</mapper>

+ 0 - 24
fhKeeper/formulahousekeeper/management-workshop/src/main/resources/mapper/SimpleReportMapper.xml

@@ -1,24 +0,0 @@
-<?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.management.platform.mapper.SimpleReportMapper">
-
-    <!-- 通用查询映射结果 -->
-    <resultMap id="BaseResultMap" type="com.management.platform.entity.SimpleReport">
-        <id column="id" property="id" />
-        <result column="company_id" property="companyId" />
-        <result column="ymonth" property="ymonth" />
-        <result column="report_date" property="reportDate" />
-        <result column="username" property="username" />
-        <result column="position" property="position" />
-        <result column="department" property="department" />
-        <result column="time_cost" property="timeCost" />
-        <result column="indate" property="indate" />
-        <result column="creator_id" property="creatorId" />
-    </resultMap>
-
-    <!-- 通用查询结果列 -->
-    <sql id="Base_Column_List">
-        id, company_id, ymonth, report_date, username, position, department, time_cost, indate, creator_id
-    </sql>
-
-</mapper>

BIN=BIN
fhKeeper/formulahousekeeper/management-workshop/workshop_print.2024-06-24.log.gz


+ 1 - 1
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/statisticsView/statisticsDetail.vue

@@ -84,7 +84,7 @@ export default {
         detailStatus:0,
         userId:this.userId,
       };
-      this.$axios.post("/report/getPersonWorkHoursWagesDetail", postData)
+      this.$axios.post("/report/getPersonWorkHoursWagesDetailForMob", postData)
         .then(res => {
           this.saving = false;
             if(res.code == "ok") {

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/workView/fillReport.vue

@@ -230,7 +230,7 @@ export default {
           if (res.code == "ok") {
             this.$toast.success('提交成功')
           } else {
-            this.$toast.fail(res.msg);
+            this.$toast.fail({ message: res.msg, duration: 5000});
           }
         }).catch(err => { this.$toast.clear(); });
     },

+ 12 - 2
fhKeeper/formulahousekeeper/timesheet-workshop/src/views/plan/orderInsert.vue

@@ -131,9 +131,10 @@
           </el-form-item>
           <el-form-item label="计划工时" prop="planWorkHour">
             <div style="display: flex;">
-              <el-input v-model="todayPlanForm.planWorkHour" type="number" placeholder="请输入" style="flex: 1;"
+              <el-input v-model="todayPlanForm.planWorkHour" type="number" placeholder="请输入" style="width: 100px"
                 maxlength="5"></el-input>
               <div style="margin-left: 10px;">分钟</div>
+              <div style="margin-left: 10px;">{{ hourNum }} 小时</div>
             </div>
           </el-form-item>
           <el-form-item label="单价" prop="moneyOfJob">
@@ -167,6 +168,9 @@
               value-format="yyyy-MM-dd">
             </el-date-picker>
           </el-form-item>
+          <el-form-item label="结算总额(元)" prop="settlementAmount">
+            <el-input v-model="todayPlanForm.settlementAmount"></el-input>
+          </el-form-item>
           <el-form-item label="描述" style="width: 100%">
             <el-input type="textarea" :rows="6" placeholder="请输入描述" v-model="todayPlanForm.describtion" maxlength="200">
             </el-input>
@@ -370,7 +374,13 @@ export default {
       }
     };
   },
-  computed: {},
+  computed: {
+    hourNum() {
+      let hour = Math.floor((this.todayPlanForm.planWorkHour || 0) / 60);
+      let xiaos = (this.todayPlanForm.planWorkHour || 0) % 60
+      return `${hour}.${xiaos}`
+    }
+  },
   watch: {},
   mounted() {
     this.getDepartmentList(),

+ 5 - 3
fhKeeper/formulahousekeeper/timesheet/src/i18n/en.json

@@ -176,7 +176,7 @@
   "textLink": {
     "fillInTheWork": "Fill out the daily",
     "fillInAWeek": "Fill in week",
-    "helpToFillIn": "Fill in the daily newspaper",
+    "helpToFillIn": "Fill in the daily report",
     "batchFillIn": "Fill in bulk",
     "workHoursImport": "Work hours import",
     "exportWork": "Export daily",
@@ -984,8 +984,10 @@
   "donlimit": "not limited",
   "lastlastmonth": "Can be filled up to the previous month",
   "lastmonth": "Can be filled up to last month",
-  "newspaperwithin": "Daily newspapers can be filled within 7 days",
-  "previousdaydaily": "You can fill in the daily newspaper 1 day before",
+  "newspaperwithin": "Daily report can be filled within 7 days",
+  "previousdaydaily": "Can fill in the daily report 1 day before",
+  "previous2daydaily": "Can fill in the daily report 2 days before",
+  "previous3daydaily": "Can fill in the daily report 3 days before",
   "afternoonworkinghours": "Please enter the working hours in the afternoon",
   "dayworkinghours": "Please select full working hours",
   "morningworkinghours": "Please enter the working hours in the morning",

+ 2 - 0
fhKeeper/formulahousekeeper/timesheet/src/i18n/zh.json

@@ -990,6 +990,8 @@
   "lastlastmonth": "可补填到上上月",
   "newspaperwithin": "可补填7天内日报",
   "previousdaydaily": "可补填前1天日报",
+  "previous2daydaily": "可补填前2天日报",
+  "previous3daydaily": "可补填前3天日报",
   "dayworkinghours": "请选择全天工作时长",
   "morningworkinghours": "请输入上午工作时长",
   "afternoonworkinghours": "请输入下午工作时长",

+ 2 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/financeAudit/financeAudit.vue

@@ -94,7 +94,8 @@ export default {
                 path: '/cost',
                 query: {
                     startDate: item.reportYrmnth,
-                    endDate: item.reportYrmnth
+                    endDate: item.reportYrmnth,
+                    financeAudit: 1
                 }
             })
         },

+ 2 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/project/cost.vue

@@ -1469,7 +1469,8 @@
                 }
                 this.exportParam.dateRange = this.dateRange;
             }
-            if(this.$route.query && this.$route.query.endDate && this.$route.query.startDate) {
+            console.log(this.$route, '<==== 当前的数据')
+            if(this.$route.query && this.$route.query.endDate && this.$route.query.startDate && this.$route.query.financeAudit) {
                 const { endDate, startDate } = this.$route.query
                 const lastDay = this.dayjs(`${endDate}-01`).endOf('month').format('YYYY-MM-DD');
                 this.dateRange = [startDate+'-01', lastDay];

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/settings/timetype.vue

@@ -810,7 +810,7 @@
                     dayList:['01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30'],
                     hourList:['00','01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23']
                 },
-                monthTimeList:[{id:0, name:this.$t('donlimit')},{id:1, name:this.$t('canbefilled')},{id:2, name:this.$t('lastmonth')},{id:3, name:this.$t('lastlastmonth')},{id:4, name:this.$t('newspaperwithin')},{id:5, name:this.$t('previousdaydaily')}],
+                monthTimeList:[{id:0, name:this.$t('donlimit')},{id:1, name:this.$t('canbefilled')},{id:2, name:this.$t('lastmonth')},{id:3, name:this.$t('lastlastmonth')},{id:4, name:this.$t('newspaperwithin')},{id:5, name:this.$t('previousdaydaily')},{id:6, name:this.$t('previous2daydaily')},{id:7, name:this.$t('previous3daydaily')}],
                 progress:30,
                 startTime:null,
                 endTime:null,

+ 15 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -1383,7 +1383,7 @@
                 <el-scrollbar style="height:100%">
                 <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id" v-loading="deptMembDataLoading"
                     ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
-                    highlight-current :filter-node-method="filterNode">
+                    highlight-current :filter-node-method="filterNode" :default-expand-all="expandAlltree">
                     <span class="custom-tree-node" slot-scope="{ node }">
                         <span v-if="user.userNameNeedTranslate == '1'">
                             <span v-if="node.data.children">
@@ -8757,6 +8757,9 @@
                         this.deptMembDataLoading = false
                         const userListName = res.data.records.map(item => item.name)
                         this.handleThreeData(userListName)
+                        setTimeout(() => {
+                            this.changeTreeNodeStatus(this.$refs.chooseMembTree.store.root)
+                        }, 200)
                     }else{
                         this.deptMembDataLoading = false
                         this.$message({
@@ -8772,6 +8775,17 @@
                     })
                 })
             },
+            changeTreeNodeStatus(node) {
+                console.log(node)
+                let allZt = true
+                node.expanded = allZt
+                for (let i = 0; i < node.childNodes.length; i++) {
+                    node.childNodes[i].expanded = allZt
+                    if (node.childNodes[i].childNodes.length > 0) {
+                        this.changeTreeNodeStatus(node.childNodes[i])
+                    }
+                }
+            },
             // 按周填报获取相关任务
             async getWeeklyTaskList(item) {
                 console.log(item, '<=== 数据')