优化部分样式修改,工程创建后端修改,创建工程根据膜系查询数据修改,模拟计算钢化参数后台获取,删除工程修改
| | |
| | | import request from "@/utils/request"; |
| | | |
| | | const props = defineProps({ |
| | | projectNo : String |
| | | project : null |
| | | }); |
| | | |
| | | const computed = ref(null); |
| | |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | if (props.projectNo) { |
| | | handleFetchData(props.projectNo); |
| | | handleTableData(data); |
| | | handleDataReceive(data); |
| | | if (props.project.projectNumber) { |
| | | handleFetchData(props.project.projectNumber); |
| | | //handleTableData(data); |
| | | //handleDataReceive(data); |
| | | } |
| | | }); |
| | | |
| | |
| | | <div style="width: 100%; height: 100%;"> |
| | | |
| | | <div id="compute"> |
| | | <compute :data="computedData" @fetch-data="handleFetchData" :project-no="props.projectNo" @sendData="handleData" @simulate-click="handleSimulation" /> |
| | | <compute :data="computedData" @fetch-data="handleFetchData" :project="props.project" @sendData="handleData" @simulate-click="handleSimulation" /> |
| | | </div> |
| | | |
| | | <div id="computeCard"> |
| | |
| | | margin-top: -30px; |
| | | margin-bottom: 2%; |
| | | width: 100%; |
| | | height: 40%; |
| | | height: 37%; |
| | | } |
| | | #computeCard{ |
| | | margin-top: 90px; |
| | | width: 64%; |
| | | height: 40%; |
| | | height: 55%; |
| | | float: left; |
| | | } |
| | | #computeDetail{ |
| | | margin-top: 90px; |
| | | margin-left: 1%; |
| | | float: left; |
| | | width: 35%; |
| | | height: 40%; |
| | | height: 55%; |
| | | } |
| | | </style> |
| | |
| | | } |
| | | |
| | | //从工程管理获取工程号,并跳转 |
| | | const projectNumber = ref(''); |
| | | const projectNumber = ref(); |
| | | const switchDialog = (number) => { |
| | | projectNumber.value = number; |
| | | detailPage.value = 3; |
| | |
| | | > |
| | | <project-create v-if="detailPage===1" /> |
| | | <project-mange v-if="detailPage===2" @switch-dialog="switchDialog" @closeDetailPage="handlePopupClose"/> |
| | | <glass-computed v-if="detailPage===3" :project-no="projectNumber"/> |
| | | <glass-computed v-if="detailPage===3" :project="projectNumber"/> |
| | | <div v-else></div> |
| | | </el-dialog> |
| | | |
| | |
| | | :deep( .el-dialog__body){ |
| | | height: calc(100% - 55px); |
| | | width: 100%; |
| | | margin-top: 30px; |
| | | //padding: 0; |
| | | } |
| | | |
| | |
| | | }) |
| | | |
| | | |
| | | |
| | | const handleProcessIdUpdate = newProcessId => { |
| | | projectRow.value.processId = newProcessId; |
| | | }; |
| | |
| | | const handleTechnologyNumberUpdate = newTechnologyNumber => { |
| | | projectRow.value.technologyNumber = newTechnologyNumber; |
| | | }; |
| | | |
| | | |
| | | |
| | | |
| | |
| | | </div> |
| | | |
| | | <div id="project-list"> |
| | | <project-list/> |
| | | <project-list /> |
| | | </div> |
| | | |
| | | </div> |
| | |
| | | }, |
| | | |
| | | columns: [ |
| | | {type: 'expand', fixed: "left", slots: {content: 'content'}, width: 50}, |
| | | {type: 'seq', title: t('basicData.Number'), width: 80}, |
| | | {field: 'projectNumber', width: 100, title: '工程号', filters: [{data: ''}], slots: {filter: 'num1_filter'},}, |
| | | {field: 'projectName', width: 50, title: '名称',}, |
| | | {field: 'glassType', width: 50, title: '膜系',}, |
| | |
| | | checkMessage: '当前工程状态不符合模拟计算条件,请确认工程状态后再操作!', |
| | | requiresRow: true, |
| | | actionFunction: async ({row}) => { |
| | | const projectNumber = row.projectNumber; |
| | | emit('switch-dialog', projectNumber); |
| | | const projectNo = row.projectNumber; |
| | | emit('switch-dialog', row); |
| | | } |
| | | }, |
| | | { |
| | |
| | | if (config.code === 'Export') { |
| | | config.gridRef.value.exportData(); |
| | | ElMessage.success(config.successMsg); |
| | | return; |
| | | } |
| | | if (config.code === 'compute') { |
| | | config.actionFunction({row}); |
| | | return; |
| | | } |
| | | // 添加确认提示弹窗,询问用户是否进行当前操作 |
| | |
| | | 'Content-Type': 'application/json' |
| | | } |
| | | }).then((res) => { |
| | | if (Number(res.code) === 200 && (res.msg === "" || res.msg === null)) { |
| | | if (res.code==200 && res.data===true) { |
| | | ElMessage.success(config.successMsg); |
| | | // 从列表中移除已删除的工程数据 |
| | | const index = produceList.value.findIndex(item => item.projectNumber === projectNumber); |
| | |
| | | <script setup> |
| | | import {reactive, ref, watch} from "vue"; |
| | | import {onMounted, reactive, ref, watch} from "vue"; |
| | | import {useI18n} from "vue-i18n"; |
| | | import {Platform, Search, SuccessFilled} from "@element-plus/icons-vue"; |
| | | import useUserInfoStore from "@/stores/userInfo"; |
| | |
| | | //获取工程号 |
| | | const props = defineProps({ |
| | | projectNo : String, |
| | | project: null, |
| | | data: { |
| | | type: Array, |
| | | default: () => [] |
| | | } |
| | | }); |
| | | // 定义响应式数据,用于绑定工程号输入框的值 |
| | | const inputValue = ref(props.projectNo); |
| | | const inputValue = ref(props.project.projectNumber); |
| | | |
| | | |
| | | |
| | | // 定义混排等级 |
| | | const optionVal = ref('') |
| | | const optionVal = ref(50) |
| | | |
| | | // 定义装载率 |
| | | const percentage1 = ref(80) |
| | |
| | | const heatingTime = ref('') // 加热时间 |
| | | const spacingLong = ref('') // 长轴间隔 |
| | | const spacingWidth = ref('') // 宽轴间隔 |
| | | const quantity = ref('') // 工程片数 |
| | | |
| | | |
| | | const gridOptions = reactive({ |
| | |
| | | ],//表头参数 |
| | | data: null,//表格数据 |
| | | toolbarConfig: { |
| | | buttons: [], |
| | | slots: { |
| | | buttons: "toolbar_buttons" |
| | | }, |
| | | |
| | | }, |
| | | }) |
| | | |
| | | onMounted(async() => { |
| | | await firstLoading() |
| | | }) |
| | | |
| | | const firstLoading = async() => { |
| | | request.post(`/glassOptimize/getConfiguration/钢化`).then((res) => { |
| | | if (res.code == "200") { |
| | | const rawData = res.data.data; |
| | | if (Array.isArray(rawData) && rawData.length > 0) { |
| | | const formattedData = rawData.map(item => { |
| | | const formattedItem = {}; |
| | | for (const key in item) { |
| | | if (typeof item[key] === 'string') { |
| | | //去除字符串属性值开头和结尾的双引号 |
| | | formattedItem[key] = item[key].replace(/^\"|\"$/g, ''); |
| | | } else { |
| | | formattedItem[key] = item[key]; |
| | | } |
| | | } |
| | | return formattedItem; |
| | | }); |
| | | furnaceWidth.value=formattedData[0].load_width |
| | | furnaceLength.value=formattedData[0].load_length |
| | | spacingLong.value=formattedData[0].x_space |
| | | spacingWidth.value=formattedData[0].y_space |
| | | heatingTime.value=formattedData[0].tempering_time |
| | | quantity.value=props.project.quantity |
| | | |
| | | } |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | |
| | | } |
| | | |
| | | // 监听父组件传递的数据变化 |
| | | watch(() => props.data, (newValue) => { |
| | |
| | | } |
| | | }) |
| | | |
| | | |
| | | const options = [ |
| | | { |
| | | value: '0', |
| | | label: '不混排', |
| | | }, |
| | | { |
| | | value: '1', |
| | | label: '轻度混排', |
| | | }, |
| | | { |
| | | value: '2', |
| | | label: '中度混排', |
| | | }, |
| | | { |
| | | value: '3', |
| | | label: '高度混排', |
| | | }, |
| | | ] |
| | | |
| | | |
| | | |
| | |
| | | </script> |
| | | |
| | | <template> |
| | | <div style="width: 100%;height: 100%"> |
| | | <div style="width: 100%;height: 100%"> |
| | | <!--模拟计算表头--> |
| | | <div id="title" style="margin-top: -10px"> |
| | | <span> |
| | | 工程编号 |
| | | <el-input style="width:150px;margin-left: 30px" clearable v-model="inputValue" placeholder="请输入工程号"></el-input> |
| | | <el-button |
| | | type="primary" |
| | | :icon="Search" |
| | | style="margin-left: 20px" |
| | | @click="handleSearchClick" |
| | | >{{ $t('basicData.search') }} |
| | | </el-button> |
| | | </span> |
| | | <span style="float: right ; margin-right: 120px"> |
| | | 工程混排等级 |
| | | <el-select |
| | | placeholder="选择混排等级" |
| | | style="margin-left:10px; width: 200px; " |
| | | ref="getSelect" |
| | | <div id="title" style="margin-top: -10px;height: 50%"> |
| | | <div style="display: flex"> |
| | | <div style="width: 850px"> |
| | | 工程编号 |
| | | <el-input style="width:150px;margin-left: 30px" clearable v-model="inputValue" placeholder="请输入工程号"></el-input> |
| | | <el-button |
| | | type="primary" |
| | | :icon="Search" |
| | | style="margin-left: 20px" |
| | | @click="handleSearchClick" |
| | | >{{ $t('basicData.search') }} |
| | | </el-button> |
| | | </div> |
| | | <div style="display: flex ; width: 700px;align-items: center;"> |
| | | <span>工程混排等级</span> |
| | | <el-slider |
| | | style="max-width: 200px; flex: 1; margin-left: 10px" |
| | | v-model="optionVal" |
| | | clearable |
| | | class="m-2" |
| | | @change="getWorkOrder" |
| | | > |
| | | <el-option |
| | | v-for="item in options" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | <el-button type="primary" style="margin-left: 10px" :icon="Platform" @click="handleSimulationClick">模拟计算</el-button> |
| | | <el-button type="primary" style="margin-left: 20px" :icon="SuccessFilled" @click="handleSave">保存</el-button> |
| | | </span><br> |
| | | :min="0" |
| | | :max="100" |
| | | :step="1"/> |
| | | <span style="margin-left: 20px ; width: 35px;">{{ optionVal }}%</span> |
| | | |
| | | <el-button type="primary" style="margin-left: 10px" :icon="Platform" @click="handleSimulationClick">模拟计算</el-button> |
| | | <el-button type="primary" style="margin-left: 20px" :icon="SuccessFilled" @click="handleSave">保存</el-button> |
| | | </div> |
| | | </div><br> |
| | | <div class="demo-progress" style="margin-top: 5px"> |
| | | <div style="display: flex; align-items: center"> |
| | | <span>钢化最大装载</span> |
| | |
| | | :min="0" |
| | | :max="100" |
| | | :step="1"/> |
| | | <span style="margin-left: 20px ; width: 30px;">{{ percentage1 }}%</span> |
| | | <span style="margin-left: 20px ; width: 35px;">{{ percentage1 }}%</span> |
| | | <span style="float: right ; margin-left: 150px;"> |
| | | 工程片数 <vxe-input size="small" disabled class="input" clearable v-model="quantity"></vxe-input> |
| | | 宽轴间隔 <vxe-input size="small" class="input" clearable v-model="spacingWidth"></vxe-input> |
| | | 炉宽(mm) <vxe-input size="small" class="input" clearable v-model="furnaceWidth"></vxe-input> |
| | | </span> |
| | |
| | | :min="0" |
| | | :max="100" |
| | | :step="1"/> |
| | | <span style="margin-left: 20px ; width: 30px;">{{ percentage2 }}%</span> |
| | | <span style="margin-left: 20px ; width: 35px;">{{ percentage2 }}%</span> |
| | | <span style="float: right ; margin-left: 150px;"> |
| | | 加热时间(秒)<vxe-input size="small" class="input" clearable v-model="heatingTime"></vxe-input> |
| | | 长轴间隔 <vxe-input size="small" class="input" clearable v-model="spacingLong"></vxe-input> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <vxe-grid |
| | | size="small" |
| | | @filter-change="filterChanged" |
| | | height="100%" |
| | | class="mytable-scrollbar" |
| | | ref="xGrid" |
| | | v-bind="gridOptions" |
| | | v-on="gridEvents" |
| | | > |
| | | <template #num2_filter="{ column, $panel }"> |
| | | <div> |
| | | <div v-for="(option, index) in column.filters" :key="index"> |
| | | <vxe-select v-model="option.data" :placeholder="$t('processCard.pleaseSelect')" |
| | | @change="changeFilterEvent($event, option, $panel)"> |
| | | <vxe-option value="0" :label="$t('basicData.unchecked')"></vxe-option> |
| | | <vxe-option value="1" :label="$t('basicData.selected')"></vxe-option> |
| | | </vxe-select> |
| | | </div> |
| | | <div style="height: 50%"> |
| | | <vxe-grid |
| | | size="small" |
| | | @filter-change="filterChanged" |
| | | height="50%" |
| | | class="mytable-scrollbar" |
| | | ref="xGrid" |
| | | v-bind="gridOptions" |
| | | v-on="gridEvents" |
| | | > |
| | | <template #num2_filter="{ column, $panel }"> |
| | | <div> |
| | | <div v-for="(option, index) in column.filters" :key="index"> |
| | | <vxe-select v-model="option.data" :placeholder="$t('processCard.pleaseSelect')" |
| | | @change="changeFilterEvent($event, option, $panel)"> |
| | | <vxe-option value="0" :label="$t('basicData.unchecked')"></vxe-option> |
| | | <vxe-option value="1" :label="$t('basicData.selected')"></vxe-option> |
| | | </vxe-select> |
| | | </div> |
| | | </template> |
| | | </div> |
| | | </template> |
| | | |
| | | <template #num1_filter="{ column, $panel }"> |
| | | <div> |
| | | <div v-for="(option, index) in column.filters" :key="index"> |
| | | <input |
| | | type="type" |
| | | v-model="option.data" |
| | | @keyup.enter.native="$panel.confirmFilter()" |
| | | @input="changeFilterEvent($event, option, $panel)"/> |
| | | </div> |
| | | <template #num1_filter="{ column, $panel }"> |
| | | <div> |
| | | <div v-for="(option, index) in column.filters" :key="index"> |
| | | <input |
| | | type="type" |
| | | v-model="option.data" |
| | | @keyup.enter.native="$panel.confirmFilter()" |
| | | @input="changeFilterEvent($event, option, $panel)"/> |
| | | </div> |
| | | </template> |
| | | </vxe-grid> |
| | | </div> |
| | | </template> |
| | | </vxe-grid> |
| | | </div> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | }, |
| | | |
| | | columns:[ |
| | | {type:'seq',fixed:"left",slots: { content:'content' },width: 50}, |
| | | {type: 'seq', title: t('basicData.Number'), width: 80}, |
| | | {field: 'check', title: '选择', width: 250, cellRender: checkboxCellRender }, |
| | | {field: 'process_id',width: 150, title: t('processCard.processId'), sortable: true}, |
| | | {field: 'technology_number',width: 70, title: '层', sortable: true}, |
| | |
| | | |
| | | toolbarConfig: { |
| | | buttons: [], |
| | | slots:{ |
| | | buttons: "toolbar_buttons" |
| | | }, |
| | | zoom: true, |
| | | custom: true |
| | | }, |
| | |
| | | <span>流程卡</span> |
| | | <vxe-grid |
| | | size="small" |
| | | @filter-change="filterChanged" |
| | | height="100%" |
| | | class="mytable-scrollbar" |
| | | ref="xGrid" |
| | |
| | | data:null,//表格数据 |
| | | toolbarConfig: { |
| | | buttons: [], |
| | | slots:{ |
| | | buttons: "toolbar_buttons" |
| | | }, |
| | | zoom: true, |
| | | custom: true |
| | | }, |
| | |
| | | //小圆点单选框 |
| | | let radio = ref(1); |
| | | |
| | | const selectFlowCardList = () => { |
| | | const selectFlowCardList = async () => { |
| | | request.post(`/glassOptimize/getFlowCardList/${optionVal.value}/${radio.value}`).then((res) => { |
| | | if (res.code == 200) { |
| | | xGrid.value.loadData(res.data.data) |
| | |
| | | <script setup> |
| | | import {onMounted, reactive, ref} from "vue"; |
| | | import {onMounted, reactive, ref, watch} from "vue"; |
| | | import {useI18n} from "vue-i18n"; |
| | | import request from "@/utils/request"; |
| | | import {ElMessage} from "element-plus"; |
| | |
| | | const { t } = useI18n() |
| | | |
| | | const xGrid = ref() |
| | | |
| | | |
| | | const gridOptions = reactive({ |
| | | height:'100%', |
| | |
| | | showStatus: true |
| | | }, |
| | | columns:[ |
| | | {type:'expand',fixed:"left",slots: { content:'content' },width: 50}, |
| | | {field: 'id',width: 150, title: 'ID',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'project_no',width: 150, title: '工程号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'project_name',width: 150, title: '项目名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | |
| | | getProject(); |
| | | }) |
| | | |
| | | |
| | | |
| | | const getProject = ()=>{ |
| | | request.post(`/glassOptimize/getProjectList`).then((res) => { |
| | | if(res.code==200){ |
| | |
| | | return new ResponseEntity<>(optContent.getBytes(), headers, HttpStatus.OK); |
| | | } |
| | | |
| | | @PostMapping("/getConfiguration/{type}") |
| | | public Result getConfiguration(@PathVariable String type) { |
| | | return Result.seccess(glassOptimizeService.getConfiguration(type)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | package com.example.erp.mapper.pp; |
| | | |
| | | |
| | | import com.example.erp.entity.pp.FlowCard; |
| | | import com.example.erp.entity.pp.OptimizeProjectMange; |
| | | import com.example.erp.entity.sd.OrderGlassDetail; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | |
| | | //工程信息流程卡 |
| | | List<Map<String, Object>> getProcessCardMp(String projectNo); |
| | | |
| | | List<FlowCard> getFlowCardList(String projectNo); |
| | | |
| | | //库存信息 |
| | | List<Map<String, Object>> materialStoreMp(String thickness, String model); |
| | | |
| | |
| | | |
| | | //创建工程膜系查询 |
| | | List<Map<String, Object>> getFlowCardListMp(String optionVal, Integer radio); |
| | | List<Map<String, Object>> getFlowCardListWhole(String optionVal); |
| | | List<Map<String, Object>> getFlowCardListNormal(String optionVal); |
| | | List<Map<String, Object>> getFlowCardListPatch(String optionVal); |
| | | |
| | | //工程管理工程号查询 |
| | | List<OptimizeProjectMange> optimizeProjectMangeMp(Date startSelectTime, Date endSelectTime, OptimizeProjectMange optimizeProjectMange); |
| | |
| | | //删除工程 |
| | | int deleteProjectMp(String projectNumber); |
| | | |
| | | int deleteOptimizeHeatDetail(String projectNumber); |
| | | |
| | | int deleteOptimizeHeatLayout(String projectNumber); |
| | | |
| | | int deleteOptimizeDetail(String projectNumber); |
| | | |
| | | //模拟计算工程号查询 |
| | | List<Map<String, Object>> selectProjectComputeMp(@Param("projectNo")String projectNumber); |
| | | |
| | | Map<String, Object> selectProjectCount(@Param("projectNo")String projectNumber); |
| | | |
| | | //模拟计算流程卡详情 |
| | | List<Map<String, Object>> selectComputeDetailMp(String processId); |
| | |
| | | |
| | | Boolean updateFlowCardProject(String processId, String technologyNumber, String projectId); |
| | | |
| | | Boolean updateFlowCardProjectReturn(String processId, String technologyNumber, String projectId); |
| | | |
| | | Double getSelectArea(String processId, String technologyNumber); |
| | | |
| | | Boolean addProjectMp(String projectId, String projectNmae, String glassThickness, String glassType, Integer sumQuantity, Double sumArea, String userName); |
| | | Boolean addProjectMp(String projectId, String projectNmae, String glassThickness, String glassType, |
| | | Integer sumQuantity, Double sumArea, String userName,Integer processIdCount, String processId, Integer type); |
| | | |
| | | List<Map<String, Object>> getTemperedConfiguration(); |
| | | } |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.sql.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | //工程查询流程卡 |
| | | public Map<String, Object> getFlowCardList(String optionVal, Integer radio) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", glassOptimizeMapper.getFlowCardListMp(optionVal, radio)); |
| | | if(radio==1){ |
| | | map.put("data", glassOptimizeMapper.getFlowCardListWhole(optionVal)); |
| | | }else if(radio==2){ |
| | | map.put("data", glassOptimizeMapper.getFlowCardListNormal(optionVal)); |
| | | }else{ |
| | | map.put("data", glassOptimizeMapper.getFlowCardListPatch(optionVal)); |
| | | } |
| | | |
| | | |
| | | return map; |
| | | } |
| | |
| | | } |
| | | |
| | | //删除工程 |
| | | public Map<String, Object> deleteProject(String projectNumber) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", glassOptimizeMapper.deleteProjectMp(projectNumber)); |
| | | return map; |
| | | public boolean deleteProject(String projectNumber) { |
| | | Map<String, Object> stringObjectMap = glassOptimizeMapper.selectProjectCount(projectNumber); |
| | | if(stringObjectMap.get("state").equals(10)){ |
| | | glassOptimizeMapper.deleteOptimizeHeatDetail(projectNumber); |
| | | glassOptimizeMapper.deleteOptimizeHeatLayout(projectNumber); |
| | | }else if(stringObjectMap.get("state").equals(20)){ |
| | | glassOptimizeMapper.deleteOptimizeDetail(projectNumber); |
| | | glassOptimizeMapper.deleteOptimizeHeatDetail(projectNumber); |
| | | glassOptimizeMapper.deleteOptimizeHeatLayout(projectNumber); |
| | | } |
| | | List<FlowCard> flowCardList =glassOptimizeMapper.getFlowCardList(projectNumber); |
| | | for (FlowCard flowCard:flowCardList){ |
| | | glassOptimizeMapper.updateFlowCardProjectReturn(flowCard.getProcessId(),flowCard.getTechnologyNumber(),projectNumber); |
| | | } |
| | | glassOptimizeMapper.deleteProjectMp(projectNumber); |
| | | return true; |
| | | } |
| | | |
| | | |
| | |
| | | public Map<String, Object>selectProjectComputeSv(String projectNumber) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", glassOptimizeMapper.selectProjectComputeMp(projectNumber)); |
| | | //map.put("project", glassOptimizeMapper.selectProjectCount(projectNumber)); |
| | | return map; |
| | | } |
| | | |
| | |
| | | if ("null".equals(projectNmae)) { |
| | | projectNmae = ""; |
| | | } |
| | | Double sumArea = (double) 0; |
| | | Double area = (double) 0; |
| | | BigDecimal sumArea = new BigDecimal(0); |
| | | double area = 0; |
| | | Integer sumQuantity = 0; |
| | | Integer type = 1; |
| | | StringBuilder processId= new StringBuilder(); |
| | | List<FlowCard> flowCardList = JSONArray.parseArray(JSONObject.toJSONString(object.get("projectdetail")), FlowCard.class); |
| | | if (!flowCardList.isEmpty()) { |
| | | for (FlowCard flowCard : flowCardList) { |
| | | //给流程卡表添加对应的工程号 |
| | | glassOptimizeMapper.updateFlowCardProject(flowCard.getProcessId(),flowCard.getTechnologyNumber(),projectId); |
| | | area = glassOptimizeMapper.getSelectArea(flowCard.getProcessId(),flowCard.getTechnologyNumber()); |
| | | sumArea += area; |
| | | area = glassOptimizeMapper.getSelectArea(flowCard.getProcessId(),flowCard.getTechnologyNumber()).doubleValue(); |
| | | sumArea = sumArea.add(BigDecimal.valueOf(area)); |
| | | sumQuantity +=flowCard.getQuantity(); |
| | | processId.append(flowCard.getProcessId()).append("-").append(flowCard.getTechnologyNumber()).append(";"); |
| | | } |
| | | int index = optionVal.indexOf("mm"); |
| | | // 获取 "mm" 前面的部分 |
| | | String glass_thickness = optionVal.substring(0, index); |
| | | // 获取 "mm" 后面的部分 |
| | | String glass_type = optionVal.substring(index + 2); |
| | | glassOptimizeMapper.addProjectMp(projectId,projectNmae,glass_thickness,glass_type,sumQuantity,sumArea,userName); |
| | | glassOptimizeMapper.addProjectMp(projectId,projectNmae,glass_thickness,glass_type,sumQuantity,sumArea.doubleValue(),userName, |
| | | flowCardList.size(), String.valueOf(processId),type); |
| | | return true; |
| | | } |
| | | else { |
| | |
| | | |
| | | } |
| | | } |
| | | |
| | | public Map<String, Object> getConfiguration(String type) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if(type.equals("钢化")){ |
| | | map.put("data", glassOptimizeMapper.getTemperedConfiguration()); |
| | | }else if(type.equals("磨量")){ |
| | | map.put("data", glassOptimizeMapper.getTemperedConfiguration()); |
| | | }else if(type.equals("修边")){ |
| | | map.put("data", glassOptimizeMapper.getTemperedConfiguration()); |
| | | } |
| | | |
| | | return map; |
| | | } |
| | | } |
| | |
| | | fc.order_number |
| | | </select> |
| | | |
| | | <select id="getFlowCardList"> |
| | | SELECT * |
| | | FROM |
| | | pp.flow_card AS fc |
| | | WHERE |
| | | fc.project_no = #{projectNo} |
| | | |
| | | </select> |
| | | |
| | | <!--库存信息--> |
| | | <select id="materialStoreMp"> |
| | | SELECT |
| | |
| | | AND pd.glass_sort = fc.technology_number |
| | | WHERE |
| | | CONCAT( JSON_UNQUOTE( JSON_EXTRACT( pd.separation, '$.thickness' )), JSON_UNQUOTE( JSON_EXTRACT( pd.separation, '$.color' )) )= #{optionVal} |
| | | and ISNULL(fc.project_no) |
| | | and ISNULL(fc.project_no) and fc.layout_status=1 |
| | | GROUP BY |
| | | fc.process_id, |
| | | fc.technology_number |
| | | ORDER BY |
| | | fc.process_id, |
| | | fc.technology_number |
| | | </select> |
| | | |
| | | <select id="getFlowCardListWhole"> |
| | | SELECT 流程卡号 as process_id, |
| | | 层 as technology_number, |
| | | 总层数 as TotalFloors, |
| | | 规格 as TotalNumber, |
| | | 数量 as quantity, |
| | | 形状 as shape, |
| | | 项目 as project, |
| | | 单片名称 as glass_child, |
| | | 面积 as area, |
| | | GlassType as glassType |
| | | FROM pp.v_optimize_process_whole where |
| | | CONCAT( JSON_UNQUOTE( JSON_EXTRACT( GlassType, '$.thickness' )), JSON_UNQUOTE( JSON_EXTRACT( GlassType, '$.color' )) )= #{optionVal} |
| | | </select> |
| | | |
| | | <select id="getFlowCardListNormal"> |
| | | SELECT 流程卡号 as process_id, |
| | | 层 as technology_number, |
| | | 总层数 as TotalFloors, |
| | | 规格 as TotalNumber, |
| | | 数量 as quantity, |
| | | 形状 as shape, |
| | | 项目 as project, |
| | | 单片名称 as glass_child, |
| | | 面积 as area, |
| | | GlassType as glassType |
| | | FROM pp.v_optimize_process_normal where |
| | | CONCAT( JSON_UNQUOTE( JSON_EXTRACT( GlassType, '$.thickness' )), JSON_UNQUOTE( JSON_EXTRACT( GlassType, '$.color' )) )= #{optionVal} |
| | | </select> |
| | | |
| | | <select id="getFlowCardListPatch"> |
| | | SELECT 流程卡号 as process_id, |
| | | 层 as technology_number, |
| | | 总层数 as TotalFloors, |
| | | 规格 as TotalNumber, |
| | | 数量 as quantity, |
| | | 形状 as shape, |
| | | 项目 as project, |
| | | 单片名称 as glass_child, |
| | | 面积 as area, |
| | | GlassType as glassType |
| | | FROM pp.v_optimize_process_patch where |
| | | CONCAT( JSON_UNQUOTE( JSON_EXTRACT( GlassType, '$.thickness' )), JSON_UNQUOTE( JSON_EXTRACT( GlassType, '$.color' )) )= #{optionVal} |
| | | </select> |
| | | |
| | | <!--工程管理--> |
| | |
| | | <!--删除工程--> |
| | | <delete id="deleteProjectMp"> |
| | | delete from pp.optimize_project |
| | | where project_no = #{projectNumber} |
| | | </delete> |
| | | |
| | | <delete id="deleteOptimizeHeatDetail"> |
| | | delete from pp.optimize_heat_detail |
| | | where project_no = #{projectNumber} |
| | | </delete> |
| | | |
| | | <delete id="deleteOptimizeHeatLayout"> |
| | | delete from pp.optimize_heat_layout |
| | | where project_no = #{projectNumber} |
| | | </delete> |
| | | |
| | | <delete id="deleteOptimizeDetail"> |
| | | delete from pp.optimize_detail |
| | | where project_no = #{projectNumber} |
| | | </delete> |
| | | |
| | |
| | | fc.process_id, fc.technology_number |
| | | ORDER BY |
| | | fc.process_id, fc.technology_number; |
| | | </select> |
| | | |
| | | <select id="selectProjectCount"> |
| | | select * from pp.optimize_project where project_no=#{projectNo} |
| | | </select> |
| | | |
| | | <!--模拟计算流程卡详情--> |
| | |
| | | </select> |
| | | |
| | | <update id="updateFlowCardProject"> |
| | | UPDATE pp.flow_card set project_no=#{projectId} |
| | | UPDATE pp.flow_card set project_no=#{projectId},layout_status=2 |
| | | where process_id=#{processId} and technology_number=#{technologyNumber} |
| | | </update> |
| | | |
| | | <update id="updateFlowCardProjectReturn"> |
| | | UPDATE pp.flow_card set project_no=null,layout_status=1 |
| | | where process_id=#{processId} and technology_number=#{technologyNumber} |
| | | </update> |
| | | |
| | | <select id="getSelectArea"> |
| | |
| | | </select> |
| | | |
| | | <insert id="addProjectMp"> |
| | | insert into pp.optimize_project (project_no, project_name, order_glass_type, order_glass_thickness) |
| | | values (#{projectId}, #{projectNmae}, #{glassType}, #{glassThickness}) |
| | | insert into pp.optimize_project (project_no, project_name, order_glass_type, order_glass_thickness,glass_type, glass_thickness, |
| | | glass_total,glass_total_area,type,state,process_qty,process_cards) |
| | | values (#{projectId}, #{projectNmae}, #{glassType}, #{glassThickness}, #{glassType}, #{glassThickness},#{sumQuantity}, #{sumArea}, |
| | | #{type},1,#{processIdCount},#{processId}) |
| | | </insert> |
| | | |
| | | |
| | |
| | | FROM pp.optimize_project_file |
| | | WHERE project_no=#{processId} and type='优化结果'; |
| | | </select> |
| | | |
| | | <select id="getTemperedConfiguration"> |
| | | select JSON_EXTRACT( oc.config_detail, '$.glass_thickness' ) as glass_thickness, |
| | | JSON_EXTRACT( oc.config_detail, '$.glass_type' ) as glass_type, |
| | | JSON_EXTRACT( oc.config_detail, '$.tempering_time' ) as tempering_time, |
| | | JSON_EXTRACT( oc.config_detail, '$.load_width' ) as load_width, |
| | | JSON_EXTRACT( oc.config_detail, '$.load_length' ) as load_length, |
| | | JSON_EXTRACT( oc.config_detail, '$.x_space' ) as x_space, |
| | | JSON_EXTRACT( oc.config_detail, '$.y_space' ) as y_space |
| | | from pp.optimize_admin oa left join pp.optimize_config oc on oa.h_id=oc.id where name='admin' |
| | | </select> |
| | | </mapper> |