| | |
| | | import {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"; |
| | | const { t } = useI18n() |
| | | const xGrid = ref() |
| | | const gridOptions = reactive({ |
| | |
| | | columns:[ |
| | | {type:'expand',fixed:"left",slots: { content:'content' },width: 50}, |
| | | {type: 'checkbox', fixed: "left", title: t('basicData.check'), width: 80}, |
| | | {field: 'processId',width: 150, title: t('processCard.processId'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'id',width: 70, title: '层',filters:[{ data: '' }], slots: { default: 'state',filter: 'num2_filter' }}, |
| | | {field: 'id',width: 150, title: '总层数',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'id',width: 100, title: '规格',filters:[{ data: '' }], slots: { default: 'state',filter: 'num2_filter' }}, |
| | | {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: 'id',width: 150, title: t('order.shape'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'orderDetail.productName',width: 150, title: t('order.product'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'order.project', width:150, title: t('order.project'), showOverflow: "ellipsis"}, |
| | | {field: 'orderDetail.computeGrossArea',width: 150, title: t('order.area'),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}, |
| | | |
| | | |
| | | ],//表头参数 |
| | |
| | | const optionVal = ref('') |
| | | const options = [ |
| | | { |
| | | value: '0', |
| | | value: '白玻', |
| | | label: '白玻', |
| | | }, |
| | | { |
| | | value: '1', |
| | | value: '灰镜', |
| | | label: '灰镜', |
| | | }, |
| | | { |
| | | value: '2', |
| | | value: 'Low-e', |
| | | label: 'Low-e', |
| | | }, |
| | | ] |
| | | |
| | | //小圆点单选框 |
| | | let radio = ref(1); |
| | | |
| | | const selectFlowCardList = ()=>{ |
| | | request.post(`/glassOptimize/getFlowCardList/${optionVal.value}/${radio.value}`).then((res) => { |
| | | if(res.code==200){ |
| | | xGrid.value.loadData(res.data.data) |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | </script> |
| | |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | <el-button type="primary" :icon="Search" style="margin-left: 20px">查询</el-button> |
| | | <el-button type="primary" :icon="Search" style="margin-left: 20px" @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 label="1" content="全部"></vxe-radio> |
| | | <vxe-radio label="2" content="正单"></vxe-radio> |
| | | <vxe-radio label="3" content="补单"></vxe-radio> |
| | | </vxe-radio-group> |
| | | </template> |
| | | </vxe-grid> |
New file |
| | |
| | | package com.example.erp.controller.pp; |
| | | |
| | | import cn.dev33.satoken.annotation.SaCheckPermission; |
| | | import com.example.erp.common.Result; |
| | | import com.example.erp.entity.sd.OrderDetail; |
| | | import com.example.erp.entity.sd.OrderGlassDetail; |
| | | import com.example.erp.service.pp.GlassOptimizeService; |
| | | import com.example.erp.service.pp.WorkOrderService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.sql.Date; |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | @Api(value="优化管理controller",tags={"优化管理操作接口"}) |
| | | @RequestMapping("/glassOptimize") |
| | | public class GlassOptimizeController { |
| | | @Autowired |
| | | GlassOptimizeService glassOptimizeService; |
| | | |
| | | //工程查询流程卡 |
| | | @ApiOperation("创建工程查询流程卡接口") |
| | | @PostMapping ("/getFlowCardList/{optionVal}/{radio}") |
| | | public Result getFlowCardList( |
| | | @PathVariable String optionVal, |
| | | @PathVariable Integer radio){ |
| | | return Result.seccess(glassOptimizeService.getFlowCardList(optionVal,radio)); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.example.erp.mapper.pp; |
| | | |
| | | import com.example.erp.entity.sd.OrderDetail; |
| | | import com.example.erp.entity.sd.OrderGlassDetail; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.sql.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Mapper |
| | | public interface GlassOptimizeMapper { |
| | | //工单管理查询未转工单数据 |
| | | List<OrderGlassDetail> selectWordOrder(Date selectTime1, Date selectTime2, OrderGlassDetail orderGlassDetail); |
| | | |
| | | List<Map<String, Object>> getFlowCardListMp(String optionVal, Integer radio); |
| | | } |
New file |
| | |
| | | |
| | | 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.sd.OrderDetail; |
| | | import com.example.erp.entity.sd.OrderGlassDetail; |
| | | import com.example.erp.mapper.pp.GlassOptimizeMapper; |
| | | import com.example.erp.mapper.pp.WorkOrderMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.sql.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | @DS("sd") |
| | | public class GlassOptimizeService { |
| | | @Autowired |
| | | GlassOptimizeMapper glassOptimizeMapper; |
| | | |
| | | |
| | | |
| | | public Map<String, Object> getFlowCardList(String optionVal, Integer radio) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", glassOptimizeMapper.getFlowCardListMp(optionVal, radio)); |
| | | |
| | | return map; |
| | | } |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.example.erp.mapper.pp.GlassOptimizeMapper"> |
| | | <resultMap id="wordOrderMap" type="com.example.erp.entity.sd.OrderGlassDetail"> |
| | | |
| | | <result column="order_id" property="orderId"/> |
| | | <result column="production_id" property="productionId"/> |
| | | <result column="splitting_status" property="splittingStatus"/> |
| | | <result column="founder" property="founder"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <!--接收其他外键实体类数据--> |
| | | <result column="batch" property="order.batch"/> |
| | | <result column="order_type" property="order.orderType"/> |
| | | <result column="project" property="order.project"/> |
| | | <result column="area" property="order.area"/> |
| | | <result column="creator" property="order.creator"/> |
| | | <result column="customer_name" property="order.customerName"/> |
| | | <result column="processing_note" property="order.processingNote"/> |
| | | <!-- <association property="orderDetail" javaType="com.example.erp.entity.sd.OrderDetail">--> |
| | | <!-- <result column="product_id" property="productId"/>--> |
| | | <!-- <result column="product_name" property="productName"/>--> |
| | | <!-- <result column="compute_area" property="computeArea"/>--> |
| | | <result column="quantity" property="orderDetail.quantity"/> |
| | | <!-- <result column="compute_gross_area" property="computeGrossArea"/>--> |
| | | <!-- <result column="perimeter" property="perimeter"/>--> |
| | | <!-- <result column="bend_radius" property="bendRadius"/>--> |
| | | <!-- <result column="processing_note" property="processingNote"/>--> |
| | | <result column="gross_area" property="orderDetail.grossArea"/> |
| | | |
| | | <!-- </association>--> |
| | | |
| | | </resultMap> |
| | | |
| | | <select id="selectWordOrder" resultMap="wordOrderMap"> |
| | | select |
| | | o.order_id, |
| | | o.batch, |
| | | o.project, |
| | | o.order_type, |
| | | o.area as gross_area, |
| | | o.quantity as quantity, |
| | | o.creator, |
| | | o.customer_name, |
| | | o.processing_note |
| | | from sd.order_detail as od |
| | | left join `order` as o |
| | | on o.order_id=od.order_id |
| | | where o.production_order!=2 and o.order_review=2 |
| | | |
| | | <if test="orderGlassDetail.orderId != null and orderGlassDetail.orderId != ''"> |
| | | and o.order_id regexp #{orderGlassDetail.orderId} |
| | | </if> |
| | | |
| | | <if test="orderGlassDetail.order.batch != null and orderGlassDetail.order.batch != ''"> |
| | | and o.batch regexp #{orderGlassDetail.order.batch} |
| | | </if> |
| | | <if test="orderGlassDetail.order.project != null and orderGlassDetail.order.project!= ''"> |
| | | and o.project regexp #{orderGlassDetail.order.project} |
| | | </if> |
| | | <if test="orderGlassDetail.order.orderType != null and orderGlassDetail.order.orderType!= ''"> |
| | | and o.order_type regexp #{orderGlassDetail.order.orderType} |
| | | </if> |
| | | <if test="orderGlassDetail.order.customerName != null and orderGlassDetail.order.customerName!= ''"> |
| | | and o.customer_name regexp #{orderGlassDetail.order.customerName} |
| | | </if> |
| | | <if test="orderGlassDetail.order.processingNote != null and orderGlassDetail.order.processingNote!= ''"> |
| | | and o.processing_note regexp #{orderGlassDetail.order.processingNote} |
| | | </if> |
| | | |
| | | <if test="orderGlassDetail.createTime != ''"> |
| | | and DATE_FORMAT((o.create_time),'%Y-%m-%d') BETWEEN #{ selectTime1 } AND #{ selectTime2 } |
| | | </if> |
| | | |
| | | group by o.order_id |
| | | order by o.id desc |
| | | |
| | | |
| | | ; |
| | | </select> |
| | | |
| | | <select id="getFlowCardListMp"> |
| | | 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, |
| | | 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, |
| | | 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 |
| | | </select> |
| | | |
| | | </mapper> |