Merge branch 'master' of http://bore.pub:10439/r/ERP_override
| | |
| | | import request from "@/utils/request"; |
| | | import {ElMessage, ElMessageBox} from "element-plus"; |
| | | import deepClone from "@/utils/deepClone"; |
| | | import {useRouter} from "vue-router"; |
| | | |
| | | const router = useRouter(); |
| | | let projectRow = ref({ |
| | | processId:null, |
| | | technologyNumber:null |
| | |
| | | options: [ |
| | | [ |
| | | {code: 'openProject', name: '打开工程', prefixIcon: 'vxe-icon-folder-open'}, |
| | | {code: 'updateProject', name: '修改工程', prefixIcon: 'vxe-icon-folder-open'}, |
| | | {code: 'compute', name: '模拟计算', prefixIcon: 'vxe-icon-subtable'}, |
| | | {code: 'delProject', name: '删除工程', prefixIcon: 'vxe-icon-delete'}, |
| | | ], |
| | |
| | | const operationConfigs = [ |
| | | { |
| | | code: 'openProject', // 打开工程 |
| | | initialState: ['10', '20', '100', '200'], // |
| | | initialState: ['1'], // |
| | | targetState: null, |
| | | successMsg: '已打开!', |
| | | checkMessage: '当前工程状态不符合条件,请确认工程状态后再操作!', |
| | | requiresRow: true, |
| | | openFile: async ({row}) => { |
| | | const projectNumber = row.projectNumber; |
| | | const thickness = row.thickness; |
| | | const glassType = row.glassType; |
| | | const thickness = row.glass_thickness; |
| | | const glassType = row.glass_type; |
| | | await router.push({ |
| | | name: 'optimizeInfo', |
| | | params: { |
| | |
| | | targetState: null, |
| | | successMsg: '工程删除成功!', |
| | | checkMessage: '当前工程状态不符合删除条件,请确认工程状态后再操作!', |
| | | }, |
| | | { |
| | | code: 'updateProject', |
| | | initialState: ['1'], |
| | | targetState: null, |
| | | successMsg: '', |
| | | checkMessage: '当前工程状态不符合删除条件,请确认工程状态后再操作!', |
| | | } |
| | | |
| | | ]; |
| | |
| | | }) |
| | | } |
| | | |
| | | // 公共处理函数,处理相同数据时的操作,并返回targetRoute对象(右键菜单和双击打开) |
| | | const handleSameDataOperation = async ({projectNumber, thickness, glassType}) => { |
| | | const targetRoute = { |
| | | name: 'optimizeInfo', |
| | | params: { |
| | | projectNo: projectNumber, |
| | | thickNess: String(thickness), |
| | | model: glassType |
| | | } |
| | | }; |
| | | const currentRoute = router.currentRoute.value; |
| | | const isRoutesEqual = currentRoute.name === targetRoute.name && |
| | | currentRoute.params.projectNo === targetRoute.params.projectNo && |
| | | currentRoute.params.thickNess === targetRoute.params.thickNess && |
| | | currentRoute.params.model === targetRoute.params.model; |
| | | if (isRoutesEqual) { |
| | | handleConfirm(); |
| | | } |
| | | return {isRoutesEqual}; |
| | | }; |
| | | |
| | | //选中相同数据时弹窗提示 |
| | | const handleConfirm = () => { |
| | | const currentRoute = router.currentRoute.value; |
| | | const projectNumber = currentRoute.params.projectNo; |
| | | ElMessageBox.confirm(`当前工程(工程号:${projectNumber})已打开,是否重新打开?`, '确认操作', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }) |
| | | .then(() => { |
| | | emit('close-detail-page'); |
| | | ElMessage.success('已打开!'); |
| | | }) |
| | | .catch(() => { |
| | | ElMessage.info('已取消操作'); |
| | | }); |
| | | }; |
| | | |
| | | const gridEvents = { |
| | | menuClick({menu, row}) { |
| | | const $grid = xGrid.value; |
| | |
| | | config.actionFunction({row}); |
| | | return; |
| | | } |
| | | if (config.code === 'updateProject') { |
| | | if (!row) { |
| | | ElMessage.warning(config.checkMessage); |
| | | return; |
| | | } |
| | | processCardRef.value.getUpdateFlowCardList(row.projectNumber,row.glass_type,row.glass_thickness); |
| | | return; |
| | | } |
| | | if (config.code === 'openProject') { |
| | | handleSameDataOperation(row).then(({isRoutesEqual}) => { |
| | | if (!isRoutesEqual) { |
| | | config.openFile({row}); |
| | | ElMessage.success(config.successMsg); |
| | | } |
| | | }); |
| | | } |
| | | // 添加确认提示弹窗,询问用户是否进行当前操作 |
| | | ElMessageBox.confirm('是否进行当前操作?', '确认操作', { |
| | | confirmButtonText: '确定', |
| | |
| | | const operationConfigs = [ |
| | | { |
| | | code: 'openProject', // 打开工程 |
| | | initialState: ['10', '20', '100', '200'], // |
| | | initialState: ['1','10', '20', '100', '200'], // |
| | | targetState: null, |
| | | successMsg: '已打开!', |
| | | checkMessage: '当前工程状态不符合条件,请确认工程状态后再操作!', |
| | |
| | | |
| | | columns:[ |
| | | {type: 'seq', title: t('basicData.Number'), width: 80}, |
| | | {field: 'check', title: '选择', width: 250, cellRender: checkboxCellRender }, |
| | | {field: "mq", title: '幕墙模式', width: 80, slots: { default: 'state' }}, |
| | | {field: "hp", title: '允许横排', width: 80, slots: { default: 'state' }}, |
| | | {field: "tempering", title: '钢化', width: 80, slots: { default: 'state' }}, |
| | | |
| | | {field: 'process_id',width: 150, title: t('processCard.processId'), sortable: true}, |
| | | {field: 'technology_number',width: 70, title: '层', sortable: true}, |
| | | {field: 'TotalFloors',width: 150, title: '总层数', sortable: true}, |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <template #state="{ row,column}"> |
| | | <el-checkbox |
| | | v-if="row[column.field] === 1" |
| | | :checked="true"/> |
| | | <el-checkbox |
| | | v-else |
| | | :checked="false"/> |
| | | </template> |
| | | </vxe-grid> |
| | | </div> |
| | | </template> |
| | |
| | | }, |
| | | toolbarConfig: { |
| | | buttons: [], |
| | | slots:{ |
| | | buttons: "toolbar_buttons" |
| | | }, |
| | | }, |
| | | }) |
| | | |
| | |
| | | import deepClone from "@/utils/deepClone"; |
| | | import {ElMessage} from "element-plus"; |
| | | import useUserInfoStore from "@/stores/userInfo"; |
| | | import {changeFilterEvent, filterChanged} from "@/hook"; |
| | | |
| | | const {t} = useI18n() |
| | | const userStore = useUserInfoStore() |
| | |
| | | useKey: true |
| | | }, |
| | | filterConfig: { //筛选配置项 |
| | | remote: true |
| | | //remote: true |
| | | }, |
| | | customConfig: { |
| | | storage: true |
| | |
| | | }, |
| | | columns: [ |
| | | |
| | | {type: 'checkbox', fixed: "left", title: t('basicData.check'), width: 80}, |
| | | {field: 'select',type:'checkbox',title: t('basicData.check'), width: 80,fixed:"left"}, |
| | | { |
| | | field: 'process_id', |
| | | width: 150, |
| | | title: t('processCard.processId'), |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | sortable: true |
| | | sortable: true, |
| | | filterMethod:filterChanged |
| | | }, |
| | | { |
| | | field: 'technology_number', |
| | |
| | | title: '层', |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | sortable: true |
| | | sortable: true, |
| | | filterMethod:filterChanged |
| | | }, |
| | | { |
| | | field: 'TotalFloors', |
| | |
| | | title: '总层数', |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | sortable: true |
| | | sortable: true, |
| | | filterMethod:filterChanged |
| | | }, |
| | | { |
| | | field: 'TotalNumber', |
| | |
| | | title: '规格', |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | sortable: true |
| | | sortable: true, |
| | | filterMethod:filterChanged |
| | | }, |
| | | { |
| | | field: 'quantity', |
| | |
| | | title: t('order.quantity'), |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | sortable: true |
| | | sortable: true, |
| | | filterMethod:filterChanged |
| | | }, |
| | | { |
| | | field: 'shape', |
| | |
| | | title: t('order.shape'), |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | sortable: true |
| | | sortable: true, |
| | | filterMethod:filterChanged |
| | | }, |
| | | { |
| | | field: 'glass_child', |
| | |
| | | title: t('order.product'), |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | sortable: true |
| | | sortable: true, |
| | | filterMethod:filterChanged |
| | | }, |
| | | {field: 'project', width: 150, title: t('order.project'), showOverflow: "ellipsis"}, |
| | | {field: 'project', width: 150, title: t('order.project'), showOverflow: "ellipsis",filterMethod:filterChanged}, |
| | | { |
| | | field: 'area', |
| | | width: 150, |
| | | title: t('order.area'), |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | sortable: true |
| | | sortable: true, |
| | | filterMethod:filterChanged |
| | | }, |
| | | |
| | | |
| | |
| | | |
| | | //小圆点单选框 |
| | | let radio = ref(1); |
| | | let isButtonDisabledAdd = false; |
| | | let isButtonDisabledUpdate = true; |
| | | |
| | | const selectFlowCardList = async () => { |
| | | request.post(`/glassOptimize/getFlowCardList/${optionVal.value}/${radio.value}`).then((res) => { |
| | | if (res.code == 200) { |
| | | getProjectId() |
| | | isButtonDisabledAdd=false |
| | | isButtonDisabledUpdate = true |
| | | xGrid.value.loadData(res.data.data) |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | |
| | | }) |
| | | } |
| | | |
| | | const getUpdateFlowCardList = async (projectNumber,type,thickness) => { |
| | | request.post(`/glassOptimize/getUpdateFlowCardList/${type}/${thickness}/${radio.value}/${projectNumber}`).then((res) => { |
| | | if (res.code == 200) { |
| | | oddNumbers.value=projectNumber |
| | | optionVal.value=thickness+"mm"+type |
| | | isButtonDisabledAdd=true |
| | | isButtonDisabledUpdate=false |
| | | xGrid.value.loadData(deepClone(res.data.data)) |
| | | xGrid.value.getTableData().fullData.forEach(item => { |
| | | if(item.occupyState===0){ |
| | | xGrid.value.setCheckboxRow(item, true); |
| | | } |
| | | }) |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | //创建工程 |
| | | const addProject = () => { |
| | | const addProject = (type) => { |
| | | const $table = xGrid.value |
| | | if ($table) { |
| | | const selectRecords = $table.getCheckboxRecords() |
| | |
| | | |
| | | let projectData = ref({ |
| | | projectdetail: selectRecords, |
| | | userName : username |
| | | userName : username, |
| | | projectType: type |
| | | }) |
| | | let inputProject = projectNmae.value |
| | | if (inputProject == undefined) { |
| | |
| | | |
| | | } |
| | | } |
| | | const handleRowClassName = ({ row, rowIndex }) => { |
| | | if (row.patch_state === 1) { |
| | | return 'high-score'; |
| | | } |
| | | if (row.occupyState === 0) { |
| | | return 'high-score2'; |
| | | } |
| | | } |
| | | |
| | | //抛出方法到父界面 |
| | | defineExpose({getProjectId,selectFlowCardList,selectGlassType}) |
| | | defineExpose({getProjectId,selectFlowCardList,selectGlassType,getUpdateFlowCardList}) |
| | | </script> |
| | | |
| | | <template> |
| | | <div style="width: 100%;height: 110%; margin-top: -36px"> |
| | | <h1>流程卡列表 |
| | | <div> |
| | | 流程卡列表 |
| | | <span style="margin-left: 140px;font-size: 14px">工程编号:</span> |
| | | <!-- <span>{{oddNumbers}}</span>--> |
| | | <el-input disabled v-model="oddNumbers" style="width: 100px"></el-input> |
| | | <!-- <vxe-input :disabled="isDisabled" placeholder="" v-model="oddNumbers" size="small" style="color:black;"></vxe-input> --> |
| | | <span style="font-size: 14px">工程名称:</span> |
| | | <el-input style="width: 150px" placeholder="" v-model="projectNmae" size="small"></el-input> |
| | | <el-button style="margin-left: 20px" type="primary" @click="addProject">创建</el-button> |
| | | </h1> |
| | | <el-button style="margin-left: 20px" id="add" type="primary" :disabled="isButtonDisabledAdd" @click="addProject(1)">创建</el-button> |
| | | <el-button style="margin-left: 20px;" id="update" :disabled="isButtonDisabledUpdate" @click="addProject(2)">修改</el-button> |
| | | </div> |
| | | <vxe-grid |
| | | ref="xGrid" |
| | | class="mytable-scrollbar" |
| | |
| | | v-bind="gridOptions" |
| | | v-on="gridEvents" |
| | | @filter-change="filterChanged" |
| | | :row-class-name="handleRowClassName" |
| | | > |
| | | <template #num2_filter="{ column, $panel }"> |
| | | <div> |
| | |
| | | <template #num1_filter="{ column, $panel }"> |
| | | <div> |
| | | <div v-for="(option, index) in column.filters" :key="index"> |
| | | <input |
| | | |
| | | v-model="option.data" |
| | | type="type" |
| | | @input="changeFilterEvent($event, option, $panel)" |
| | | @keyup.enter.native="$panel.confirmFilter()"/> |
| | | <input type="type" v-model="option.data" @keyup.enter.native="$panel.confirmFilter()" @input="changeFilterEvent($event, option, $panel)"/> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | <vxe-radio content="补单" label="3"></vxe-radio> |
| | | </vxe-radio-group> |
| | | </template> |
| | | |
| | | </vxe-grid> |
| | | </div> |
| | | </template> |
| | | |
| | | <style scoped> |
| | | |
| | | <style lang="css"> |
| | | .high-score { |
| | | background-color: #d4baba !important; |
| | | } |
| | | .high-score2 { |
| | | background-color: #a5aec9 !important; |
| | | } |
| | | </style> |
| | |
| | | }, |
| | | |
| | | columns: [ |
| | | {type: 'seq', fixed: "left", title: ' ', slots: {content: 'content'}, width: 50}, |
| | | {type: 'seq', title: t('basicData.Number'), width: 80}, |
| | | {field: 'order_number', title: '订序', width: 70}, |
| | | {field: 'child_width', |
| | | {field: 'width', |
| | | width: 100, |
| | | title: t('order.width'), |
| | | sortable: true |
| | | }, |
| | | { |
| | | field: 'child_height', |
| | | field: 'height', |
| | | width: 100, |
| | | title: t('order.height'), |
| | | sortable: true |
| | |
| | | sortable: true |
| | | }, |
| | | { |
| | | field: 'process_cards', |
| | | field: 'process_id', |
| | | width: 150, |
| | | title: '流程卡号', |
| | | filters: [{data: ''}], |
| | |
| | | }, |
| | | |
| | | { |
| | | field: 'shelf_number', |
| | | field: 'layout_id', |
| | | width: 150, |
| | | title: '架号', |
| | | filters: [{data: ''}], |
| | |
| | | request.post(`/glassOptimize/projectInfo/${projectNo.value}`).then((res) => { |
| | | if ((Number(res.code) === 200)) { |
| | | const data = res.data.data; |
| | | data.forEach(item => { |
| | | item.longGrind1 = 0; |
| | | item.longGrind2 = 0; |
| | | item.shortGrind1 = 0; |
| | | item.shortGrind2 = 0; |
| | | item.shelf_number = 0; |
| | | }); |
| | | xGrid.value.loadData(res.data.data); |
| | | gridOptions.data = res.data.data; |
| | | projectName.value = res.data.data[0].project_name; |
| | | const grindingTrimming = res.data.grindingTrimming; |
| | | if(grindingTrimming!==null){ |
| | | const formattedData = grindingTrimming.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; |
| | | }); |
| | | data.forEach(item => { |
| | | if(formattedData[0].autoFillEdge==="true"){ |
| | | item.longGrind1=0 |
| | | item.longGrind2=0 |
| | | item.shortGrind1=0 |
| | | item.shortGrind2=0 |
| | | if(item.width>=formattedData[0].minAutoLenght){ |
| | | item.width+=parseFloat(formattedData[0].leftEdge) |
| | | item.width+=parseFloat(formattedData[0].rightEdge) |
| | | item.longGrind1 = formattedData[0].leftEdge; |
| | | item.longGrind2 = formattedData[0].rightEdge; |
| | | } |
| | | if(item.height>=formattedData[0].minAutoLenght){ |
| | | item.height+=parseFloat(formattedData[0].upEdge) |
| | | item.height+=parseFloat(formattedData[0].downEdge) |
| | | item.shortGrind1 = formattedData[0].upEdge; |
| | | item.shortGrind2 = formattedData[0].downEdge; |
| | | } |
| | | } |
| | | item.height=parseFloat(item.height.toFixed(2)) |
| | | item.width=parseFloat(item.width.toFixed(2)) |
| | | |
| | | }); |
| | | } |
| | | xGrid.value.loadData(data); |
| | | gridOptions.data = data; |
| | | projectName.value = data[0].project_name; |
| | | } else { |
| | | ElMessage.warning(res.msg); |
| | | } |
| | |
| | | |
| | | // 从子组件SetAmount获取磨量值,并更新表格数据 |
| | | const Amount = (amountData) => { |
| | | nextTick(() => { |
| | | fetchData() |
| | | /*nextTick(() => { |
| | | const data = gridOptions.data; |
| | | if (data) { |
| | | try { |
| | |
| | | } else { |
| | | console.warn('表格数据为空,无法更新磨量值'); |
| | | } |
| | | }); |
| | | });*/ |
| | | }; |
| | | |
| | | //中转站接受SetTrimming的值(设置修边) |
| | |
| | | } |
| | | |
| | | //工程查询流程卡 |
| | | @ApiOperation("修改工程查询流程卡接口") |
| | | @PostMapping ("/getUpdateFlowCardList/{type}/{thickness}/{radio}/{projectNo}") |
| | | public Result getUpdateFlowCardList( |
| | | @PathVariable String type,@PathVariable String thickness, |
| | | @PathVariable Integer radio,@PathVariable String projectNo){ |
| | | return Result.seccess(glassOptimizeService.getUpdateFlowCardList(type,thickness,radio,projectNo)); |
| | | } |
| | | |
| | | //工程查询流程卡 |
| | | @ApiOperation("工程查询流程卡") |
| | | @PostMapping ("/getProjectList") |
| | | public Result getProjectList(){ |
| | |
| | | import com.example.erp.entity.pp.FlowCard; |
| | | import com.example.erp.entity.pp.OptimizeProjectMange; |
| | | import com.example.erp.entity.pp.OptimizeUse; |
| | | import com.example.erp.entity.pp.PatchLog; |
| | | import com.example.erp.entity.sd.OrderGlassDetail; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | //工程信息 |
| | | List<Map<String, Object>> projectInfoMp(String projectNo); |
| | | |
| | | List<Map<String, Object>> firstOptimization(String projectNo); |
| | | |
| | | List<Map<String, Object>> analogComputationOptimization(String projectNo); |
| | | |
| | | //工程信息流程卡 |
| | | List<Map<String, Object>> getProcessCardMp(String projectNo); |
| | | |
| | | List<FlowCard> getFlowCardList(String projectNo); |
| | | |
| | | List<PatchLog> getPatchLogList(String projectNo); |
| | | |
| | | //库存信息 |
| | | List<Map<String, Object>> materialStoreMp(String thickness, String model); |
| | |
| | | List<Map<String, Object>> getFlowCardListWhole(String optionVal); |
| | | List<Map<String, Object>> getFlowCardListNormal(String optionVal); |
| | | List<Map<String, Object>> getFlowCardListPatch(String optionVal); |
| | | |
| | | List<Map<String, Object>> getFlowCardListModify(String type,String thickness,String projectNO); |
| | | |
| | | //工程管理工程号查询 |
| | | List<OptimizeProjectMange> optimizeProjectMangeMp(Date startSelectTime, Date endSelectTime, OptimizeProjectMange optimizeProjectMange); |
| | |
| | | |
| | | Boolean updateFlowCardProject(String processId, String technologyNumber, String projectId); |
| | | |
| | | Boolean updatePatchLogProject(String processId, String technologyNumber, String projectId); |
| | | |
| | | Boolean updateFlowCardProjectReturn(String processId, String technologyNumber, String projectId); |
| | | |
| | | Boolean updatePatchLogProjectReturn(String processId, Integer technologyNumber, String projectId); |
| | | |
| | | Double getSelectArea(String processId, String technologyNumber); |
| | | |
| | | Double getSelectAreaPatchLog(String processId, String technologyNumber); |
| | | |
| | | Boolean addProjectMp(String projectId, String projectNmae, String glassThickness, String glassType, |
| | | Integer sumQuantity, Double sumArea, String userName,Integer processIdCount, String processId, Integer type); |
| | | |
| | |
| | | import com.example.erp.common.RabbitMQUtil; |
| | | import com.example.erp.entity.pp.FlowCard; |
| | | import com.example.erp.entity.pp.OptimizeProjectMange; |
| | | import com.example.erp.entity.pp.PatchLog; |
| | | import com.example.erp.entity.userInfo.Log; |
| | | import com.example.erp.entity.userInfo.SysError; |
| | | import com.example.erp.mapper.pp.GlassOptimizeMapper; |
| | |
| | | Map<String, Object> stringObjectMap = glassOptimizeMapper.selectProjectCount(projectNo); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if(Integer.parseInt(stringObjectMap.get("state").toString())<10){ |
| | | map.put("data", glassOptimizeMapper.projectInfoMp(projectNo)); |
| | | map.put("grindingTrimming", glassOptimizeMapper.getEdgeTrimming()); |
| | | map.put("data", glassOptimizeMapper.firstOptimization(projectNo)); |
| | | map.put("grindingTrimming", glassOptimizeMapper.getGrindingTrimming()); |
| | | }else if(stringObjectMap.get("state").equals(10)){ |
| | | map.put("data", glassOptimizeMapper.projectInfoMp(projectNo)); |
| | | map.put("grindingTrimming", glassOptimizeMapper.getEdgeTrimming()); |
| | | map.put("data", glassOptimizeMapper.analogComputationOptimization(projectNo)); |
| | | map.put("grindingTrimming", glassOptimizeMapper.getGrindingTrimming()); |
| | | }else{ |
| | | map.put("data", glassOptimizeMapper.projectInfoMp(projectNo)); |
| | | map.put("grindingTrimming", null); |
| | | map.put("data", glassOptimizeMapper.analogComputationOptimization(projectNo)); |
| | | map.put("grindingTrimming", glassOptimizeMapper.getGrindingTrimming()); |
| | | } |
| | | return map; |
| | | } |
| | |
| | | map.put("data", glassOptimizeMapper.getFlowCardListNormal(optionVal)); |
| | | }else{ |
| | | map.put("data", glassOptimizeMapper.getFlowCardListPatch(optionVal)); |
| | | } |
| | | |
| | | |
| | | return map; |
| | | } |
| | | |
| | | public Map<String, Object> getUpdateFlowCardList(String type,String thickness, Integer radio,String projectNo) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if(radio==1){ |
| | | map.put("data", glassOptimizeMapper.getFlowCardListModify(type,thickness,projectNo)); |
| | | }else if(radio==2){ |
| | | map.put("data", glassOptimizeMapper.getFlowCardListNormal(type)); |
| | | }else{ |
| | | map.put("data", glassOptimizeMapper.getFlowCardListPatch(type)); |
| | | } |
| | | |
| | | |
| | |
| | | glassOptimizeMapper.deleteOptimizeHeatLayout(projectNumber); |
| | | } |
| | | List<FlowCard> flowCardList =glassOptimizeMapper.getFlowCardList(projectNumber); |
| | | for (FlowCard flowCard:flowCardList){ |
| | | glassOptimizeMapper.updateFlowCardProjectReturn(flowCard.getProcessId(),flowCard.getTechnologyNumber(),projectNumber); |
| | | List<PatchLog> patchLogList =glassOptimizeMapper.getPatchLogList(projectNumber); |
| | | if(flowCardList!=null){ |
| | | for (FlowCard flowCard:flowCardList){ |
| | | glassOptimizeMapper.updateFlowCardProjectReturn(flowCard.getProcessId(),flowCard.getTechnologyNumber(),projectNumber); |
| | | } |
| | | } |
| | | if(patchLogList!=null){ |
| | | for (PatchLog patchLog:patchLogList){ |
| | | glassOptimizeMapper.updatePatchLogProjectReturn(patchLog.getProcessId(),patchLog.getTechnologyNumber(),projectNumber); |
| | | } |
| | | } |
| | | |
| | | glassOptimizeMapper.deleteProjectMp(projectNumber); |
| | | return true; |
| | | } |
| | |
| | | if (object.get("userName") != null) { |
| | | userName = object.get("userName").toString(); |
| | | } |
| | | String projectType = ""; |
| | | if (object.get("projectType") != null) { |
| | | projectType = object.get("projectType").toString(); |
| | | } |
| | | if ("null".equals(projectNmae)) { |
| | | projectNmae = ""; |
| | | } |
| | | BigDecimal sumArea = new BigDecimal(0); |
| | | double area = 0; |
| | | Integer sumQuantity = 0; |
| | | Integer type = 1; |
| | | Integer type = 0; |
| | | int state1 = 0; |
| | | int state2 = 0; |
| | | StringBuilder processId= new StringBuilder(); |
| | | List<FlowCard> flowCardList = JSONArray.parseArray(JSONObject.toJSONString(object.get("projectdetail")), FlowCard.class); |
| | | if (!flowCardList.isEmpty()) { |
| | | if(projectType.equals("2")){ |
| | | deleteProject(projectId); |
| | | } |
| | | for (FlowCard flowCard : flowCardList) { |
| | | //给流程卡表添加对应的工程号 |
| | | glassOptimizeMapper.updateFlowCardProject(flowCard.getProcessId(),flowCard.getTechnologyNumber(),projectId); |
| | | 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(";"); |
| | | if(flowCard.getPatchState().equals(0)){ |
| | | state1=1; |
| | | //给流程卡表添加对应的工程号 |
| | | Boolean a=glassOptimizeMapper.updateFlowCardProject(flowCard.getProcessId(),flowCard.getTechnologyNumber(),projectId); |
| | | 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(";"); |
| | | }else{ |
| | | state2=1; |
| | | Boolean a=glassOptimizeMapper.updatePatchLogProject(flowCard.getProcessId(),flowCard.getTechnologyNumber(),projectId); |
| | | area = glassOptimizeMapper.getSelectAreaPatchLog(flowCard.getProcessId(),flowCard.getTechnologyNumber()).doubleValue(); |
| | | sumArea = sumArea.add(BigDecimal.valueOf(area)); |
| | | sumQuantity +=flowCard.getQuantity(); |
| | | processId.append(flowCard.getProcessId()).append("-").append(flowCard.getTechnologyNumber()).append(";"); |
| | | } |
| | | |
| | | } |
| | | if(state1==1&&state2==0){ |
| | | type=1; |
| | | }else if(state1==1&&state2==1){ |
| | | type=2; |
| | | } |
| | | int index = optionVal.indexOf("mm"); |
| | | // 获取 "mm" 前面的部分 |
| | |
| | | <select id="projectInfoMp"> |
| | | SELECT |
| | | f.order_number, |
| | | g.child_width , |
| | | g.child_height , |
| | | g.child_width as 'width', |
| | | g.child_height as 'height', |
| | | f.quantity , |
| | | d.shape , |
| | | op.process_cards , |
| | |
| | | f.order_id, |
| | | f.technology_number, |
| | | f.order_number; |
| | | </select> |
| | | |
| | | <!--第一次优化查询--> |
| | | <select id="firstOptimization"> |
| | | ( SELECT |
| | | c.project_no, |
| | | d.child_width as 'width', |
| | | d.child_height as 'height', |
| | | c.quantity, |
| | | o.shape, |
| | | concat( c.process_id, '-', c.technology_number ) AS 'process_id', |
| | | c.technology_number, |
| | | d.glass_child, |
| | | o.product_name, |
| | | o.price, |
| | | o.remarks, |
| | | o.building_number, |
| | | round( d.area * c.quantity, 4 ) as 'area', |
| | | c.order_number, |
| | | d.icon, |
| | | op.project_name |
| | | FROM |
| | | pp.flow_card c |
| | | LEFT JOIN sd.order_detail o ON c.order_id = o.order_id |
| | | AND c.order_number = o.order_number |
| | | LEFT JOIN sd.order_glass_detail d ON c.order_id = d.order_id |
| | | AND c.order_number = d.order_number |
| | | AND c.technology_number = d.technology_number |
| | | INNER JOIN pp.optimize_project AS op ON op.project_no = c.project_no |
| | | WHERE |
| | | c.project_no IS NOT NULL |
| | | and c.project_no = #{projectNo} |
| | | ORDER BY |
| | | c.process_id, |
| | | c.order_number |
| | | ) union |
| | | ( |
| | | SELECT |
| | | c.project_no, |
| | | d.child_width as 'width', |
| | | d.child_height as 'height', |
| | | c.patch_num as quantity, |
| | | o.shape, |
| | | concat( c.process_id, '-', c.technology_number ) AS 'process_id', |
| | | c.technology_number, |
| | | d.glass_child, |
| | | o.product_name, |
| | | o.price, |
| | | o.remarks, |
| | | o.building_number, |
| | | round( d.area * c.patch_num, 4 ) as 'area', |
| | | c.order_sort as order_number, |
| | | d.icon, |
| | | op.project_name |
| | | FROM |
| | | pp.patch_log c |
| | | LEFT JOIN sd.order_detail o ON c.order_id = o.order_id |
| | | AND c.order_sort = o.order_number |
| | | LEFT JOIN sd.order_glass_detail d ON c.order_id = d.order_id |
| | | AND c.order_sort = d.order_number |
| | | AND c.technology_number = d.technology_number |
| | | INNER JOIN pp.optimize_project AS op ON op.project_no = c.project_no |
| | | WHERE |
| | | c.project_no IS NOT NULL |
| | | and c.project_no = #{projectNo} |
| | | ORDER BY |
| | | c.process_id, |
| | | c.order_sort) |
| | | </select> |
| | | |
| | | |
| | | <!--第一次优化查询--> |
| | | <select id="analogComputationOptimization"> |
| | | SELECT |
| | | h.project_no, |
| | | h.layout_id, |
| | | h.width AS width, |
| | | h.height AS height, |
| | | count( 1 ) AS quantity, |
| | | o.shape, |
| | | concat( h.process_id, '-', h.layer ) AS 'process_id', |
| | | h.layer, |
| | | d.glass_child, |
| | | o.product_name, |
| | | o.price, |
| | | o.remarks, |
| | | o.building_number, |
| | | round( d.area * count( 1 ), 4 ) AS 'area', |
| | | c.order_number, |
| | | d.icon, |
| | | o.price |
| | | from |
| | | pp.`optimize_heat_detail` h |
| | | LEFT JOIN pp.flow_card c ON h.process_id = c.process_id |
| | | AND h.layer = c.technology_number |
| | | AND h.order_sort = c.order_number |
| | | LEFT JOIN sd.order_detail o ON c.order_id = o.order_id |
| | | AND c.order_number = o.order_number |
| | | LEFT JOIN sd.order_glass_detail d ON c.order_id = d.order_id |
| | | AND c.order_number = d.order_number |
| | | AND c.technology_number = d.technology_number |
| | | WHERE |
| | | h.project_no = #{projectNo} |
| | | GROUP BY |
| | | h.project_no, |
| | | h.layout_id, |
| | | h.width, |
| | | h.height, |
| | | h.process_id, |
| | | h.layer, |
| | | d.area, |
| | | c.quantity, |
| | | d.child_width, |
| | | d.child_height, |
| | | o.shape, |
| | | d.glass_child, |
| | | o.product_name, |
| | | o.price, |
| | | o.remarks, |
| | | o.building_number, |
| | | c.order_number, |
| | | d.icon, |
| | | o.price |
| | | ORDER BY |
| | | LENGTH( h.layout_id ), |
| | | h.layout_id; |
| | | </select> |
| | | |
| | | <!--工程信息流程卡--> |
| | |
| | | pp.flow_card AS fc |
| | | WHERE |
| | | fc.project_no = #{projectNo} |
| | | |
| | | </select> |
| | | |
| | | <select id="getPatchLogList"> |
| | | SELECT * |
| | | FROM |
| | | pp.patch_log |
| | | WHERE |
| | | project_no = #{projectNo} |
| | | |
| | | </select> |
| | | |
| | |
| | | 项目 as project, |
| | | 单片名称 as glass_child, |
| | | 面积 as area, |
| | | GlassType as glassType |
| | | GlassType as glassType, |
| | | patch_state |
| | | FROM pp.v_optimize_process_whole where |
| | | CONCAT( JSON_UNQUOTE( JSON_EXTRACT( GlassType, '$.thickness' )), JSON_UNQUOTE( JSON_EXTRACT( GlassType, '$.color' )) )= #{optionVal} |
| | | </select> |
| | |
| | | 项目 as project, |
| | | 单片名称 as glass_child, |
| | | 面积 as area, |
| | | GlassType as glassType |
| | | GlassType as glassType, |
| | | patch_state |
| | | FROM pp.v_optimize_process_normal where |
| | | CONCAT( JSON_UNQUOTE( JSON_EXTRACT( GlassType, '$.thickness' )), JSON_UNQUOTE( JSON_EXTRACT( GlassType, '$.color' )) )= #{optionVal} |
| | | </select> |
| | |
| | | 项目 as project, |
| | | 单片名称 as glass_child, |
| | | 面积 as area, |
| | | GlassType as glassType |
| | | GlassType as glassType, |
| | | patch_state |
| | | FROM pp.v_optimize_process_patch where |
| | | CONCAT( JSON_UNQUOTE( JSON_EXTRACT( GlassType, '$.thickness' )), JSON_UNQUOTE( JSON_EXTRACT( GlassType, '$.color' )) )= #{optionVal} |
| | | </select> |
| | | |
| | | <select id="getFlowCardListModify"> |
| | | 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, |
| | | patch_state, |
| | | 占用 as occupyState |
| | | FROM pp.v_optimize_porject_modify where |
| | | GlassType REGEXP #{type} and GlassType REGEXP #{thickness} |
| | | and (工程号 is null or 工程号 = #{projectNO}) order by 占用 |
| | | </select> |
| | | |
| | | <!--工程管理--> |
| | |
| | | |
| | | <!--模拟计算查询流程卡--> |
| | | <select id="selectProjectComputeMp"> |
| | | SELECT |
| | | fc.process_id, |
| | | fc.technology_number, |
| | | fc.project_no, |
| | | fcss.TotalFloors, |
| | | COUNT(fc.order_number) AS TotalNumber, |
| | | SUM(fc.quantity) AS quantity, |
| | | ROUND(SUM(od.width * od.height * fc.quantity / 1000000), 2) AS area, |
| | | o.project, |
| | | ogd.glass_child, |
| | | od.shape, |
| | | SUBSTRING(glass_child, 1, LOCATE('mm', glass_child) - 1) as thickness, |
| | | SUBSTRING(glass_child, LOCATE('mm', glass_child) + 2) as glassType |
| | | FROM |
| | | pp.flow_card AS fc |
| | | LEFT JOIN sd.`order` AS o ON fc.order_id = o.order_id |
| | | LEFT JOIN sd.order_detail AS od ON od.order_id = fc.order_id AND od.order_number = fc.order_number |
| | | LEFT JOIN sd.order_glass_detail AS ogd |
| | | ON ogd.order_id = fc.order_id AND ogd.order_number = fc.order_number AND |
| | | ogd.technology_number = fc.technology_number |
| | | LEFT JOIN ( |
| | | SELECT |
| | | fcs.process_id, |
| | | fcs.order_number, |
| | | COUNT(DISTINCT fcs.technology_number) AS TotalFloors |
| | | FROM |
| | | pp.flow_card AS fcs |
| | | GROUP BY |
| | | fcs.process_id, fcs.order_number |
| | | ) AS fcss |
| | | ON fcss.process_id = fc.process_id AND fcss.order_number = fc.order_number |
| | | WHERE |
| | | fc.project_no = #{projectNo} |
| | | GROUP BY |
| | | fc.process_id, fc.technology_number |
| | | ORDER BY |
| | | fc.process_id, fc.technology_number; |
| | | select |
| | | 流程卡号 as process_id, |
| | | 层 as technology_number, |
| | | 总层数 as TotalFloors, |
| | | 规格 as TotalNumber, |
| | | 数量 as quantity, |
| | | 项目 as project, |
| | | 产品名称 as glass_child, |
| | | 面积 as area, |
| | | tempering as tempering, |
| | | merge as merge, |
| | | patch_state as patch_state |
| | | from pp.v_optimize_init_project_process_summary where project_no = #{projectNo} |
| | | </select> |
| | | |
| | | <select id="selectProjectCount"> |
| | |
| | | where process_id=#{processId} and technology_number=#{technologyNumber} |
| | | </update> |
| | | |
| | | <update id="updatePatchLogProject"> |
| | | UPDATE pp.patch_log set project_no=#{projectId} |
| | | 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} |
| | | where process_id=#{processId} and technology_number=#{technologyNumber} and project_no=#{projectId} |
| | | </update> |
| | | |
| | | <update id="updatePatchLogProjectReturn"> |
| | | UPDATE pp.patch_log set project_no=null |
| | | where process_id=#{processId} and technology_number=#{technologyNumber} and project_no=#{projectId} |
| | | </update> |
| | | |
| | | <select id="getSelectArea"> |
| | |
| | | group by fc.process_id,fc.technology_number |
| | | </select> |
| | | |
| | | <select id="getSelectAreaPatchLog"> |
| | | select |
| | | sum(patch_area) |
| | | from pp.patch_log |
| | | where process_id=#{processId} and technology_number=#{technologyNumber} |
| | | group by process_id,technology_number |
| | | </select> |
| | | |
| | | <insert id="addProjectMp"> |
| | | 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) |