| | |
| | | let cellarea = ref(` |
| | | <div class="vxe-table--cell-area" style="font-size: 10px;text-align: left" > |
| | | <span class="vxe-table--cell-main-area" > |
| | | <p style="bottom: 0;color: blue;background-color: #5cadfe; margin-top: auto;"></p> |
| | | <p style="bottom: 0;color: blue;background-color: #5cadfe; margin-top: auto;font-size: 14px"></p> |
| | | </span> |
| | | <span class="vxe-table--cell-active-area" ></span> |
| | | </div> |
| | |
| | | let cellarea = ref(` |
| | | <div class="vxe-table--cell-area" style="font-size: 10px;text-align: left" > |
| | | <span class="vxe-table--cell-main-area" > |
| | | <p style="bottom: 0;color: blue;background-color: #5cadfe; margin-top: auto;"></p> |
| | | <p style="bottom: 0;color: blue;background-color: #5cadfe; margin-top: auto;font-size: 14px"></p> |
| | | </span> |
| | | <span class="vxe-table--cell-active-area" ></span> |
| | | </div> |
| | |
| | | reportingWorkDate:ref(["",""]), |
| | | qualityInspectionDate:ref(["",""]), |
| | | brokenDate:ref(["",""]), |
| | | yieldDate:ref(["",""]), |
| | | searchOrderListFilter:ref([]),//订单首页筛选] |
| | | searchOrderFilter:{ |
| | | list:ref([]), |
| | |
| | | this.reportFormDate=["",""] |
| | | this.workOrderDate=["",""] |
| | | this.reportingWorkDate=["",""] |
| | | this.qualityInspectionDate=["",""] |
| | | this.brokenDate=["",""] |
| | | this.yieldDate=["",""] |
| | | this.searchOrderFilter={ |
| | | list:[], |
| | | data:{} |
| | |
| | | ElMessage.success(config.successMsg); |
| | | } |
| | | }); |
| | | return; |
| | | } |
| | | // 添加确认提示弹窗,询问用户是否进行当前操作 |
| | | ElMessageBox.confirm('是否进行当前操作?', '确认操作', { |
| | |
| | |
|
| | | //点击小片
|
| | | const handleRectClick = (layoutIndex, rectIndex) => {
|
| | | if (dragging.value) {
|
| | | return;
|
| | | }
|
| | |
|
| | | focusIndex.value = { layoutIndex, rectIndex };
|
| | | emit('rectClicked', layoutIndex, rectIndex);
|
| | | };
|
| | |
| | | const glassDetail = layout.glassDetails[rectIndex];
|
| | | if (glassDetail.isRemain) return;
|
| | |
|
| | | dragging.value = true;
|
| | | dragRect.value = { layoutIndex, rectIndex };
|
| | | dragStartPos.value = {
|
| | | x: event.clientX,
|
| | |
| | |
|
| | | //小片鼠标移动事件
|
| | | const handleRectDragging = (event) => {
|
| | | if (!dragging.value || !dragRect.value) return;
|
| | | if (!dragRect.value) return;
|
| | |
|
| | | // 如果还没确认是拖拽,则先判断是否达到拖拽阈值(例如5像素)
|
| | | if (!dragging.value) {
|
| | | const deltaX = event.clientX - dragStartPos.value.x;
|
| | | const deltaY = event.clientY - dragStartPos.value.y;
|
| | | const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY);
|
| | |
|
| | | // 如果移动距离小于阈值,则认为是点击而非拖拽
|
| | | if (distance < 5) {
|
| | | return;
|
| | | }
|
| | |
|
| | | // 达到阈值,确认是拖拽操作
|
| | | dragging.value = true;
|
| | | }
|
| | |
|
| | | const layoutIndex = dragRect.value.layoutIndex;
|
| | | const rectIndex = dragRect.value.rectIndex;
|
| | |
| | |
|
| | | //小片鼠标松开事件
|
| | | const handleRectDragEnd = () => {
|
| | | dragging.value = false;
|
| | | dragRect.value = null;
|
| | | dragStartPos.value = { x: 0, y: 0 };
|
| | | if (dragRect.value) {
|
| | | const layoutIndex = dragRect.value.layoutIndex;
|
| | | const rectIndex = dragRect.value.rectIndex;
|
| | |
| | | import {VXETable} from "vxe-table"; |
| | | import useUserInfoStore from '@/stores/userInfo' |
| | | import {useI18n} from "vue-i18n"; |
| | | import { computed } from 'vue' |
| | | import UpdateOrderCraft from "@/components/sd/order/UpdateOrderCraft.vue"; |
| | | import {filterChanged} from "@/hook"; |
| | | let productGlassTypeStore = useProductGlassTypeStore() |
| | |
| | | const saveCraft = () => { |
| | | //rowIndex.value.process = craftObj.newCraft.join('->') |
| | | let orderProcess= craftObj.newCraft.join('->') |
| | | request.post(`/processCard/updateProcess/${rowIndex.value.process_id}/${rowIndex.value.order_number}/${rowIndex.value.technology_number}/${rowIndex.value.order_id}/${orderProcess}`, craftObj).then((res) => { |
| | | if (res.code == 200 && res.data === true) { |
| | | ElMessage.success(t('basicData.msg.saveSuccess')) |
| | | router.push({ |
| | | path: '/main/processCard/SelectDetailProcessCard', |
| | | query: {processId: processId,random: Math.random()} |
| | | }) |
| | | } else { |
| | | //获取差异工序 |
| | | const diffCraft = computed(() => { |
| | | return [ |
| | | ...craftObj.oldCraft.filter(item => !craftObj.newCraft.includes(item)), //删除 |
| | | ...craftObj.newCraft.filter(item => !craftObj.oldCraft.includes(item))//增加 |
| | | ] |
| | | }) |
| | | if (diffCraft.value == '') {//无变化不执行后续 |
| | | return |
| | | } |
| | | //获取最新报工工序的顺序 |
| | | request.post(`/processCard/getNewProcess/${rowIndex.value.process_id}/${rowIndex.value.order_number}/${rowIndex.value.technology_number}/${diffCraft.value}`).then((res) => { |
| | | if (res.code == 200 ) { |
| | | if (res.data){ |
| | | request.post(`/processCard/updateProcess/${rowIndex.value.process_id}/${rowIndex.value.order_number}/${rowIndex.value.technology_number}/${rowIndex.value.order_id}/${orderProcess}`, craftObj).then((res) => { |
| | | if (res.code == 200 && res.data === true) { |
| | | ElMessage.success(t('basicData.msg.saveSuccess')) |
| | | router.push({ |
| | | path: '/main/processCard/SelectDetailProcessCard', |
| | | query: {processId: processId,random: Math.random()} |
| | | }) |
| | | } else { |
| | | |
| | | ElMessage.warning(t('processCard.updateProcessMsg')) |
| | | ElMessage.warning(t('processCard.updateProcessMsg')) |
| | | |
| | | } |
| | | }) |
| | | craftVisible.value= false |
| | | }else { |
| | | ElMessage.warning(t('processCard.updateProcessMsg')) |
| | | } |
| | | } |
| | | }) |
| | | craftVisible.value= false |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | import dayjs from 'dayjs' |
| | | import {addListener} from "@/hook/mouseMove"; |
| | | import {VxeUI} from "vxe-pc-ui"; |
| | | import companyInfo from "@/stores/sd/companyInfo"; |
| | | import useOrderInfoStore from "@/stores/sd/order/orderInfo"; |
| | | const company = companyInfo() |
| | | const reportTime=company.reportTime |
| | | const orderInfo = useOrderInfoStore() |
| | | //语言获取 |
| | | const {t} = useI18n() |
| | | let router = useRouter() |
| | |
| | | let pageNum = ref(1) |
| | | let pageState = null |
| | | |
| | | //获取七天前到当前时间 |
| | | function getNowTime() { |
| | | const pad = (n) => n.toString().padStart(2, '0'); |
| | | |
| | | const formatDate = (date) => { |
| | | const year = date.getFullYear(); |
| | | const month = pad(date.getMonth() + 1); |
| | | const day = pad(date.getDate()); |
| | | return `${year}-${month}-${day} 08:00:00`; |
| | | }; |
| | | |
| | | const now = new Date(); |
| | | const startDate = new Date(now.getTime() - 3600 * 1000 * 24 * 3); // 三天前 |
| | | const start = formatDate(startDate); |
| | | const end = formatDate(now); |
| | | |
| | | return [start, end]; |
| | | } |
| | | |
| | | |
| | | //第一次加载获取近七天时间和默认状态 |
| | | form.date1 = getNowTime() |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | let date = new Date(endTime); // 将日期字符串转为 Date 对象 |
| | | |
| | | // 使用 setDate 方法加一天 |
| | | date.setDate(date.getDate() + 1); |
| | | const pad = (n) => n.toString().padStart(2, '0'); |
| | | let year = date.getFullYear(); |
| | | let month = pad(date.getMonth() + 1); |
| | | let day = pad(date.getDate()); |
| | | let newEndTime = `${year}-${month}-${day} 08:00:00`; |
| | | let selectProcesses = value.value |
| | | let total = reactive({ |
| | | pageTotal: 0, |
| | |
| | | processType: [], |
| | | }) |
| | | //第一次加载数据 |
| | | request.post(`/report/yield/${startTime}/${newEndTime}/${selectProcesses}`, filterData.value).then((res) => { |
| | | request.post(`/report/yield/${orderInfo.yieldDate}/${selectProcesses}/${reportTime}`, filterData.value).then((res) => { |
| | | |
| | | if (res.code == 200) { |
| | | // total.dataTotal = res.data.total.total*1 |
| | | // total.pageTotal= res.data.total.pageTotal |
| | | // pageTotal.value = res.data.total |
| | | produceList = produceList.value.concat(deepClone(res.data.data)) |
| | | titleSelectJson.value.processType = res.data.process |
| | | orderInfo.yieldDate = res.data.selectDate |
| | | xGrid.value.reloadData(produceList) |
| | | gridOptions.loading = false |
| | | } else { |
| | | gridOptions.loading = false |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | |
| | | //页脚翻页查询 |
| | | const selectPageList = () => { |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | |
| | | request.post(`/report/yield/${pageNum.value}/${total.pageSize}/${startTime}/${endTime}/${inputVal}`, filterData.value).then((res) => { |
| | | if (res.code == 200) { |
| | | |
| | | |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.reloadData(produceList) |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | //点击查询 |
| | | const getWorkOrder = () => { |
| | | gridOptions.loading = true |
| | | // 原始 form.date1 是日期对象数组 |
| | | const rawStart = new Date(form.date1[0]); |
| | | const rawEnd = new Date(form.date1[1]); |
| | | // 如果时间部分是 00:00,则设置为 08:00 |
| | | if (rawStart.getHours() === 8 || rawStart.getHours() === 0) { |
| | | rawStart.setHours(8, 0, 0, 0); |
| | | } |
| | | if (rawEnd.getHours() === 8 || rawEnd.getHours() === 0) { |
| | | rawEnd.setHours(8, 0, 0, 0); |
| | | } |
| | | |
| | | const startTime = formatDateTime(rawStart); |
| | | const endPlusOne = new Date(rawEnd); |
| | | endPlusOne.setDate(endPlusOne.getDate()); |
| | | const newEndTime = formatDateTime(endPlusOne); |
| | | form.date1 = [startTime, newEndTime]; |
| | | let selectProcesses = value.value |
| | | request.post(`/report/yield/${startTime}/${newEndTime}/${selectProcesses}`, filterData.value).then((res) => { |
| | | console.log(orderInfo.yieldDate) |
| | | console.log(reportTime) |
| | | request.post(`/report/yield/${orderInfo.yieldDate}/${selectProcesses}/${reportTime}`, filterData.value).then((res) => { |
| | | |
| | | if (res.code == 200) { |
| | | // total.dataTotal = res.data.total.total*1 |
| | | // total.pageTotal= res.data.total.pageTotal |
| | | // pageTotal.value = res.data.total |
| | | orderInfo.yieldDate = res.data.selectDate |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.reloadData(produceList) |
| | | gridOptions.loading = false |
| | | } else { |
| | | gridOptions.loading = false |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const formatDateTime = (date) => { |
| | | const year = date.getFullYear(); |
| | | const month = pad(date.getMonth() + 1); |
| | | const day = pad(date.getDate()); |
| | | const hour = pad(date.getHours()); |
| | | const minute = pad(date.getMinutes()); |
| | | return `${year}-${month}-${day} ${hour}:${minute}:00`; |
| | | }; |
| | | |
| | | //页脚跳转 |
| | | const handlePageChange = ({currentPage, pageSize}) => { |
| | | pageNum.value = currentPage |
| | | total.pageTotal = pageSize |
| | | selectPageList() |
| | | } |
| | | |
| | | |
| | |
| | | <div style="width: 100%;height: 100%"> |
| | | <div class="head"> |
| | | <el-date-picker |
| | | v-model="form.date1" |
| | | v-model="orderInfo.yieldDate" |
| | | :start-placeholder="$t('basicData.startDate')" |
| | | :end-placeholder="$t('basicData.endDate')" |
| | | format="YYYY/MM/DD HH:mm" |
| | | style="width: 350px" |
| | | type="daterange" |
| | | value-format="YYYY/MM/DD HH:mm" |
| | | format="YYYY/MM/DD HH:mm" |
| | | value-format="YYYY-MM-DD HH:mm" |
| | | /> |
| | | |
| | | <el-select v-model="value" clearable default-value="default_city" style="width: 120px"> |
| | |
| | | import dayjs from 'dayjs' |
| | | import {VxeUI} from "vxe-pc-ui"; |
| | | import {addListener} from "@/hook/mouseMove"; |
| | | import companyInfo from "@/stores/sd/companyInfo"; |
| | | import useOrderInfoStore from "@/stores/sd/order/orderInfo"; |
| | | const company = companyInfo() |
| | | const reportTime=company.reportTime |
| | | const orderInfo = useOrderInfoStore() |
| | | //语言获取 |
| | | const {t} = useI18n() |
| | | let router = useRouter() |
| | |
| | | let pageNum = ref(1) |
| | | let pageState = null |
| | | |
| | | //获取七天前到当前时间 |
| | | function getNowTime() { |
| | | const pad = (n) => n.toString().padStart(2, '0'); |
| | | |
| | | const formatDate = (date) => { |
| | | const year = date.getFullYear(); |
| | | const month = pad(date.getMonth() + 1); |
| | | const day = pad(date.getDate()); |
| | | return `${year}-${month}-${day} 08:00:00`; |
| | | }; |
| | | |
| | | const now = new Date(); |
| | | const startDate = new Date(now.getTime() - 3600 * 1000 * 24 * 3); // 三天前 |
| | | const start = formatDate(startDate); |
| | | const end = formatDate(now); |
| | | |
| | | return [start, end]; |
| | | } |
| | | |
| | | |
| | | //第一次加载获取近七天时间和默认状态 |
| | | form.date1 = getNowTime() |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | let date = new Date(endTime); // 将日期字符串转为 Date 对象 |
| | | |
| | | // 使用 setDate 方法加一天 |
| | | date.setDate(date.getDate() + 1); |
| | | const pad = (n) => n.toString().padStart(2, '0'); |
| | | let year = date.getFullYear(); |
| | | let month = pad(date.getMonth() + 1); |
| | | let day = pad(date.getDate()); |
| | | let newEndTime = `${year}-${month}-${day} 08:00:00`; |
| | | let selectProcesses = value.value |
| | | let total = reactive({ |
| | | pageTotal: 0, |
| | | dataTotal: 0, |
| | | pageSize: 100 |
| | | }) |
| | | //定义接收加载表头下拉数据 |
| | | const titleSelectJson = ref({ |
| | | processType: [], |
| | | }) |
| | | //第一次加载数据 |
| | | request.post(`/report/yieldProcess/${startTime}/${newEndTime}`, filterData.value).then((res) => { |
| | | request.post(`/report/yieldProcess/${orderInfo.yieldDate}/${reportTime}`, filterData.value).then((res) => { |
| | | |
| | | if (res.code == 200) { |
| | | // total.dataTotal = res.data.total.total*1 |
| | | // total.pageTotal= res.data.total.pageTotal |
| | | // pageTotal.value = res.data.total |
| | | orderInfo.yieldDate = res.data.selectDate |
| | | produceList = produceList.value.concat(deepClone(res.data.data)) |
| | | titleSelectJson.value.processType = res.data.process |
| | | xGrid.value.reloadData(produceList) |
| | | gridOptions.loading = false |
| | | } else { |
| | | gridOptions.loading = false |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | |
| | | //页脚翻页查询 |
| | | const selectPageList = () => { |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | |
| | | request.post(`/report/yield/${pageNum.value}/${total.pageSize}/${startTime}/${endTime}/${inputVal}`, filterData.value).then((res) => { |
| | | if (res.code == 200) { |
| | | |
| | | |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.reloadData(produceList) |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | //点击查询 |
| | | const getWorkOrder = () => { |
| | | gridOptions.loading = true |
| | | // 原始 form.date1 是日期对象数组 |
| | | const rawStart = new Date(form.date1[0]); |
| | | const rawEnd = new Date(form.date1[1]); |
| | | // 如果时间部分是 00:00,则设置为 08:00 |
| | | if (rawStart.getHours() === 8 || rawStart.getHours() === 0) { |
| | | rawStart.setHours(8, 0, 0, 0); |
| | | } |
| | | if (rawEnd.getHours() === 8 || rawEnd.getHours() === 0) { |
| | | rawEnd.setHours(8, 0, 0, 0); |
| | | } |
| | | |
| | | const startTime = formatDateTime(rawStart); |
| | | const endPlusOne = new Date(rawEnd); |
| | | endPlusOne.setDate(endPlusOne.getDate()); |
| | | const newEndTime = formatDateTime(endPlusOne); |
| | | form.date1 = [startTime, newEndTime]; |
| | | let selectProcesses = value.value |
| | | request.post(`/report/yieldProcess/${startTime}/${newEndTime}`, filterData.value).then((res) => { |
| | | request.post(`/report/yieldProcess/${orderInfo.yieldDate}/${reportTime}`, filterData.value).then((res) => { |
| | | |
| | | if (res.code == 200) { |
| | | // total.dataTotal = res.data.total.total*1 |
| | | // total.pageTotal= res.data.total.pageTotal |
| | | // pageTotal.value = res.data.total |
| | | orderInfo.yieldDate = res.data.selectDate |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.reloadData(produceList) |
| | | gridOptions.loading = false |
| | | } else { |
| | | gridOptions.loading = false |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const formatDateTime = (date) => { |
| | | const year = date.getFullYear(); |
| | | const month = pad(date.getMonth() + 1); |
| | | const day = pad(date.getDate()); |
| | | const hour = pad(date.getHours()); |
| | | const minute = pad(date.getMinutes()); |
| | | return `${year}-${month}-${day} ${hour}:${minute}:00`; |
| | | }; |
| | | |
| | | //页脚跳转 |
| | | const handlePageChange = ({currentPage, pageSize}) => { |
| | | pageNum.value = currentPage |
| | | total.pageTotal = pageSize |
| | | selectPageList() |
| | | } |
| | | |
| | | |
| | | /*使用筛选,后端获取数据*/ |
| | | // const changeFilterEvent = (event, option, $panel,) => { |
| | |
| | | <template> |
| | | <div style="width: 100%;height: 100%"> |
| | | <div class="head"> |
| | | <el-date-picker |
| | | v-model="form.date1" |
| | | :start-placeholder="$t('basicData.startDate')" |
| | | :end-placeholder="$t('basicData.endDate')" |
| | | format="YYYY/MM/DD HH:mm" |
| | | style="width: 350px" |
| | | type="daterange" |
| | | value-format="YYYY/MM/DD HH:mm" |
| | | /> |
| | | <el-date-picker |
| | | v-model="orderInfo.yieldDate" |
| | | :start-placeholder="$t('basicData.startDate')" |
| | | :end-placeholder="$t('basicData.endDate')" |
| | | style="width: 350px" |
| | | type="daterange" |
| | | format="YYYY/MM/DD HH:mm" |
| | | value-format="YYYY-MM-DD HH:mm" |
| | | /> |
| | | |
| | | |
| | | <el-button type="primary" @click="getWorkOrder">{{$t('basicData.search')}}</el-button> |
| | |
| | | import com.example.erp.service.mm.FinishedGoodsInventoryService; |
| | | import com.example.erp.service.mm.MaterialInventoryService; |
| | | import com.example.erp.service.pp.ReportService; |
| | | import com.example.erp.service.pp.ReportingWorkService; |
| | | import com.example.erp.service.sd.DeliveryService; |
| | | import com.example.erp.service.sd.OrderService; |
| | | import io.swagger.annotations.Api; |
| | |
| | | private final MaterialInventoryService materialInventoryService; |
| | | private final FinishedGoodsInventoryService finishedGoodsInventoryService; |
| | | private final ReportService reportService; |
| | | private final ReportingWorkService reportingWorkService; |
| | | |
| | | @ApiOperation("订单报表") |
| | | @PostMapping("/getOrderList") |
| | |
| | | public Result addDeliveryDetail( @RequestBody Map<String,Object> object){ |
| | | return Result.success(finishedGoodsInventoryService.addDeliveryDetail(object)); |
| | | } |
| | | |
| | | @ApiOperation("app多个流程卡报工") |
| | | @PostMapping("/addWorkInProgress") |
| | | @SaCheckPermission("addReportingWork.add") |
| | | public Result addWorkInProgress(@RequestBody Map<String,Object> object){ |
| | | return reportingWorkService.addWorkInProgress(object); |
| | | } |
| | | } |
| | |
| | | |
| | | } |
| | | |
| | | @ApiOperation("获取最报工新工序") |
| | | @PostMapping("/getNewProcess/{processId}/{orderNumber}/{technologyNumber}/{orderProcess}") |
| | | public Result getNewProcess(@PathVariable String processId, |
| | | @PathVariable String orderNumber, |
| | | @PathVariable String technologyNumber, |
| | | @PathVariable List<String> orderProcess){ |
| | | return Result.success(flowCardService.getNewProcessSv(processId,orderNumber,technologyNumber,orderProcess)); |
| | | } |
| | | |
| | | @ApiOperation("修改工艺流程") |
| | | @PostMapping("/updateProcess/{processId}/{orderNumber}/{technologyNumber}/{orderId}/{process}") |
| | | public Result updateProcess( |
| | |
| | | } |
| | | |
| | | @ApiOperation("成品率报表") |
| | | @PostMapping("/yield/{selectTime1}/{selectTime2}/{selectProcesses}") |
| | | @PostMapping("/yield/{selectDate}/{selectProcesses}/{reportTime}") |
| | | public Result yield( |
| | | @PathVariable String selectTime1, |
| | | @PathVariable String selectTime2, |
| | | @PathVariable List<String> selectDate, |
| | | @PathVariable String selectProcesses, |
| | | @PathVariable String reportTime, |
| | | @RequestBody Report report) { |
| | | return Result.success(reportService.yieldSv(selectTime1, selectTime2, selectProcesses, report)); |
| | | return Result.success(reportService.yieldSv(selectDate, selectProcesses,reportTime, report)); |
| | | |
| | | } |
| | | |
| | | @ApiOperation("成品率工序汇总报表") |
| | | @PostMapping("/yieldProcess/{selectTime1}/{selectTime2}") |
| | | @PostMapping("/yieldProcess/{selectDate}/{reportTime}") |
| | | public Result yieldProcess( |
| | | @PathVariable String selectTime1, |
| | | @PathVariable String selectTime2, |
| | | @PathVariable List<String> selectDate, |
| | | @PathVariable String reportTime, |
| | | @RequestBody Report report) { |
| | | return Result.success(reportService.yieldProcessSv(selectTime1, selectTime2, report)); |
| | | return Result.success(reportService.yieldProcessSv(selectDate,reportTime, report)); |
| | | |
| | | } |
| | | |
| | |
| | | package com.example.erp.mapper.pp; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.example.erp.dto.pp.FlowCardDTO; |
| | | import com.example.erp.entity.pp.FlowCard; |
| | |
| | | Boolean updateTerminationStatus(String processId, Integer orderNumber); |
| | | |
| | | Boolean updateTerminationNoMp(String processId, Integer orderNumber); |
| | | |
| | | List<Map<String, Object>> getNewProcessMp(String processId, String orderNumber, String technologyNumber); |
| | | |
| | | Map<String, Object> getProcessInfo( String processName); |
| | | } |
| | |
| | | import java.io.IOException; |
| | | |
| | | |
| | | import java.sql.Date; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import java.util.stream.IntStream; |
| | |
| | | } |
| | | //将原来已报工的数据更新 |
| | | if (resultList != null && !resultList.isEmpty()) { |
| | | for (OrderProcessDetail d : resultList) { |
| | | flowCardMapper.updateOrderProcessDetail(d.getProcessId(),d.getOrderNumber(),d.getTechnologyNumber(), |
| | | d.getReportingWorkNumCount(),d.getReportingWorkNum(),d.getBrokenNum(),d.getProcess()); |
| | | |
| | | for (String number : numberList) { |
| | | for (OrderProcessDetail d : resultList) { |
| | | flowCardMapper.updateOrderProcessDetail(d.getProcessId(),number,d.getTechnologyNumber(), |
| | | d.getReportingWorkNumCount(),d.getReportingWorkNum(),d.getBrokenNum(),d.getProcess()); |
| | | } |
| | | } |
| | | |
| | | } |
| | | return true; |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | public boolean getNewProcessSv(String processId, String orderNumber, String technologyNumber, List<String> orderProcess) { |
| | | |
| | | // 获取最新报工工序 |
| | | List<Map<String, Object>> newProcess = flowCardMapper.getNewProcessMp(processId, orderNumber, technologyNumber); |
| | | |
| | | if (newProcess == null || newProcess.isEmpty()) { |
| | | return false; // 找不到标准值 |
| | | } |
| | | |
| | | // 最新工序排序号 |
| | | int standardSort = Integer.parseInt(newProcess.get(0).get("sort").toString()); |
| | | |
| | | // 循环 orderProcess 的每一个工序,查询它们的 sort |
| | | for (String processName : orderProcess) { |
| | | Map<String, Object> data = flowCardMapper.getProcessInfo(processName); |
| | | |
| | | if (data == null) { |
| | | return false; // 工序查不到 |
| | | } |
| | | int orderSort = Integer.parseInt(data.get("sort").toString()); |
| | | // orderSort 必须 > standardSort |
| | | if (orderSort <= standardSort) { |
| | | return false; |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | @Autowired |
| | | SysErrorService sysErrorService; |
| | | |
| | | @Value("${mesIp:localhost}") // 注入mesIp配置,默认值为10.153.19.31 |
| | | @Value("${mesIp:10.153.19.31}") |
| | | private String mesIp; |
| | | |
| | | RabbitMQUtil rabbitMQUtil; |
| | |
| | | public Boolean issuingProjects(String projectNo) throws JsonProcessingException { |
| | | boolean saveState=false; |
| | | try { |
| | | System.out.println(mesIp); |
| | | // 1. 创建URL对象 |
| | | URL url = new URL("http://" + mesIp + ":88/api/loadGlass/engineering/importEngineer"); |
| | | |
| | |
| | | return map; |
| | | } |
| | | |
| | | public Map<String, Object> yieldSv(String selectTime1, String selectTime2, String selectProcesses, Report report) { |
| | | public Map<String, Object> yieldSv(List<String> selectDate, String selectProcesses,String reportTime, Report report) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", reportMapper.yieldMp(selectTime1, selectTime2, selectProcesses, report)); |
| | | // 默认时间范围:过去 7 天(日期 + reportTime) |
| | | String startDate = toReportTime(LocalDate.now().minusDays(7).toString(), reportTime); |
| | | String endDate = toReportTime(LocalDate.now().toString(), reportTime); |
| | | |
| | | // 如果前端传了时间,就用前端日期 + reportTime |
| | | if (selectDate != null && selectDate.size() == 2) { |
| | | if (selectDate.get(0) != null && !selectDate.get(0).isEmpty()) { |
| | | startDate = toReportTime(selectDate.get(0), reportTime); |
| | | } |
| | | if (selectDate.get(1) != null && !selectDate.get(1).isEmpty()) { |
| | | endDate = toReportTime(selectDate.get(1), reportTime); |
| | | } |
| | | } |
| | | map.put("data", reportMapper.yieldMp(startDate, endDate, selectProcesses, report)); |
| | | map.put("process", productionSchedulingMapper.selectProcess()); |
| | | List<String> list = new ArrayList<>(); |
| | | list.add(startDate); |
| | | list.add(endDate); |
| | | map.put("selectDate",list); |
| | | return map; |
| | | } |
| | | |
| | |
| | | return map; |
| | | } |
| | | |
| | | public Map<String, Object> yieldProcessSv(String selectTime1, String selectTime2, Report report) { |
| | | public Map<String, Object> yieldProcessSv(List<String> selectDate,String reportTime, Report report) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", reportMapper.yieldProcessMp(selectTime1, selectTime2, report)); |
| | | // 默认时间范围:过去 7 天(日期 + reportTime) |
| | | String startDate = toReportTime(LocalDate.now().minusDays(7).toString(), reportTime); |
| | | String endDate = toReportTime(LocalDate.now().toString(), reportTime); |
| | | |
| | | // 如果前端传了时间,就用前端日期 + reportTime |
| | | if (selectDate != null && selectDate.size() == 2) { |
| | | if (selectDate.get(0) != null && !selectDate.get(0).isEmpty()) { |
| | | startDate = toReportTime(selectDate.get(0), reportTime); |
| | | } |
| | | if (selectDate.get(1) != null && !selectDate.get(1).isEmpty()) { |
| | | endDate = toReportTime(selectDate.get(1), reportTime); |
| | | } |
| | | } |
| | | map.put("data", reportMapper.yieldProcessMp(startDate, endDate, report)); |
| | | map.put("process", productionSchedulingMapper.selectProcess()); |
| | | List<String> list = new ArrayList<>(); |
| | | list.add(startDate); |
| | | list.add(endDate); |
| | | map.put("selectDate",list); |
| | | return map; |
| | | } |
| | | |
| | |
| | | |
| | | return result; |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Result addWorkInProgress(Map<String, Object> object) { |
| | | List<Map<String,Object>> list = (List<Map<String,Object>>) object.get("reportingWorks"); |
| | | |
| | | list.forEach(item -> { |
| | | ReportingWork reportingWork = JSONObject.parseObject( |
| | | JSONObject.toJSONString(item.get("processTitle")), ReportingWork.class); |
| | | Map<String, String> mapTitle = new HashMap<>(); |
| | | String[] processIdStr = reportingWork.getProcessId() != null |
| | | ? reportingWork.getProcessId().split("/") |
| | | : new String[]{""}; |
| | | mapTitle.put("process", reportingWork.getPreviousProcess()); |
| | | mapTitle.put("processId", reportingWork.getProcessId()); |
| | | mapTitle.put("thisProcess", reportingWork.getThisProcess()); |
| | | mapTitle.put("technologyStr", processIdStr[1]); |
| | | mapTitle.put("userName", object.get("userName").toString()); |
| | | ReviewReportingWorkSv(mapTitle); |
| | | |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("detail", item.get("processList")); |
| | | map.put("title", item.get("processTitle")); |
| | | map.put("type", object.get("type")); |
| | | map.put("userId", object.get("userId")); |
| | | map.put("userName", object.get("userName")); |
| | | map.put("qualityInsStatus", object.get("qualityInsStatus")); |
| | | map.put("class", object.get("class")); |
| | | SaveReportingWorkSv(map); |
| | | }); |
| | | |
| | | return Result.success(true); |
| | | } |
| | | } |
| | |
| | | <update id="updateTerminationNoMp"> |
| | | update pp.flow_card set termination_status=0 , termination_quantity=0 where process_id = #{processId} and order_number = #{orderNumber} |
| | | </update> |
| | | |
| | | <select id="getNewProcessMp"> |
| | | select opd.process,bd.sort from sd.order_process_detail as opd |
| | | left join sd.basic_data as bd on bd.basic_name = opd.process and bd.basic_category='process' |
| | | where opd.process_id=#{processId} and opd.order_number=#{orderNumber} |
| | | and opd.technology_number = #{technologyNumber} and reporting_work_num_count>0 ORDER BY opd.id DESC LIMIT 1 |
| | | </select> |
| | | |
| | | <select id="getProcessInfo"> |
| | | select basic_name as process,sort FROM sd.basic_data as bd |
| | | where bd.basic_category='process' and bd.basic_name = #{processName} |
| | | </select> |
| | | </mapper> |
| | |
| | | x_axis = #{detail.x}, |
| | | y_axis = #{detail.y} |
| | | WHERE |
| | | project_no = #{processId} AND polys_id = #{detail.polySort} |
| | | project_no = #{processId} AND polys_id = #{detail.polySort} AND stock_id = #{detail.stockSort} |
| | | </update> |
| | | <update id="updateProjectOptimize"> |
| | | update pp.optimize_project as p |
| | |
| | | <association property="flowCard" javaType="com.example.erp.entity.pp.FlowCard"> |
| | | <result property="orderId" column="order_id"/> |
| | | <result property="productionId" column="production_id"/> |
| | | <result property="processId" column="processIdFirst"/> |
| | | </association> |
| | | <association property="reportingWorkDetail" javaType="com.example.erp.entity.pp.ReportingWorkDetail"> |
| | | <result property="completedQuantity" column="completed_quantity"/> |
| | |
| | | <select id="AddSelectLastWorkMp" resultMap="reportingWorkMap"> |
| | | select o.order_id, |
| | | fc.production_id, |
| | | fc.process_id as 'processIdFirst', |
| | | o.customer_id, |
| | | o.customer_name, |
| | | o.project, |
| | |
| | | </if> |
| | | |
| | | </where> |
| | | order by dd.id |
| | | order by dd.box_no,dd.order_id,dd.order_number |
| | | </select> |
| | | |
| | | <select id="getSelectShippingOrderDetailPageTotal"> |