| | |
| | | import {ref} from "vue"; |
| | | import {useI18n} from "vue-i18n"; |
| | | |
| | | let projectRow = ref({ |
| | | processId:null, |
| | | technologyNumber:null |
| | | }) |
| | | |
| | | |
| | | const handleProcessIdUpdate = newProcessId => { |
| | | projectRow.value.processId = newProcessId; |
| | | }; |
| | | |
| | | const handleTechnologyNumberUpdate = newTechnologyNumber => { |
| | | projectRow.value.technologyNumber = newTechnologyNumber; |
| | | }; |
| | | |
| | | |
| | | |
| | | </script> |
| | |
| | | <div style="width: 100%; height: 100%;"> |
| | | |
| | | <div id="processCard"> |
| | | <process-card/> |
| | | <process-card :process-id="projectRow.processId===null?null:projectRow.processId" |
| | | :technology-number="projectRow.technologyNumber===null?null:projectRow.technologyNumber" |
| | | @updateProcessId="handleProcessIdUpdate" |
| | | @updateTechnologyNumber="handleTechnologyNumberUpdate" |
| | | /> |
| | | </div> |
| | | |
| | | <div id="processCard-detail"> |
| | | <process-card-detail/> |
| | | <process-card-detail :process-id="projectRow.processId===null?null:projectRow.processId" |
| | | :technology-number="projectRow.technologyNumber===null?null:projectRow.technologyNumber"/> |
| | | </div> |
| | | |
| | | <div id="project-list"> |
| | |
| | | <script setup> |
| | | import {reactive, ref} from "vue"; |
| | | import {onMounted, reactive, ref} from "vue"; |
| | | import {useI18n} from "vue-i18n"; |
| | | import {Search} from "@element-plus/icons-vue"; |
| | | import request from "@/utils/request"; |
| | | import deepClone from "@/utils/deepClone"; |
| | | import {ElMessage} from "element-plus"; |
| | | import useUserInfoStore from "@/stores/userInfo"; |
| | | |
| | | const { t } = useI18n() |
| | | const userStore = useUserInfoStore() |
| | | const username = userStore.user.userName |
| | | let rowClickIndex = ref(null) |
| | | |
| | | let props = defineProps({ |
| | | processId: null, |
| | | technologyNumber: null |
| | | }) |
| | | |
| | | //膜系 |
| | | const optionVal = ref() |
| | | //膜系 |
| | | const projectNmae = ref() |
| | | //工程编号个数 |
| | | let projectId = ref() |
| | | //工程编号 |
| | | const Id = ref() |
| | | let oddNumbers = ref() |
| | | |
| | | //定义接收加载表头下拉数据 |
| | | const titleSelectJson = ref({ |
| | | processType: [], |
| | | }) |
| | | |
| | | const selectGlassType = () => { |
| | | //查询膜系 |
| | | request.post(`/glassOptimize/selectGlassType`).then((res) => { |
| | | if (res.code == 200) { |
| | | titleSelectJson.value.processType = res.data.data |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | //查询最新工程号 |
| | | const getProjectId = () => { |
| | | request.post(`/glassOptimize/getProjectId`).then((res) => { |
| | | if (res.code == 200) { |
| | | projectId = res.data.data[0].project_no |
| | | // 获取字符串的最后两位数字 |
| | | let maximum = projectId.slice(-2); |
| | | let lastTwoInteger = parseInt(maximum, 10); |
| | | // 设置两位不够补0 |
| | | let formattedNumber = (lastTwoInteger + 1).toString().padStart(2, '0'); |
| | | // 格式化当前日期为 "yyMMdd" |
| | | let currentDate = new Date(); |
| | | let formattedDate = currentDate.getFullYear().toString().slice(-2) + |
| | | (currentDate.getMonth() + 1).toString().padStart(2, '0') + |
| | | currentDate.getDate().toString().padStart(2, '0'); |
| | | |
| | | // 拼接成最终的字符串 |
| | | oddNumbers.value = 'P' + formattedDate + formattedNumber; |
| | | |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | onMounted(() => { |
| | | getProjectId(); |
| | | selectGlassType(); |
| | | |
| | | }) |
| | | |
| | | const xGrid = ref() |
| | | const gridOptions = reactive({ |
| | | |
| | |
| | | mode: 'row', |
| | | showStatus: true |
| | | }, |
| | | /*formConfig: { |
| | | data: { |
| | | width: '', |
| | | height: '', |
| | | quantity: '' |
| | | }, |
| | | items: [ |
| | | { field: 'width', title: t('order.width')+':', itemRender: { name: 'VxeInput' } }, |
| | | { field: 'height', title: t('order.height')+':', itemRender: { name: 'VxeInput' } }, |
| | | { field: 'quantity', title: t('order.quantity')+':', itemRender: { name: 'VxeInput' } }, |
| | | { |
| | | itemRender: { |
| | | name: 'VxeButtonGroup', |
| | | options: [ |
| | | { type: 'submit', content: t('craft.sure'), status: 'primary' }, |
| | | { type: 'reset', content: t('product.msg.reset') } |
| | | ] |
| | | } |
| | | } |
| | | ] |
| | | },*/ |
| | | columns:[ |
| | | {type:'expand',fixed:"left",slots: { content:'content' },width: 50}, |
| | | |
| | | {type: 'checkbox', fixed: "left", title: t('basicData.check'), width: 80}, |
| | | {field: 'process_id',width: 150, title: t('processCard.processId'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'technology_number',width: 70, title: '层',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'TotalFloors',width: 150, title: '总层数',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'TotalNumber',width: 150, title: '规格',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'quantity',width: 150, title: t('order.quantity'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'shape',width: 150, title: t('order.shape'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'glass_child',width: 150, title: t('order.product'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | { |
| | | field: 'process_id', |
| | | width: 150, |
| | | title: t('processCard.processId'), |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | sortable: true |
| | | }, |
| | | { |
| | | field: 'technology_number', |
| | | width: 70, |
| | | title: '层', |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | sortable: true |
| | | }, |
| | | { |
| | | field: 'TotalFloors', |
| | | width: 150, |
| | | title: '总层数', |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | sortable: true |
| | | }, |
| | | { |
| | | field: 'TotalNumber', |
| | | width: 150, |
| | | title: '规格', |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | sortable: true |
| | | }, |
| | | { |
| | | field: 'quantity', |
| | | width: 150, |
| | | title: t('order.quantity'), |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | sortable: true |
| | | }, |
| | | { |
| | | field: 'shape', |
| | | width: 150, |
| | | title: t('order.shape'), |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | sortable: true |
| | | }, |
| | | { |
| | | field: 'glass_child', |
| | | width: 150, |
| | | title: t('order.product'), |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | sortable: true |
| | | }, |
| | | {field: 'project', width:150, title: t('order.project'), showOverflow: "ellipsis"}, |
| | | {field: 'area',width: 150, title: t('order.area'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | { |
| | | field: 'area', |
| | | width: 150, |
| | | title: t('order.area'), |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | sortable: true |
| | | }, |
| | | |
| | | |
| | | ],//表头参数 |
| | |
| | | }, |
| | | }, |
| | | |
| | | |
| | | }) |
| | | let emit = defineEmits([ |
| | | 'changeDialog' |
| | | ]) |
| | | //膜系列表 |
| | | const optionVal = ref('') |
| | | const options = [ |
| | | { |
| | | value: '白玻', |
| | | label: '白玻', |
| | | }, |
| | | { |
| | | value: '灰镜', |
| | | label: '灰镜', |
| | | }, |
| | | { |
| | | value: 'Low-e', |
| | | label: 'Low-e', |
| | | }, |
| | | ] |
| | | |
| | | const gridEvents = { |
| | | cellClick({row}) { |
| | | rowClickIndex.value = row |
| | | // Emit 事件将更新后的值传递给父组件 |
| | | emit('updateProcessId', rowClickIndex.value.process_id); |
| | | emit('updateTechnologyNumber', rowClickIndex.value.technology_number); |
| | | } |
| | | } |
| | | const emit = defineEmits(['updateProcessId', 'updateTechnologyNumber']); |
| | | |
| | | |
| | | //小圆点单选框 |
| | | let radio = ref(1); |
| | |
| | | }) |
| | | } |
| | | |
| | | //创建工程 |
| | | const addProject = () => { |
| | | const $table = xGrid.value |
| | | if ($table) { |
| | | const selectRecords = $table.getCheckboxRecords() |
| | | if (selectRecords.length == 0) { |
| | | ElMessage.warning(t('reportingWorks.selectProcessCardData')) |
| | | return; |
| | | } |
| | | |
| | | let projectData = ref({ |
| | | projectdetail: selectRecords, |
| | | userName : username |
| | | }) |
| | | request.post(`/glassOptimize/addProject/${optionVal.value}/${oddNumbers.value}/${projectNmae.value}`, projectData.value).then((res) => { |
| | | if (res.code == 200 && res.data === true) { |
| | | ElMessage.success(t('basicData.msg.saveSuccess')) |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <template> |
| | | <div style="width: 100%;height: 110%; margin-top: -36px"> |
| | | <h1>流程卡列表 |
| | | <span style="margin-left: 140px;font-size: 14px">工程编号:</span> |
| | | <vxe-input disabled placeholder="" size="small"></vxe-input> |
| | | <!-- <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> |
| | | <vxe-input placeholder="" size="small"></vxe-input> |
| | | <el-button type="primary" style="margin-left: 20px">创建</el-button> |
| | | <vxe-input placeholder="" v-model="projectNmae" size="small"></vxe-input> |
| | | <el-button style="margin-left: 20px" type="primary" @click="addProject">创建</el-button> |
| | | </h1> |
| | | <vxe-grid |
| | | size="small" |
| | | @filter-change="filterChanged" |
| | | height="100%" |
| | | class="mytable-scrollbar" |
| | | ref="xGrid" |
| | | class="mytable-scrollbar" |
| | | height="100%" |
| | | size="small" |
| | | v-bind="gridOptions" |
| | | v-on="gridEvents" |
| | | @filter-change="filterChanged" |
| | | > |
| | | <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 v-model="option.data" :placeholder="$t('processCard.pleaseSelect')" |
| | | @change="changeFilterEvent($event, option, $panel)"> |
| | | <vxe-option :label="$t('basicData.unchecked')" value="0"></vxe-option> |
| | | <vxe-option :label="$t('basicData.selected')" value="1"></vxe-option> |
| | | </vxe-select> |
| | | </div> |
| | | </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)"/> |
| | | type="type" |
| | | @input="changeFilterEvent($event, option, $panel)" |
| | | @keyup.enter.native="$panel.confirmFilter()"/> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <template #toolbar_buttons> |
| | | <h1>膜系筛选:</h1> |
| | | <el-select |
| | | placeholder="选择膜系" |
| | | style="margin-left:10px; width: 170px " |
| | | ref="getSelect" |
| | | v-model="optionVal" |
| | | clearable |
| | | class="m-2" |
| | | @change="getWorkOrder" |
| | | > |
| | | |
| | | <el-select v-model="optionVal" clearable default-value="default_city" placeholder="选择膜系" |
| | | style="width: 120px"> |
| | | <el-option |
| | | v-for="item in options" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | v-for="item in titleSelectJson['processType']" |
| | | :key="item.id" |
| | | :label="item.glassType" |
| | | :value="item.glassType" |
| | | /> |
| | | </el-select> |
| | | <el-button type="primary" :icon="Search" style="margin-left: 20px" @click="selectFlowCardList">查询</el-button> |
| | | <el-button :icon="Search" style="margin-left: 20px" type="primary" @click="selectFlowCardList">查询</el-button> |
| | | <vxe-radio-group v-model="radio" style="margin-left: 20px"> |
| | | <vxe-radio label="1" content="全部"></vxe-radio> |
| | | <vxe-radio label="2" content="正单"></vxe-radio> |
| | | <vxe-radio label="3" content="补单"></vxe-radio> |
| | | <vxe-radio content="全部" label="1"></vxe-radio> |
| | | <vxe-radio content="正单" label="2"></vxe-radio> |
| | | <vxe-radio content="补单" label="3"></vxe-radio> |
| | | </vxe-radio-group> |
| | | </template> |
| | | </vxe-grid> |
| | |
| | | <script setup> |
| | | import {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() |
| | | |
| | | let props = defineProps({ |
| | | processId:null, |
| | | technologyNumber:null |
| | | }) |
| | | const xGrid = ref() |
| | | |
| | | const gridOptions = reactive({ |
| | |
| | | ] |
| | | },*/ |
| | | columns:[ |
| | | {field: 'id',width: 70, title: '序号',filters:[{ data: '' }], slots: { default: 'state',filter: 'num2_filter' }}, |
| | | {field:'state',width: 150,title: t('order.width'),filters:[{ data: '' }], slots: { default: 'state',filter: 'num2_filter' }}, |
| | | {type: 'seq',width: 150,title: t('order.height')}, |
| | | {field: 'id',width: 150, title: t('order.quantity'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'id',width: 150, title: t('order.buildingNumber'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'id',width: 150, title: t('order.shape'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'id',width: 150, title: t('order.grossArea'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'id',width: 150, title: t('craft.TrademarkAttribute'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'order_number',width: 70, title: '序号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field:'child_width',width: 150,title: t('order.width'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'child_height',width: 150,title: t('order.height'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'quantity',width: 150, title: t('order.quantity'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'building_number',width: 150, title: t('order.buildingNumber'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'shape',width: 150, title: t('order.shape'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'grossArea',width: 150, title: t('order.grossArea'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'separation',width: 150, title: t('craft.TrademarkAttribute'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | |
| | | ],//表头参数 |
| | | data:null,//表格数据 |
| | | toolbarConfig: { |
| | | buttons: [], |
| | | slots:{ |
| | | buttons: "toolbar_buttons" |
| | | }, |
| | | }, |
| | | |
| | | }) |
| | | let emit = defineEmits([ |
| | | 'changeDialog' |
| | | ]) |
| | | let ProjectName = ref('') |
| | | const changeOrderType = async ()=>{ |
| | | await emit('changeDialog',ProjectName.value) |
| | | ProjectName.value = null |
| | | |
| | | |
| | | onMounted(()=>{ |
| | | |
| | | }) |
| | | |
| | | watch( |
| | | |
| | | () => props.processId, |
| | | (newValue, oldValue) => { |
| | | if (props.processId!=null){ |
| | | getWorkOrder() |
| | | } |
| | | |
| | | } |
| | | ); |
| | | |
| | | const getWorkOrder = () => { |
| | | if (props.processId!=null || props.processId!=""){ |
| | | request.post(`/glassOptimize/getProcessCardDetail/${props.processId}/${props.technologyNumber}`).then((res) => { |
| | | if(res.code==200){ |
| | | xGrid.value.loadData(res.data.data) |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | } |
| | | </script> |
| | | |
| | | <template> |
| | |
| | | package com.example.erp.controller.pp; |
| | | |
| | | import cn.dev33.satoken.annotation.SaCheckPermission; |
| | | import com.example.erp.common.Constants; |
| | | import com.example.erp.common.Result; |
| | | import com.example.erp.entity.pp.OptimizeProjectMange; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.sql.Date; |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | @Api(value="优化管理controller",tags={"优化管理操作接口"}) |
| | |
| | | return Result.seccess(glassOptimizeService.selectComputeDetailSv(processId)); |
| | | } |
| | | |
| | | //创建工程查询流程卡明细 |
| | | @ApiOperation("创建工程查询流程卡明细") |
| | | @PostMapping ("/getProcessCardDetail/{processId}/{technologyNumber}") |
| | | public Result getProcessCardDetail( |
| | | @PathVariable String processId, |
| | | @PathVariable Integer technologyNumber){ |
| | | return Result.seccess(glassOptimizeService.getProcessCardDetailSv(processId,technologyNumber)); |
| | | } |
| | | |
| | | @ApiOperation("膜系查询") |
| | | @PostMapping ("/selectGlassType") |
| | | public Result selectGlassType(){ |
| | | return Result.seccess(glassOptimizeService.selectGlassTypeSv()); |
| | | } |
| | | |
| | | @ApiOperation("最新工程号查询") |
| | | @PostMapping ("/getProjectId") |
| | | public Result getProjectId(){ |
| | | return Result.seccess(glassOptimizeService.getProjectIdSv()); |
| | | } |
| | | @ApiOperation("创建工程接口") |
| | | @PostMapping("/addProject/{optionVal}/{projectId}/{projectNmae}") |
| | | public Result addProject( |
| | | @PathVariable String optionVal, |
| | | @PathVariable String projectId, |
| | | @PathVariable String projectNmae, |
| | | @RequestBody Map<String,Object> object){ |
| | | return Result.seccess(glassOptimizeService.addProjectSv(optionVal,projectId,projectNmae,object)); |
| | | } |
| | | } |
| | |
| | | |
| | | //模拟计算流程卡详情 |
| | | List<Map<String, Object>> selectComputeDetailMp(String processId); |
| | | |
| | | List<Map<String, Object>> getProcessCardDetailmMp(String processId, Integer technologyNumber); |
| | | |
| | | List<Map<String, Object>> selectGlassTypeMp(); |
| | | |
| | | List<Map<String, Object>> getProjectIdSv(); |
| | | |
| | | Boolean updateFlowCardProject(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); |
| | | } |
| | |
| | | |
| | | package com.example.erp.service.pp; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.example.erp.entity.pp.FlowCard; |
| | | import com.example.erp.entity.pp.OptimizeProjectMange; |
| | | import com.example.erp.mapper.pp.GlassOptimizeMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | import java.sql.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | |
| | | return map; |
| | | } |
| | | |
| | | public Map<String, Object> getProcessCardDetailSv(String processId, Integer technologyNumber) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", glassOptimizeMapper.getProcessCardDetailmMp(processId,technologyNumber)); |
| | | return map; |
| | | } |
| | | |
| | | public Map<String, Object> selectGlassTypeSv() { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", glassOptimizeMapper.selectGlassTypeMp()); |
| | | return map; |
| | | } |
| | | |
| | | |
| | | public Map<String, Object> getProjectIdSv() { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", glassOptimizeMapper.getProjectIdSv()); |
| | | return map; |
| | | } |
| | | |
| | | public Boolean addProjectSv(String optionVal, String projectId, String projectNmae, Map<String, Object> object) { |
| | | String userName = ""; |
| | | if (object.get("userName") != null) { |
| | | userName = object.get("userName").toString(); |
| | | } |
| | | Double sumArea = (double) 0; |
| | | Double area = (double) 0; |
| | | Integer sumQuantity = 0; |
| | | 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; |
| | | sumQuantity +=flowCard.getQuantity(); |
| | | } |
| | | 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); |
| | | return true; |
| | | } |
| | | else { |
| | | return false; |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | //判断是否大于当前数量并且抛出异常 |
| | | if (processNum < (reportingWorkDetail.getBreakageQuantity() + reportingWorkDetail.getCompletedQuantity())) { |
| | | System.out.println(processNum+"--"+reportingWorkDetail.getBreakageQuantity()+"--"+reportingWorkDetail.getCompletedQuantity()); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("orderNumber", reportingWorkDetail.getOrderNumber()); |
| | | map.put("technologyNumber", reportingWorkDetail.getOrderNumber()); |
| | |
| | | </select> |
| | | |
| | | <select id="getFlowCardListMp"> |
| | | select fc.process_id, |
| | | SELECT |
| | | fc.process_id, |
| | | fc.technology_number, |
| | | 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, |
| | | 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 |
| | | |
| | | 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, |
| | | od.shape, |
| | | CONCAT( JSON_UNQUOTE( JSON_EXTRACT( pd.separation, '$.thickness' )), JSON_UNQUOTE( JSON_EXTRACT( pd.separation, '$.color' )) ) 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 position(#{optionVal} in ogd.glass_child) |
| | | GROUP BY fc.process_id, fc.technology_number |
| | | ORDER BY fc.process_id, fc.technology_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 |
| | | LEFT JOIN sd.product_detail AS pd ON pd.prod_id = od.product_id |
| | | 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) |
| | | GROUP BY |
| | | fc.process_id, |
| | | fc.technology_number |
| | | ORDER BY |
| | | fc.process_id, |
| | | fc.technology_number |
| | | </select> |
| | | |
| | | <!--工程管理--> |
| | |
| | | p.state IN (1, 2) |
| | | AND f.process_id = #{processId} |
| | | </select> |
| | | |
| | | <select id="getProcessCardDetailmMp"> |
| | | select fc.order_number, |
| | | ogd.child_width, |
| | | ogd.child_height, |
| | | fc.quantity, |
| | | od.building_number,IF(od.shape!=2,'普形','异形') as shape, |
| | | ROUND(ogd.child_width*ogd.child_height*fc.quantity/1000000,2) as grossArea, |
| | | pd.separation |
| | | from pp.flow_card as fc |
| | | 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 sd.order_detail as od on od.order_id=ogd.order_id and od.order_number=ogd.order_number |
| | | left join sd.product_detail as pd on pd.prod_id=od.product_id and pd.glass_sort=fc.technology_number |
| | | where fc.process_id=#{processId} and fc.technology_number=#{technologyNumber} |
| | | group by fc.process_id,fc.order_number,fc.technology_number |
| | | order by fc.order_number,fc.technology_number |
| | | </select> |
| | | |
| | | <select id="selectGlassTypeMp"> |
| | | SELECT |
| | | JSON_UNQUOTE(JSON_EXTRACT(type, '$.lowE')) AS lowE, |
| | | JSON_UNQUOTE(JSON_EXTRACT(type, '$.color')) AS color, |
| | | JSON_UNQUOTE(JSON_EXTRACT(type, '$.thickness')) AS thickness, |
| | | JSON_UNQUOTE(JSON_EXTRACT(type, '$.craft')) AS craft, |
| | | JSON_UNQUOTE(JSON_EXTRACT(type, '$.position')) AS position, |
| | | CONCAT( |
| | | JSON_UNQUOTE(JSON_EXTRACT(type, '$.thickness')), |
| | | JSON_UNQUOTE(JSON_EXTRACT(type, '$.color')) |
| | | ) AS glassType |
| | | FROM pp.v_optimize_create_process_type |
| | | GROUP BY |
| | | thickness, |
| | | color |
| | | ORDER BY |
| | | CAST(REPLACE(JSON_UNQUOTE(JSON_EXTRACT(type, '$.thickness')), 'mm', '') AS UNSIGNED); |
| | | </select> |
| | | |
| | | <select id="getProjectIdSv"> |
| | | SELECT IFNULL( |
| | | (SELECT project_no |
| | | FROM pp.optimize_project |
| | | WHERE DATE(create_time) = CURDATE() |
| | | ORDER BY create_time DESC |
| | | LIMIT 1), '00') AS project_no; |
| | | </select> |
| | | |
| | | <update id="updateFlowCardProject"> |
| | | UPDATE pp.flow_card set project_no=#{projectId} |
| | | where process_id=#{processId} and technology_number=#{technologyNumber} |
| | | </update> |
| | | |
| | | <select id="getSelectArea"> |
| | | select |
| | | ROUND(SUM(ogd.child_width*ogd.child_height*fc.quantity)/1000000,2) as grossArea |
| | | from pp.flow_card as fc |
| | | 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 sd.order_detail as od on od.order_id=ogd.order_id and od.order_number=ogd.order_number |
| | | left join sd.product_detail as pd on pd.prod_id=od.product_id and pd.glass_sort=fc.technology_number |
| | | where fc.process_id=#{processId} and fc.technology_number=#{technologyNumber} |
| | | group by fc.process_id,fc.technology_number |
| | | </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> |
| | | </mapper> |