jiangping
2024-11-29 a2e8793e2c53c7e80b67c1fe407b78fde59b2296
最新版本541200007
已添加19个文件
已修改20个文件
1542 ■■■■■ 文件已修改
admin/.env.development 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/api/business/areas.js 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/components/business/OperaAreasWindow.vue 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/business/areas.vue 160 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/meeting/meeting_admin/src/main/resources/application.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/system_gateway/src/main/resources/application.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/system_service/src/main/java/com/doumee/core/utils/Constants.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/system_service/src/main/java/com/doumee/core/utils/DateUtil.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/system_timer/src/main/resources/application.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/admin_timer/src/main/resources/application.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/board/PlatformJobRunActController.java 157 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/board/PlatformJobRunController.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_admin/src/main/resources/application.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_screen/src/main/resources/application.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/cars/BaseCarsPageResponse.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/cars/BaseCarsResponse.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/cars/request/CarsDeviceRequest.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/cars/request/CarsGpsRequest.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/cars/response/CarsDeviceChannelResponse.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/cars/response/CarsDeviceDetaisResponse.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/cars/response/CarsDeviceResponse.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/cars/response/CarsGpsResponse.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/service/HKCarOpenService.java 236 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/PlatformLogMapper.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/PlatformWmsJobMapper.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/PlatformWmsDetail.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/PlatformWmsJob.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/web/reqeust/CarsJobAndContractDTO.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/web/response/platformReport/AlarmEventDataVO.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/web/response/platformReport/BoardCarsListVO.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/web/response/platformReport/BoardJobCenterDataVO.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/web/response/platformReport/CarsContractVO.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/web/response/platformReport/CarsJobAndContractVO.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/web/response/platformReport/PlatformJobRunBoardNewVO.java 93 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncInitConfigServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/thrid/BoardServiceImpl.java 381 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/thrid/WmsServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/third/BoardService.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/openapi/src/main/resources/application.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/.env.development
@@ -1,8 +1,8 @@
# å¼€å‘环境配置
NODE_ENV = 'development'
#VUE_APP_API_URL  = 'http://localhost:10010'
VUE_APP_API_URL  = 'http://localhost:10010'
# VUE_APP_API_URL  = 'http://192.168.0.113:10010'
# VUE_APP_API_URL  = 'http://192.168.0.173/gateway_interface'
 VUE_APP_API_URL  = 'http://10.50.250.253:8088/gateway_interface'
 #VUE_APP_API_URL  = 'http://10.50.250.253:8088/gateway_interface'
admin/src/api/business/areas.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,43 @@
import request from '../../utils/request'
// æŸ¥è¯¢
export function fetchList (data) {
  // return request.post('/visitsAdmin/cloudService/business/areas/treeList', data, {
  //   trim: true
  // })
  return request.post('/visitsAdmin/cloudService/business/areas/page', data, {
    trim: true
  })
}
export function listByParentId (data) {
  return request.post('/visitsAdmin/cloudService/business/areas/listByParentId', data)
}
// åˆ›å»º
export function create (data) {
  return request.post('/visitsAdmin/cloudService/business/areas/create', data)
}
// ä¿®æ”¹
export function updateById (data) {
  return request.post('/visitsAdmin/cloudService/business/areas/updateById', data)
}
// æ ‘å½¢
export function treeList (data) {
  return request.post('/visitsAdmin/cloudService/business/areas/listByParentId', data)
}
// åˆ é™¤
export function deleteById (id) {
  return request.get(`/visitsAdmin/cloudService/business/areas/delete/${id}`)
}
// æ‰¹é‡åˆ é™¤
export function deleteByIdInBatch (ids) {
  return request.get('/visitsAdmin/cloudService/business/areas/delete/batch', {
    params: {
      ids
    }
  })
}
admin/src/components/business/OperaAreasWindow.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,94 @@
<template>
  <GlobalAlertWindow
    :title="title"
    :visible.sync="visible"
    :confirm-working="isWorking"
    @confirm="confirm"
  >
    <el-form :model="form" ref="form" label-width="100px" label-suffix=":" :rules="rules">
      <el-form-item :label="form.type==0?'市名称':'县区名称'" prop="name">
        <el-input v-model="form.name" :placeholder="form.type==0?'输入市名称':'输入县区名称'" v-trim/>
      </el-form-item>
      <el-form-item label="排序码" prop="sortnum">
        <el-input v-model="form.sortnum" placeholder="请输入排序码" v-trim/>
      </el-form-item>
    </el-form>
  </GlobalAlertWindow>
</template>
<script>
import BaseOpera from '@/components/base/BaseOpera'
import GlobalAlertWindow from '@/components/common/GlobalAlertWindow'
export default {
  name: 'OperaAreasWindow',
  extends: BaseOpera,
  components: { GlobalAlertWindow },
  data () {
    return {
      // è¡¨å•数据
      form: {
        id: null,
        parentId: null,
        name: null,
        sortnum: '0',
        type: '',
      },
      // éªŒè¯è§„则
      rules: {
      }
    }
  },
  created () {
    this.config({
      api: '/business/areas',
      'field.id': 'id'
    })
  },
  methods: {
    // ç¡®è®¤æ–°å»º
    __confirmCreate () {
      this.$refs.form.validate((valid) => {
        if (!valid) {
          return
        }
        // è°ƒç”¨æ–°å»ºæŽ¥å£
        this.isWorking = true
        this.api.create(this.form)
          .then(() => {
            this.visible = false
            this.$message.success('新建成功')
            this.$emit('success', this.form.parentId)
          })
          .catch(e => {
            this.$message.error(e)
          })
          .finally(() => {
            this.isWorking = false
          })
      })
    },
    // ç¡®è®¤ä¿®æ”¹
    __confirmEdit () {
      this.$refs.form.validate((valid) => {
        if (!valid) {
          return
        }
        // è°ƒç”¨æ–°å»ºæŽ¥å£
        this.isWorking = true
        this.api.updateById(this.form)
          .then(() => {
            this.visible = false
            this.$message.success('修改成功')
            this.$emit('success', this.form.parentId)
          })
          .catch(e => {
            this.$message.error(e)
          })
          .finally(() => {
            this.isWorking = false
          })
      })
    }
  },
}
</script>
admin/src/views/business/areas.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,160 @@
<template>
  <TableLayout :permissions="['business:areas:query']">
    <!-- è¡¨æ ¼å’Œåˆ†é¡µ -->
    <template v-slot:table-wrap>
      <el-table
        ref="table"
        v-loading="isWorking.search"
        :data="tableData.list"
        lazy
        :load="load"
        :tree-props="{ children: 'childList', hasChildren: 'hasChildren' }"
        row-key="id"
        stripe
        border
        :header-row-class-name="'table-header'"
        class="doumee-element-table"
        @selection-change="handleSelectionChange"
      >
        <el-table-column prop="name" label="地区名称" min-width="100px"></el-table-column>
        <el-table-column prop="createDate" label="创建时间" align="center" min-width="140px"></el-table-column>
        <el-table-column prop="sortnum" label="排序码" align="center" min-width="140px"></el-table-column>
        <el-table-column
          v-if="containPermissions(['business:areas:update', 'business:areas:create', 'business:areas:delete'])"
          label="操作"
          align="center"
          min-width="220"
          fixed="right"
        >
          <template slot-scope="{ row }">
            <el-button type="text" @click="edit(row)" v-permissions="['business:areas:update']">编辑</el-button>
            <el-button v-if="row.type!=2" type="text" @click="createChild(row)" v-permissions="['business:areas:create']">新建{{ row.type==0 ? '市' : '区县' }}</el-button>
            <el-button type="text" @click="deleteById(row)" v-permissions="['business:areas:delete']">删除</el-button>
          </template>
        </el-table-column>
      </el-table>
    </template>
    <!-- æ–°å»º/修改 -->
    <OperaAreasWindow ref="operaAreasWindow" @success="update"/>
  </TableLayout>
</template>
<script>
import BaseTable from '@/components/base/BaseTable'
import TableLayout from '@/layouts/TableLayout'
import Pagination from '@/components/common/Pagination'
import OperaAreasWindow from '@/components/business/OperaAreasWindow'
import { listByParentId } from '@/api/business/areas'
export default {
  name: 'Areas',
  extends: BaseTable,
  components: { TableLayout, Pagination, OperaAreasWindow },
  data () {
    return {
      // æœç´¢
      searchForm: {
        type: 0,
        parentId: ''
      },
      treeMaps: new Map(),
      parentId: null
    }
  },
  created () {
    this.config({
      module: '省市区信息表',
      api: '/business/areas',
      'field.id': 'id',
      'field.main': 'id'
    })
    this.search()
  },
  methods: {
    // é¡µç å˜æ›´å¤„理
    handlePageChange (pageIndex) {
      this.isWorking.search = true
      listByParentId(this.searchForm)
        .then(data => {
          this.tableData.list = this.dataAddBool(data)
        })
        .catch(e => {
          this.$message.error(e)
        })
        .finally(() => {
          this.isWorking.search = false
        })
    },
    dataAddBool(array) {
      array.forEach(item => {
        item.hasChildren = item.type != 2
        // item.childList = item.childList && this.dataAddBool(item.childList)
      })
      return array
    },
    load(tree, treeNode, resolve) {
      this.treeMaps.set(tree.id, { tree, treeNode, resolve })
      listByParentId({ parentId: tree.id, type: tree.type + 1 })
        .then(data => {
          resolve(this.dataAddBool(data||[]))
        })
        .catch(e => {
          this.$message.error(e)
        })
        .finally(() => {
          this.isWorking.search = false
        })
    },
    refreshLoadTree(parentId) {
      if (this.treeMaps.get(parentId)) {
        const { tree, treeNode, resolve } = this.treeMaps.get(parentId)
        this.$set(this.$refs.table.store.states.lazyTreeNodeMap, parentId, [])
        if (tree) { // é‡æ–°æ‰§è¡Œçˆ¶èŠ‚ç‚¹åŠ è½½å­çº§æ“ä½œ
          this.load(tree, treeNode, resolve)
          if (tree.parentId) { // è‹¥å­˜åœ¨çˆ·çˆ·ç»“点,则执行爷爷节点加载子级操作,防止最后一个子节点被删除后父节点不显示删除按钮
            const a = this.treeMaps.get(tree.parentId)
            this.load(a.tree, a.treeNode, a.resolve)
          }
        }
      } else {
        this.handlePageChange()
      }
    },
    deleteById (row, childConfirm = true) {
      // let message = `确认删除${this.module}【${row[this.configData['field.main']]}】吗?`
      let message = `确认删除该记录吗?`
      if (childConfirm && row.childList != null && row.childList.length > 0) {
        // message = `确认删除${this.module}【${row[this.configData['field.main']]}】及其子${this.module}吗?`
        message = `确认删除该记录及其子数据吗?`
      }
      this.$dialog.deleteConfirm(message)
        .then(() => {
          this.isWorking.delete = true
          this.api.deleteById(row[this.configData['field.id']])
            .then(() => {
              this.$message.success('删除成功')
              this.refreshLoadTree(row.parentId)
            })
            .catch(e => {
              this.$message.error(e)
            })
            .finally(() => {
              this.isWorking.delete = false
            })
        })
        .catch(() => {})
    },
    edit(row) {
      // this.parentId = row.type==0 ? null : row.type==1 ? '编辑市' : '编辑区县'
      this.$refs.operaAreasWindow.open(row.type==0 ? '编辑省' : row.type==1 ? '编辑市' : '编辑区县', row)
    },
    createChild(row) {
      this.$refs.operaAreasWindow.open(row.type == 0 ? '新建市' : '新建县区', { parentId: row.id, name: '', type: row.type + 1 })
    },
    update(parentId) {
      this.refreshLoadTree(parentId)
    }
  }
}
</script>
server/meeting/meeting_admin/src/main/resources/application.yml
@@ -34,7 +34,7 @@
cache:
  session:
    # ä¼šè¯è¿‡æœŸæ—¶é•¿(s)
    expire: 18000
    expire: 1800
  captcha:
    # éªŒè¯ç è¿‡æœŸæ—¶é•¿(s)
    expire: 300
server/system_gateway/src/main/resources/application.yml
@@ -37,7 +37,7 @@
cache:
  session:
    # ä¼šè¯è¿‡æœŸæ—¶é•¿(s)
    expire: 18000
    expire: 1800
  captcha:
    # éªŒè¯ç è¿‡æœŸæ—¶é•¿(s)
    expire: 300
server/system_service/src/main/java/com/doumee/core/utils/Constants.java
@@ -43,6 +43,9 @@
    public static final String HK_APPSECRET ="HK_APPSECRET" ;
    public static final String HK_HTTPS ="HK_HTTPS" ;
    public static final String HK_PUSH_URL = "HK_PUSH_URL";
    public static final String HK_CARS_OPENAPI_ACCESS_KEY = "HK_CARS_OPENAPI_ACCESS_KEY";
    public static final String HK_CARS_OPENAPI_ACCESS_SECRET = "HK_CARS_OPENAPI_ACCESS_SECRET";
    public static final String HK_CARS_OPENAPI_URL = "HK_CARS_OPENAPI_URL";
    public static final String HK_ROOTORG_CODE ="HK_ROOTORG_CODE" ;
    public static final String HK_ROOTORG_NAME ="HK_ROOTORG_NAME" ;
    public static final String PLATFORM ="PLATFORM" ;
@@ -470,6 +473,14 @@
        d = d.setScale(4, BigDecimal.ROUND_HALF_UP);
        return  d;
    }
    public static BigDecimal formatBigdecimal0Float(BigDecimal d) {
        if (d == null) {
            d = new BigDecimal(0.0);
        }
        //保留两位小数且四舍五入
        d = d.setScale(0, BigDecimal.ROUND_HALF_UP);
        return  d;
    }
    public static BigDecimal formatBigdecimal2Float(BigDecimal d) {
        if (d == null) {
            d = new BigDecimal(0.0);
server/system_service/src/main/java/com/doumee/core/utils/DateUtil.java
@@ -442,7 +442,7 @@
     * @return String
     * @throws Exception
     */
    public static String getNowPlusTime() throws Exception {
    public static String getNowPlusTime()   {
        String nowDate = "";
        try {
            java.sql.Date date = null;
@@ -3042,6 +3042,12 @@
        calendar.add(Calendar.MONTH, month);//
        return calendar.getTime();
    }
    public static Date addYearToDate(Date date, int year) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);
        calendar.add(Calendar.YEAR, year);//
        return calendar.getTime();
    }
    public static String afterDateToStr(Integer days){
        Date date = new Date();
server/system_timer/src/main/resources/application.yml
@@ -35,7 +35,7 @@
cache:
  session:
    # ä¼šè¯è¿‡æœŸæ—¶é•¿(s)
    expire: 18000
    expire: 1800
  captcha:
    # éªŒè¯ç è¿‡æœŸæ—¶é•¿(s)
    expire: 300
server/visits/admin_timer/src/main/resources/application.yml
@@ -31,7 +31,7 @@
cache:
  session:
    # ä¼šè¯è¿‡æœŸæ—¶é•¿(s)
    expire: 18000
    expire: 1800
  captcha:
    # éªŒè¯ç è¿‡æœŸæ—¶é•¿(s)
    expire: 300
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/board/PlatformJobRunActController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,157 @@
package com.doumee.cloud.board;
import com.doumee.api.BaseController;
import com.doumee.config.annotation.LoginNoRequired;
import com.doumee.core.model.ApiResponse;
import com.doumee.core.utils.Constants;
import com.doumee.dao.business.join.PlatformJobJoinMapper;
import com.doumee.dao.business.model.Platform;
import com.doumee.dao.business.model.PlatformBooks;
import com.doumee.dao.business.model.PlatformJob;
import com.doumee.dao.business.model.PlatformWmsJob;
import com.doumee.dao.web.reqeust.CarsJobAndContractDTO;
import com.doumee.dao.web.response.platformReport.*;
import com.doumee.service.business.third.BoardService;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
/**
 * Created by IntelliJ IDEA.
 *
 * @Author : Rk
 * @create 2024/10/28 13:42
 */
@Api(tags = "【看板大屏】园区物流运行调度看板")
@RestController
@Slf4j
@RequestMapping(Constants.CLOUD_SERVICE_URL_INDEX+"/board/api/platformJobRunAct")
public class PlatformJobRunActController extends BaseController {
    @Autowired
    private PlatformJobJoinMapper platformJobJoinMapper;
    @Autowired
    private BoardService boardService;
    @LoginNoRequired
    @ApiOperation("查询本月、本年的累计出库量,出入库任务量、出入库作业效率统计数据")
    @GetMapping("/centerData")
    public ApiResponse<PlatformJobRunBoardNewVO> centerData() {
        PlatformJobRunBoardNewVO data = boardService.platformJobCenterData();
        return ApiResponse.success(data);
    }
    @LoginNoRequired
    @ApiOperation("运输任务分析")
    @GetMapping("/transportMeasure")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "queryType", value = "查询类型:0=周;1=月;2=年;", required = true),
    })
    public ApiResponse<List<TransportMeasureVO>> transportMeasure(@RequestParam Integer queryType) {
        List<TransportMeasureVO> list = boardService.transportMeasure(queryType);
        return ApiResponse.success(list);
    }
    @LoginNoRequired
    @ApiOperation("汽车状态、经纬度集合数据")
    @GetMapping("/carsList")
    public ApiResponse<BoardCarsListVO> carsList() {
        BoardCarsListVO data = boardService.platformJobCarsList();
        return ApiResponse.success(data);
    }
    @LoginNoRequired
    @ApiOperation("根据车牌号查询作业信息和合同信息集合")
    @PostMapping("/getCarsJobDetails")
    public ApiResponse<CarsJobAndContractVO> getCarsJobDetails(@RequestBody CarsJobAndContractDTO param) {
        CarsJobAndContractVO data = boardService.getCarsJobDetails(param);
        return ApiResponse.success(data);
    }
    @LoginNoRequired
    @ApiOperation("当日运输任务")
    @GetMapping("/platformJobList")
    public ApiResponse<List<PlatformJob>> platformJobList() {
        List<PlatformJob> list =  platformJobJoinMapper.selectJoinList(PlatformJob.class,
                new MPJLambdaWrapper<PlatformJob>()
                        .selectAll(PlatformJob.class)
                        .selectAs(PlatformBooks::getId,PlatformJob::getBookId)
                        .selectAs(Platform::getName,PlatformJob::getPlatformName)
                        .selectAs(Platform::getWorkRate,PlatformJob::getWorkRate)
                        .selectAs(PlatformWmsJob::getCarrierName,PlatformJob::getCarrierName)
                        .selectAs(PlatformWmsJob::getRepertotyAddress,PlatformJob::getRepertotyAddress)
                        .leftJoin(Platform.class,Platform::getId,PlatformJob::getPlatformId)
                        .leftJoin(PlatformWmsJob.class,PlatformWmsJob::getCarryBillCode,PlatformJob::getBillCode)
                        .leftJoin(PlatformBooks.class,PlatformBooks::getJobId,PlatformJob::getId)
                        .eq(PlatformJob::getIsdeleted,Constants.ZERO)
                        .in(PlatformJob::getStatus
                                ,Constants.PlatformJobStatus.WAIT_CALL.getKey()
                                ,Constants.PlatformJobStatus.CALLED.getKey()
                                ,Constants.PlatformJobStatus.IN_WAIT.getKey()
                                ,Constants.PlatformJobStatus.WORKING.getKey()
                                ,Constants.PlatformJobStatus.TRANSFERING.getKey()
                                ,Constants.PlatformJobStatus.EXCEPTION.getKey()
                                ,Constants.PlatformJobStatus.DONE.getKey()
                        )
                        .orderByDesc(PlatformJob::getSignNum)
                        .last(" limit 20 ")
        );
        return ApiResponse.success(list);
    }
    @LoginNoRequired
    @ApiOperation("出入库任务量")
    @GetMapping("/jobData")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "queryType", value = "查询类型:0=出库;1=入库;", required = true),
    })
    public ApiResponse<JobDataVO> jobData(@RequestParam Integer queryType) {
        Random random = new Random();
        JobDataVO jobDataVO = new JobDataVO();
        jobDataVO.setPlanTaskNum(BigDecimal.valueOf(random.nextInt(1000)));
        jobDataVO.setFinishTaskNum(BigDecimal.valueOf(jobDataVO.getPlanTaskNum().intValue()));
        return ApiResponse.success(jobDataVO);
    }
    @LoginNoRequired
    @ApiOperation("今日入库量统计")
    @GetMapping("/totalInList")
    public ApiResponse<List<GeneralVO>> totalInList() {
        List<GeneralVO> list = new ArrayList<>();
        for (int i = 1; i < 4; i++) {
            Random random = new Random();
            GeneralVO data = new GeneralVO();
            data.setName("厂区名称_"+i);
            data.setNum(BigDecimal.valueOf(random.nextInt(1000)));
            list.add(data);
        }
        return ApiResponse.success(list);
    }
    @LoginNoRequired
    @ApiOperation("库存情况")
    @GetMapping("/stockList")
    public ApiResponse<List<GeneralVO>> stockList() {
        List<GeneralVO> list = new ArrayList<>();
        for (int i = 1; i < 10; i++) {
            Random random = new Random();
            GeneralVO data = new GeneralVO();
            data.setName("名称"+i);
            data.setNum(BigDecimal.valueOf(random.nextInt(1000)));
            list.add(data);
        }
        return ApiResponse.success(list);
    }
}
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/board/PlatformJobRunController.java
@@ -98,9 +98,6 @@
    }
    @LoginNoRequired
    @ApiOperation("当日运输任务")
    @GetMapping("/platformJobList")
server/visits/dmvisit_admin/src/main/resources/application.yml
@@ -34,7 +34,7 @@
cache:
  session:
    # ä¼šè¯è¿‡æœŸæ—¶é•¿(s)
    expire: 18000
    expire: 1800
  captcha:
    # éªŒè¯ç è¿‡æœŸæ—¶é•¿(s)
    expire: 300
server/visits/dmvisit_screen/src/main/resources/application.yml
@@ -37,7 +37,7 @@
cache:
  session:
    # ä¼šè¯è¿‡æœŸæ—¶é•¿(s)
    expire: 18000
    expire: 1800
  captcha:
    # éªŒè¯ç è¿‡æœŸæ—¶é•¿(s)
    expire: 300
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/cars/BaseCarsPageResponse.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,18 @@
package com.doumee.core.haikang.model.cars;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.util.List;
@Data
public class BaseCarsPageResponse<T> {
  private int total;//    number    False    æŸ¥è¯¢æ•°æ®è®°å½•总数
  private int totalPages;//    æ€»é¡µæ•°    Integer
  private int  currentPage    ;//当前页    Integer
  private int  totalRecords;//    æ€»è®°å½•条数    Long
  private int  startIndex    ;//记录开始序号    Long
  @JSONField(name="results",alternateNames = {"rows","list"})
  private List<T> results    ;// object[]    False    æƒé™ç»„对象列表
}
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/cars/BaseCarsResponse.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,17 @@
package com.doumee.core.haikang.model.cars;
import lombok.Data;
@Data
public class BaseCarsResponse<T> {
    private T data;
    /**
     *错误信息描述,仅status不为0时有值
     */
    private String msg;
    /**
     * è¯·æ±‚结果状态值, æˆåŠŸä¸º0,其他值请查看附录返回码状态表。
     */
    private Integer status;
}
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/cars/request/CarsDeviceRequest.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,14 @@
package com.doumee.core.haikang.model.cars.request;
import lombok.Data;
/**
 * è®¾å¤‡åˆ—表请求信息
 */
@Data
public class CarsDeviceRequest  {
    private String   productKey    ;//设备型号秘钥    String    æ—     å¦
    private Integer   pageSize;//    é¡µé¢å¤§å°    Integer    1000    å¦
    private Integer   pageNo    ;//当前页    Integer    1
}
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/cars/request/CarsGpsRequest.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,18 @@
package com.doumee.core.haikang.model.cars.request;
import lombok.Data;
/**
 * GPS列表请求信息
 */
@Data
public class CarsGpsRequest  {
    private String  deviceCode    ;//设备终端手机号    String    æ—     æ˜¯
    private String   startTime    ;//开始时间yyyy-MM-dd HH:mm:ss    String    æ—     æ˜¯
    private String    endTime    ;//结束时间yyyy-MM-dd HH:mm:ss    String    æ—     æ˜¯
    private Boolean   filterInvalidGps    ;//是否过滤无效的GPS    boolean    true    å¦
    private Boolean  filterSupplementGps    ;//是否过滤补报的GPS    boolean    true    å¦
    private Integer   pageSize;//    é¡µé¢å¤§å°    Integer    1000    å¦
    private Integer   pageNo    ;//当前页    Integer    1
}
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/cars/response/CarsDeviceChannelResponse.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,16 @@
package com.doumee.core.haikang.model.cars.response;
import lombok.Data;
/**
 * è®¾å¤‡é€šé“信息
 * @param <T>
 */
@Data
public class CarsDeviceChannelResponse<T> {
    private String  terminalID;//    ç»ˆç«¯æ‰‹æœºå·    String
    private String   channelName;//    é€šé“号名称    String
    private Integer    channelNum;//    é€šé“编号
    private Integer    channelType;//    é€šé“号类型,0 è§†é¢‘通道,1 éŸ³é¢‘通道
}
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/cars/response/CarsDeviceDetaisResponse.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,23 @@
package com.doumee.core.haikang.model.cars.response;
import lombok.Data;
/**
 * GPS列表单元信息
 */
@Data
public class CarsDeviceDetaisResponse {
    private Integer gpsValid    ;//定位状态,0 æ— æ•ˆï¼Œ 1 æœ‰æ•ˆ
    private Double  longitude    ;//经度    Double
    private Double  latitude;//    çº¬åº¦
    private Double  altitude    ;//海拔高度
    private Float   speed;//    é€Ÿåº¦
    private Integer direction;//    æ–¹å‘è§’    Integer
    private String  collectTime    ;//GPS上报时间yyyy-MM-dd HH:mm:ss    String
    private String  accStatus;//    acc状态 0:关闭 1:开启    String
    private Integer supplementSign;//    è¡¥æŠ¥æ ‡è¯†ï¼ˆ1:补报;0:正常上报)    Integer
    private String  createTime;//    ç³»ç»Ÿæ”¶åˆ°GPS时间yyyy-MM-dd HH:mm:ss    String
    private Integer status;//设备状态 0:离线;1:在线;2:休眠
    private String plateNum;//车牌号
    private String  terminalID;//    ç»ˆç«¯æ‰‹æœºå·    String
}
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/cars/response/CarsDeviceResponse.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,25 @@
package com.doumee.core.haikang.model.cars.response;
import lombok.Data;
import java.util.List;
/**
 * è®¾å¤‡åˆ—表单元信息
 * @param <T>
 */
@Data
public class CarsDeviceResponse<T> {
    private String  terminalID;//    ç»ˆç«¯æ‰‹æœºå·    String
    private String  productKey    ;//设备所属型号的产品密钥    String
    private String  createTime;//    æ·»åŠ æ—¶é—´    String
    private String   deviceStatus;//    è®¾å¤‡çŠ¶æ€ 0:离线;1:在线;2:休眠    Integer
    private String  language    ;//固件语言:CN/EN    String
    private String  organizeName;//    ç»„织名称    Sring
    private String  organizeId    ;//组织id    Integer
    private String version    ;//软件版本    String
    private String plateNum    ;//车牌号    String
    private List<CarsDeviceChannelResponse> deviceChannelList;//    è®¾å¤‡é€šé“列表,详细参数见*表2
}
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/cars/response/CarsGpsResponse.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,25 @@
package com.doumee.core.haikang.model.cars.response;
import lombok.Data;
import javax.annotation.PostConstruct;
import java.util.List;
/**
 * GPS列表单元信息
 * @param <T>
 */
@Data
public class CarsGpsResponse<T> {
    private Integer    gpsValid    ;//定位状态,0 æ— æ•ˆï¼Œ 1 æœ‰æ•ˆ
    private Double    longitude    ;//经度    Double
    private Double    latitude;//    çº¬åº¦
    private Double   altitude    ;//海拔高度
    private Float    speed;//    é€Ÿåº¦
    private Integer    direction;//    æ–¹å‘è§’    Integer
    private String   collectTime    ;//GPS上报时间yyyy-MM-dd HH:mm:ss    String
    private String    accStatus;//    acc状态 0:关闭 1:开启    String
    private Integer    supplementSign;//    è¡¥æŠ¥æ ‡è¯†ï¼ˆ1:补报;0:正常上报)    Integer
    private String    createTime;//    ç³»ç»Ÿæ”¶åˆ°GPS时间yyyy-MM-dd HH:mm:ss    String
}
server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/service/HKCarOpenService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,236 @@
package com.doumee.core.haikang.service;
    import com.alibaba.fastjson.JSONObject;
    import com.alibaba.fastjson.TypeReference;
    import com.doumee.core.haikang.model.cars.BaseCarsPageResponse;
    import com.doumee.core.haikang.model.cars.BaseCarsResponse;
    import com.doumee.core.haikang.model.cars.request.CarsDeviceRequest;
    import com.doumee.core.haikang.model.cars.request.CarsGpsRequest;
    import com.doumee.core.haikang.model.cars.response.CarsDeviceDetaisResponse;
    import com.doumee.core.haikang.model.cars.response.CarsDeviceResponse;
    import com.doumee.core.haikang.model.cars.response.CarsGpsResponse;
    import com.doumee.core.haikang.model.param.BaseListPageResponse;
    import com.doumee.core.haikang.model.param.BaseResponse;
    import com.doumee.core.haikang.model.param.respose.FindHomeAlarmInfoPageResponse;
    import com.doumee.core.utils.Constants;
    import com.doumee.core.utils.DateUtil;
    import com.google.common.collect.Maps;
    import org.apache.commons.lang3.StringUtils;
    import org.apache.http.client.methods.CloseableHttpResponse;
    import org.apache.http.client.methods.HttpGet;
    import org.apache.http.impl.client.CloseableHttpClient;
    import org.apache.http.impl.client.HttpClientBuilder;
    import org.apache.http.util.EntityUtils;
    import org.springframework.http.HttpMethod;
    import java.io.UnsupportedEncodingException;
    import java.util.*;
public class HKCarOpenService {
    public static   String ACCESS_KEY = "D_SUB_gfJkiUxt_1723101405213";
    public static   String ACCESS_SECRET = "0vB3VLU21SC6eG8T";
    private static final String SIGNATURE_METHOD = "HMAC-SHA1";
    private static final String DEFAULT_CHARSET  = "UTF-8";
    private static final String REGION_ID = "cn-hangzhou";
    private static final String VERSION = "2.1.0";
    public static   String BASE_URL = "https://open.hikvisionauto.com:14021/v2/";
    private static TreeMap<String, String> getBaseParams()   {
        Map<String, String> params = Maps.newHashMap();
        params.put("SignatureMethod", SIGNATURE_METHOD);
        params.put("SignatureNonce", UUID.randomUUID().toString());
        params.put("AccessKey", ACCESS_KEY);
        params.put("Timestamp", String.valueOf(System.currentTimeMillis()));
        params.put("Version", VERSION);
        params.put("RegionId", REGION_ID);
        TreeMap<String, String> sortParas = Maps.newTreeMap();
        sortParas.putAll(params);
        return sortParas;
    }
    public static String sign(String accessSecret, TreeMap<String, String> params, HttpMethod method) throws Exception {
        String stringToSign = getStringToSign(params, method);
        System.out.println("StringToSign = [" + stringToSign + "]");
        javax.crypto.Mac mac = javax.crypto.Mac.getInstance("HmacSHA1");
        mac.init(new javax.crypto.spec.SecretKeySpec(accessSecret.getBytes(DEFAULT_CHARSET), "HmacSHA1"));
        byte[] signData = mac.doFinal(stringToSign.getBytes(DEFAULT_CHARSET));
        return new sun.misc.BASE64Encoder().encode(signData);
    }
    private static String getStringToSign(TreeMap<String, String> params, HttpMethod method) throws Exception {
        StringBuilder sortQueryStringTmp = new StringBuilder();
        for(Map.Entry<String, String> entry : params.entrySet()){
            sortQueryStringTmp.append("&").append(specialUrlEncode(entry.getKey())).append("=").append(specialUrlEncode(entry.getValue()));
        }
        StringBuilder stringToSign = new StringBuilder();
        stringToSign.append(method.toString()).append("&").append(specialUrlEncode("/")).append("&").append(specialUrlEncode(sortQueryStringTmp.substring(1)));
        return stringToSign.toString();
    }
    public static String specialUrlEncode(String value) throws Exception {
        return java.net.URLEncoder.encode(value, "UTF-8").replace("+", "%20").replace("*", "%2A").replace("%7E", "~");
    }
    public static void main(String[] args) {
        getAllCarsDetais();
    }
    public static List<CarsDeviceDetaisResponse> getAllCarsDetais() {
        List<CarsDeviceDetaisResponse> list = new ArrayList<>();
        BaseCarsPageResponse<CarsDeviceResponse>  data = getDeviceList(new CarsDeviceRequest());
        if(data!=null &&data.getResults()!=null){
            List<String> cars = new ArrayList<>();
            List<String> codes = new ArrayList<>();
            for(CarsDeviceResponse model :data.getResults()){
//                System.out.println("=================车牌号:"+model.getPlateNum());
                cars.add(model.getPlateNum());
                codes.add(model.getTerminalID());
                CarsDeviceDetaisResponse t = new CarsDeviceDetaisResponse();
                t.setPlateNum(model.getPlateNum());
                t.setTerminalID(model.getTerminalID());
                /*CarsGpsRequest gp = new CarsGpsRequest();
                gp.setDeviceCode(t.getTerminalID());
                gp.setFilterSupplementGps(false);
                gp.setFilterSupplementGps(false);
                gp.setStartTime(DateUtil.getYesterday()+" 00:00:00");
                gp.setEndTime(DateUtil.getNowPlusTime());
                gp.setPageNo(1);
                gp.setPageSize(10);*/
                 CarsGpsResponse tg = getLatestGpsInfo(t.getTerminalID());
                if(tg!=null ){
                    t.setSpeed(tg.getSpeed());
                    t.setLatitude(tg.getLatitude());
                    t.setLongitude(tg.getLongitude());
                    t.setCollectTime(tg.getCollectTime());
                    t.setAccStatus(tg.getAccStatus());
                    t.setGpsValid(tg.getGpsValid());
                }
                list.add(t);
            }
            System.out.println("=================车牌总数:"+codes.size());
            Map<String,Integer>   statusList = getDeviceStatusList(codes);
            if(statusList!=null &&statusList.size()>0){
                for(Map.Entry<String, Integer> entry : statusList.entrySet()){
                    CarsDeviceDetaisResponse t = getFromListById(entry.getKey(),list);
                    if(t!=null) {
                        t.setStatus(entry.getValue());
                    }
                }
            }
        }
        for(CarsDeviceDetaisResponse m  : list){
            System.out.println("=================车牌号:"+m.getPlateNum()+" çŠ¶æ€ï¼šã€"+m.getStatus()+"】"+" ä½ç½®ï¼šã€"+m.getLongitude()+","+m.getLatitude()+"】");
        }
        return list;
    }
    private static CarsDeviceDetaisResponse getFromListById(String key, List<CarsDeviceDetaisResponse> list) {
        for(CarsDeviceDetaisResponse dd  :list){
            if(dd.getTerminalID()!=null && key !=null && dd.getTerminalID().equals(key)){
                return  dd;
            }
        }
        return null;
    }
    public static String sendRequest(String url,TreeMap<String, String> map){
        try {
            StringBuilder sortQueryStringTmp = new StringBuilder();
            for(Map.Entry<String, String> entry : map.entrySet()){
                sortQueryStringTmp
                        .append("&")
                        .append(specialUrlEncode(entry.getKey()))
                        .append("=")
                        .append(specialUrlEncode(entry.getValue()));
            }
            //与下方的HttpGet对应,采用的是HttpMethod.GET
            String sign = sign(ACCESS_SECRET + "&", map, HttpMethod.GET);
            url += "?Signature=" + specialUrlEncode(sign) + sortQueryStringTmp.toString();
            CloseableHttpClient httpClient = HttpClientBuilder.create().build();
            //与上方的HttpMethod.GET对应,使用HttpGet
            HttpGet httpDelete = new HttpGet(url);
            CloseableHttpResponse response = httpClient.execute(httpDelete);
            return  EntityUtils.toString(response.getEntity());
        }catch (Exception e){
            e.printStackTrace();
        }
        return null;
}
    public static  BaseCarsPageResponse<CarsGpsResponse>  getGpsList(CarsGpsRequest param)   {
        String url = BASE_URL + "gps/list/";
        TreeMap<String, String> BASE_PARAMS = getBaseParams();
        if(StringUtils.isNotBlank(param.getEndTime())) {
            BASE_PARAMS.put("endTime", param.getEndTime());
        }
        if(StringUtils.isNotBlank(param.getStartTime())){
             BASE_PARAMS.put("startTime",param.getStartTime());
        }
        if( param.getFilterInvalidGps() !=null && !param.getFilterInvalidGps()){
             BASE_PARAMS.put("filterInvalidGps", "false");
        }
        if( param.getFilterSupplementGps() !=null && !param.getFilterSupplementGps()){
             BASE_PARAMS.put("filterSupplementGps", "false");
        }
        if(StringUtils.isNotBlank(param.getDeviceCode())){
            BASE_PARAMS.put("deviceCode", param.getDeviceCode().toString());//设备型号秘钥
        }
        BASE_PARAMS.put("pageSize",Constants.equalsInteger(param.getPageSize(),0)? "100":param.getPageSize().toString());//页面大小
        BASE_PARAMS.put("pageNo", Constants.equalsInteger(param.getPageNo(),0)? "1":param.getPageNo().toString());//当前页
        String str = sendRequest(url,BASE_PARAMS);
        TypeReference typeReference =
                new TypeReference<BaseCarsResponse<BaseCarsPageResponse<CarsGpsResponse>>>(){};
        BaseCarsResponse<BaseCarsPageResponse<CarsGpsResponse>>   result = JSONObject.parseObject(str, typeReference.getType());
        if(result!=null && Constants.equalsInteger(result.getStatus(),0)){
            return  result.getData();
        }
        return  null;
    }
    public static  CarsGpsResponse   getLatestGpsInfo(String deviceCode)   {
        String url = BASE_URL + "gps/latest/";
        TreeMap<String, String> BASE_PARAMS = getBaseParams();
        BASE_PARAMS.put("deviceCode", deviceCode);//设备型号秘钥
        String str = sendRequest(url,BASE_PARAMS);
        TypeReference typeReference =
                new TypeReference<BaseCarsResponse<CarsGpsResponse>>(){};
        BaseCarsResponse<CarsGpsResponse>   result = JSONObject.parseObject(str, typeReference.getType());
        if(result!=null && Constants.equalsInteger(result.getStatus(),0)){
            return  result.getData();
        }
        return  null;
    }
    public static   Map<String,Integer>   getDeviceStatusList(List<String> code)   {
        String url = BASE_URL + "device/status/";
        TreeMap<String, String> BASE_PARAMS = getBaseParams();
        if(code ==null || code.size() ==0){
            return  new HashMap<>();
        }
        BASE_PARAMS.put("deviceCodeList", JSONObject.toJSONString(code));//终端手机号列表
        String str = sendRequest(url,BASE_PARAMS);
        TypeReference typeReference =
                new TypeReference<BaseCarsResponse<Map<String,Integer>>>(){};
        BaseCarsResponse<Map<String,Integer>>   result = JSONObject.parseObject(str, typeReference.getType());
        if(result!=null && Constants.equalsInteger(result.getStatus(),0)){
            return  result.getData();
        }
        return  null;
    }
    public static BaseCarsPageResponse<CarsDeviceResponse> getDeviceList(CarsDeviceRequest param)  {
        String url = BASE_URL + "device/list/";
        TreeMap<String, String> BASE_PARAMS = getBaseParams();
        if(StringUtils.isNotBlank(param.getProductKey())){
            BASE_PARAMS.put("productKey", "");//设备型号秘钥
        }
        BASE_PARAMS.put("pageSize",Constants.equalsInteger(param.getPageSize(),0)? "100":param.getPageSize().toString());//页面大小
        BASE_PARAMS.put("pageNo", Constants.equalsInteger(param.getPageNo(),0)? "1":param.getPageNo().toString());//当前页
        String str = sendRequest(url,BASE_PARAMS);
        TypeReference typeReference =
                new TypeReference<BaseCarsResponse<BaseCarsPageResponse<CarsDeviceResponse>>>(){};
        BaseCarsResponse<BaseCarsPageResponse<CarsDeviceResponse>>   result = JSONObject.parseObject(str, typeReference.getType());
        if(result!=null && Constants.equalsInteger(result.getStatus(),0)){
            return  result.getData();
        }
        return  null;
    }
}
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/PlatformLogMapper.java
@@ -2,11 +2,12 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.doumee.dao.business.model.PlatformLog;
import com.github.yulichang.base.MPJBaseMapper;
/**
 * @author æ±Ÿè¹„蹄
 * @date 2024/06/28 10:03
 */
public interface PlatformLogMapper extends BaseMapper<PlatformLog> {
public interface PlatformLogMapper extends MPJBaseMapper<PlatformLog> {
}
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/PlatformWmsJobMapper.java
@@ -2,11 +2,12 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.doumee.dao.business.model.PlatformWmsJob;
import com.github.yulichang.base.MPJBaseMapper;
/**
 * @author æ±Ÿè¹„蹄
 * @date 2024/06/28 10:03
 */
public interface PlatformWmsJobMapper extends BaseMapper<PlatformWmsJob> {
public interface PlatformWmsJobMapper extends MPJBaseMapper<PlatformWmsJob> {
}
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/PlatformWmsDetail.java
@@ -77,7 +77,9 @@
    @ApiModelProperty(value = "供应商")
    @ExcelColumn(name="供应商")
    private String inRepertotyCode;
    @ApiModelProperty(value = "收货地")
    @ExcelColumn(name="收货地")
    private String repertotyAddress;
    @ApiModelProperty(value = "计划收货数量", example = "1")
    @ExcelColumn(name="计划收货数量")
    private BigDecimal ioQty;
@@ -98,7 +100,7 @@
    @ApiModelProperty(value = "作业完成时间(最终时间)")
    @TableField(exist = false)
    private Date doneDate;
    @ApiModelProperty(value = "计划收货数量(非wms)", example = "1")
    @ApiModelProperty(value = "承运单号", example = "1")
    @TableField(exist = false)
    private BigDecimal ortherIoQty;
    private String carryBillCode;
}
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/PlatformWmsJob.java
@@ -75,7 +75,9 @@
    @ApiModelProperty(value = "司机姓名")
    @ExcelColumn(name="司机姓名")
    private String driverName;
    @ApiModelProperty(value = "收货地")
    @ExcelColumn(name="收货地")
    private String repertotyAddress;
    @ApiModelProperty(value = "承运商")
    @ExcelColumn(name="承运商")
    private String carrierName;
@@ -104,10 +106,6 @@
    @ApiModelProperty(value = "车牌号")
    @ExcelColumn(name="车牌号")
    private String plateNumber;
    @ApiModelProperty(value = "收货地")
    @ExcelColumn(name="收货地")
    private String repertotyAddress;
    @ApiModelProperty(value = "合同号`")
    @ExcelColumn(name="合同号`")
server/visits/dmvisit_service/src/main/java/com/doumee/dao/web/reqeust/CarsJobAndContractDTO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,19 @@
package com.doumee.dao.web.reqeust;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * Created by IntelliJ IDEA.
 *
 * @Author : Rk
 * @create 2024/1/4 16:17
 */
@Data
public class CarsJobAndContractDTO {
    @ApiModelProperty(value = "车牌号")
    private String carCode;
}
server/visits/dmvisit_service/src/main/java/com/doumee/dao/web/response/platformReport/AlarmEventDataVO.java
@@ -26,7 +26,7 @@
    @ApiModelProperty(value = "报警源资源名称")
    private String resourceName;
    @ApiModelProperty(value = "报警状态")
    private String handleStatus;
    private Integer handleStatus;
    @ApiModelProperty(value = "报警类型名称")
    private String alarmTypeName;
server/visits/dmvisit_service/src/main/java/com/doumee/dao/web/response/platformReport/BoardCarsListVO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,31 @@
package com.doumee.dao.web.response.platformReport;
import com.doumee.core.haikang.model.cars.response.CarsDeviceDetaisResponse;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
/**
 * è¿è¾“量
 *
 * @Author : Rk
 * @create 2024/10/25 10:59
 */
@Data
public class BoardCarsListVO {
    @ApiModelProperty(value = "车辆及经纬度信息")
    private List<CarsDeviceDetaisResponse> carsList;
    @ApiModelProperty(value = "在途数量")
    private int busyNum;
    @ApiModelProperty(value = "空闲数量")
    private int idleNum;
    @ApiModelProperty(value = "离线数量")
    private int offlineNum;
}
server/visits/dmvisit_service/src/main/java/com/doumee/dao/web/response/platformReport/BoardJobCenterDataVO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,28 @@
package com.doumee.dao.web.response.platformReport;
import com.doumee.core.haikang.model.cars.response.CarsDeviceDetaisResponse;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
 * è¿è¾“量
 *
 * @Author : Rk
 * @create 2024/10/25 10:59
 */
@Data
public class BoardJobCenterDataVO {
    @ApiModelProperty(value = "在途数量")
    private int busyNum;
    @ApiModelProperty(value = "空闲数量")
    private int idleNum;
    @ApiModelProperty(value = "离线数量")
    private int offlineNum;
}
server/visits/dmvisit_service/src/main/java/com/doumee/dao/web/response/platformReport/CarsContractVO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,30 @@
package com.doumee.dao.web.response.platformReport;
import com.doumee.dao.business.model.PlatformLog;
import com.doumee.dao.business.model.PlatformWmsDetail;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
/**
 * è¿è¾“量
 *
 * @Author : Rk
 * @create 2024/10/25 10:59
 */
@Data
public class CarsContractVO {
    @ApiModelProperty(value = "物料清单")
    private List<PlatformWmsDetail> detailList;
    @ApiModelProperty(value = "合同号")
    private String ioCode;
    @ApiModelProperty(value ="收货地")
    private String address;
    @ApiModelProperty(value = "运输总量")
    private BigDecimal totalNum;
}
server/visits/dmvisit_service/src/main/java/com/doumee/dao/web/response/platformReport/CarsJobAndContractVO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,36 @@
package com.doumee.dao.web.response.platformReport;
import com.doumee.core.haikang.model.cars.response.CarsDeviceDetaisResponse;
import com.doumee.dao.business.model.PlatformLog;
import com.doumee.dao.business.model.PlatformWmsDetail;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
/**
 * è¿è¾“量
 *
 * @Author : Rk
 * @create 2024/10/25 10:59
 */
@Data
public class CarsJobAndContractVO {
    @ApiModelProperty(value = "作业记录集合")
    private List<PlatformLog> logList;
    @ApiModelProperty(value = "合同列表")
    private List<CarsContractVO> contractList;
    @ApiModelProperty(value = "司机手机号")
    private String phone;
    @ApiModelProperty(value = "司机姓名")
    private String name;
    @ApiModelProperty(value = "运输单号")
    private String billCode;
    @ApiModelProperty(value = "运输总量")
    private BigDecimal totalNum;
}
server/visits/dmvisit_service/src/main/java/com/doumee/dao/web/response/platformReport/PlatformJobRunBoardNewVO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,93 @@
package com.doumee.dao.web.response.platformReport;
import com.doumee.dao.business.model.PlatformJob;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
/**
 * å›­åŒºç‰©æµè¿è¡Œè°ƒåº¦çœ‹æ¿
 *
 * @Author : Rk
 * @create 2024/10/25 9:54
 */
@Data
public class PlatformJobRunBoardNewVO {
    @ApiModelProperty(value = "累计出库量 - æœ¬æœˆ")
    private BigDecimal monthOutTotal;
    @ApiModelProperty(value = "累计出库量月度 - ä¸Šæœˆ")
    private BigDecimal monthLastOutTotal;
    @ApiModelProperty(value = "累计出库量 - æœ¬å¹´")
    private BigDecimal yearOutTotal;
    @ApiModelProperty(value = "累计出库量年度 - å޻年")
    private BigDecimal yearLastOutTotal;
    @ApiModelProperty(value = "累计出库车次 - æœ¬æœˆ")
    private Integer monthOutTimes;
    @ApiModelProperty(value = "累计出库车次 - æœ¬å¹´")
    private Integer yearOutTimes;
    @ApiModelProperty(value = "出库任务 - å½“前任务量")
    private BigDecimal currentOutNum;
    @ApiModelProperty(value = "出库任务 - å½“前完成任务量")
    private BigDecimal currentOutDoneNum;
    @ApiModelProperty(value = "入库任务 - å½“前任务量")
    private BigDecimal currentInNum;
    @ApiModelProperty(value = "入库任务 - å½“前完成任务量")
    private BigDecimal currentInDoneNum;
    @ApiModelProperty(value = "今日出库效率")
    private BigDecimal todayOutRate;
    @ApiModelProperty(value = "本月出库效率")
    private BigDecimal monthOutRate;
    @ApiModelProperty(value = "今日入库效率")
    private BigDecimal todayInRate;
    @ApiModelProperty(value = "本月入库效率")
    private BigDecimal monthInRate;
    @ApiModelProperty(value = "库存最大值")
    private BigDecimal stockMax;
    @ApiModelProperty(value = "当前库存")
    private BigDecimal stockTotal;
    @ApiModelProperty(value = "运输任务分析 - 7日" , hidden = true)
    private List<TransportMeasureVO> transportMeasureWeekList;
    @ApiModelProperty(value = "运输任务分析 - æœˆåº¦", hidden = true)
    private List<TransportMeasureVO> transportMeasureMonthList;
    @ApiModelProperty(value = "运输任务分析 - å¹´åº¦", hidden = true)
    private List<TransportMeasureVO> transportMeasureYearList;
    @ApiModelProperty(value = "当日运输任务")
    private List<PlatformJob> platformJobList;
    @ApiModelProperty(value = "出库任务")
    private JobDataVO outJob;
    @ApiModelProperty(value = "入库任务")
    private JobDataVO inJob;
    @ApiModelProperty(value = "今日入库量统计")
    private List<GeneralVO> totalInList;
    @ApiModelProperty(value = "库存情况")
    private List<GeneralVO> stockList;
}
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncInitConfigServiceImpl.java
@@ -3,6 +3,7 @@
import com.doumee.biz.system.SystemDictDataBiz;
import com.doumee.core.haikang.model.HKConstants;
import com.doumee.core.haikang.model.HKTools;
import com.doumee.core.haikang.service.HKCarOpenService;
import com.doumee.core.utils.Constants;
import com.doumee.service.business.InterfaceLogService;
import com.hikvision.artemis.sdk.config.ArtemisConfig;
@@ -28,6 +29,9 @@
    @PostConstruct
    public  int  initHkConfig(){
        HKCarOpenService.ACCESS_KEY= systemDictDataBiz.queryByCode(Constants.HK_PARAM, Constants.HK_CARS_OPENAPI_ACCESS_KEY).getCode();
        HKCarOpenService.BASE_URL= systemDictDataBiz.queryByCode(Constants.HK_PARAM, Constants.HK_CARS_OPENAPI_URL).getCode();
        HKCarOpenService.ACCESS_SECRET= systemDictDataBiz.queryByCode(Constants.HK_PARAM, Constants.HK_CARS_OPENAPI_ACCESS_SECRET).getCode();
        ArtemisConfig.host = systemDictDataBiz.queryByCode(Constants.HK_PARAM, Constants.HK_HOST).getCode();
        ArtemisConfig.appKey = systemDictDataBiz.queryByCode(Constants.HK_PARAM, Constants.HK_APPKEY).getCode();
        ArtemisConfig.appSecret = systemDictDataBiz.queryByCode(Constants.HK_PARAM, Constants.HK_APPSECRET).getCode();
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/thrid/BoardServiceImpl.java
@@ -6,11 +6,13 @@
import com.doumee.core.constants.ResponseStatus;
import com.doumee.core.exception.BusinessException;
import com.doumee.core.haikang.model.HKConstants;
import com.doumee.core.haikang.model.cars.response.CarsDeviceDetaisResponse;
import com.doumee.core.haikang.model.param.BaseListPageResponse;
import com.doumee.core.haikang.model.param.BaseResponse;
import com.doumee.core.haikang.model.param.BaseListPageRequest;
import com.doumee.core.haikang.model.param.request.*;
import com.doumee.core.haikang.model.param.respose.*;
import com.doumee.core.haikang.service.HKCarOpenService;
import com.doumee.core.haikang.service.HKService;
import com.doumee.core.model.ApiResponse;
import com.doumee.core.model.PageData;
@@ -22,6 +24,7 @@
import com.doumee.dao.business.join.VisitsJoinMapper;
import com.doumee.dao.business.model.*;
import com.doumee.dao.system.model.SystemDictData;
import com.doumee.dao.web.reqeust.CarsJobAndContractDTO;
import com.doumee.dao.web.reqeust.SavePlatformWarnEventDTO;
import com.doumee.dao.web.response.platformReport.*;
import com.doumee.service.business.impl.PlatformJobServiceImpl;
@@ -62,6 +65,8 @@
    private PlatformJobMapper platformJobMapper;
    @Autowired
    private PlatformWmsDetailMapper platformWmsDetailMapper;
    @Autowired
    private PlatformWmsJobMapper platformWmsJobMapper;
    @Autowired
    private PlatformMapper platformMapper;
    @Autowired
@@ -451,6 +456,8 @@
        FindHomeAlarmInfoPageRequest param = new FindHomeAlarmInfoPageRequest();
        param.setHour(24);
        param.setPage(1);
        param.setUserId("admin");
//        param.setRegionIndexCodes("root000000");
        param.setAlarmStartTime(DateUtil.getPlusTime2(DateUtil.addDaysToDate(new Date(),-1)));
        param.setAlarmEndTime(DateUtil.getPlusTime2(new Date()));
        param.setPageSize(20);
@@ -464,7 +471,7 @@
                data.add(t);
            }
        }
            return data;
        return data;
    }
    /**
@@ -477,7 +484,7 @@
        List<MonitorDataVO> list = new ArrayList<>();
        MinitorDataSearchRequest param = new MinitorDataSearchRequest();
        param.setResourceTypeCodes(new String[]{});
        param.setRegionIndexCode("root0001");
        param.setRegionIndexCode("root000000");
        param.setIncludeDown("1");
        param.setUserId("admin");
        BaseResponse<BaseListPageResponse<MonitorDataSearchResponse>> response = HKService.minitorDataSearch(param);
@@ -514,8 +521,8 @@
    @Override
    public   List<AlarmDataVO> fightingAlarmHandleData(){
        List<AlarmDataVO> alarmHandleDataVOList = new ArrayList<>();
        Date now = DateUtil.getStartOfDay(new Date());
        for (int i = 1; i < 12; i++) {
        Date now =DateUtil.StringToDate(DateUtil.getFirstDayCurrentMonth(),"yyyy-MM") ;
        for (int i = 1; i <= 12; i++) {
            Date start  =  DateUtil.addMonthToDate(now,-12+i);
            Date end  =  DateUtil.addMonthToDate(now,-11+i);
            AlarmDataVO t = getAlertDataByStartEndTime(DateUtil.getPlusTime2(start),DateUtil.getPlusTime2(end));
@@ -523,6 +530,138 @@
        }
        return alarmHandleDataVOList;
    }
    /**
     * ã€å›­åŒºç‰©æ–™ä¸­å¿ƒè°ƒåº¦ã€‘看板-运输任务分析
     *
     * @return
     *
     */
    @Override
    public  List<TransportMeasureVO> transportMeasure(Integer queryType){
        List<TransportMeasureVO> list = new ArrayList<>();
        Random random = new Random();
        List<String> dayList = DateUtil.getBeforDays(new Date(),7);
        if(Constants.equalsInteger(queryType,Constants.ONE)){
            dayList = DateUtil.getBeforDays(new Date(),30);
        }else if(Constants.equalsInteger(queryType,Constants.TWO)){
            dayList = DateUtil.getBeforMonth(new Date(),12);
        }
        for (String str:dayList) {
            TransportMeasureVO data = new TransportMeasureVO();
            data.setPlanDate(str);
            data.setPlanTimes(random.nextInt(200));
            data.setPlanTaskNum(new BigDecimal(random.nextInt(1000)));
            data.setFinishTaskNum(new BigDecimal(data.getPlanTaskNum().intValue()));
            list.add(data);
        }
        return list;
    }
    /**
     * ã€å›­åŒºç‰©æ–™ä¸­å¿ƒè°ƒåº¦ã€‘看板-根据车牌号查询作业信息和合同信息集合
     *
     * @return
     *
     */
    @Override
    public    CarsJobAndContractVO getCarsJobDetails(CarsJobAndContractDTO param){
        CarsJobAndContractVO data = new CarsJobAndContractVO();
        if(StringUtils.isBlank(param.getCarCode())){
            return  data;
        }
        PlatformJob job = platformJobMapper.selectJoinOne(PlatformJob.class,
                new MPJLambdaWrapper<PlatformJob>()
                        .selectAll(PlatformJob.class)
                        .eq(PlatformJob::getIsdeleted,Constants.ZERO)
                        .eq(PlatformJob::getCarCodeFront,param.getCarCode())
                        .in(PlatformJob::getStatus,Constants.PlatformJobStatus.DONE.getKey(),Constants.PlatformJobStatus.LEAVED.getKey(),Constants.PlatformJobStatus.AUTHED_LEAVE.getKey(),Constants.PlatformJobStatus.CALLED.getKey())
                        .last("limit 1"));
        if(job!=null){
            List<PlatformLog>  logList = platformLogMapper.selectJoinList(PlatformLog.class,
                    new MPJLambdaWrapper<PlatformLog>()
                            .selectAll(PlatformLog.class)
                            .eq(PlatformLog::getIsdeleted,Constants.ZERO)
                            .eq(PlatformLog::getJobId,job.getId())
                            .orderByDesc(PlatformLog::getCreateDate));
            data.setLogList(logList);
            data.setName(job.getDriverName());
            data.setPhone(job.getDrivierPhone());
            data.setBillCode(job.getBillCode());
            data.setTotalNum(Constants.formatBigdecimal(job.getTotalNum()));
            data.setContractList(new ArrayList<>());
            CarsContractVO tt = new CarsContractVO();
            tt.setIoCode(job.getContractNum());
            tt.setDetailList(new ArrayList<>());
            data.getContractList().add(tt);
            PlatformWmsJob wmsJob = platformWmsJobMapper.selectJoinOne(PlatformWmsJob.class,
                    new MPJLambdaWrapper<PlatformWmsJob>()
                            .selectAll(PlatformWmsJob.class)
                            .eq(PlatformWmsJob::getIsdeleted,Constants.ZERO)
                            .eq(PlatformWmsJob::getJobId,job.getId())
                            .last("limit 1"));
            if(wmsJob!=null){
                data.setName(wmsJob.getDriverName());
                data.setPhone(wmsJob.getDriverPhone());
                data.setBillCode(wmsJob.getCarryBillCode());
                data.setContractList(new ArrayList<>());
                List<PlatformWmsDetail>  detailList = platformWmsDetailMapper.selectJoinList(PlatformWmsDetail.class,
                        new MPJLambdaWrapper<PlatformWmsDetail>()
                                .selectAll(PlatformWmsDetail.class)
                                .eq(PlatformWmsDetail::getIsdeleted,Constants.ZERO)
                                .eq(PlatformWmsDetail::getWmsJobId,wmsJob.getId())
                                .orderByDesc(PlatformLog::getCreateDate));
                if(detailList!=null){
                    for(PlatformWmsDetail d : detailList){
                        if(!isNotExistIocode(d.getIocode(),data.getContractList())){
                                continue;
                        }
                        tt = new CarsContractVO();
                        tt.setIoCode(d.getIocode());
                        tt.setAddress(d.getRepertotyAddress());
                        tt.setDetailList(getDetailListByCode(d.getIocode(),detailList,tt));
                        data.getContractList().add(tt);
                        data.getTotalNum().add(Constants.formatBigdecimal(tt.getTotalNum()));//总运输量
                    }
                }
            }
        }
        return data;
    }
    private List<PlatformWmsDetail> getDetailListByCode(String iocode, List<PlatformWmsDetail> detailList,CarsContractVO tt) {
        List<PlatformWmsDetail> list = new ArrayList<>();
        BigDecimal total = new BigDecimal(0);
        if(detailList!=null){
            for(PlatformWmsDetail d :detailList){
                if(StringUtils.equals(d.getIocode(),iocode)){
                    list.add(d);
                    total.add(Constants.formatBigdecimal(d.getIoQty()));
                }
            }
        }
        tt.setTotalNum(total);
        return list;
    }
    private boolean isNotExistIocode(String iocode, List<CarsContractVO> detailList) {
        if(detailList!=null){
            for(CarsContractVO d :detailList){
                if(StringUtils.equals(d.getIoCode(),iocode)){
                    return true;
                }
            }
        }
        return false;
    }
    /**
     * ã€æ¶ˆé˜²ç®¡æŽ§ã€‘看板-告警信息集合
     *
@@ -534,6 +673,236 @@
        AlarmDataVO alarmDataVO = getAlertDataByStartEndTime(DateUtil.getPlusTime2(DateUtil.addDaysToDate(new Date(),-1))
                ,(DateUtil.getPlusTime2(new Date())));
        return  alarmDataVO;
    }
    /**
     * æŸ¥è¯¢æœ¬æœˆ æœ¬å¹´çš„累计出库量统计数据,出库任务、入库任务量
     * @return
     */
    @Override
    public  PlatformJobRunBoardNewVO platformJobCenterData(){
        PlatformJobRunBoardNewVO data = new PlatformJobRunBoardNewVO();
        Random random = new Random();
        data.setMonthOutTimes(random.nextInt(1000));
        data.setYearOutTimes(random.nextInt(1000) * 11);
        Date month  = Utils.Date.getStart(new Date());//本月
        Date lastMonth =  DateUtil.addMonthToDate(month,-1);//上月
        Date year = Utils.Date.getStart(new Date());//今年
        Date lastYear = DateUtil.addYearToDate(year,-1);//去年
        List<PlatformJob>  monthNum = platformJobMapper.selectJoinList(PlatformJob.class,
                new MPJLambdaWrapper<PlatformJob>()
                .selectAs(PlatformJob::getId,PlatformJob::getId)
                .select(PlatformJob::getTotalNum,PlatformJob::getTotalNum)
                .select("select sum(io_qty) from platform_wms_details a where a.isdeleted=0 and a.job_id=t.id",PlatformJob::getIoQty)
                        .eq(PlatformJob::getIsdeleted,Constants.ZERO)
//                        .in(PlatformJob::getType,Constants.ONE,Constants.THREE)
                        .in(PlatformJob::getStatus,Constants.PlatformJobStatus.DONE.getKey(),Constants.PlatformJobStatus.LEAVED.getKey(),Constants.PlatformJobStatus.AUTHED_LEAVE.getKey())
                        .apply("year(create_date) = year("+DateUtil.getPlusTime2(month)+") and month(create_date) = month("+DateUtil.getPlusTime2(month)+") and to_days(create_date)<= "+DateUtil.getPlusTime2(month)));
        List<PlatformJob>  monthLastNum = platformJobMapper.selectJoinList(PlatformJob.class,
                new MPJLambdaWrapper<PlatformJob>()
                        .selectAs(PlatformJob::getId,PlatformJob::getId)
                        .select("select sum(io_qty) from platform_wms_details a where a.isdeleted=0 and a.job_id=t.id",PlatformJob::getIoQty)
                        .eq(PlatformJob::getIsdeleted,Constants.ZERO)
                        .in(PlatformJob::getType,Constants.ONE,Constants.THREE)
                        .in(PlatformJob::getStatus,Constants.PlatformJobStatus.DONE.getKey(),Constants.PlatformJobStatus.LEAVED.getKey(),Constants.PlatformJobStatus.AUTHED_LEAVE.getKey())
                        .apply("year(create_date) = year("+DateUtil.getPlusTime2(lastMonth)+") and month(create_date) = month("+DateUtil.getPlusTime2(lastMonth)+") and to_days(create_date)<= "+DateUtil.getPlusTime2(lastMonth)));
        List<PlatformJob>  yearNum = platformJobMapper.selectJoinList(PlatformJob.class,
                new MPJLambdaWrapper<PlatformJob>()
                        .selectAs(PlatformJob::getId,PlatformJob::getId)
                        .select(PlatformJob::getTotalNum,PlatformJob::getTotalNum)
                        .selectCount(PlatformJob::getPlatformId,PlatformJob::getCountum)
                        .select("select sum(io_qty) from platform_wms_details a where a.isdeleted=0 and a.job_id=t.id",PlatformJob::getIoQty)
                        .eq(PlatformJob::getIsdeleted,Constants.ZERO)
                        .in(PlatformJob::getType,Constants.ONE,Constants.THREE)
                        .in(PlatformJob::getStatus,Constants.PlatformJobStatus.DONE.getKey(),Constants.PlatformJobStatus.LEAVED.getKey(),Constants.PlatformJobStatus.AUTHED_LEAVE.getKey())
                        .apply("year(create_date) = year("+DateUtil.getPlusTime2(year)+")   and to_days(create_date)<= "+DateUtil.getPlusTime2(year)));
        List<PlatformJob> yearLastNum = platformJobMapper.selectJoinList(PlatformJob.class,
                new MPJLambdaWrapper<PlatformJob>()
                        .selectAs(PlatformJob::getId,PlatformJob::getId)
                        .select(PlatformJob::getTotalNum,PlatformJob::getTotalNum)
                        .select("select sum(io_qty) from platform_wms_details a where a.isdeleted=0 and a.job_id=t.id",PlatformJob::getIoQty)
                        .eq(PlatformJob::getIsdeleted,Constants.ZERO)
                        .in(PlatformJob::getType,Constants.ONE,Constants.THREE)
                        .in(PlatformJob::getStatus,Constants.PlatformJobStatus.DONE.getKey(),Constants.PlatformJobStatus.LEAVED.getKey(),Constants.PlatformJobStatus.AUTHED_LEAVE.getKey())
                        .apply("year(create_date) = year("+DateUtil.getPlusTime2(lastYear)+")  and to_days(create_date)<= "+DateUtil.getPlusTime2(lastYear)));
        data.setMonthOutTotal(getSumTotalByList(monthNum,0,null));//本月出库量
        data.setMonthLastOutTotal(getSumTotalByList(monthLastNum,null,null) );//上有出库量
        data.setYearOutTotal(getSumTotalByList(yearNum,null,null)  );//本年出库量
        data.setYearLastOutTotal(getSumTotalByList(yearLastNum,null,null) );//去年出库量
        data.setMonthOutTimes(monthNum!=null?monthNum.size():0);
        data.setYearOutTimes(yearNum!=null?yearNum.size():0);
        //==========今天之前未完成出入库任务
        List<PlatformJob> beforeJobNum = platformJobMapper.selectJoinList(PlatformJob.class,
                new MPJLambdaWrapper<PlatformJob>()
                        .selectAs(PlatformJob::getId,PlatformJob::getId)
                        .selectAs(PlatformJob::getStatus,PlatformJob::getStatus)
                        .selectAs(PlatformJob::getType,PlatformJob::getType)
                        .select(PlatformJob::getTotalNum,PlatformJob::getTotalNum)
                        .select("select sum(io_qty) from platform_wms_details a where a.isdeleted=0 and a.job_id=t.id",PlatformJob::getIoQty)
                        .eq(PlatformJob::getIsdeleted,Constants.ZERO)
                        .notIn(PlatformJob::getStatus,Constants.PlatformJobStatus.DONE.getKey(),Constants.PlatformJobStatus.LEAVED.getKey(),Constants.PlatformJobStatus.AUTHED_LEAVE.getKey(),Constants.PlatformJobStatus.CALLED.getKey())
                        .apply(" and to_days(create_date) <to_days(now())"));
        //==========今天出入库任务
        List<PlatformJob> currentNum = platformJobMapper.selectJoinList(PlatformJob.class,
                new MPJLambdaWrapper<PlatformJob>()
                        .selectAs(PlatformJob::getId,PlatformJob::getId)
                        .selectAs(PlatformJob::getStatus,PlatformJob::getStatus)
                        .selectAs(PlatformJob::getType,PlatformJob::getType)
                        .select(PlatformJob::getTotalNum,PlatformJob::getTotalNum)
                        .select("select sum(io_qty) from platform_wms_details a where a.isdeleted=0 and a.job_id=t.id",PlatformJob::getIoQty)
                        .eq(PlatformJob::getIsdeleted,Constants.ZERO)
                        .notIn(PlatformJob::getStatus,Constants.PlatformJobStatus.CALLED.getKey())
                        .apply("year(create_date) = year("+DateUtil.getPlusTime2(lastYear)+")  and to_days(create_date)<= "+DateUtil.getPlusTime2(lastYear)));
        BigDecimal beforeOutNum = (getSumTotalByList(beforeJobNum,0,null));//今天之前未完成出库任务
        BigDecimal currentOutNum = (getSumTotalByList(currentNum,0,null));//今天下发出库任务
        BigDecimal beforeInNum = (getSumTotalByList(beforeJobNum,1,null));//今天之前未完成入库任务
        BigDecimal currentInNum = (getSumTotalByList(currentNum,1,null));//今天下发入库任务
        data.setCurrentInNum(beforeInNum.add(currentInNum));//当前入库总任务成量
        data.setCurrentOutNum(beforeOutNum.add(currentOutNum));//当前出库总任务成量
        data.setCurrentInDoneNum(getSumTotalByList(currentNum,0,1));//今日完成量
        data.setCurrentOutDoneNum(getSumTotalByList(currentNum,1,1));//今日完成量
        //------------今日出入库效率----------------
        BigDecimal outHours = getTotalDoneTimes(currentNum,0);//
        BigDecimal inHours = getTotalDoneTimes(currentNum,1);//
        if(outHours.compareTo(new BigDecimal(0))>0){
            data.setTodayOutRate(data.getCurrentOutDoneNum().divide(outHours,2));//当前入库总任务成量
        }
        if(inHours.compareTo(new BigDecimal(0))>0){
            data.setTodayInRate(data.getCurrentInDoneNum().divide(inHours,2));//当前入库总任务成量
        }
        //------------本月出入库效率----------------
        BigDecimal outMonthNum = getSumTotalByList(monthNum,0,null).add(data.getCurrentOutDoneNum());
        BigDecimal inMonthNum = getSumTotalByList(monthNum,1,null).add(data.getCurrentInDoneNum());
        BigDecimal outYearHours = getTotalDoneTimes(yearNum,0).add(outHours);//
        BigDecimal inYearHours = getTotalDoneTimes(yearNum,1).add(inHours);//
        if(outYearHours.compareTo(new BigDecimal(0))>0){
            data.setMonthOutRate(outMonthNum.divide(outYearHours,2));//本月入库效率
        }
        if(inYearHours.compareTo(new BigDecimal(0))>0){
            data.setMonthInRate(inMonthNum.divide(inYearHours,2));//本月入库效率
        }
        return data;
    }
    private BigDecimal getDoneHoursByData(String start ,String end) {
        List<PlatformLog> platformLogList = platformLogMapper.selectList(new QueryWrapper<PlatformLog>().lambda()
                .apply("create_date >= '"+start+"' and create_date <= '"+end+"'")
                .isNotNull(PlatformLog::getParam3)
                .ne(PlatformLog::getParam3,Constants.ZERO+""));
        if(platformLogList!=null && platformLogList.size()>0){
            return new BigDecimal((double)(platformLogList.stream().map(m->Long.valueOf(m.getParam3())).reduce(Long.valueOf(0),Long::sum))/(double)60);
        }
        return new BigDecimal(0);
    }
    private BigDecimal getTotalDoneTimes(List<PlatformJob> list, Integer type) {
        BigDecimal r = new BigDecimal(0);
        if(list==null || list.size() == 0){
            return r;
        }
        List<Integer> jobIds= new ArrayList<>();
        for(PlatformJob job : list){
            if( !(Constants.equalsInteger(job.getStatus(),Constants.PlatformJobStatus.DONE.getKey())
                    ||Constants.equalsInteger(job.getStatus(),Constants.PlatformJobStatus.LEAVED.getKey())
                    ||Constants.equalsInteger(job.getStatus(),Constants.PlatformJobStatus.AUTHED_LEAVE.getKey()))){
                //只查询完成数据
                continue;
            }
            if(type !=null &&type ==0 &&  (Constants.equalsInteger(job.getType(),Constants.ONE) ||Constants.equalsInteger(job.getType(),Constants.THREE))){
               //出库
               jobIds.add(job.getId());
            }
            if(type !=null &&type ==1 &&  (Constants.equalsInteger(job.getType(),Constants.ZERO) ||Constants.equalsInteger(job.getType(),Constants.TWO)||Constants.equalsInteger(job.getType(),Constants.FOUR))){
                //入库
                jobIds.add(job.getId());
            }
        }
        if(jobIds.size()>0){
            //处理作业时长
            List<PlatformLog> platformLogList = platformLogMapper.selectList(new QueryWrapper<PlatformLog>().lambda()
                    .in(PlatformLog::getJobId,jobIds)
                    .isNotNull(PlatformLog::getParam3)
                    .ne(PlatformLog::getParam3,Constants.ZERO+""));
            if(platformLogList!=null && platformLogList.size()>0){
                return new BigDecimal((double)(platformLogList.stream().map(m->Long.valueOf(m.getParam3())).reduce(Long.valueOf(0),Long::sum))/(double)60);
            }
        }
        return r;
    }
    private BigDecimal getSumTotalByList(List<PlatformJob> list,Integer type,Integer status) {
        BigDecimal r = new BigDecimal(0);
        if(list==null || list.size() == 0){
            return r;
        }
        for(PlatformJob job : list){
            if(type !=null &&type ==0 && !(Constants.equalsInteger(job.getType(),Constants.ONE) ||Constants.equalsInteger(job.getType(),Constants.THREE))){
                continue;
            }
            if(type !=null &&type ==1 && !(Constants.equalsInteger(job.getType(),Constants.ZERO) ||Constants.equalsInteger(job.getType(),Constants.TWO)||Constants.equalsInteger(job.getType(),Constants.FOUR))){
                continue;
            }
            if(status !=null &&status ==1 && !(Constants.equalsInteger(job.getStatus(),Constants.PlatformJobStatus.DONE.getKey())
                    ||Constants.equalsInteger(job.getStatus(),Constants.PlatformJobStatus.LEAVED.getKey())
                    ||Constants.equalsInteger(job.getStatus(),Constants.PlatformJobStatus.AUTHED_LEAVE.getKey()))){
                continue;
            }
            if(Constants.formatBigdecimal(job.getIoQty()).compareTo(new BigDecimal(0)) >0){
                r.add( job.getIoQty());
            }else{
                r.add(Constants.formatBigdecimal(job.getTotalNum()));
            }
        }
        return Constants.formatBigdecimal0Float(r);
    }
    @Override
    public     BoardCarsListVO platformJobCarsList(){
        BoardCarsListVO data = new BoardCarsListVO();
        List<CarsDeviceDetaisResponse> detaisResponses = HKCarOpenService.getAllCarsDetais();
        data.setCarsList(detaisResponses);
        if(data.getCarsList()!=null && data.getCarsList().size()>0){
            List<String> codes = new ArrayList<>();
            //设备状态 0:离线;1:在线;2:休眠
            int online = 0;
            for(CarsDeviceDetaisResponse model:detaisResponses){
                if(Constants.equalsInteger(model.getStatus(),Constants.ONE) ||Constants.equalsInteger(model.getStatus(),Constants.TWO)){
                   //如果是在线或者休眠,查询在途还是空闲
                    codes.add(model.getPlateNum());
                }else
                    data.setOfflineNum(data.getOfflineNum()+1);
                }
            if(codes.size()>0){
                //状态 0待确认 1待签到 2等待叫号 3入园等待 4已叫号 5作业中 6作业完成 7转移中 8异常挂起 9已授权离园 10已离园 11 å·²è¿‡å·  12取消(WMS)
                long busyNum = platformJobMapper.selectCount(new QueryWrapper<PlatformJob>().lambda()
                        .eq(PlatformJob::getIsdeleted,Constants.ZERO)
                        .in(PlatformJob::getCarCodeFront,codes)
                        .in(PlatformJob::getStatus,Constants.PlatformJobStatus.WORKING.getKey()
                                ,Constants.PlatformJobStatus.WAIT_CALL.getKey()
                                ,Constants.PlatformJobStatus.CALLED.getKey()
                                ,Constants.PlatformJobStatus.IN_WAIT.getKey()
                                ,Constants.PlatformJobStatus.TRANSFERING.getKey()
                                ,Constants.PlatformJobStatus.WART_SIGN_IN.getKey()
                                ,Constants.PlatformJobStatus.WAIT_CONFIRM.getKey()
                                ,Constants.PlatformJobStatus.EXCEPTION.getKey())
                        .groupBy(PlatformJob::getCarCodeFront));
                data.setBusyNum((int)busyNum);//在途有任务数量
                data.setIdleNum(codes.size() -data.getBusyNum());//无任务空闲数量
            }
        }
        return  data;
    }
    public static AlarmDataVO getAlertDataByStartEndTime(String start,String end){
@@ -615,12 +984,12 @@
        data.setDeviceTypeList(list);
        Long totalNum =hiddenDangerMapper.selectCount(new QueryWrapper<HiddenDanger>().lambda()
                .eq(HiddenDanger::getIsdeleted,Constants.ZERO )
                .apply("to_day(create_data) = to_days(now())" ) );
                .apply("to_days(create_date) = to_days(now())" ) );
        data.setDangerTotalNum(totalNum !=null?totalNum.intValue():0);//今日隐患数量
        totalNum =hiddenDangerMapper.selectCount(new QueryWrapper<HiddenDanger>().lambda()
                .eq(HiddenDanger::getIsdeleted,Constants.ZERO )
                .in(HiddenDanger::getStatus,Constants.ONE,Constants.TWO )
                .apply("to_day(check_date) = to_days(now())" ) );
                .apply("to_days(check_date) = to_days(now())" ) );
        data.setDangerDealedNum(totalNum !=null?totalNum.intValue():0);//今日处理隐患数量
        return  data;
    }
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/thrid/WmsServiceImpl.java
@@ -462,6 +462,7 @@
                        entity.setJobId(job.getJobId());
                        entity.setWmsJobId(job.getId());
                        entity.setIoQty(d.getIoQty());
                        entity.setRepertotyAddress(job.getRepertotyAddress());
                        entity.setWmsJobId(job.getId());
                        entity.setStatus(Constants.ZERO);
                        entity.setRate(d.getRate());
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/third/BoardService.java
@@ -12,6 +12,7 @@
import com.doumee.core.tms.model.response.TmsOrderInfoResponse;
import com.doumee.core.tms.model.response.TmsOrderListResponse;
import com.doumee.dao.business.model.PlatformWarnEvent;
import com.doumee.dao.web.reqeust.CarsJobAndContractDTO;
import com.doumee.dao.web.response.platformReport.*;
import java.util.List;
@@ -81,4 +82,12 @@
    List<AlarmDataVO> fightingAlarmHandleData();
    List<MonitorDataVO> monitorDataList();
    BoardCarsListVO platformJobCarsList();
    PlatformJobRunBoardNewVO platformJobCenterData();
    CarsJobAndContractVO getCarsJobDetails(CarsJobAndContractDTO param);
    List<TransportMeasureVO> transportMeasure(Integer queryType);
}
server/visits/openapi/src/main/resources/application.yml
@@ -36,7 +36,7 @@
cache:
  session:
    # ä¼šè¯è¿‡æœŸæ—¶é•¿(s)
    expire: 18000
    expire: 1800
  captcha:
    # éªŒè¯ç è¿‡æœŸæ—¶é•¿(s)
    expire: 300