¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.jcdm.main.bs.orderScheduling.Query; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class EngineQuery { |
| | | |
| | | @JsonProperty("ZFDJM") |
| | | private String ZFDJM; |
| | | } |
| | |
| | | package com.jcdm.main.bs.orderScheduling.Query; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class SAPQuery { |
| | | |
| | | private String IV_ZFDJM; |
| | | @JsonProperty("IV_ZFDJM") |
| | | private List<EngineQuery> IV_ZFDJM; |
| | | } |
| | |
| | | import com.jcdm.common.exception.ServiceException; |
| | | import com.jcdm.common.utils.StringUtils; |
| | | import com.jcdm.common.utils.poi.ExcelUtil; |
| | | import com.jcdm.main.bs.orderScheduling.Query.EngineQuery; |
| | | import com.jcdm.main.bs.orderScheduling.Query.SAPQuery; |
| | | import com.jcdm.main.bs.orderScheduling.common.Constants; |
| | | import com.jcdm.main.bs.orderScheduling.domain.BsOrderScheduling; |
| | | import com.jcdm.main.bs.orderScheduling.service.IBsOrderSchedulingService; |
| | | import com.jcdm.main.bs.orderScheduling.vo.FollowReportVO; |
| | | import com.jcdm.main.bs.orderScheduling.vo.LineChartVO; |
| | | import com.jcdm.main.bs.orderScheduling.vo.ReportVO; |
| | | import com.jcdm.main.bs.orderScheduling.vo.SumDataVO; |
| | | import com.jcdm.main.bs.orderScheduling.vo.*; |
| | | import com.jcdm.main.da.paramCollection.domain.DaParamCollection; |
| | | import com.jcdm.main.da.paramCollection.mapper.DaParamCollectionMapper; |
| | | import com.jcdm.main.da.passingStationCollection.domain.DaPassingStationCollection; |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | |
| | | |
| | | |
| | | @PostMapping("/engine-report") |
| | | public R getReportDetail(SAPQuery sapQuery){ |
| | | public ReportVO getReportDetail(@RequestBody SAPQuery sapQuery){ |
| | | ReportVO reportVO = new ReportVO(); |
| | | if (StrUtil.isBlank(sapQuery.getIV_ZFDJM())){ |
| | | reportVO.setEV_STATUS("E"); |
| | | reportVO.setEV_MESSAGE("åå¨æºå·ä¸è½ä¸ºç©º"); |
| | | List<ResultDataVO> EV_DATA = new ArrayList<>(); |
| | | List<EngineQuery> engineQueryList = sapQuery.getIV_ZFDJM(); |
| | | if (CollUtil.isEmpty(engineQueryList)){ |
| | | reportVO.setEV_DATA(EV_DATA); |
| | | return reportVO; |
| | | } |
| | | BsOrderScheduling query = new BsOrderScheduling(); |
| | | query.setEngineNo(sapQuery.getIV_ZFDJM()); |
| | | List<String> engineNoList = engineQueryList.stream().map(EngineQuery::getZFDJM).collect(Collectors.toList()); |
| | | query.setEngineNoList(engineNoList); |
| | | List<BsOrderScheduling> bsOrderSchedulingList = bsOrderSchedulingService.selectBsOrderSchedulingList(query); |
| | | if (CollUtil.isNotEmpty(bsOrderSchedulingList)){ |
| | | BsOrderScheduling bsOrderScheduling = bsOrderSchedulingList.get(0); |
| | | for (String s : engineNoList) { |
| | | ResultDataVO resultDataVO = new ResultDataVO(); |
| | | resultDataVO.setZFDJM(s); |
| | | List<BsOrderScheduling> collect = bsOrderSchedulingList.stream().filter(x -> x.getEngineNo().equals(s)).collect(Collectors.toList()); |
| | | if (CollUtil.isNotEmpty(collect)){ |
| | | BsOrderScheduling bsOrderScheduling = collect.get(0); |
| | | if (StrUtil.isBlank(bsOrderScheduling.getReport20())){ |
| | | reportVO.setEV_STATUS("0"); |
| | | reportVO.setEV_MESSAGE("æªæ¥å·¥"); |
| | | resultDataVO.setSTATU("0"); |
| | | resultDataVO.setEV_MESSAGE("æªæ¥å·¥"); |
| | | } else { |
| | | if ("1".equals(bsOrderScheduling.getReport20())){ |
| | | reportVO.setEV_STATUS("1"); |
| | | reportVO.setEV_MESSAGE("å·²æ¥å·¥"); |
| | | resultDataVO.setSTATU("1"); |
| | | resultDataVO.setEV_MESSAGE("å·²æ¥å·¥"); |
| | | } else if ("3".equals(bsOrderScheduling.getReport20())){ |
| | | reportVO.setEV_STATUS("E"); |
| | | reportVO.setEV_MESSAGE(bsOrderScheduling.getRemarks()); |
| | | resultDataVO.setSTATU("2"); |
| | | resultDataVO.setEV_MESSAGE(bsOrderScheduling.getRemarks()); |
| | | } |
| | | } |
| | | } else { |
| | | reportVO.setEV_STATUS("E"); |
| | | reportVO.setEV_MESSAGE("æªæ¥è¯¢å°æ¤åå¨æºä¿¡æ¯"); |
| | | resultDataVO.setSTATU("2"); |
| | | resultDataVO.setEV_MESSAGE("æªæ¥è¯¢å°æ¤åå¨æºä¿¡æ¯"); |
| | | } |
| | | return R.ok(reportVO); |
| | | EV_DATA.add(resultDataVO); |
| | | } |
| | | reportVO.setEV_DATA(EV_DATA); |
| | | return reportVO; |
| | | } |
| | | } |
| | |
| | | * @return 订åæ产éå |
| | | */ |
| | | public List<BsOrderScheduling> selectBsOrderSchedulingList(BsOrderScheduling bsOrderScheduling); |
| | | public List<BsOrderScheduling> selectBsOrderSchedulingForReport(BsOrderScheduling bsOrderScheduling); |
| | | public List<BsOrderScheduling> selectBsOrderSchedulingListForNum(@Param("queryDate") String queryDate,@Param("addQueryDate") String addQueryDate); |
| | | |
| | | public List<BsOrderScheduling> selectBsOrderSchedulingPage(BsOrderScheduling bsOrderScheduling); |
| | |
| | | package com.jcdm.main.bs.orderScheduling.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class ReportVO { |
| | | |
| | | private String EV_STATUS; |
| | | |
| | | private String EV_MESSAGE; |
| | | @JsonProperty("EV_DATA") |
| | | private List<ResultDataVO> EV_DATA; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.jcdm.main.bs.orderScheduling.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ResultDataVO { |
| | | |
| | | @JsonProperty("ZFDJM") |
| | | private String ZFDJM; |
| | | |
| | | @JsonProperty("STATU") |
| | | private String STATU; |
| | | |
| | | @JsonProperty("EV_MESSAGE") |
| | | private String EV_MESSAGE; |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | colorInt = 4; |
| | | } |
| | | if (ObjectUtil.isNotEmpty(colorInt)){ |
| | | ReadWriteEntity entity = new ReadWriteEntity("CFL4HX.OP055.Color", colorInt); |
| | | ReadWriteEntity entity = new ReadWriteEntity("CFL4LJ.OP001.Color", colorInt); |
| | | miloService.writeToOpcByte(entity); |
| | | } |
| | | } |
| | |
| | | select id, order_no, engine_no, product_type, model, production_status, working_hours, current_workstation, quality_status, whether_or_print, report_10, report_20, combined_box_time, final_assembly_time, operator, operate_time, status, spare_field_1, spare_field_2, spare_field_3, spare_field_4, create_user, create_time, update_user, update_time, remarks, report_30, box_closing_online_time, closing_box_offline_time, final_assembly_launch_time, final_assembly_offline_time, cvt_launch_time, cvt_offline_time from bs_order_scheduling |
| | | </sql> |
| | | |
| | | <sql id="selectBsOrderSchedulingForReport"> |
| | | select id, engine_no, report_20, remarks from bs_order_scheduling |
| | | </sql> |
| | | |
| | | <select id="selectBsOrderSchedulingForReport" |
| | | parameterType="BsOrderScheduling" resultMap="BsOrderSchedulingResult"> |
| | | <include refid="selectBsOrderSchedulingForReport"/> |
| | | <where> |
| | | <if test="engineNoList != null and engineNoList.size() > 0"> |
| | | and engine_no in |
| | | <foreach collection="engineNoList" open="(" close=")" separator="," item="engine"> |
| | | #{engine} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectBsOrderSchedulingList" parameterType="BsOrderScheduling" resultMap="BsOrderSchedulingResult"> |
| | | <include refid="selectBsOrderSchedulingVo"/> |
| | | <where> |
| | |
| | | "axios": "0.24.0", |
| | | "clipboard": "2.0.8", |
| | | "core-js": "3.25.3", |
| | | "echarts": "5.4.0", |
| | | "echarts": "^4.9.0", |
| | | "element-ui": "^2.15.13", |
| | | "file-saver": "2.0.5", |
| | | "fuse.js": "6.4.3", |
| | |
| | | "vue": "2.6.12", |
| | | "vue-count-to": "1.0.13", |
| | | "vue-cropper": "0.5.5", |
| | | "vue-echarts": "^4.0.0", |
| | | "vue-meta": "2.4.0", |
| | | "vue-qr": "^4.0.9", |
| | | "vue-router": "3.4.9", |
| | |
| | | </span> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
| | | <el-form-item label="产åç¼ç " prop="productCode"> |
| | | <el-select style="width: 100%" @change="handleSelectChange(form.productCode)" v-model="form.productCode" placeholder="请è¾å
¥äº§åç¼ç "> |
| | | <el-option |
| | | v-for="item in options" |
| | | :key="item.productCode" |
| | | :label="item.productCode" |
| | | :value="item.productCode"> |
| | | </el-option> |
| | | </el-select> |
| | | <el-input v-model="form.productCode" placeholder="请è¾å
¥äº§åç¼ç " /> |
| | | </el-form-item> |
| | | <el-form-item label="产åå称" prop="productName"> |
| | | <el-input disabled v-model="form.productName" placeholder="请è¾å
¥äº§åå称" /> |
| | | <el-input v-model="form.productName" placeholder="请è¾å
¥äº§åå称" /> |
| | | </el-form-item> |
| | | <el-form-item label="èæ" prop="beat"> |
| | | <el-input v-model="form.beat" placeholder="请è¾å
¥èæ" /> |
| | | </el-form-item> |
| | | <el-form-item label="å¤æ³¨" prop="remark"> |
| | | <el-input v-model="form.remark" placeholder="请è¾å
¥å¤æ³¨" /> |
| | | </el-form-item> |
| | | |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="submitForm">ç¡® å®</el-button> |
| | |
| | | beat: [ |
| | | { required: true, message: "èæä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | productCode: [ |
| | | { required: true, message: "产åç¼ç ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | } |
| | | }; |
| | | }, |
| | |
| | | const startDate = value[0]; |
| | | const endDate = value[1]; |
| | | const dayCount = this.daysBetween(startDate, endDate); |
| | | if (dayCount + 1 > 7) { |
| | | this.$message.error('请éæ©è¿ç»ç7天ï¼'); |
| | | if (dayCount + 1 > 3) { |
| | | this.$message.error('请éæ©è¿ç»ç3天ï¼'); |
| | | this.queryParams.dateConditions = []; // éç½®æ¥æèå´ |
| | | } |
| | | } |
| | |
| | | <el-card style="margin-top: 10px" class="box-card"> |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-tabs v-model="activeName" @tab-click="handleClick"> |
| | | <el-tab-pane label="ç¨æ·ç®¡ç" name="first">ç¨æ·ç®¡ç</el-tab-pane> |
| | | <el-tab-pane label="é
置管ç" name="second">é
置管ç</el-tab-pane> |
| | | <el-tab-pane label="è§è²ç®¡ç" name="third">è§è²ç®¡ç</el-tab-pane> |
| | | <el-tab-pane label="æ£æåå¸" name="first"> |
| | | <div> |
| | | <!-- <v-chart :option="chartOption" :style="{width: '600px', height: '400px'}"/>--> |
| | | <div ref="chart1" :style="{ width: '900px', height: '400px' }"></div> |
| | | </div> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="æ£åå¾" name="second"> |
| | | <div ref="chart2" :style="{ width: '900px', height: '400px' }"></div> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </el-row> |
| | | <!-- <div>--> |
| | | <!--<!– <v-chart :option="chartOption" :style="{width: '600px', height: '400px'}"/>–>--> |
| | | <!-- <div ref="chart" :style="{ width: '100%', height: '400px' }"></div>--> |
| | | <!-- </div>--> |
| | | <!-- <el-table v-loading="loading" border :data="paramCollectionList" @selection-change="handleSelectionChange" v-if="paramCollectionList.length > 0">--> |
| | | |
| | | <el-table v-loading="loading" border :data="paramCollectionList" @selection-change="handleSelectionChange" v-if="paramCollectionList.length > 0"> |
| | | <!-- </el-table>--> |
| | | |
| | | </el-table> |
| | | <el-empty v-else> |
| | | <span slot="description">ææ æ°æ®</span> |
| | | </el-empty> |
| | | <!-- <el-empty v-else>--> |
| | | <!-- <span slot="description">ææ æ°æ®</span>--> |
| | | <!-- </el-empty>--> |
| | | </el-card> |
| | | |
| | | |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { listParamCollection, getParamCollection, delParamCollection, addParamCollection, updateParamCollection } from "@/api/main/da/paramCollection/paramCollection"; |
| | | import {queryDaParamCollectionListForSearch, getSelectOption, queryChart} from "../../../../api/main/da/paramCollection/paramCollection"; |
| | | import { |
| | | addParamCollection, |
| | | delParamCollection, |
| | | getParamCollection, |
| | | updateParamCollection |
| | | } from "@/api/main/da/paramCollection/paramCollection"; |
| | | import { |
| | | getSelectOption, |
| | | queryChart, |
| | | queryDaParamCollectionListForSearch |
| | | } from "../../../../api/main/da/paramCollection/paramCollection"; |
| | | import VueECharts from 'vue-echarts'; |
| | | import echarts from 'echarts' |
| | | import async from "async"; |
| | | |
| | | export default { |
| | | name: "ParamCollection", |
| | | components: { |
| | | 'v-chart': VueECharts |
| | | }, |
| | | data() { |
| | | return { |
| | | convertedData:[], |
| | | convertedData2:[], |
| | | activeName: 'second', |
| | | dataTypeList:[ |
| | | { |
| | |
| | | paramValue: [ |
| | | { required: true, message: "åæ°å¼ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | } |
| | | }, |
| | | }; |
| | | }, |
| | | created() { |
| | | // this.getList(); |
| | | }, |
| | | mounted() { |
| | | this.initChart1(); |
| | | this.initChart2(); |
| | | this.getSelectOptionMethod() |
| | | }, |
| | | methods: { |
| | | initChart1() { |
| | | // åºäºåå¤å¥½çdomï¼åå§åechartså®ä¾ |
| | | const chart = echarts.init(this.$refs.chart1); |
| | | |
| | | // æå®å¾è¡¨çé
置项åæ°æ® |
| | | const option = { |
| | | title: { |
| | | text: 'æ£æåå¸å¾', |
| | | }, |
| | | tooltip: {}, |
| | | xAxis: { |
| | | type: 'value', |
| | | scale: true |
| | | }, |
| | | yAxis: { |
| | | type: 'value', |
| | | }, |
| | | series: [ |
| | | { |
| | | name: 'æ£æåå¸', |
| | | type: 'line', |
| | | smooth: true, |
| | | // data: this.generateNormalDistributionData(10,0,1), // åå¼0ï¼æ åå·®1çæ£æåå¸æ°æ® |
| | | // data: this.queryChartMethod(), // åå¼0ï¼æ åå·®1çæ£æåå¸æ°æ® |
| | | data: this.convertedData, // åå¼0ï¼æ åå·®1çæ£æåå¸æ°æ® |
| | | }, |
| | | ], |
| | | }; |
| | | |
| | | // 使ç¨åæå®çé
置项åæ°æ®æ¾ç¤ºå¾è¡¨ã |
| | | chart.setOption(option); |
| | | }, |
| | | initChart2() { |
| | | // åºäºåå¤å¥½çdomï¼åå§åechartså®ä¾ |
| | | const chart = echarts.init(this.$refs.chart2); |
| | | |
| | | // æå®å¾è¡¨çé
置项åæ°æ® |
| | | const option = { |
| | | title: { |
| | | text: 'æ£åå¾', |
| | | }, |
| | | tooltip: {}, |
| | | xAxis: { |
| | | type: 'category', |
| | | data:[] |
| | | }, |
| | | yAxis: { |
| | | type: 'value', |
| | | scale: true |
| | | }, |
| | | series: [ |
| | | { |
| | | name: 'æ£åå¾', |
| | | type: 'scatter', |
| | | data: this.convertedData2, // åå¼0ï¼æ åå·®1çæ£æåå¸æ°æ® |
| | | }, |
| | | ], |
| | | }; |
| | | |
| | | // 使ç¨åæå®çé
置项åæ°æ®æ¾ç¤ºå¾è¡¨ã |
| | | chart.setOption(option); |
| | | }, |
| | | generateNormalDistributionData(numPoints, mean, stdDev) { |
| | | let data = []; |
| | | for (let i = 0; i < numPoints; i++) { |
| | | const x = (i - numPoints / 2) / (numPoints / 4); // 缩æ¾å°åéçXèå´ |
| | | const y = (1 / (stdDev * Math.sqrt(2 * Math.PI))) * Math.exp(-0.5 * Math.pow((x - mean) / stdDev, 2)); |
| | | data.push([x, y]); |
| | | } |
| | | console.log('rrered1111111111ata',data) |
| | | data = this.chartData |
| | | return data; |
| | | }, |
| | | getSelectOptionMethod(){ |
| | | getSelectOption(this.queryParams).then(res => { |
| | | console.log('rrrrrrr',res) |
| | |
| | | } |
| | | }) |
| | | }, |
| | | queryChartMethod(){ |
| | | queryChart(this.queryParams).then(res => { |
| | | async queryChartMethod(){ |
| | | //计ç®æ¹å¼å¯ä»¥ç¾åº¦ |
| | | let convertedData = [] |
| | | await queryChart(this.queryParams).then(res => { |
| | | if (res.code === 200){ |
| | | console.log('res',res) |
| | | let dataArray = [] |
| | | if (res.data.length > 0){ |
| | | res.data.forEach(x => { |
| | | let num = parseInt(x) |
| | | let num = parseFloat(x) |
| | | dataArray.push(num) |
| | | }) |
| | | } |
| | | console.log('res222',dataArray) |
| | | this.convertedData2 = dataArray |
| | | let array=dataArray |
| | | console.log('arra',array) |
| | | // å¹³åå¼ |
| | | let mean=(array.reduce((a,b)=>a+b))/array.length |
| | | mean = mean.toFixed(2) |
| | | console.log('mean',mean) |
| | | // æ¹å·® |
| | | let variance=array.map(x=>{ |
| | | return Math.pow(x-mean,2) |
| | | }).reduce((a,b)=>a+b)/array.length |
| | | console.log('variance',variance) |
| | | console.log('variance222',variance) |
| | | // æ åå·® |
| | | let StandardDeviation = Math.sqrt(variance) |
| | | StandardDeviation = StandardDeviation.toFixed(2) |
| | | console.log('StandardDeviation',StandardDeviation) |
| | | //计ç®æ¹å¼å¯ä»¥ç¾åº¦ |
| | | let convertedData=[] |
| | | for(let x=mean-3*StandardDeviation;x<=mean + 3*StandardDeviation;x++){ |
| | | console.log('mean-3*StandardDeviation',mean - 3*StandardDeviation) |
| | | console.log('mean+3*StandardDeviation',parseFloat(mean) + 3*StandardDeviation) |
| | | let step = 0.1 |
| | | |
| | | for(let x=mean-3*StandardDeviation; x<=parseFloat(mean) + 3*StandardDeviation; x = parseFloat((x+step).toFixed(2))){ |
| | | console.log('x',x) |
| | | //for循ç¯ä¸çæ¡ä»¶ä»£è¡¨ä½ è¦çæå 个æ åå·®çæ°æ®ï¼ |
| | | // å带å
¥æ£æåå¸å
¬å¼ï¼å°±å¯ä»¥çæä¸æ¡æ´æ¡åå¸æ²çº¿çæ°æ® |
| | | let y=1/(StandardDeviation*Math.sqrt(2*(Math.PI)))*Math.exp(-(Math.pow(x-mean,2))/(2*(Math.pow(StandardDeviation,2)))) |
| | | convertedData.push([x,y]) |
| | | console.log('(StandardDeviation*Math.sqrt(2*(Math.PI)))',(StandardDeviation*Math.sqrt(2*(Math.PI)))) |
| | | console.log('1/(StandardDeviation*Math.sqrt(2*(Math.PI)))',1/(StandardDeviation*Math.sqrt(2*(Math.PI)))) |
| | | console.log('-(Math.pow(x-mean,2))',-(Math.pow(x-mean,2))) |
| | | console.log('(2*(Math.pow(parseFloat(StandardDeviation),2)))',(2*(Math.pow(parseFloat(StandardDeviation),2)))) |
| | | const temp =1/(StandardDeviation*Math.sqrt(2*(Math.PI)))*Math.exp(-(Math.pow(x-mean,2))/(2*(Math.pow(parseFloat(StandardDeviation),2)))) |
| | | console.log('temp',temp) |
| | | let y = parseFloat(temp.toFixed(2)) |
| | | console.log('yyyyyyyyyyy',y) |
| | | let a = [] |
| | | a = [x,y] |
| | | console.log('a',a) |
| | | convertedData.push(a) |
| | | } |
| | | } |
| | | }) |
| | | console.log('34535435345',convertedData) |
| | | this.convertedData = convertedData |
| | | this.initChart1() |
| | | this.initChart2() |
| | | }, |
| | | handleClick(tab, event) { |
| | | console.log(tab, event); |
| | |
| | | const startDate = value[0]; |
| | | const endDate = value[1]; |
| | | const dayCount = this.daysBetween(startDate, endDate); |
| | | if (dayCount + 1 > 7) { |
| | | this.$message.error('请éæ©è¿ç»ç7天ï¼'); |
| | | if (dayCount + 1 > 2) { |
| | | this.$message.error('请éæ©è¿ç»ç2天ï¼'); |
| | | this.queryParams.dateConditions = []; // éç½®æ¥æèå´ |
| | | } |
| | | } |