浏览代码

Merge remote-tracking branch 'origin/master'

ysm 11 月之前
父节点
当前提交
8c9cc27717
共有 35 个文件被更改,包括 689 次插入592 次删除
  1. 19 61
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/analysis/index.vue
  2. 19 28
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/corpreport/api.ts
  3. 20 29
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/corpreport/index.vue
  4. 2 2
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/login.vue
  5. 0 5
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/product/component/attachment.vue
  6. 2 2
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/product/index.vue
  7. 1 1
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/product/type.d.ts
  8. 5 0
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/team/api.ts
  9. 184 22
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/team/index.vue
  10. 15 13
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/team/module/AddPersonnelModal.vue
  11. 2 2
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/thread/index.vue
  12. 10 11
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/ProductController.java
  13. 36 7
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/SalesOrderController.java
  14. 68 9
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/ProductServiceImpl.java
  15. 6 3
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/SalesOrderServiceImpl.java
  16. 1 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/ReportMapper.java
  17. 2 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java
  18. 2 1
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ReportMapper.xml
  19. 13 0
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/ProdProcedureController.java
  20. 7 2
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/ReportController.java
  21. 102 0
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/WxCorpInfoController.java
  22. 2 0
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/mapper/ReportMapper.java
  23. 2 0
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/ProdProcedureService.java
  24. 2 1
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/ReportService.java
  25. 100 0
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/ProdProcedureServiceImpl.java
  26. 27 6
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java
  27. 1 0
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/WxCorpInfoServiceImpl.java
  28. 1 1
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/task/TimingTask.java
  29. 0 44
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/util/CodeUtil.java
  30. 0 153
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/util/FileUtil.java
  31. 0 150
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/util/ZipUtils.java
  32. 33 33
      fhKeeper/formulahousekeeper/management-workshop/src/main/resources/mapper/ReportMapper.xml
  33. 2 1
      fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/planView/todayPlan/distribution.vue
  34. 1 1
      fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/statisticsView/statisticsView.vue
  35. 2 2
      fhKeeper/formulahousekeeper/timesheet_h5/vue.config.js

+ 19 - 61
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/analysis/index.vue

@@ -56,18 +56,18 @@ type PromptType = {
 };
 
 const bulletinPrompt = reactive<PromptType>({
-  permission: undefined,
-  date: undefined,
+  permission: 0,
+  date: 0,
   sliceDate: [new Date(), new Date()]
 });
 const summaryPrompt = reactive<PromptType>({
-  permission: undefined,
-  date: undefined,
+  permission: 0,
+  date: 0,
   sliceDate: [new Date(), new Date()]
 });
 const stagePrompt = reactive<PromptType>({
-  permission: undefined,
-  date: undefined,
+  permission: 0,
+  date: 0,
   sliceDate: [new Date(), new Date()]
 });
 
@@ -155,12 +155,7 @@ watchEffect(() => {
 });
 
 watchEffect(() => {
-  console.log(
-    bulletinPrompt.date,
-    '-----',
-    bulletinPrompt.sliceDate,
-    '88888888---watchEffect'
-  );
+  console.log(bulletinPrompt.date, '-----', bulletinPrompt.sliceDate, '88888888---watchEffect');
 });
 </script>
 
@@ -170,7 +165,6 @@ watchEffect(() => {
       <div class="flex gap-3 mb-4">
         <div class="w-40">
           <el-select
-            clearable
             size="small"
             :model-value="bulletinPrompt.permission"
             @change="(value) => (bulletinPrompt.permission = value)"
@@ -184,16 +178,11 @@ watchEffect(() => {
         </div>
         <div class="w-40">
           <el-select
-            clearable
             size="small"
             :model-value="bulletinPrompt.date"
             @change="(value) => (bulletinPrompt.date = value)"
           >
-            <el-option
-              v-for="date in dateOptions"
-              :label="date.label"
-              :value="date.value"
-            />
+            <el-option v-for="date in dateOptions" :label="date.label" :value="date.value" />
             <el-option label="自定义" value="ignore">
               <div class="flex gap-2 w-80">
                 <el-date-picker
@@ -233,14 +222,8 @@ watchEffect(() => {
           <TrendCard
             title="新增商机"
             unit="个"
-            :number="
-              requestData?.bulletin?.businessOpportunity
-                .businessOpportunityCount
-            "
-            :compare="
-              requestData?.bulletin?.businessOpportunity
-                .businessOpportunityPromote
-            "
+            :number="requestData?.bulletin?.businessOpportunity.businessOpportunityCount"
+            :compare="requestData?.bulletin?.businessOpportunity.businessOpportunityPromote"
           />
           <TrendCard
             title="新增销售订单"
@@ -252,21 +235,13 @@ watchEffect(() => {
             title="销售订单金额"
             unit="元"
             :number="requestData?.bulletin?.salesOrdersPrice.salesOrdersPrice"
-            :compare="
-              requestData?.bulletin?.salesOrdersPrice.salesOrderPricePromote
-            "
+            :compare="requestData?.bulletin?.salesOrdersPrice.salesOrderPricePromote"
           />
           <TrendCard
             title="商机金额"
             unit="元"
-            :number="
-              requestData?.bulletin?.businessOpportunityPrice
-                .businessOpportunityPrice
-            "
-            :compare="
-              requestData?.bulletin?.businessOpportunityPrice
-                .businessOpportunityPromote
-            "
+            :number="requestData?.bulletin?.businessOpportunityPrice.businessOpportunityPrice"
+            :compare="requestData?.bulletin?.businessOpportunityPrice.businessOpportunityPromote"
           />
           <TrendCard
             title="新增线索"
@@ -301,11 +276,7 @@ watchEffect(() => {
                 :model-value="summaryPrompt.date"
                 @change="(value) => (summaryPrompt.date = value)"
               >
-                <el-option
-                  v-for="date in dateOptions"
-                  :label="date.label"
-                  :value="date.value"
-                />
+                <el-option v-for="date in dateOptions" :label="date.label" :value="date.value" />
                 <el-option label="自定义" value="ignore">
                   <div class="flex gap-2 w-80">
                     <el-date-picker
@@ -341,31 +312,22 @@ watchEffect(() => {
             <SimpleCard
               title="新增商机"
               unit="个"
-              :number="
-                requestData.summary?.businessOpportunityDataSummary.newNum
-              "
+              :number="requestData.summary?.businessOpportunityDataSummary.newNum"
             />
             <SimpleCard
               title="赢单商机"
               unit="个"
-              :number="
-                requestData.summary?.businessOpportunityDataSummary.winning
-              "
+              :number="requestData.summary?.businessOpportunityDataSummary.winning"
             />
             <SimpleCard
               title="输单商机"
               unit="个"
-              :number="
-                requestData.summary?.businessOpportunityDataSummary.losting
-              "
+              :number="requestData.summary?.businessOpportunityDataSummary.losting"
             />
             <SimpleCard
               title="商机总金额"
               unit="元"
-              :number="
-                requestData.summary?.businessOpportunityDataSummary
-                  .allAmountOfMoney
-              "
+              :number="requestData.summary?.businessOpportunityDataSummary.allAmountOfMoney"
             />
           </div>
           <Divider title="线索汇总" />
@@ -406,11 +368,7 @@ watchEffect(() => {
                 :model-value="stagePrompt.date"
                 @change="(value) => (stagePrompt.date = value)"
               >
-                <el-option
-                  v-for="date in dateOptions"
-                  :label="date.label"
-                  :value="date.value"
-                />
+                <el-option v-for="date in dateOptions" :label="date.label" :value="date.value" />
                 <el-option label="自定义" value="ignore">
                   <div class="flex gap-2 w-80">
                     <el-date-picker

+ 19 - 28
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/corpreport/api.ts

@@ -4,7 +4,7 @@ import { dayjs } from 'element-plus';
 export type RequestProps = {
   startDate?: string;
   endDate?: string;
-  type?: 0 | 1;
+  exportType?: 0 | 1;
   userId?: number;
   departmentId?: number;
 };
@@ -25,14 +25,9 @@ export async function getStaffData(): Promise<any> {
   return await get('/user/getSimpleActiveUserList');
 }
 
-export async function exportFile(
-  payload: RequestProps,
-  type: number
-): Promise<any> {
+export async function exportFile(payload: RequestProps, type: number): Promise<any> {
   return await post(
-    type === 0
-      ? '/report/exportCustomerTotalCount'
-      : '/report/exportCustomerTransferRate',
+    type === 0 ? '/report/exportCustomerTotalCount' : '/report/exportCustomerTransferRate',
     payload
   );
 }
@@ -40,46 +35,42 @@ export async function exportFile(
 export const dateCollections = [
   {
     name: '当日',
-    start_time: dayjs().startOf('date').toISOString(),
-    end_time: dayjs().endOf('date').toISOString()
+    start_time: dayjs().startOf('date').format('YYYY-MM-DD HH:mm:ss'),
+    end_time: dayjs().endOf('date').format('YYYY-MM-DD HH:mm:ss')
   },
   {
     name: '昨日',
-    start_time: dayjs().startOf('date').subtract(1, 'day').toISOString(),
-    end_time: dayjs().endOf('date').subtract(1, 'day').toISOString()
+    start_time: dayjs().startOf('date').subtract(1, 'day').format('YYYY-MM-DD HH:mm:ss'),
+    end_time: dayjs().endOf('date').subtract(1, 'day').format('YYYY-MM-DD HH:mm:ss')
   },
   {
     name: '本周',
-    start_time: dayjs().startOf('week').add(1, 'day').toISOString(),
-    end_time: dayjs().endOf('week').add(1, 'day').toISOString()
+    start_time: dayjs().startOf('week').add(1, 'day').format('YYYY-MM-DD HH:mm:ss'),
+    end_time: dayjs().endOf('week').add(1, 'day').format('YYYY-MM-DD HH:mm:ss')
   },
   {
     name: '上周',
-    start_time: dayjs()
-      .add(-1, 'week')
-      .startOf('week')
-      .add(1, 'day')
-      .toISOString(),
-    end_time: dayjs().add(-1, 'week').endOf('week').add(1, 'day').toISOString()
+    start_time: dayjs().add(-1, 'week').startOf('week').add(1, 'day').format('YYYY-MM-DD HH:mm:ss'),
+    end_time: dayjs().add(-1, 'week').endOf('week').add(1, 'day').format('YYYY-MM-DD HH:mm:ss')
   },
   {
     name: '本月',
-    start_time: dayjs().startOf('month').toISOString(),
-    end_time: dayjs().endOf('month').toISOString()
+    start_time: dayjs().startOf('month').format('YYYY-MM-DD HH:mm:ss'),
+    end_time: dayjs().endOf('month').format('YYYY-MM-DD HH:mm:ss')
   },
   {
     name: '上月',
-    start_time: dayjs().add(-1, 'month').startOf('month').toISOString(),
-    end_time: dayjs().add(-1, 'month').endOf('month').toISOString()
+    start_time: dayjs().add(-1, 'month').startOf('month').format('YYYY-MM-DD HH:mm:ss'),
+    end_time: dayjs().add(-1, 'month').endOf('month').format('YYYY-MM-DD HH:mm:ss')
   },
   {
     name: '本季度',
-    start_time: dayjs().month(0).toISOString(),
-    end_time: dayjs().month(2).endOf('month').toISOString()
+    start_time: dayjs().month(0).format('YYYY-MM-DD HH:mm:ss'),
+    end_time: dayjs().month(2).endOf('month').format('YYYY-MM-DD HH:mm:ss')
   },
   {
     name: '上季度',
-    start_time: dayjs().add(-1, 'year').month(9).toISOString(),
-    end_time: dayjs().add(-1, 'year').month(11).endOf('month').toISOString()
+    start_time: dayjs().add(-1, 'year').month(9).format('YYYY-MM-DD HH:mm:ss'),
+    end_time: dayjs().add(-1, 'year').month(11).endOf('month').format('YYYY-MM-DD HH:mm:ss')
   }
 ];

+ 20 - 29
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/corpreport/index.vue

@@ -16,7 +16,7 @@ import { downloadFile } from '@/utils/tools';
 
 const isLoading = ref(false);
 const dataSource = ref([]);
-const form = reactive({ type: undefined, date: undefined, member: undefined });
+const form = reactive({ type: 1, date: undefined, member: undefined });
 const memberOptions = ref([]);
 // 0 客户总量  1 客户转化率
 const dataType = ref<0 | 1>(0);
@@ -49,7 +49,7 @@ const onSubmit = async (isExport?: boolean) => {
   const payload = {
     startDate: form.date && dateCollections[form.date - 1].start_time,
     endDate: form.date && dateCollections[form.date - 1].end_time,
-    type: form.type,
+    exportType: form.type,
     userId: form.type === 1 ? form.member : undefined,
     departmentId: form.type === 1 ? undefined : form.member
   } as RequestProps;
@@ -70,10 +70,10 @@ const queryOverall = async (payload?: RequestProps) => {
   isLoading.value = false;
 
   dataSource.value = data.map((d) => ({
-    name: d.name,
     dealRate: d.dealRate * 100,
     customerDeal: d.customerDeal,
-    customertotal: d.customertotal
+    customertotal: d.customertotal,
+    name: form.type === 1 ? d.name : d.departmentName
   }));
 
   // @ts-ignore
@@ -85,7 +85,7 @@ const queryOverall = async (payload?: RequestProps) => {
   chartOptions.dataset.dimensions = ['name', '成交客户数', '新增客户数'];
   // @ts-ignore
   chartOptions.dataset.source = data.map((d) => ({
-    name: d.name,
+    name: form.type === 1 ? d.name : d.departmentName,
     ['成交客户数']: d.customerDeal,
     ['新增客户数']: d.customertotal
   }));
@@ -93,12 +93,13 @@ const queryOverall = async (payload?: RequestProps) => {
 };
 
 const queryConversion = async (payload?: RequestProps) => {
+  console.log(payload, '--------');
   isLoading.value = true;
   const { data = [] } = await getConversionData(payload);
   isLoading.value = false;
 
   dataSource.value = data.map((d) => ({
-    name: d.name,
+    name: form.type === 1 ? d.name : d.departmentName,
     dealRate: d.dealRate * 100
   }));
 
@@ -108,19 +109,18 @@ const queryConversion = async (payload?: RequestProps) => {
   chartOptions.dataset.dimensions = ['name', '客户转化率(%)'];
   // @ts-ignore
   chartOptions.dataset.source = data.map((d) => ({
-    name: d.name,
+    name: form.type === 1 ? d.name : d.departmentName,
     ['客户转化率(%)']: d.dealRate * 100
   }));
   chartOptions.legend = undefined;
 };
 
 watchEffect(() => {
-  dataType.value === 0 ? queryOverall() : queryConversion();
+  dataType.value === 0 ? queryOverall({ exportType: 1 }) : queryConversion({ exportType: 1 });
 });
 
 watchEffect(async () => {
-  const { data = [] } =
-    form.type === 1 ? await getStaffData() : await getDepartmentData();
+  const { data = [] } = form.type === 1 ? await getStaffData() : await getDepartmentData();
 
   memberOptions.value = data.map((d) => ({
     name: form.type === 1 ? d.name : d.departmentName,
@@ -144,11 +144,7 @@ watchEffect(async () => {
           </el-select>
         </el-form-item>
         <el-form-item class="w-28">
-          <el-select
-            clearable
-            v-model="form.type"
-            @change="form.member = undefined"
-          >
+          <el-select v-model="form.type" @change="form.member = undefined">
             <el-option label="按部门" :value="0" />
             <el-option label="按员工" :value="1" />
           </el-select>
@@ -168,13 +164,12 @@ watchEffect(async () => {
           </el-select>
         </el-form-item>
         <el-form-item>
-          <el-button
-            type="primary"
-            :loading="isLoading"
-            @click="onSubmit(false)"
-            >搜索</el-button
-          >
-          <el-button type="primary" @click="onSubmit(true)">导出</el-button>
+          <!-- :loading="isLoading" -->
+
+          <div class="flex gap-1">
+            <el-button type="primary" @click="onSubmit(false)">搜索</el-button>
+            <el-button type="primary" @click="onSubmit(true)">导出</el-button>
+          </div>
         </el-form-item>
       </el-form>
 
@@ -185,7 +180,7 @@ watchEffect(async () => {
           () => {
             form.date = undefined;
             form.member = undefined;
-            form.type = undefined;
+            form.type = 1;
             dataSource = [];
           }
         "
@@ -198,12 +193,8 @@ watchEffect(async () => {
       <Echarts :option="chartOptions"></Echarts>
     </div>
     <el-table :data="dataSource">
-      <el-table-column prop="name" label="员工姓名" />
-      <el-table-column
-        prop="dealRate"
-        label="客户转化率(%)"
-        v-if="dataType === 1"
-      />
+      <el-table-column prop="name" label="名称" />
+      <el-table-column prop="dealRate" label="客户转化率(%)" v-if="dataType === 1" />
       <template v-else>
         <el-table-column prop="customertotal" label="新增客户数" />
         <el-table-column prop="customerDeal" label="成交客户数" />

+ 2 - 2
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/login.vue

@@ -7,11 +7,11 @@
       <h2 class="text-xl text-center pt-4 font-bold">客户管家</h2>
       <el-form class="pt-4" ref="ruleFormRef" :model="ruleForm" :rules="rules">
         <el-form-item prop="username">
-          <el-input clearable :prefix-icon="UserFilled" size="large" class="mt-2" v-model="ruleForm.username"
+          <el-input clearable :prefix-icon="UserFilled" size="large" class="mt-2" v-model.trim="ruleForm.username"
             autocomplete="off" placeholder="账号/手机号" />
         </el-form-item>
         <el-form-item prop="password">
-          <el-input clearable :prefix-icon="Lock" show-password size="large" class="mt-4" v-model="ruleForm.password"
+          <el-input clearable :prefix-icon="Lock" show-password size="large" class="mt-4" v-model.trim="ruleForm.password"
             autocomplete="off" placeholder="密码" />
         </el-form-item>
         <div class="pt-4">

+ 0 - 5
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/product/component/attachment.vue

@@ -20,7 +20,6 @@
                 <el-table-column label="操作" width="180" fixed="right">
                     <template #default="scope">
                         <el-button link type="primary" size="large" @click="fileDownload(scope.row)">下载</el-button>
-                        <el-button link type="primary" size="large" @click="fileDownload2(scope.row)">下载2</el-button>
                         <el-button link type="primary" size="large" @click="showVisible(scope.row)">重命名</el-button>
                         <el-button link type="danger" size="large" @click="deteleFile(scope.row)">删除</el-button>
                     </template>
@@ -79,10 +78,6 @@ function fileDownload(item: any) {
     downloadFile(item.url, `${removeSuffix(item.attachmentName, item.attachmentSuffix)}${item.attachmentSuffix}`)
 }
 
-function fileDownload2(item: any) {
-    downloadFile(item.serverName, `${removeSuffix(item.attachmentName, item.attachmentSuffix)}${item.attachmentSuffix}`)
-}
-
 function removeSuffix(str: string, suffix: string) {
     if (str.endsWith(suffix)) {
         return str.slice(0, -suffix.length);

+ 2 - 2
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/product/index.vue

@@ -11,7 +11,7 @@
               <el-input v-model="filterProductForm.productName" clearable placeholder="请输入"></el-input>
             </el-form-item>
             <el-form-item label="产品类别">
-              <el-select v-model="filterProductForm.type" placeholder="请选择" clearable filterable>
+              <el-select v-model="filterProductForm.productType" placeholder="请选择" clearable filterable>
                 <el-option v-for="item in fixedData.ProductType" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
@@ -157,7 +157,7 @@ const filterProductForm = reactive<filterProductFormType>({ // 筛选条件form
   pageIndex: 1,
   pageSize: 10,
   id: '',
-  type: '',
+  productType: '',
   status: '',
 })
 const allLoading = reactive({

+ 1 - 1
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/product/type.d.ts

@@ -4,7 +4,7 @@ interface filterProductFormType {
     productCode: string,
     pageIndex: number,
     pageSize: number,
-    type: string | number,
+    productType: string | number,
     id: string | number,
     startTime: string,
     endTime: string,

+ 5 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/team/api.ts

@@ -10,3 +10,8 @@ export const GET_USERINFO = '/user/getUserInfo'
 export const BACTHUPDATEDEPT = `/user/batchUpdateDept`
 export const BACTHUPDATEROLE = `/user/batchUpdateRole`
 export const BACTHSERROLE = `/user/setActiveByIds`
+export const SETRESETPWD = `/user/resetPwd`
+export const DEACTIVEUSER = `/user/deactiveUser`
+export const SETACTIVE = `/user/setActive`
+export const EXPOERTUSER = `/user/exportUsers`
+export const URL_IMPORTUSER = `/user/importUser`

+ 184 - 22
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/team/index.vue

@@ -46,8 +46,8 @@
           <template #dropdown>
             <el-dropdown-menu>
               <el-dropdown-item @click="addPersone(false)" v-permission="['teamAdd']">添加人员</el-dropdown-item>
-              <el-dropdown-item v-permission="['teamExport']">导出人员</el-dropdown-item>
-              <el-dropdown-item v-permission="['teamImport']">批量导入</el-dropdown-item>
+              <el-dropdown-item @click="transitionOperation('exportUser', '')" v-permission="['teamExport']">导出人员</el-dropdown-item>
+              <el-dropdown-item @click="transitionOperation('importUser', '')" v-permission="['teamImport']">批量导入</el-dropdown-item>
             </el-dropdown-menu>
           </template>
         </el-dropdown>
@@ -90,10 +90,12 @@
               <el-table-column label="创建时间" property="createTime"></el-table-column>
               <el-table-column label="操作" width="200" fixed="right">
                 <template #default="scope">
-                  <el-button :size="'small'">重置</el-button>
+                  <el-button :size="'small'" @click="resetPwd(scope.row)">重置</el-button>
                   <el-button type="primary" :size="'small'" @click="addPersone(scope.row)">编辑</el-button>
-                  <el-button :size="'small'" v-if="scope.row.isActive == 1">停用</el-button>
-                  <el-button :size="'small'" v-if="scope.row.isActive == 0">启用</el-button>
+                  <el-button :size="'small'" @click="transitionOperation('disable', scope.row)"
+                    v-if="scope.row.isActive == 1">停用</el-button>
+                  <el-button type="success" :size="'small'" @click="enableUser(scope.row)"
+                    v-if="scope.row.isActive == 0">启用</el-button>
                 </template>
               </el-table-column>
             </el-table>
@@ -128,10 +130,21 @@
     </div>
 
     <!-- 新增部门 -->
-    <el-dialog v-model="dialogFrom.addDeptDialogVisible" :title="deptListItem.label || '创建部门'" width="500"
-      :before-close="handleClose">
-      <div class="pt-2">
-        <el-form ref="deptRuleFormRef" style="max-width: 500px" :model="deptForm" :rules="deptRules" label-width="auto"
+    <el-dialog v-model="dialogFrom.addDeptDialogVisible" width="600" :show-close="false" :before-close="handleClose">
+      <template #header="{ close, titleId, titleClass }">
+        <div class="flex justify-between items-center border-b pb-3 dialog-header">
+          <h4 :id="titleId">{{ deptListItem.label || '创建部门' }}</h4>
+          <div class="flex">
+            <el-button @click="dialogFrom.addDeptDialogVisible = false">取消</el-button>
+            <el-button type="primary" @click="createDepartment(deptRuleFormRef)"
+              v-bind:loading="loadingFrom.deptDialogVisibleLoading">
+              确定
+            </el-button>
+          </div>
+        </div>
+      </template>
+      <div class="pt-5">
+        <el-form ref="deptRuleFormRef" style="max-width: 500px" :model="deptForm" :rules="deptRules" label-width="140px"
           size="large" status-icon>
           <el-form-item label="部门名称" prop="name">
             <el-input v-model="deptForm.name" placeholder="请输入部门名称" clearable />
@@ -148,15 +161,75 @@
           </el-form-item>
         </el-form>
       </div>
-      <template #footer>
-        <div class="dialog-footer">
-          <el-button @click="dialogFrom.addDeptDialogVisible = false">取消</el-button>
-          <el-button type="primary" @click="createDepartment(deptRuleFormRef)"
-            v-bind:loading="loadingFrom.deptDialogVisibleLoading">
-            确定
-          </el-button>
+    </el-dialog>
+
+    <!-- 停用 -->
+    <el-dialog v-model="dialogFrom.resignationVisible" width="600" :show-close="false" :before-close="handleClose">
+      <template #header="{ close, titleId, titleClass }">
+        <div class="flex justify-between items-center border-b pb-3 dialog-header">
+          <h4 :id="titleId">离职停用员工</h4>
+          <div class="flex">
+            <el-button @click="dialogFrom.resignationVisible = false">取消</el-button>
+            <el-button type="primary" @click="resignation" v-bind:loading="loadingFrom.resignationLoading">
+              确定
+            </el-button>
+          </div>
         </div>
       </template>
+      <div class="pt-4 pb-2">
+        <div class="flex items-center justify-center">
+          <div class="pr-2">员工离职日期:</div>
+          <el-date-picker v-model="resignationDate" type="date" placeholder="请选择日期" value-format="YYYY-MM-DD"
+            :clearable="false" />
+        </div>
+      </div>
+    </el-dialog>
+
+    <!-- 导出人员列表 -->
+    <el-dialog v-model="dialogFrom.exportUserVisible" width="600" :show-close="false" :before-close="handleClose">
+      <template #header="{ close, titleId, titleClass }">
+        <div class="flex justify-between items-center border-b pb-3 dialog-header">
+          <h4 :id="titleId">导出人员列表</h4>
+          <div class="flex">
+            <el-button @click="dialogFrom.exportUserVisible = false">取消</el-button>
+            <el-button type="primary" @click="exportUser" v-bind:loading="loadingFrom.exportUserLoading">
+              导出
+            </el-button>
+          </div>
+        </div>
+      </template>
+      <div class="pt-4 pb-2">
+        <div class="flex items-center justify-center">
+          <div class="pr-2">导出:</div>
+          <el-radio-group v-model="exportRadio" class="ml-4">
+            <el-radio value="1" size="large">全部人员</el-radio>
+            <el-radio value="0" size="large">仅在职人员</el-radio>
+          </el-radio-group>
+        </div>
+      </div>
+    </el-dialog>
+
+    <!-- 人员导入 -->
+    <el-dialog v-model="dialogFrom.importVisible" width="680" :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 class="flex">
+            <el-button class="mr-3" @click="dialogFrom.importVisible = false">取消</el-button>
+            <el-upload ref="importUserRef" class="upload-demo" :limit="1" :show-file-list="false" accept=".xlsx"
+              :http-request="importUser">
+              <el-button type="primary" :loading="loadingFrom.importLoading">导入</el-button>
+            </el-upload>
+          </div>
+        </div>
+      </template>
+      <div class="p-8">
+        <div class="ml-4 mr-4">
+          <div class="flex items-center">1、点击下载 <el-link type="primary"
+              @click="downloadFile('/upload/人员导入模板.xlsx', '人员导入模板.xlsx')">人员导入模板.xlsx</el-link></div>
+          <div class="mt-4">2、填写excel模板,并上传</div>
+        </div>
+      </div>
     </el-dialog>
 
     <!-- 新增人员 -->
@@ -175,17 +248,19 @@
 
 <script lang="ts" setup>
 import { ref, reactive, onMounted, onBeforeMount, inject } from 'vue';
-import { dayjs } from 'element-plus'
+import { UploadRequestOptions, dayjs } from 'element-plus'
 import { Search, CirclePlusFilled, Edit, CirclePlus, Delete } from '@element-plus/icons-vue'
 import { FormInstance, FormRules, ElMessageBox } from 'element-plus'
 import { useStore } from '@/store/index'
-import { GET_DATA_LIST, DETELE_DEPT, MOD, GET_USERINFO, GET_ROUTELIST, GET_DEPTLIST, BACTHSERROLE, GET_USERLIST, GET_ADDDEPT, ADD_USER } from './api'
-import { post } from "@/utils/request";
-import { getFromValue, updateDepTreeData, resetFromValue } from '@/utils/tools'
+import { GET_DATA_LIST, DETELE_DEPT, MOD, GET_USERINFO, GET_ROUTELIST, DEACTIVEUSER, SETACTIVE, GET_DEPTLIST, BACTHSERROLE, GET_USERLIST, GET_ADDDEPT, ADD_USER, SETRESETPWD, EXPOERTUSER } from './api'
+import { post, uploadFile } from "@/utils/request";
+import { getFromValue, updateDepTreeData, resetFromValue, confirmAction, downloadFile } from '@/utils/tools'
 
 // 导入页面
 import AddPersonnelModal from './module/AddPersonnelModal.vue'
 import BatchOperation from './module/BatchOperation.vue'
+import { formatDate } from '@/utils/times';
+import { URL_IMPORTTHREAD } from '../thread/constant';
 
 const { getFunctionList, getUserInfoVal } = useStore()
 const globalPopup = inject<GlobalPopup>('globalPopup')
@@ -202,16 +277,26 @@ interface deptRuleForm { // 部门表单类型
 // 固定数据
 const stateOptions = [{ value: '3', label: '全部' }, { value: '1', label: '在职' }, { value: '0', label: '停用' }]
 
+// ref
+const importUserRef = ref<any>()
+
 // 定义变量
+const transitiondata = ref<any>() // 过度数据(针对二次弹窗)
 const pagePermission: any = ref([]) // 功能权限
 const loadingFrom = reactive({ // 所有加载状态
   tableLoading: false,
-  deptDialogVisibleLoading: false
+  deptDialogVisibleLoading: false,
+  resignationLoading: false,
+  exportUserLoading: false,
+  importLoading: false
 })
 const dialogFrom: any = reactive({ // 所有弹窗状态
   addDeptDialogVisible: false,
   addPersonnelDialogVisible: false,
-  batchOperationVisible: false
+  batchOperationVisible: false,
+  resignationVisible: false,
+  exportUserVisible: false,
+  importVisible: false,
 });
 const allText = reactive({
   batchText: '批量操作'
@@ -228,6 +313,8 @@ const multipleTableRef: any = ref()
 const deptListUntreated: any = ref([]) // 部门数据(未处理)
 const deptListItem: any = ref({}) // 选中的部门数据
 const personnelFromData = ref({}) // 人员表单数据
+const resignationDate = ref(formatDate(new Date())) // 员工离职日期
+const exportRadio = ref('1') // 导出人员列表
 const teamForm = reactive({ // 筛选条件表单
   matchingType: 0,
   keyword: '',
@@ -257,6 +344,66 @@ const deptRules = reactive<FormRules<typeof deptForm>>({ // 部门表单校验
 })
 
 // 定义方法
+async function importUser(param: UploadRequestOptions) {
+  loadingFrom.importLoading = true
+  const formData = new FormData();
+  formData.append('file', param.file)
+  const res = await uploadFile(URL_IMPORTTHREAD, formData).finally(() => {
+    importUserRef.value.clearFiles()
+    loadingFrom.importLoading = false
+  })
+  loadingFrom.importLoading = false
+  if (res.code == 'ok') {
+    globalPopup?.showSuccess('导入成功' || '')
+    closeModal('importVisible')
+    getTableData()
+    return
+  }
+  globalPopup?.showError(res.msg || '')
+}
+
+function exportUser() {
+  loadingFrom.exportUserLoading = true
+  post(EXPOERTUSER, { containInvalid: exportRadio.value }).then((res) => {
+    downloadFile(`${res.data}`, '人员列表.xlsx')
+    globalPopup?.showSuccess('导出成功')
+    closeModal('exportUserVisible')
+  }).finally(() => {
+    loadingFrom.exportUserLoading = false
+  })
+}
+
+function enableUser(row: any) {
+  const id = row.id
+  post(SETACTIVE, { id, isActive: 1 }).then(() => {
+    globalPopup?.showSuccess('启用成功')
+    getTableData()
+  })
+}
+
+function resignation() {
+  const id = transitiondata.value.id || ''
+  loadingFrom.resignationLoading = true
+  post(DEACTIVEUSER, { id, inactiveDate: resignationDate.value }).then(() => {
+    globalPopup?.showSuccess('停用成功')
+    getTableData()
+    closeModal('resignationVisible')
+  }).finally(() => {
+    loadingFrom.resignationLoading = false
+  })
+}
+
+function resetPwd(row: any) {
+  const userId = row.id
+  confirmAction(`确定要为${row.name}重置密码吗?`, '重置密码').then(() => {
+    post(SETRESETPWD, { userId }).then(() => {
+      globalPopup?.showSuccess('密码已重置为000000,请通知员工及时修改')
+    }).catch((err) => {
+      globalPopup?.showError(err.msg)
+    })
+  })
+}
+
 function batchEnableItem() {
   const userIds = batchTableData.value.map((item: any) => item.id)
   post(BACTHSERROLE, { ids: JSON.stringify(userIds), isActive: 1 }).then(() => {
@@ -451,6 +598,21 @@ function handleClose(done: any) {
   done()
 }
 
+function transitionOperation(type: string, data: any) {
+  if (type == 'disable') { // 停用
+    resignationDate.value = formatDate(new Date())
+    console.log(resignationDate.value, '<==== 离职')
+    dialogFrom.resignationVisible = true
+  } else if (type == 'exportUser') { // 导出
+    exportRadio.value = '1'
+    dialogFrom.exportUserVisible = true
+  } else if (type == 'importUser') { // 导入
+    dialogFrom.importVisible = true
+  }
+
+  transitiondata.value = data
+}
+
 function closeModal(modelType: string, flag: boolean = false) {
   dialogFrom[modelType] = false
   if (flag) {

+ 15 - 13
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/team/module/AddPersonnelModal.vue

@@ -1,8 +1,19 @@
 <template>
-    <el-dialog v-model="data.addPersonnelDialogVisible" :title="'添加人员'" width="500" :before-close="handleClose">
-        <div class="pt-3">
+    <el-dialog v-model="data.addPersonnelDialogVisible" :title="'添加人员'" :show-close="false" width="600" :before-close="handleClose">
+        <template #header="{ close, titleId, titleClass }">
+            <div class="flex justify-between items-center border-b pb-3 dialog-header">
+                <h4 :id="titleId">添加/编辑人员</h4>
+                <div class="flex">
+                    <el-button @click="handleClose">取消</el-button>
+                    <el-button type="primary" @click="addPersonel(personnelRuleFormRef)">
+                        确定
+                    </el-button>
+                </div>
+            </div>
+        </template>
+        <div class="pt-5">
             <el-form ref="personnelRuleFormRef" style="max-width: 500px" :model="personnelFrom" :rules="personnelRules"
-                label-width="auto" size="large" status-icon>
+                label-width="120px" size="large" status-icon>
                 <el-form-item label="姓名" prop="name">
                     <el-input v-model="personnelFrom.name" placeholder="请输入姓名" clearable />
                 </el-form-item>
@@ -24,15 +35,7 @@
                     <el-date-picker v-model="personnelFrom.inductionDate" type="date" placeholder="选择入职时间" value-format="YYYY-MM-DD" style="width: 100%" />
                 </el-form-item>
             </el-form>
-        </div>
-        <template #footer>
-            <div class="dialog-footer">
-                <el-button @click="handleClose">取消</el-button>
-                <el-button type="primary" @click="addPersonel(personnelRuleFormRef)">
-                    确定
-                </el-button>
-            </div>
-        </template>
+        </div> 
     </el-dialog>
 </template>
 <script setup lang="ts">
@@ -95,7 +98,6 @@ function addPersonel(formEl: FormInstance | undefined) {
 
 // 监听 Props 的变化
 watch(() => props.data, (newValue) => {
-    console.log('开始执行', newValue)
     data.value = newValue
     personnelFrom.value = newValue.personnelFromData
 });

+ 2 - 2
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/thread/index.vue

@@ -101,7 +101,7 @@
         <div class="flex justify-between items-center border-b pb-3 dialog-header">
           <h4 :id="titleId">{{ allText.editClueText }}</h4>
           <div>
-            <el-button type="primary" :loading="allLoading.clueSaveLoading" @click="saveEditClue(true)">保存并新建</el-button>
+            <el-button type="primary" v-if="!editForm.id" :loading="allLoading.clueSaveLoading" @click="saveEditClue(true)">保存并新建</el-button>
             <el-button type="primary" :loading="allLoading.clueSaveLoading" @click="saveEditClue(false)">保存</el-button>
             <el-button @click="dialogVisible.editClueDialogVisible = false">取消</el-button>
           </div>
@@ -247,7 +247,7 @@ const clueTemplate = ref({
   list: [],
   config: {}
 }) // 线索模板
-const editForm = ref({}) // 编辑表单
+const editForm = ref<any>({}) // 编辑表单
 const taskModalForm = ref({}) // 任务弹窗表单
 const batchTableData = ref([])
 

+ 10 - 11
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/ProductController.java

@@ -7,6 +7,7 @@ import com.management.platform.mapper.UserMapper;
 import com.management.platform.service.*;
 import com.management.platform.util.BeanChangeUtil;
 import com.management.platform.util.HttpRespMsg;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.StringUtils;
 import org.springframework.web.bind.annotation.RequestMapping;
 
@@ -54,6 +55,8 @@ public class ProductController {
     private SalesOrderService salesOrderService;
     @Resource
     private SysDictService sysDictService;
+    @Resource
+    private StageService stageService;
 
 
     /**
@@ -77,6 +80,7 @@ public class ProductController {
     * @Date: 2024/5/21
     */
     @RequestMapping("/addOrUpdate")
+    @Transactional
     public HttpRespMsg addOrUpdate(Product product){
         HttpRespMsg msg=new HttpRespMsg();
         User user = userMapper.selectById(request.getHeader("token"));
@@ -97,18 +101,17 @@ public class ProductController {
         AuditLogCenter auditLogCenter =new AuditLogCenter();
         auditLogCenter.setAuditorId(user.getId());
         auditLogCenter.setAuditorName(user.getName());
-        boolean isNew=true;
+        auditLogCenter.setModuleId(product.getId());
+        auditLogCenter.setModuleCode("Product");
         if(product.getId()==null){
             auditLogCenter.setAuditorContent("创建了产品");
+            auditLogCenterService.save(auditLogCenter);
         }else {
             Product oldProduct = productService.getById(product.getId());
             BeanChangeUtil<Product> beanChangeUtil = new BeanChangeUtil();
             String content = beanChangeUtil.contrastObj(oldProduct, product);
             //发生变化才生成记录
             if(!StringUtils.isEmpty(content.trim())){
-                isNew=false;
-                auditLogCenter.setModuleId(product.getId());
-                auditLogCenter.setModuleCode("Product");
                 auditLogCenter.setAuditorContent("编辑了产品");
                 auditLogCenterService.save(auditLogCenter);
             }
@@ -118,11 +121,6 @@ public class ProductController {
             msg.setError("验证失败");
             return msg;
         }
-        if(isNew){
-            auditLogCenter.setModuleId(product.getId());
-            auditLogCenter.setModuleCode("Product");
-            auditLogCenterService.save(auditLogCenter);
-        }
         return msg;
     }
 
@@ -268,7 +266,8 @@ public class ProductController {
         List<BusinessOpportunity> opportunityList = businessOpportunityService.list(new LambdaQueryWrapper<BusinessOpportunity>().in(BusinessOpportunity::getId, businessIds));
         List<Custom> customList = customService.list(new LambdaQueryWrapper<Custom>().eq(Custom::getCompanyId, companyId));
         List<User> userList = userMapper.selectList(new LambdaQueryWrapper<User>().eq(User::getCompanyId, companyId));
-        List<SysDict> businessStageList = sysDictService.list(new LambdaQueryWrapper<SysDict>().eq(SysDict::getCode, "BusinessStage"));
+//        List<SysDict> businessStageList = sysDictService.list(new LambdaQueryWrapper<SysDict>().eq(SysDict::getCode, "BusinessStage"));
+        List<Stage> businessStageList = stageService.list(new LambdaQueryWrapper<Stage>().eq(Stage::getCompanyId, companyId));
         opportunityList.forEach(c->{
             Optional<Custom> custom = customList.stream().filter(ct -> ct.getId().equals(c.getCustomerId())).findFirst();
             if(custom.isPresent()){
@@ -282,7 +281,7 @@ public class ProductController {
             if(incharger.isPresent()){
                 c.setInchargerName(incharger.get().getName());
             }
-            Optional<SysDict> businessStage = businessStageList.stream().filter(b -> b.getId().equals(c.getStageId())).findFirst();
+            Optional<Stage> businessStage = businessStageList.stream().filter(b -> b.getId().equals(c.getStageId())).findFirst();
             if(businessStage.isPresent()){
                 c.setStageValue(businessStage.get().getName());
             }

+ 36 - 7
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/SalesOrderController.java

@@ -9,6 +9,7 @@ import com.management.platform.mapper.UserMapper;
 import com.management.platform.service.*;
 import com.management.platform.util.BeanChangeUtil;
 import com.management.platform.util.HttpRespMsg;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.StringUtils;
 import org.springframework.web.bind.annotation.RequestMapping;
 
@@ -50,6 +51,8 @@ public class SalesOrderController {
     private AuditLogCenterService auditLogCenterService;
     @Resource
     private SalesOrderPaymentService salesOrderPaymentService;
+    @Resource
+    private ProductService productService;
 
 
     /**
@@ -79,6 +82,7 @@ public class SalesOrderController {
      * 新增编辑订单数据
      * */
     @RequestMapping("/addOrUpdate")
+    @Transactional
     public HttpRespMsg addOrUpdate(SalesOrder order){
         HttpRespMsg msg=new HttpRespMsg();
         User user = userMapper.selectById(request.getHeader("token"));
@@ -88,16 +92,23 @@ public class SalesOrderController {
         if(order.getPrice()!=null){
             order.setUnReceivedPayment(order.getPrice());
         }
-        int count;
+        int countCode;
+        int countName;
         if(order.getId()==null){
-            count = salesOrderService.count(new LambdaQueryWrapper<SalesOrder>().eq(SalesOrder::getCompanyId, companyId).eq(SalesOrder::getOrderCode, order.getOrderCode()));
+            countCode = salesOrderService.count(new LambdaQueryWrapper<SalesOrder>().eq(SalesOrder::getCompanyId, companyId).eq(SalesOrder::getOrderCode, order.getOrderCode()));
+            countName = salesOrderService.count(new LambdaQueryWrapper<SalesOrder>().eq(SalesOrder::getCompanyId, companyId).eq(SalesOrder::getOrderName, order.getOrderName()));
         }else {
-            count = salesOrderService.count(new LambdaQueryWrapper<SalesOrder>().eq(SalesOrder::getCompanyId, companyId).ne(SalesOrder::getId,order.getId()).eq(SalesOrder::getOrderCode,order.getOrderCode()));
+            countCode = salesOrderService.count(new LambdaQueryWrapper<SalesOrder>().eq(SalesOrder::getCompanyId, companyId).ne(SalesOrder::getId,order.getId()).eq(SalesOrder::getOrderCode,order.getOrderCode()));
+            countName = salesOrderService.count(new LambdaQueryWrapper<SalesOrder>().eq(SalesOrder::getCompanyId, companyId).ne(SalesOrder::getId,order.getId()).eq(SalesOrder::getOrderName,order.getOrderName()));
         }
-        if(count>0){
+        if(countCode>0){
             msg.setError("订单编号为["+order.getOrderCode()+"]的订单已存在");
             return msg;
         }
+        if(countName>0){
+            msg.setError("订单名称为["+order.getOrderCode()+"]的订单已存在");
+            return msg;
+        }
         //todo:生成操作记录
         AuditLogCenter auditLogCenter =new AuditLogCenter();
         auditLogCenter.setAuditorId(user.getId());
@@ -125,10 +136,24 @@ public class SalesOrderController {
         if(!StringUtils.isEmpty(order.getOrderProductDetailString())){
             String orderProductDetailString = order.getOrderProductDetailString();
             List<OrderProductDetail> orderProductDetails = JSONArray.parseArray(orderProductDetailString, OrderProductDetail.class);
+            List<Integer> productIds = orderProductDetails.stream().map(OrderProductDetail::getProductId).distinct().collect(Collectors.toList());
+            productIds.add(-1);
+            List<Product> productList = productService.list(new LambdaQueryWrapper<Product>().in(Product::getId, productIds));
             if(orderProductDetails.size()>0){
-                orderProductDetails.forEach(o->{
-                    o.setOrderId(order.getId());
-                });
+                for (OrderProductDetail orderProductDetail : orderProductDetails) {
+                    orderProductDetail.setOrderId(order.getId());
+                    Optional<Product> first = productList.stream().filter(p -> p.getId().equals(orderProductDetail.getProductId())).findFirst();
+                    if(first.isPresent()){
+                        if(orderProductDetail.getNum().intValue()>first.get().getInventory()){
+                            try {
+                                throw new Exception("相关产品["+first.get().getProductName()+"]库存数量不足");
+                            } catch (Exception e) {
+                                e.printStackTrace();
+                                msg.setError(e.getMessage());
+                            }
+                        }
+                    }
+                }
                 orderProductDetailService.saveOrUpdateBatch(orderProductDetails);
             }
         }
@@ -364,6 +389,10 @@ public class SalesOrderController {
         SalesOrderPayment salesOrderPayment=new SalesOrderPayment();
         salesOrderPayment.setMoney(new BigDecimal(money));
         salesOrderPayment.setOrderId(orderId);
+        if(money>salesOrder.getUnReceivedPayment().doubleValue()){
+            msg.setError("回款金额不能大于当前未回款金额");
+            return msg;
+        }
         //订单已回款金额
         BigDecimal receivedPayment = salesOrder.getReceivedPayment();
         //订单未回款金额

+ 68 - 9
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/ProductServiceImpl.java

@@ -122,12 +122,12 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
                 deptIds=deptIds.stream().distinct().collect(Collectors.toList());
                 List<Integer> finalDeptIds2 = deptIds;
                 List<String> userIds = userList.stream().filter(u -> finalDeptIds2.contains(u.getDepartmentId())).map(User::getId).collect(Collectors.toList());
-                userIds.add("-1");
+                userIds.add(targetUsr.getId());
                 queryWrapper.in(Product::getCreatorId,userIds);
             }
         }
         if(!StringUtils.isEmpty(userId)){
-            queryWrapper.eq(Product::getCreatorId,userId);
+            queryWrapper.eq(Product::getInchargerId,userId);
         }
         if(!StringUtils.isEmpty(productName)){
             queryWrapper.like(Product::getProductName,productName);
@@ -151,6 +151,7 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
             pageIndex=-1;
             pageSize=-1;
         }
+        queryWrapper.orderByDesc(Product::getCreateTime);
         IPage<Product> productIPage = productMapper.selectPage(new Page<>(pageIndex, pageSize,true), queryWrapper);
         List<Product> records = productIPage.getRecords();
         records.forEach(r->{
@@ -515,13 +516,71 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
     @Override
     public HttpRespMsg recycleList(Integer pageIndex, Integer pageSize) {
         HttpRespMsg msg=new HttpRespMsg();
-        User user = userMapper.selectById(request.getHeader("token"));
-        LambdaQueryWrapper<Product> productLambdaQueryWrapper = new LambdaQueryWrapper<>();
-        productLambdaQueryWrapper.eq(Product::getCompanyId,user.getCompanyId());
-        productLambdaQueryWrapper.eq(Product::getIsDelete,1);
-        IPage<Product> productIPage = productMapper.selectPage(new Page<>(pageIndex, pageSize), productLambdaQueryWrapper);
-        Map<String,Object> map=new HashMap<>();
-        map.put("record",productIPage.getRecords());
+        User targetUsr = userMapper.selectById(request.getHeader("token"));
+        Integer companyId=targetUsr.getCompanyId();
+        List<Department> departments = departmentMapper.selectList(new LambdaQueryWrapper<Department>().eq(Department::getCompanyId, companyId));
+        LambdaQueryWrapper<Product> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(Product::getCompanyId,companyId);
+        queryWrapper.eq(Product::getIsDelete,1);
+        List<User> userList = userMapper.selectList(new LambdaQueryWrapper<User>().eq(User::getCompanyId, companyId));
+        List<SysDict> sysDictOfProductType = sysDictMapper.selectList(new LambdaQueryWrapper<SysDict>().eq(SysDict::getCompanyId, companyId).eq(SysDict::getCode, "ProductType"));
+        List<SysDict> sysDictOfProductUnit = sysDictMapper.selectList(new LambdaQueryWrapper<SysDict>().eq(SysDict::getCompanyId, companyId).eq(SysDict::getCode, "ProductUnit"));
+        boolean hasPriviledgeAll = sysFunctionService.hasPriviledge(targetUsr.getRoleId(), "查看全部产品数据");
+        boolean hasPriviledgeDept = sysFunctionService.hasPriviledge(targetUsr.getRoleId(), "查看负责部门产品数据");
+        //判断查看全部的权限
+        if(!hasPriviledgeAll){
+            //判断查看负责部门的权限
+            if(!hasPriviledgeDept){
+                //都没有就只能看自己创建的
+                queryWrapper.eq(Product::getCreatorId,targetUsr.getId());
+            }else {
+                List<Department> departmentList = departmentMapper.selectList(new LambdaQueryWrapper<Department>().eq(Department::getManagerId, targetUsr.getId()));
+                List<DepartmentOtherManager> otherManagerList = departmentOtherManagerMapper.selectList(new LambdaQueryWrapper<DepartmentOtherManager>().eq(DepartmentOtherManager::getOtherManagerId, targetUsr.getId()));
+                List<Integer> deptIds=new ArrayList<>();
+                deptIds.add(-1);
+                List<Integer> managerDeptIds = departmentList.stream().map(Department::getDepartmentId).distinct().collect(Collectors.toList());
+                List<Integer> otherManagerDeptIds = otherManagerList.stream().map(DepartmentOtherManager::getDepartmentId).distinct().collect(Collectors.toList());
+                deptIds.addAll(managerDeptIds);
+                List<Integer> finalDeptIds1 = deptIds;
+                managerDeptIds.forEach(m->{
+                    List<Integer> branchDepartment = getBranchDepartment(m, departments);
+                    finalDeptIds1.addAll(branchDepartment);
+                });
+                deptIds.addAll(otherManagerDeptIds);
+                List<Integer> finalDeptIds = deptIds;
+                otherManagerDeptIds.forEach(o->{
+                    List<Integer> branchDepartment = getBranchDepartment(o, departments);
+                    finalDeptIds.addAll(branchDepartment);
+                });
+                deptIds=deptIds.stream().distinct().collect(Collectors.toList());
+                List<Integer> finalDeptIds2 = deptIds;
+                List<String> userIds = userList.stream().filter(u -> finalDeptIds2.contains(u.getDepartmentId())).map(User::getId).collect(Collectors.toList());
+                userIds.add("-1");
+                queryWrapper.in(Product::getCreatorId,userIds);
+            }
+        }
+        IPage<Product> productIPage = productMapper.selectPage(new Page<>(pageIndex, pageSize,true), queryWrapper);
+        List<Product> records = productIPage.getRecords();
+        records.forEach(r->{
+            Optional<User> user = userList.stream().filter(u -> u.getId().equals(r.getInchargerId())).findFirst();
+            if(user.isPresent()){
+                r.setInchargerName(user.get().getName());
+            }
+            Optional<User> creator = userList.stream().filter(u -> u.getId().equals(r.getCreatorId())).findFirst();
+            if(creator.isPresent()){
+                r.setCreatorName(creator.get().getName());
+            }
+            Optional<SysDict> unit = sysDictOfProductUnit.stream().filter(u -> u.getId().equals(r.getUnit())).findFirst();
+            if(unit.isPresent()){
+                r.setUnitName(unit.get().getName());
+            }
+            Optional<SysDict> type = sysDictOfProductType.stream().filter(u -> u.getId().equals(r.getType())).findFirst();
+            if(type.isPresent()){
+                r.setTypeName(type.get().getName());
+            }
+        });
+        Map map=new HashMap();
+        map.put("record",records);
         map.put("total",productIPage.getTotal());
         msg.setData(map);
         return msg;

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

@@ -116,8 +116,8 @@ public class SalesOrderServiceImpl extends ServiceImpl<SalesOrderMapper, SalesOr
         if(!viewAll){
             //判断查看负责部门的权限
             if(!viewDept){
-                //都没有就只能看自己创建的
-                orderLambdaQueryWrapper.eq(SalesOrder::getCreatorId,user.getId());
+                //都没有就只能看自己创建的或者负责的
+                orderLambdaQueryWrapper.and(wrapper->wrapper.eq(SalesOrder::getCreatorId,user.getId()).or().eq(SalesOrder::getInchargerId,user.getId()));
             }else {
                 List<Department> departmentList = departmentMapper.selectList(new LambdaQueryWrapper<Department>().eq(Department::getManagerId, user.getId()));
                 List<DepartmentOtherManager> otherManagerList = departmentOtherManagerMapper.selectList(new LambdaQueryWrapper<DepartmentOtherManager>().eq(DepartmentOtherManager::getOtherManagerId, user.getId()));
@@ -140,7 +140,9 @@ public class SalesOrderServiceImpl extends ServiceImpl<SalesOrderMapper, SalesOr
                 deptIds=deptIds.stream().distinct().collect(Collectors.toList());
                 List<Integer> finalDeptIds2 = deptIds;
                 List<String> userIds = userList.stream().filter(u -> finalDeptIds2.contains(u.getDepartmentId())).map(User::getId).collect(Collectors.toList());
-                orderLambdaQueryWrapper.in(SalesOrder::getCreatorId,userIds);
+                //加上本人
+                userIds.add(user.getId());
+                orderLambdaQueryWrapper.and(wrapper->wrapper.in(SalesOrder::getCreatorId,userIds).or().in(SalesOrder::getInchargerId,userIds));
             }
         }
         if (!StringUtils.isEmpty(inchargerId)){
@@ -182,6 +184,7 @@ public class SalesOrderServiceImpl extends ServiceImpl<SalesOrderMapper, SalesOr
             pageIndex=-1;
             pageSize=-1;
         }
+        orderLambdaQueryWrapper.orderByDesc(SalesOrder::getCreateTime);
         IPage<SalesOrder> orderIPage = salesOrderMapper.selectPage(new Page<>(pageIndex, pageSize), orderLambdaQueryWrapper);
         List<SalesOrder> records = orderIPage.getRecords();
         List<Integer> orderIds = records.stream().map(SalesOrder::getId).distinct().collect(Collectors.toList());

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/ReportMapper.java

@@ -57,7 +57,7 @@ public interface ReportMapper extends BaseMapper<Report> {
     List<HashMap<String, Object>> getDeptMembReportByDate(@Param("startDate") String startDate,
                                                              @Param("companyId") Integer companyId,
                                                              @Param("deptIds") List<Integer> deptIds,
-                                                             @Param("endDate") String endDate, @Param("projectId") Integer projectId,@Param("stateKey")Integer stateKey,@Param("branchDepartment")List<Integer> branchDepartment);
+                                                             @Param("endDate") String endDate, @Param("projectId") Integer projectId,@Param("stateKey")Integer stateKey,@Param("branchDepartment")List<Integer> branchDepartment, @Param("viewUserId")String viewUserId);
 
 
     //获取项目经理所管理的人员的报告

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

@@ -5582,7 +5582,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                 //检查是否是部门负责人
                 List<Integer> allVisibleDeptIdList = getAllVisibleDeptIdList(user, null);
                 if (allVisibleDeptIdList.size() > 0) {
-                    allReportByDate = reportMapper.getDeptMembReportByDate(startDate, null, allVisibleDeptIdList, endDate, projectId,stateKey,branchDepartment);
+                    allReportByDate = reportMapper.getDeptMembReportByDate(startDate, null, allVisibleDeptIdList, endDate, projectId,stateKey,branchDepartment, user.getId());
                 }
 
                 List<HashMap<String, Object>> reportsFromProjects = null;
@@ -5622,6 +5622,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                         allReportByDate.addAll(filteredReports);
                     }
                 }
+
             }
             else {
                 //看公司所有人的

+ 2 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ReportMapper.xml

@@ -385,10 +385,11 @@
             </foreach>
         </if>
         <if test="deptIds != null">
-            AND c.department_id in
+            AND (c.department_id in
             <foreach collection="deptIds" item="deptId" separator="," close=")" open="(" index="index">
                 #{deptId}
             </foreach>
+        or a.creator_id=#{viewerId})
         </if>
         ORDER BY a.creator_id, a.create_date desc
     </select>

+ 13 - 0
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/ProdProcedureController.java

@@ -85,5 +85,18 @@ public class ProdProcedureController {
     public HttpRespMsg updateData(){
         return prodProcedureService.updateData();
     }
+
+
+    /**
+    * @Description:供恢复南京雷啊伟数据
+    * @Param: []
+    * @return: com.management.platform.util.HttpRespMsg
+    * @Author: yurk
+    * @Date: 2024/6/18
+    */
+    @RequestMapping("/updateHistoryData")
+    public HttpRespMsg updateHistoryData(){
+        return prodProcedureService.updateHistoryData();
+    }
 }
 

+ 7 - 2
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/ReportController.java

@@ -1537,8 +1537,13 @@ public class ReportController {
     }
 
     @RequestMapping("getPersonWorkHoursWagesDetail")
-    public HttpRespMsg getPersonWorkHoursWagesDetail(String date,String userId,String startDate,String endDate,Integer checkStatus,Integer detailStatus){
-        return reportService.getPersonWorkHoursWagesDetail(date,userId,startDate,endDate,checkStatus,detailStatus);
+    public HttpRespMsg getPersonWorkHoursWagesDetail(String date,String userId,String startDate,String endDate){
+        return reportService.getPersonWorkHoursWagesDetail(date,userId,startDate,endDate);
+    }
+
+    @RequestMapping("getPersonWorkHoursWagesDetailForMob")
+    public HttpRespMsg getPersonWorkHoursWagesDetailForMob(String date,String userId,String startDate,String endDate,Integer checkStatus,Integer detailStatus){
+        return reportService.getPersonWorkHoursWagesDetailForMob(date,userId,startDate,endDate,checkStatus,detailStatus);
     }
 
     @RequestMapping("exportPersonWorkHoursWorkTime")

+ 102 - 0
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/WxCorpInfoController.java

@@ -3,18 +3,27 @@ package com.management.platform.controller;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.management.platform.entity.LeaveSheet;
 import com.management.platform.entity.User;
 import com.management.platform.entity.WxCorpInfo;
 import com.management.platform.mapper.UserMapper;
+import com.management.platform.service.LeaveSheetService;
 import com.management.platform.service.WxCorpInfoService;
+import com.management.platform.util.DateTimeUtil;
 import com.management.platform.util.HttpRespMsg;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.time.LocalDate;
+import java.util.ArrayList;
 import java.util.List;
+import java.util.Optional;
 
 /**
  * <p>
@@ -32,6 +41,8 @@ public class WxCorpInfoController {
     WxCorpInfoService wxCorpInfoService;
     @Resource
     UserMapper userMapper;
+    @Resource
+    LeaveSheetService leaveSheetService;
 
     @RequestMapping("/testDownload")
     public HttpRespMsg testDownload() {
@@ -95,8 +106,99 @@ public class WxCorpInfoController {
         filter2.put("value",2);
         jsonArrayFilter.add(filter2);
         List<String> approvalInfo = wxCorpInfoService.getApprovalInfo(7, startDate, endDate, "", jsonArrayFilter);
+        List<User> userList = userMapper.selectList(new LambdaQueryWrapper<User>().eq(User::getCompanyId,7));
+        if(approvalInfo!=null){
+            List<LeaveSheet> leaveSheets = new ArrayList<>();
+            for (int i = 0; i < approvalInfo.size(); i++) {
+                String codeNum = approvalInfo.get(i);
+                String approvalInfoDetailResp = wxCorpInfoService.getApprovalInfoDetail(7, codeNum);
+                JSONObject approvalInfoDetail = JSONObject.parseObject(approvalInfoDetailResp);
+                JSONObject info = approvalInfoDetail.getJSONObject("info");
+                JSONObject applyer = info.getJSONObject("applyer");
+                String userid = applyer.getString("userid");
+                Optional<User> first = userList.stream().filter(u ->u.getCorpwxRealUserid()!=null&&u.getCorpwxRealUserid().equals(userid)).findFirst();
+                if(!first.isPresent()){
+                    continue;
+                }
+                LeaveSheet leaveSheet=new LeaveSheet();
+                leaveSheet.setCompanyId(7);
+                leaveSheet.setStatus(0);
+                leaveSheet.setOwnerId(first.get().getId());
+                leaveSheet.setOwnerName(first.get().getName());
+                JSONObject apply_data = info.getJSONObject("apply_data");
+                System.out.println("获取到的单据信息===========>"+apply_data);
+                JSONArray contents = apply_data.getJSONArray("contents");
+                for (int i1 = 0; i1 < contents.size(); i1++) {
+                    JSONObject map = contents.getJSONObject(i1);
+                    JSONArray title = map.getJSONArray("title");
+                    JSONObject value = map.getJSONObject("value");
+                    String control = map.getString("control");
+                    if(control.equals("Vacation")){
+                        JSONObject vacation = value.getJSONObject("vacation");
+                        JSONObject selector = vacation.getJSONObject("selector");
+                        //企业微信请假默认单选
+                        JSONArray options = selector.getJSONArray("options");
+                        JSONObject option = options.getJSONObject(0);
+                        int leaveType;
+                        switch (option.getJSONArray("value").getJSONObject(0).getString("text")){
+                            case "事假":leaveType=0;
+                                break;
+                            case "病假":leaveType=1;
+                                break;
+                            case "年假":leaveType=2;
+                                break;
+                            case "产假":leaveType=3;
+                                break;
+                            case "婚假":leaveType=4;
+                                break;
+                            case "丧假":leaveType=5;
+                                break;
+                            case "调休":leaveType=6;
+                                break;
+                            case "陪产假":leaveType=7;
+                                break;
+                            default:leaveType=8;
+                        }
+                        leaveSheet.setLeaveType(leaveType);
+                        JSONObject attendance = vacation.getJSONObject("attendance");
+                        JSONObject date_range = attendance.getJSONObject("date_range");
+                        leaveSheet.setTimeType(date_range.getString("type").equals("hour")?1:0);
+                        long new_begin = date_range.getLongValue("new_begin");
+                        long new_end = date_range.getLongValue("new_end");
+                        LocalDate startDate1 = DateTimeUtil.getLocalDateFromUnix(new_begin);
+                        LocalDate endDate1 = DateTimeUtil.getLocalDateFromUnix(new_end);
+                        leaveSheet.setStartDate(startDate1);
+                        leaveSheet.setEndDate(endDate1);
+                        long new_duration = date_range.getLongValue("new_duration");
+                        BigDecimal bigDecimal = new BigDecimal(new_duration);
+                        bigDecimal=bigDecimal.divide(new BigDecimal(3600),1, RoundingMode.HALF_DOWN);
+                        leaveSheet.setTimeHours(bigDecimal.floatValue());
+                        bigDecimal=bigDecimal.divide(new BigDecimal(8),1,RoundingMode.HALF_DOWN);
+                        leaveSheet.setTimeDays(bigDecimal.floatValue());
+                        leaveSheet.setLeaveType(1);
+                    }
+                    if(control.equals("Text")||control.equals("Textarea")){
+                        if(title.getJSONObject(0).getString("text").equals("请假事由")){
+                            leaveSheet.setRemark(value.getString("text"));
+                        }
+                    }
+                }
+                LeaveSheet one = leaveSheetService.getOne(new LambdaQueryWrapper<LeaveSheet>().eq(LeaveSheet::getStartDate, leaveSheet.getStartDate()).eq(LeaveSheet::getEndDate, leaveSheet.getEndDate()).eq(LeaveSheet::getOwnerId, leaveSheet.getOwnerId()));
+                if(one!=null){
+                    leaveSheet.setId(one.getId());
+                }
+                leaveSheets.add(leaveSheet);
+            }
+            if(leaveSheets.size()>0){
+                leaveSheetService.saveOrUpdateBatch(leaveSheets);
+            }
+        }
         msg.setData(approvalInfo);
         return msg;
     }
+
+    public static void main(String[] args) {
+
+    }
 }
 

+ 2 - 0
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/mapper/ReportMapper.java

@@ -184,6 +184,8 @@ public interface ReportMapper extends BaseMapper<Report> {
 
     List<Map<String, Object>> getPersonWorkHoursWagesList(Integer companyId, String startDate, String endDate,@Param("list") List<Integer> deptId, String userId);
 
+    List<Map<String, Object>> getPersonWorkHoursWagesDetailForMob(String date, String userId, Integer companyId,String startDate,String endDate,Integer checkStatus,Integer detailStatus);
+
     List<Map<String, Object>> getPersonWorkHoursWagesDetail(String date, String userId, Integer companyId,String startDate,String endDate,Integer checkStatus,Integer detailStatus);
 
     List<Map<String, Object>> getProcedureRealTimeProgressList(Integer companyId,List<Integer> deptIds, String foremanId,String userId, String startDate, String endDate, Integer pageStart, Integer pageSize);

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

@@ -29,4 +29,6 @@ public interface ProdProcedureService extends IService<ProdProcedure> {
     HttpRespMsg getLastProcedureList(HttpServletRequest request, Integer productId);
 
     HttpRespMsg updateData();
+
+    HttpRespMsg updateHistoryData();
 }

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

@@ -119,7 +119,7 @@ public interface ReportService extends IService<Report> {
 
     HttpRespMsg getPersonWorkHoursWagesList(String deptIds, String userId, String startDate, String endDate, Integer pageIndex, Integer pageSize);
 
-    HttpRespMsg getPersonWorkHoursWagesDetail(String date, String userId,String startDate,String endDate,Integer checkStatus,Integer detailStatus);
+    HttpRespMsg getPersonWorkHoursWagesDetail(String date, String userId,String startDate,String endDate);
 
     HttpRespMsg exportPersonWorkHoursWorkTime(String deptIds, String userId, String startDate, String endDate);
 
@@ -161,4 +161,5 @@ public interface ReportService extends IService<Report> {
 
     HttpRespMsg fixFinishNumData();
 
+    HttpRespMsg getPersonWorkHoursWagesDetailForMob(String date, String userId, String startDate, String endDate,Integer checkStatus,Integer detailStatus);
 }

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

@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.management.platform.util.HttpRespMsg;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.RequestParam;
 
 import javax.annotation.Resource;
@@ -336,4 +337,103 @@ public class ProdProcedureServiceImpl extends ServiceImpl<ProdProcedureMapper, P
 
         return new HttpRespMsg();
     }
+
+    @Override
+    @Transactional
+    public HttpRespMsg updateHistoryData() {
+        HttpRespMsg msg=new HttpRespMsg();
+        try {
+            List<PlanProcedureTotal> planProcedureTotals = planProcedureTotalService.list(new LambdaQueryWrapper<PlanProcedureTotal>().inSql(PlanProcedureTotal::getId, "\n" +
+                    "SELECT ppt.id FROM plan_procedure_total ppt\n" +
+                    "LEFT JOIN plan p ON p.id=ppt.plan_id\n" +
+                    "LEFT JOIN prod_procedure pp ON ppt.prod_procedure_id=pp.id\n" +
+                    "WHERE p.num*pp.working_time!=ppt.total_working_hours"));
+            List<Integer> prodProcedureIds = planProcedureTotals.stream().map(PlanProcedureTotal::getProdProcedureId).distinct().collect(Collectors.toList());
+            List<ProdProcedure> prodProcedureList = prodProcedureMapper.selectList(new LambdaQueryWrapper<ProdProcedure>().in(ProdProcedure::getId, prodProcedureIds));
+            if(planProcedureTotals.size()>0){
+                List<Integer> planIds = planProcedureTotals.stream().map(PlanProcedureTotal::getPlanId).distinct().collect(Collectors.toList());
+                List<Plan> planList = planService.list(new LambdaQueryWrapper<Plan>().in(Plan::getId, planIds));
+                List<Integer> totalIds = planProcedureTotals.stream().map(PlanProcedureTotal::getId).distinct().collect(Collectors.toList());
+                totalIds.add(-1);
+                List<ProdProcedureTeam> allProdProcedureTeams = prodProcedureTeamService.list(new LambdaQueryWrapper<ProdProcedureTeam>().in(ProdProcedureTeam::getPlanProcedureId,totalIds));
+                List<Integer> teamIdList = allProdProcedureTeams.stream().map(ProdProcedureTeam::getId).distinct().collect(Collectors.toList());
+                teamIdList.add(-1);
+                List<Report> allReports = reportService.list(new LambdaQueryWrapper<Report>().select(Report::getId,Report::getUserProcedureTeamId, Report::getProdProcedureId,Report::getFinishNum).in(Report::getUserProcedureTeamId, teamIdList));
+                List<ProdProcedureTeam> needUpdateTeamList=new ArrayList<>();
+                List<Report> needUpdateReportList=new ArrayList<>();
+                for (PlanProcedureTotal planProcedureTotal : planProcedureTotals) {
+                    Optional<ProdProcedure> first = prodProcedureList.stream().filter(u -> u.getId().equals(planProcedureTotal.getProdProcedureId())).findFirst();
+                    if(first.isPresent()){
+                        Optional<Plan> plan = planList.stream().filter(p -> p.getId().equals(planProcedureTotal.getPlanId())).findFirst();
+                        if(plan.isPresent()){
+                            BigDecimal totalWages=new BigDecimal(String.valueOf(first.get().getUnitPrice()));
+                            totalWages=totalWages.multiply(new BigDecimal(plan.get().getNum()));
+                            planProcedureTotal.setTotalWages(totalWages.doubleValue());
+                            BigDecimal totalWorkingHours=new BigDecimal(String.valueOf(first.get().getWorkingTime()));
+                            totalWorkingHours=totalWorkingHours.multiply(new BigDecimal(plan.get().getNum()));
+                            planProcedureTotal.setTotalWorkingHours(totalWorkingHours.doubleValue());
+                            //todo:找到用到当前工序的prod_procedure_team (计划分配表) 更新 单价相关数据
+                            List<ProdProcedureTeam> prodProcedureTeams =allProdProcedureTeams.stream().filter(a->a.getPlanProcedureId().equals(planProcedureTotal.getId())).collect(Collectors.toList());
+                            prodProcedureTeams = prodProcedureTeams.stream().sorted(Comparator.comparing(ProdProcedureTeam::getId)).collect(Collectors.toList());
+                            String teamIds = prodProcedureTeams.stream().map(ProdProcedureTeam::getUserId).collect(Collectors.joining(","));
+                            BigDecimal overCountWages = new BigDecimal(0);
+                            BigDecimal overWorkingHours = new BigDecimal(0);
+                            if(!org.springframework.util.StringUtils.isEmpty(teamIds)){
+                                String[] team = teamIds.split(",");
+                                totalWages=totalWages.divide(new BigDecimal(team.length),1, RoundingMode.HALF_UP);
+                                totalWorkingHours=totalWorkingHours.divide(new BigDecimal(team.length),1, RoundingMode.HALF_UP);
+                                overCountWages=totalWages.multiply(new BigDecimal(team.length));
+                                overWorkingHours=totalWorkingHours.multiply(new BigDecimal(team.length));
+                                for (int i = 0; i < team.length; i++) {
+                                    int finalI = i;
+                                    //已存在的人员更新处理
+                                    Optional<ProdProcedureTeam> teamOptional = prodProcedureTeams.stream().filter(pl -> pl.getUserId().equals(team[finalI])).findFirst();
+                                    if(teamOptional.isPresent()){
+                                        ProdProcedureTeam prodProcedureTeam = teamOptional.get();
+                                        if(i==team.length-1){
+                                            double wagesAbs =new BigDecimal(planProcedureTotal.getTotalWages()).subtract(overCountWages).doubleValue();
+                                            double workTimesAbs =new BigDecimal(planProcedureTotal.getTotalWorkingHours()).subtract(overWorkingHours).doubleValue();
+                                            prodProcedureTeam.setWorkTime(totalWorkingHours.add(new BigDecimal(workTimesAbs)).doubleValue());
+                                            prodProcedureTeam.setJobOfMoney(totalWages.add(new BigDecimal(wagesAbs)));
+                                        }else {
+                                            prodProcedureTeam.setWorkTime(totalWorkingHours.doubleValue());
+                                            prodProcedureTeam.setJobOfMoney(totalWages);
+                                        }
+                                        if(plan.get().getPlanType()==1){
+                                            prodProcedureTeam.setStatus(1);
+                                        }
+                                        needUpdateTeamList.add(prodProcedureTeam);
+                                        //todo:找到用到当前工序的report (报工表) 更新 单价相关数据
+                                        List<Report> reports = allReports.stream().filter(a -> a.getUserProcedureTeamId().equals(prodProcedureTeam.getId())).collect(Collectors.toList());
+                                        for (Report report : reports) {
+                                            double curReportTime = 0.0;
+                                            Integer num = plan.get().getNum();//总件数
+                                            double addPercent = report.getFinishNum() / num;
+                                            //新版计算报工的工时和价钱;根据填报件数的占比计算工时和价钱
+                                            double earnMoney = planProcedureTotal.getTotalWages() * addPercent;
+                                            curReportTime = planProcedureTotal.getTotalWorkingHours() * addPercent;
+                                            report.setWorkingTime(curReportTime);//本次报工的工时数
+                                            report.setCost(new BigDecimal(earnMoney));//本次报工的成本
+                                            needUpdateReportList.add(report);
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+                planProcedureTotalService.updateBatchById(planProcedureTotals);
+                if(needUpdateTeamList.size()>0){
+                    prodProcedureTeamService.updateBatchById(needUpdateTeamList);
+                }
+                if(needUpdateReportList.size()>0){
+                    reportService.updateBatchById(needUpdateReportList);
+                }
+            }
+        }catch (Exception e){
+            e.printStackTrace();
+            msg.setError("验证失败");
+        }
+        return msg;
+    }
 }

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

@@ -4285,11 +4285,11 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
     }
 
     @Override
-    public HttpRespMsg getPersonWorkHoursWagesDetail(String date, String userId,String startDate,String endDate,Integer checkStatus,Integer detailStatus) {
+    public HttpRespMsg getPersonWorkHoursWagesDetail(String date, String userId,String startDate,String endDate) {
         User user = userMapper.selectById(request.getHeader("token"));
-        if(checkStatus!=null&&checkStatus==0&&StringUtils.isEmpty(userId)){
-            userId=user.getId();
-        }
+//        if(checkStatus!=null&&checkStatus==0&&StringUtils.isEmpty(userId)){
+//            userId=user.getId();
+//        }
         boolean canViewAll = sysFunctionService.hasPriviledge(user.getRoleId(), "查看全部人员工时工价");
         List<Department> allDeptList = departmentMapper.selectList(new LambdaQueryWrapper<Department>().eq(Department::getCompanyId, user.getCompanyId()));
         List<Department> departmentList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", user.getCompanyId()).eq("manager_id", user.getId()));
@@ -4299,14 +4299,35 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
         deptIds.addAll(otherDeptIds);
         //日期范围内所有请假数据
         List<LeaveSheet> leaveSheetList = leaveSheetService.list(new LambdaQueryWrapper<LeaveSheet>().le(LeaveSheet::getStartDate, endDate).ge(LeaveSheet::getEndDate, startDate).eq(LeaveSheet::getOwnerId,userId));
-        List<Map<String,Object>> mapList=reportMapper.getPersonWorkHoursWagesDetail(date,userId,user.getCompanyId(),startDate,endDate,checkStatus,detailStatus);
+        List<Map<String,Object>> mapList=reportMapper.getPersonWorkHoursWagesDetail(date,userId,user.getCompanyId(),startDate,endDate,null,null);
         HttpRespMsg httpRespMsg=new HttpRespMsg();
         HashMap map=new HashMap();
         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());
+        httpRespMsg.setData(map);
+        return httpRespMsg;
+    }
+
+    @Override
+    public HttpRespMsg getPersonWorkHoursWagesDetailForMob(String date, String userId, String startDate, String endDate,Integer checkStatus,Integer detailStatus) {
+        User user = userMapper.selectById(request.getHeader("token"));
+        if(checkStatus!=null&&checkStatus==0&&StringUtils.isEmpty(userId)){
+            userId=user.getId();
+        }
+        boolean canViewAll = sysFunctionService.hasPriviledge(user.getRoleId(), "查看全部人员工时工价");
+        List<Department> allDeptList = departmentMapper.selectList(new LambdaQueryWrapper<Department>().eq(Department::getCompanyId, user.getCompanyId()));
+        List<Department> departmentList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", user.getCompanyId()).eq("manager_id", user.getId()));
+        List<DepartmentOtherManager> departmentOtherManagers = departmentOtherManagerMapper.selectList(new QueryWrapper<DepartmentOtherManager>().eq("company_id", user.getCompanyId()).eq("other_manager_id", user.getId()));
+        List<Integer> deptIds = departmentList.stream().map(Department::getDepartmentId).distinct().collect(Collectors.toList());
+        List<Integer> otherDeptIds = departmentOtherManagers.stream().map(DepartmentOtherManager::getDepartmentId).distinct().collect(Collectors.toList());
+        deptIds.addAll(otherDeptIds);
+        //日期范围内所有请假数据
+        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();
         if(checkStatus!=null && detailStatus==null){
-            mapList=reportMapper.getPersonWorkHoursWagesDetail(date,user.getId(),user.getCompanyId(),startDate,endDate,checkStatus,detailStatus);
+            List<Map<String,Object>> mapList=reportMapper.getPersonWorkHoursWagesDetailForMob(date,user.getId(),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));

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

@@ -2060,6 +2060,7 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
         ResponseEntity<String> ResponseEntity = restTemplate.postForEntity(url, entity, String.class);
         if (ResponseEntity.getStatusCode() == HttpStatus.OK) {
             String resp = ResponseEntity.getBody();
+            System.out.println("GET APPROVAL_INFO_DETAIL======>"+resp);
             return resp;
         }
         return null;

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

@@ -248,7 +248,7 @@ public class TimingTask {
                     JSONObject info = approvalInfoDetail.getJSONObject("info");
                     JSONObject applyer = info.getJSONObject("applyer");
                     String userid = applyer.getString("userid");
-                    Optional<User> first = userList.stream().filter(u -> u.getCorpwxUserid().equals(userid)).findFirst();
+                    Optional<User> first = userList.stream().filter(u ->u.getCorpwxRealUserid()!=null&& u.getCorpwxRealUserid().equals(userid)).findFirst();
                     if(!first.isPresent()){
                         continue;
                     }

+ 0 - 44
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/util/CodeUtil.java

@@ -1,44 +0,0 @@
-package com.management.platform.util;
-
-import java.math.BigDecimal;
-import java.math.RoundingMode;
-import java.text.DecimalFormat;
-import java.util.Random;
-
-/**
- * Author: 吴涛涛 cuiyi@itany.com
- * Date : 2019 - 10 - 24 16:23
- * Description:验证码生成工具
- * Version: 1.0
- */
-public class CodeUtil {
-
-
-    public HttpRespMsg getVcode(String mobile) {
-        HttpRespMsg msg = new HttpRespMsg();
-        if (mobile != null) {
-            Random r = new Random();
-            int val = r.nextInt(10000);
-            if (val < 1000) {
-                val += 1000;
-            }
-            String codeValStr = "" + val;
-//            Vcode record = new Vcode();
-//            record.setMobile(mobile);
-//            record.setVcode("" + val);
-//            vcodeMapper.insertSelective(record);
-//            try {
-//                SendSmsResponse sendSmsResponse = SmsDemo.sendSms(mobile, record.getVcode());
-//            } catch (ClientException e) {
-//                e.printStackTrace();
-//            }
-        }
-        return msg;
-    }
-
-    public static void main(String[] args) {
-        double temp = 1.42;
-        int thirdPosNum = ((int)(temp*1000))%10;
-        System.out.println(thirdPosNum);
-    }
-}

+ 0 - 153
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/util/FileUtil.java

@@ -1,153 +0,0 @@
-package com.management.platform.util;
-
-import com.fasterxml.jackson.annotation.ObjectIdGenerators;
-import org.apache.commons.io.FileUtils;
-import org.springframework.web.multipart.MultipartFile;
-
-import java.io.*;
-import java.util.Arrays;
-
-/**
- * 文件读取工具类
- */
-public class FileUtil {
-
-    /**
-     * 获取容易识别的文件大小,比如KB, MB, GB
-     * @param size
-     * @return
-     */
-    public static String getReadableFileSize(long size) {
-        if (size < 1024) {//1K以内
-            return size + "byte";
-        } else if (size < 1024 * 1024) {//1M以内
-            return String.format("%.1fKB", (size*1.0f/1024));
-        } else if (size < 1024 * 1024 * 1024) {//1G以内
-            return String.format("%.1fMB", (size*1.0f/1024/1024));
-        } else {
-            return String.format("%.1fGB", (size*1.0f/1024/1024/1024));
-        }
-    }
-
-
-    /**
-     * 读取文件内容,作为字符串返回
-     */
-    public static String readFileAsString(String filePath) throws IOException {
-        File file = new File(filePath);
-        if (!file.exists()) {
-            throw new FileNotFoundException(filePath);
-        }
-
-        if (file.length() > 1024 * 1024 * 1024) {
-            throw new IOException("File is too large");
-        }
-
-        StringBuilder sb = new StringBuilder((int) (file.length()));
-        // 创建字节输入流  
-        FileInputStream fis = new FileInputStream(filePath);
-        // 创建一个长度为10240的Buffer
-        byte[] bbuf = new byte[10240];
-        // 用于保存实际读取的字节数  
-        int hasRead = 0;
-        while ((hasRead = fis.read(bbuf)) > 0) {
-            sb.append(new String(bbuf, 0, hasRead));
-        }
-        fis.close();
-        return sb.toString();
-    }
-
-    /**
-     * 根据文件路径读取byte[] 数组
-     */
-    public static byte[] readFileByBytes(String filePath) throws IOException {
-        File file = new File(filePath);
-        if (!file.exists()) {
-            throw new FileNotFoundException(filePath);
-        } else {
-            ByteArrayOutputStream bos = new ByteArrayOutputStream((int) file.length());
-            BufferedInputStream in = null;
-
-            try {
-                in = new BufferedInputStream(new FileInputStream(file));
-                short bufSize = 1024;
-                byte[] buffer = new byte[bufSize];
-                int len1;
-                while (-1 != (len1 = in.read(buffer, 0, bufSize))) {
-                    bos.write(buffer, 0, len1);
-                }
-
-                byte[] var7 = bos.toByteArray();
-                return var7;
-            } finally {
-                try {
-                    if (in != null) {
-                        in.close();
-                    }
-                } catch (IOException var14) {
-                    var14.printStackTrace();
-                }
-
-                bos.close();
-            }
-        }
-    }
-
-    /**
-     * 根据文件路径读取byte[] 数组
-     */
-    public static byte[] readFileByBytes(File file) throws IOException {
-        if (file == null) {
-            throw new FileNotFoundException("file is not null");
-        } else {
-            ByteArrayOutputStream bos = new ByteArrayOutputStream((int) file.length());
-            BufferedInputStream in = null;
-            try {
-                in = new BufferedInputStream(new FileInputStream(file));
-                short bufSize = 1024;
-                byte[] buffer = new byte[bufSize];
-                int len1;
-                while (-1 != (len1 = in.read(buffer, 0, bufSize))) {
-                    bos.write(buffer, 0, len1);
-                }
-
-                byte[] var7 = bos.toByteArray();
-                return var7;
-            } finally {
-                try {
-                    if (in != null) {
-                        in.close();
-                    }
-                } catch (IOException var14) {
-                    var14.printStackTrace();
-                }
-
-                bos.close();
-            }
-        }
-    }
-
-
-    /**
-     * 删除
-     *
-     * @param files
-     */
-    private void deleteFile(File... files) {
-        for (File file : files) {
-            if (file.exists()) {
-                file.delete();
-            }
-        }
-    }
-
-    public static void main(String[] args) {
-        String file = "C:\\gitproject\\manHourHousekeeper\\fhKeeper\\formulahousekeeper\\timesheet-workshop-h5\\dist";
-        String target = "D:\\www\\staticproject\\workshop_h5";
-        try {
-            FileUtils.copyDirectory(new File(file), new File(target));
-        } catch (IOException e) {
-            throw new RuntimeException(e);
-        }
-    }
-}

+ 0 - 150
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/util/ZipUtils.java

@@ -1,150 +0,0 @@
-package com.management.platform.util;
-
-import com.alibaba.excel.util.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.*;
-import java.util.Enumeration;
-import java.util.zip.*;
-
-/**
- * @Description 压缩与解压工具
- * @Author      yanghanwei
- * @Date        18:42 2019-11-20
- * @Version     v1
- **/
-public class ZipUtils {
-
-    private static final Logger logger = LoggerFactory.getLogger(ZipUtils.class);
-
-    /**
-     * 压缩 zip
-     * @param filePath  文件夹 全路径
-     * @param fileName  文件夹名称
-     * @param outPath   压缩文件保存路径
-     */
-    public static void zipFile(String filePath, String fileName, String outPath) {
-        logger.info("filePath:{}, fileName:{}, outPath:{}", filePath, fileName, outPath);
-        try {
-            //创建Test.zip文件
-            OutputStream is = new FileOutputStream(outPath);
-            //检查输出流,采用CRC32算法,保证文件的一致性
-            CheckedOutputStream cos = new CheckedOutputStream(is, new CRC32());
-            //创建zip文件的输出流
-            ZipOutputStream zos = new ZipOutputStream(cos);
-            //需要压缩的文件或文件夹对象
-            File file = new File(filePath);
-            //压缩文件的具体实现函数
-            zipFilePost(zos,file,filePath,fileName,outPath);
-            zos.close();
-            cos.close();
-            is.close();
-            System.out.println("压缩完成");
-        } catch (Exception e) {
-            logger.error("压缩失败zipFile,Exception:" + e);
-        }
-    }
-
-    /**
-     * 压缩文件
-     * @param zos       zip文件的输出流
-     * @param file      需要压缩的文件或文件夹对象
-     * @param filePath  压缩的文件路径
-     * @param fileName  需要压缩的文件夹名
-     * @param outPath   缩完成后保存为Test.zip文件
-     */
-    private static void zipFilePost(ZipOutputStream zos, File file, String filePath, String fileName, String outPath){
-
-        try{
-            String path = file.getPath();
-            String zosName = "";
-            if(!StringUtils.isEmpty(path)){
-                zosName = path.substring(path.indexOf(fileName));
-            }
-            File[] files = file.listFiles();
-            if(file.isDirectory() && files != null && files.length > 0) {
-                // 创建压缩文件的目录结构
-                zos.putNextEntry(new ZipEntry(zosName + File.separator));
-                for(File f : files) {
-                    zipFilePost(zos, f, filePath, fileName, outPath);
-                }
-            } else {
-                logger.info("正在压缩文件:{}",file.getName());
-                // 创建压缩文件
-                zos.putNextEntry(new ZipEntry(zosName));
-                // 用字节方式读取源文件
-                InputStream is = new FileInputStream(file.getPath());
-                // 创建一个缓存区
-                BufferedInputStream bis = new BufferedInputStream(is);
-                // 字节数组,每次读取1024个字节
-                byte [] b = new byte[1024];
-                // 循环读取,边读边写
-                while(bis.read(b)!=-1) {
-                    // 写入压缩文件
-                    zos.write(b);
-                }
-                //关闭流
-                bis.close();
-                is.close();
-            }
-        } catch (Exception e) {
-            logger.error("压缩文件失败zipFilePost,Exception:" + e);
-        }
-    }
-
-    public static void unzip(String sourcePath, String targetPath) {
-        //targetPath输出文件路径
-        File targetFile = new File(targetPath);
-        // 如果目录不存在,则创建
-        if (!targetFile.exists()) {
-            targetFile.mkdirs();
-        }
-        //sourcePath压缩包文件路径
-        try (ZipFile zipFile = new ZipFile(new File(sourcePath))) {
-            System.out.println("file nums:" + zipFile.size());
-            Enumeration enumeration = zipFile.entries();
-            while (enumeration.hasMoreElements()) {
-                //依次获取压缩包内的文件实体对象
-                ZipEntry entry = (ZipEntry) enumeration.nextElement();
-                String name = entry.getName();
-                if (entry.isDirectory()) {
-                    continue;
-                }
-                try (BufferedInputStream inputStream = new BufferedInputStream(zipFile.getInputStream(entry))) {
-                    // 需要判断文件所在的目录是否存在,处理压缩包里面有文件夹的情况
-                    String outName = targetPath + "/" + name;
-                    File outFile = new File(outName);
-                    File tempFile = new File(outName.substring(0, outName.lastIndexOf("/")));
-                    if (!tempFile.exists()) {
-                        tempFile.mkdirs();
-                    }
-                    try (BufferedOutputStream outputStream = new BufferedOutputStream(new FileOutputStream(outFile))) {
-                        int len;
-                        byte[] buffer = new byte[1024];
-                        while ((len = inputStream.read(buffer)) > 0) {
-                            outputStream.write(buffer, 0, len);
-                        }
-                    }
-
-                }
-
-            }
-
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-    public static void main(String[] args) throws Exception{
-//        String filePath = "/var/folders/88/jh37h0fj59l1f302jdryz4780000gn/T/201908月小微平台消耗-1574300435525/";
-//        // 需要压缩的文件夹名
-//        String fileName = "201908月小微平台消耗-1574300435525";
-//        // 压缩完成后保存为Test.zip文件,名字随意
-//        String outPath = "/var/folders/88/jh37h0fj59l1f302jdryz4780000gn/T/Test3.zip";
-//        zipFile(filePath, fileName, outPath);
-
-        String sourcePath = "C:\\gitproject\\manHourHousekeeper\\fhKeeper\\formulahousekeeper\\timesheet-workshop\\distPC.zip";
-        String targetPath = "C:\\文档资料\\distPC";
-        unzip(sourcePath, targetPath);
-    }
-}

+ 33 - 33
fhKeeper/formulahousekeeper/management-workshop/src/main/resources/mapper/ReportMapper.xml

@@ -154,38 +154,38 @@
         </if>
         group by b.id, a.create_date
     </select>
-<!--修改前 人员工时工价表详情数据-->
-<!--    <select id="getPersonWorkHoursWagesDetail" resultType="java.util.Map">-->
-<!--        select r.cost,r.working_time,r.finish_num, r.creator_id,ppt.total_progress as progress,DATE_FORMAT(r.create_date,'%Y%m%d') as createDate,pp.name as procedureName,(case  when pp.check_type=0 then '自检' when pp.check_type=1 then '互检' else '专检' end) as checkType,-->
-<!--        p.name as productName,DATE_FORMAT(plan.start_date,'%Y%m%d') as planStartDate,DATE_FORMAT(plan.end_date,'%Y%m%d') as planEndDate ,-->
-<!--        plan.task_change_notice_num as taskName,plan.plan_type as planType,u.name as checkerName,u2.name as creatorName,plan.product_scheduling_num,r.finish_num as finishNum-->
-<!--        from report r-->
-<!--        left join prod_procedure_team ppt2 on r.user_procedure_team_id=ppt2.id-->
-<!--        left join prod_procedure pp on r.prod_procedure_id=pp.id-->
-<!--        left join plan_procedure_total ppt on ppt.id=ppt2.plan_procedure_id-->
-<!--        left join product p on p.id=r.product_id-->
-<!--        left join plan on plan.id=r.plan_id-->
-<!--        left join user u on r.checker_id=u.id-->
-<!--        left join user u2 on r.creator_id=u2.id-->
-<!--        where r.company_id=#{companyId}  and r.finish_num &gt; 0-->
-<!--        <if test="date!=null and date!=''">-->
-<!--            and r.create_date=#{date}-->
-<!--        </if>-->
-<!--        <if test="userId!=null and userId!=''">-->
-<!--            <choose>-->
-<!--                <when test="checkStatus!=null and checkStatus==1 and detailStatus==null">-->
-<!--                    and plan.foreman_id=#{userId}-->
-<!--                </when>-->
-<!--                <otherwise>-->
-<!--                    and r.creator_id=#{userId}-->
-<!--                </otherwise>-->
-<!--            </choose>-->
-<!--        </if>-->
-<!--        <if test="startDate!=null and endDate!=null">-->
-<!--            and r.create_date between #{startDate} and #{endDate}-->
-<!--        </if>-->
-<!--    </select>-->
 
+    <select id="getPersonWorkHoursWagesDetailForMob" resultType="java.util.Map">
+        select r.cost,r.working_time,r.finish_num, r.creator_id,ppt.total_progress as progress,DATE_FORMAT(r.create_date,'%Y%m%d') as createDate,pp.name as procedureName,(case  when pp.check_type=0 then '自检' when pp.check_type=1 then '互检' else '专检' end) as checkType,
+        p.name as productName,DATE_FORMAT(plan.start_date,'%Y%m%d') as planStartDate,DATE_FORMAT(plan.end_date,'%Y%m%d') as planEndDate ,
+        plan.task_change_notice_num as taskName,plan.plan_type as planType,u.name as checkerName,u2.name as creatorName,plan.product_scheduling_num,r.finish_num as finishNum
+        from report r
+        left join prod_procedure_team ppt2 on r.user_procedure_team_id=ppt2.id
+        left join prod_procedure pp on r.prod_procedure_id=pp.id
+        left join plan_procedure_total ppt on ppt.id=ppt2.plan_procedure_id
+        left join product p on p.id=r.product_id
+        left join plan on plan.id=r.plan_id
+        left join user u on r.checker_id=u.id
+        left join user u2 on r.creator_id=u2.id
+        where r.company_id=#{companyId}  and r.finish_num &gt; 0
+        <if test="date!=null and date!=''">
+            and r.create_date=#{date}
+        </if>
+        <if test="userId!=null and userId!=''">
+            <choose>
+                <when test="checkStatus!=null and checkStatus==1 and detailStatus==null">
+                    and plan.foreman_id=#{userId}
+                </when>
+                <otherwise>
+                    and r.creator_id=#{userId}
+                </otherwise>
+            </choose>
+        </if>
+        <if test="startDate!=null and endDate!=null">
+            and r.create_date between #{startDate} and #{endDate}
+        </if>
+    </select>
+    <!--修改前 人员工时工价表详情数据-->
     <select id="getPersonWorkHoursWagesDetail" resultType="java.util.Map">
         select r.cost,r.working_time,r.finish_num as finish_num, r.creator_id,ppt.total_progress as progress,DATE_FORMAT(r.create_date,'%Y%m%d') as createDate,pp.name as procedureName,(case  when pp.check_type=0 then '自检' when pp.check_type=1 then '互检' else '专检' end) as checkType,
         p.name as productName,DATE_FORMAT(plan.start_date,'%Y%m%d') as planStartDate,DATE_FORMAT(plan.end_date,'%Y%m%d') as planEndDate ,
@@ -196,8 +196,8 @@
         LEFT JOIN report r ON r.user_procedure_team_id=ppt2.id
         LEFT JOIN prod_procedure pp ON ppt.prod_procedure_id=pp.id
         LEFT JOIN product p ON p.id=plan.product_id
-        LEFT JOIN USER u ON r.checker_id=u.id
-        LEFT JOIN USER u2 ON r.creator_id=u2.id
+        LEFT JOIN user u ON r.checker_id=u.id
+        LEFT JOIN user u2 ON r.creator_id=u2.id
         WHERE ppt2.company_id=#{companyId}
         <if test="date!=null and date!=''">
             and r.create_date=#{date}

+ 2 - 1
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/planView/todayPlan/distribution.vue

@@ -180,7 +180,7 @@ export default {
     allChecked(){
         if(this.isAllChecked){
             for(let i in this.distributionList){
-                if(this.distributionList[i].teamNames.indexOf(this.user.name) == -1){
+                if(this.distributionList[i].teamNames&&this.distributionList[i].teamNames.indexOf(this.user.name) != -1){
                   this.distributionList[i].prodProcedure.isSelected = true
                 }
             }
@@ -191,6 +191,7 @@ export default {
             }
             this.isCanAgree = false
         }
+        console.log(this.distributionList)
         this.$forceUpdate();
     },
     itemChecked(){

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

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

+ 2 - 2
fhKeeper/formulahousekeeper/timesheet_h5/vue.config.js

@@ -5,9 +5,9 @@ const themePath = path.resolve(__dirname,'src/assets/style/theme.less');
 const Timestamp = new Date().getTime();
 
 // var ip = '47.101.180.183'
-var ip = '47.100.37.243'
+// var ip = '47.100.37.243'
 // var ip = '192.168.2.8'
-// var ip = '127.0.0.1'
+var ip = '127.0.0.1'
 
 // var os = require('os'), ip = '', ifaces = os.networkInterfaces() // 获取本机ip
 // for (var i in ifaces) {