Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override
| | |
| | | <script setup> |
| | | |
| | | import {reactive} from "vue"; |
| | | import {reactive, ref} from "vue"; |
| | | import {useRouter} from 'vue-router' |
| | | import request from "@/utils/request"; |
| | | import deepClone from "@/utils/deepClone"; |
| | | import {ElDatePicker, ElMessage} from "element-plus"; |
| | | import {Search} from "@element-plus/icons-vue"; |
| | | import { useI18n } from 'vue-i18n' |
| | | import SelectProduct from "@/views/sd/product/SelectProduct.vue"; |
| | | //语言获取 |
| | | const { t } = useI18n() |
| | | let router=useRouter() |
| | | const getTableRow = (row,type) =>{ |
| | | switch (type) { |
| | | case 'edit' :{ |
| | | //alert('我接收到子组件传送的编辑信息') |
| | | router.push({path: '/main/reportingWorks/AddReportingWork', query: { id: row.id }}) |
| | | // router.push({path: '/main/reportingWorks/AddReportingWork', query: { id: row.id }}) |
| | | break |
| | | } |
| | | case 'delete':{ |
| | | alert('我接收到子组件传送的删除信息') |
| | | request.post(`/reportingWork/deleteWork/${row.reportingWorkId}/${row.processId}/${row.thisProcess}`).then((res) => { |
| | | if (res.code == 200) { |
| | | ElMessage.success(t('workOrder.deleteOk')) |
| | | router.push({path: '/main/reportingWorks/SelectReportingWorks', query: {random:Math.random()}}) |
| | | } else { |
| | | |
| | | ElMessage.warning(res.msg) |
| | | |
| | | } |
| | | }) |
| | | break |
| | | } |
| | | case 'setType':{ |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | function padLeftZero(str) { |
| | | return ('00' + str).substr(str.length) |
| | | } |
| | | |
| | | //提交的表单 |
| | | const form = reactive({ |
| | | date1: '', |
| | | orderId: '' |
| | | }) |
| | | |
| | | //表尾求和 |
| | | const sumNum = (list, field) => { |
| | |
| | | return count.toFixed(2) |
| | | } |
| | | |
| | | //子组件接收参数 |
| | | //定义滚动条高度 |
| | | let scrollTop = ref(null) |
| | | let scrollHeight = ref(null) |
| | | let clientHeight = ref(null) |
| | | const scrollEvnt = (row) => { |
| | | // 内容高度 |
| | | scrollTop.value = row.$event.target.scrollTop |
| | | scrollHeight.value = row.$event.target.scrollHeight |
| | | clientHeight.value = row.$event.target.clientHeight |
| | | } |
| | | //筛选条件,有外键需要先定义明细里面的数据 |
| | | let filterData = ref({ |
| | | order: { |
| | | project: '', |
| | | batch:'' |
| | | }, |
| | | orderGlassDetail: { |
| | | completedArea:'', |
| | | wornArea:'' |
| | | } |
| | | |
| | | }) |
| | | //定义页面总页数 |
| | | let pageTotal = ref('') |
| | | //定义数据返回结果 |
| | | let produceList = ref([]) |
| | | //定义当前页数 |
| | | let pageNum=ref(1) |
| | | let pageState = null |
| | | |
| | | //获取七天前到当前时间 |
| | | function getNowTime() { |
| | | const start = new Date(new Date().getTime()- 3600 * 1000 * 24 * 7) |
| | | .toISOString() |
| | | .replace('T', ' ') |
| | | .slice(0,10) //默认开始时间7天前 |
| | | const end = new Date(new Date().getTime()+3600 * 1000 * 24) |
| | | .toISOString() |
| | | .replace('T', ' ') |
| | | .slice(0,10)//默认结束时间当前时间 |
| | | return [start, end] |
| | | } |
| | | |
| | | |
| | | //第一次加载获取近七天时间和默认状态 |
| | | form.date1=getNowTime() |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | let inputVal = form.orderId |
| | | if (inputVal == '') { |
| | | inputVal = null |
| | | } |
| | | let total = reactive({ |
| | | pageTotal : 0, |
| | | dataTotal : 0, |
| | | pageSize : 100 |
| | | }) |
| | | //第一次加载数据 |
| | | request.post(`/reportingWork/selectReportingWork/1/${total.pageSize}/${startTime}/${endTime}/${inputVal}`, filterData.value).then((res) => { |
| | | |
| | | if (res.code == 200) { |
| | | console.log(res.data.data); |
| | | total.dataTotal = res.data.total.total*1 |
| | | total.pageTotal= res.data.total.pageTotal |
| | | pageTotal.value = res.data.total |
| | | produceList = produceList.value.concat(deepClone(res.data.data)) |
| | | xGrid.value.reloadData(produceList) |
| | | gridOptions.loading = false |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | |
| | | //页脚翻页查询 |
| | | const selectPageList = ()=>{ |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | let inputVal = form.orderId |
| | | if (inputVal == '') { |
| | | inputVal = null |
| | | } |
| | | request.post(`/reportingWork/selectReportingWork/${pageNum.value}/${total.pageSize}/${startTime}/${endTime}/${inputVal}`,filterData.value).then((res) => { |
| | | if(res.code==200){ |
| | | |
| | | |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.reloadData(produceList) |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | //点击查询 |
| | | const getWorkOrder = () => { |
| | | |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | let inputVal = form.orderId |
| | | if (inputVal == '') { |
| | | inputVal = null |
| | | } |
| | | request.post(`/reportingWork/selectReportingWork/${pageNum.value}/${total.pageSize}/${startTime}/${endTime}/${inputVal}`, filterData.value).then((res) => { |
| | | if (res.code == 200) { |
| | | total.dataTotal = res.data.total.total*1 |
| | | total.pageTotal= res.data.total.pageTotal |
| | | pageTotal.value = res.data.total |
| | | xGrid.value.loadData(res.data.data) |
| | | gridOptions.loading = false |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | //页脚跳转 |
| | | const handlePageChange = ({ currentPage, pageSize }) => { |
| | | pageNum.value=currentPage |
| | | total.pageTotal = pageSize |
| | | selectPageList() |
| | | } |
| | | |
| | | /*使用筛选,后端获取数据*/ |
| | | const changeFilterEvent = (event, option, $panel,) => { |
| | | // 手动触发筛选 |
| | | $panel.changeOption(event, !!option.data, option) |
| | | } |
| | | |
| | | function filterChanged(column) { |
| | | gridOptions.loading = true |
| | | //筛选条件发生变化条件发生变化 |
| | | let value = column.datas[0] != undefined ? column.datas[0] : '' |
| | | value = value.trim() |
| | | //判断是否存在外键 |
| | | if (column.property.indexOf('.') > -1) { |
| | | const columnArr = column.property.split('.') |
| | | filterData.value[columnArr[0]] = { |
| | | [columnArr[1]]: value |
| | | } |
| | | } else { |
| | | filterData.value[column.property] = value |
| | | } |
| | | |
| | | //获取选中时间 |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | |
| | | request.post(`/reportingWork/selectReportingWork/1/${total.pageSize}/${startTime}/${endTime}/${inputVal}`, filterData.value).then((res) => { |
| | | if(res.code==200){ |
| | | pageTotal.value=res.data.total |
| | | total.pageTotal=parseInt(res.data.total) |
| | | pageNum.value=1 |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.loadData(produceList) |
| | | gridOptions.loading=false |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | /*后端返回结果多层嵌套展示*/ |
| | | const hasDecimal = (value) => { |
| | | const regex = /\./; // 定义正则表达式,查找小数点 |
| | | return regex.test(value); // 返回true/false |
| | | } |
| | | |
| | | //子组件接收参数 |
| | | const xGrid = ref() |
| | | const gridOptions = reactive({ |
| | | border: "full",//表格加边框 |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe:true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 50},//鼠标移动或选择高亮 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 30},//鼠标移动或选择高亮 |
| | | id: 'CustomerList', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | |
| | | {type:'expand',fixed:"left",slots: { content:'content' },width: 50}, |
| | | {title: '操作', width: 140, slots: { default: 'button_slot' },fixed:"left"}, |
| | | { type: 'seq',fixed:"left", title: '自序', width: 50 }, |
| | | {field: 'reportingWorkNo', width: 120, title: '报工编号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true, }, |
| | | {field: 'reportingWorkTime',width: 120, title: '报工时间', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'processCard', width: 130,title: '流程卡号', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'entryName',width: 120, title: '项目名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'batch', width: 100,title: '批次', sortable: true,showOverflow:"ellipsis"}, |
| | | {field: 'device', width: 100,title: '设备', sortable: true}, |
| | | {field: 'thisProcess',width: 100, title: '本工序', sortable: true}, |
| | | {field: 'finishedNumber',width: 120, title: '本工序完工', sortable: true,showOverflow:"ellipsis"}, |
| | | {field: 'finishedArea', width: 120,title: '完工面积', sortable: true}, |
| | | {field: 'wornNumber',width: 120, title: '本工序次破', sortable: true}, |
| | | {field: 'wornArea',width: 120, title: '次破面积', sortable: true}, |
| | | {field: 'teamName',width: 120, title: '班组名称', sortable: true} |
| | | {field: 'reportingWorkId', width: 120, title: '报工编号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, }, |
| | | {field: 'reportingWorkTime',width: 120, title: '报工时间' ,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'orderId', width: 130,title: '销售单号' ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'processId', width: 130,title: '流程卡号' ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'order.project',width: 120, title: '项目名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, }, |
| | | {field: 'order.batch', width: 100,title: '批次' ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | |
| | | {field: 'thisProcess',width: 100, title: '本工序',filters:[{ data: '' }],slots: { filter: 'num1_filter' } }, |
| | | {field: 'thisCompletedQuantity',width: 120, title: '本工序完工' }, |
| | | {field: 'completedArea', width: 120,title: '完工面积', }, |
| | | {field: 'thisWornQuantity',width: 120, title: '本工序次破', }, |
| | | {field: 'wornArea',width: 120, title: '次破面积', }, |
| | | {field: 'deviceName', width: 100,title: '报工设备', }, |
| | | {field: 'teamsGroupsName',width: 120, title: '报工班组', }, |
| | | {field: 'reviewedState',width: 120, title: '审核状态', }, |
| | | |
| | | ],//表头按钮 |
| | | |
| | | toolbarConfig: { |
| | |
| | | zoom: true, |
| | | custom: true |
| | | }, |
| | | data: [ |
| | | { |
| | | reportingWorkNo: 'BG2312080011', |
| | | reportingWorkTime: '2023-12-08 09:05:58', |
| | | processCard: 'NG23120801A01', |
| | | entryName: '信合春天里', |
| | | batch: '四批二', |
| | | device:'大海利宁', |
| | | thisProcess: '切割', |
| | | finishedNumber: '13', |
| | | finishedArea: '44.22', |
| | | wornNumber: '', |
| | | wornArea: '', |
| | | teamName:'切割一班' |
| | | }, |
| | | { |
| | | reportingWorkNo: 'BG2312080013', |
| | | reportingWorkTime: '2023-12-08 09:05:58', |
| | | processCard: 'NG23120801A01', |
| | | entryName: '信合春天里', |
| | | batch: '一批二', |
| | | device:'大海利宁', |
| | | thisProcess: '切割', |
| | | finishedNumber: '13', |
| | | finishedArea: '44.22', |
| | | wornNumber: '', |
| | | wornArea: '', |
| | | teamName:'切割一班' |
| | | }, |
| | | { |
| | | reportingWorkNo: 'BG2311080025', |
| | | reportingWorkTime: '2023-12-08 09:05:58', |
| | | processCard: 'NG23120801A01', |
| | | entryName: '信合春天里', |
| | | batch: '一批二', |
| | | device:'大海利宁', |
| | | thisProcess: '切割', |
| | | finishedNumber: '13', |
| | | finishedArea: '44.22', |
| | | wornNumber: '', |
| | | wornArea: '', |
| | | teamName:'切割一班' |
| | | }, |
| | | { |
| | | reportingWorkNo: 'BG2303080025', |
| | | reportingWorkTime: '2023-12-08 09:05:58', |
| | | processCard: 'NG23120801A01', |
| | | entryName: '信合春天里', |
| | | batch: '一批二', |
| | | device:'大海利宁', |
| | | thisProcess: '切割', |
| | | finishedNumber: '13', |
| | | finishedArea: '44.22', |
| | | wornNumber: '', |
| | | wornArea: '', |
| | | teamName:'切割一班' |
| | | }, |
| | | { |
| | | reportingWorkNo: 'BG2312080001', |
| | | reportingWorkTime: '2023-12-08 09:05:58', |
| | | processCard: 'NG23120801A01', |
| | | entryName: '信合春天里', |
| | | batch: '一批二', |
| | | device:'大海利宁', |
| | | thisProcess: '切割', |
| | | finishedNumber: '13', |
| | | finishedArea: '44.22', |
| | | wornNumber: '', |
| | | wornArea: '', |
| | | teamName:'切割一班' |
| | | }, |
| | | { |
| | | reportingWorkNo: 'BG2312080015', |
| | | reportingWorkTime: '2023-12-08 09:05:58', |
| | | processCard: 'NG23120801A01', |
| | | entryName: '信合春天里', |
| | | batch: '一批二', |
| | | device:'大海利宁', |
| | | thisProcess: '切割', |
| | | finishedNumber: '13', |
| | | finishedArea: '44.22', |
| | | wornNumber: '', |
| | | wornArea: '', |
| | | teamName:'切割一班' |
| | | }, |
| | | ],//table body实际数据 |
| | | data: [],//table body实际数据 |
| | | //脚部求和 |
| | | footerMethod ({ columns, data }) {//页脚函数 |
| | | let footList=['finishedNumber','finishedArea','wornNumber','wornArea'] |
| | | let footList=['','','',''] |
| | | return[ |
| | | columns.map((column, columnIndex) => { |
| | | if (columnIndex === 0) { |
| | |
| | | }) |
| | | |
| | | |
| | | const form = reactive({ |
| | | name: '', |
| | | region: '', |
| | | date1: '', |
| | | date2: '', |
| | | delivery: false, |
| | | type: [], |
| | | resource: '', |
| | | desc: '', |
| | | }) |
| | | </script> |
| | | |
| | | <template> |
| | |
| | | <el-date-picker |
| | | v-model="form.date1" |
| | | type="daterange" |
| | | start-placeholder="开始时间" |
| | | end-placeholder="结束时间" |
| | | format="YYYY/MM/DD" |
| | | value-format="YYYY-MM-DD" |
| | | :start-placeholder="$t('basicData.startDate')" |
| | | :end-placeholder="$t('basicData.endDate')" |
| | | :default-time="defaultTime" |
| | | |
| | | /> |
| | | |
| | | <el-button type="primary">查询</el-button> |
| | | <el-input v-model="form.orderId" clearable :placeholder="$t('order.orderId')" style="width: 130px"></el-input> |
| | | |
| | | <el-button |
| | | @click="getWorkOrder" |
| | | id="select" |
| | | type="primary" :icon="Search">{{$t('basicData.search')}} |
| | | |
| | | </el-button> |
| | | </el-row> |
| | | |
| | | </div> |
| | |
| | | <!-- 下拉显示所有信息插槽--> |
| | | <template #content="{ row }"> |
| | | <ul class="expand-wrapper"> |
| | | <li v-for="(item,index) in gridOptions.columns" v-show="item.field!=undefined "> |
| | | <span style="font-weight: bold">{{item.title+': '}}</span> |
| | | <span>{{ row[item.field] }}</span> |
| | | <li v-for="(item,index) in gridOptions.columns" v-show="item.field!=undefined "> |
| | | <span style="font-weight: bold">{{ item.title + ': ' }}</span> |
| | | <span v-if="hasDecimal(item.field)">{{ row[item.field.split('.')[0]][item.field.split('.')[1]] }}</span> |
| | | <span v-else>{{ row[item.field] }}</span> |
| | | |
| | | </li> |
| | | </ul> |
| | | </template> |
| | |
| | | <!--左边固定显示的插槽--> |
| | | <template #button_slot="{ row }"> |
| | | <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">编辑</el-button> |
| | | <el-button @click="getTableRow(row,'setType')" link type="primary" size="small">反审</el-button> |
| | | <el-button @click="getTableRow(row,'delete')" link type="primary" size="small">删除</el-button> |
| | | </template> |
| | | |
| | |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <template #pager> |
| | | <!--使用 pager 插槽--> |
| | | <!-- 'PrevJump','NextJump', --> |
| | | <vxe-pager |
| | | @page-change="handlePageChange" |
| | | :layouts="[ 'PrevPage', 'Jump','PageCount', 'NextPage', 'Total']" |
| | | v-model:current-page="pageNum" |
| | | v-model:page-size="total.pageSize" |
| | | v-model:pager-count="total.pageTotal" |
| | | :total="total.dataTotal" |
| | | > |
| | | </vxe-pager> |
| | | </template> |
| | | |
| | | </vxe-grid> |
| | | <!-- <el-dialog v-model="updateWork" style="width: 80%;height:75% ">--> |
| | | <!-- <select-product :rowIndex="rowIndex" @getProductRow="getProductRow" style="width: 100%;height: 100%" />--> |
| | | <!-- </el-dialog>--> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | height: 100%; |
| | | } |
| | | #selectForm { |
| | | width: 40%; |
| | | width: 45%; |
| | | text-align: center; |
| | | } |
| | | </style> |
| | |
| | | }, |
| | | {field: 'order.batch', title: t('order.batch'), filters: [{data: ''}], slots: {filter: 'num1_filter'}, width: 110}, |
| | | {field: 'orderDetail.productName', title: t('order.product'), filters: [{data: ''}], slots: {filter: 'num1_filter'}, width: 210}, |
| | | {field: 'orderDetail.computeArea', title: t('order.area'), showOverflow: "ellipsis", width: 110}, |
| | | {field: 'orderDetail.computeArea', title: t('order.computeArea'), showOverflow: "ellipsis", width: 110}, |
| | | {field: 'orderDetail.quantity', title: t('order.quantity'), width: 70}, |
| | | {field: 'orderDetail.computeGrossArea', title: t('order.trueGrossArea'),}, |
| | | {field: 'orderDetail.perimeter', title: t('workOrder.perimeter'), showOverflow: "ellipsis"}, |
| | | {field: 'orderDetail.bendRadius', title: t('order.trueGrossArea'),}, |
| | | {field: 'orderDetail.bendRadius', title: t('order.bendRadius'),}, |
| | | {field: 'orderDetail.processingNote', title: t('order.processingNote'),} |
| | | ],//表头按钮 |
| | | data: null,//表格数据 |
| | |
| | | } |
| | | |
| | | |
| | | //删除工单 |
| | | @ApiOperation("删除工单接口") |
| | | //删除流程卡 |
| | | @ApiOperation("删除流程卡接口") |
| | | @PostMapping("/deleteFlowCard/{orderId}/{processId}") |
| | | public Result deleteOrderWork( |
| | | @PathVariable String orderId, |
| | |
| | | |
| | | import com.example.erp.common.Constants; |
| | | import com.example.erp.common.Result; |
| | | import com.example.erp.entity.pp.FlowCard; |
| | | import com.example.erp.entity.pp.ReportingWork; |
| | | import com.example.erp.exception.ServiceException; |
| | | import com.example.erp.service.pp.ReportingWorkService; |
| | |
| | | return Result.seccess(reportingWorkService.updateReportingWork(reportingWork)); |
| | | } |
| | | |
| | | @ApiOperation("报工查询接口") |
| | | @PostMapping ("/selectReportingWork/{pageNum}/{pageSize}/{selectTime1}/{selectTime2}/{orderId}") |
| | | public Result selectReportingWork( |
| | | @PathVariable Integer pageNum, |
| | | @PathVariable Integer pageSize, |
| | | @PathVariable Date selectTime1, |
| | | @PathVariable Date selectTime2, |
| | | @PathVariable String orderId, |
| | | @RequestBody ReportingWork reportingWork){ |
| | | return Result.seccess(reportingWorkService.selectReportingWorkSv(pageNum,pageSize,selectTime1,selectTime2,orderId,reportingWork)); |
| | | |
| | | } |
| | | |
| | | @ApiOperation("删除报工接口") |
| | | @PostMapping("/deleteWork/{reportingWorkId}/{processId}/{thisProcess}") |
| | | public Result deleteWork(@PathVariable String reportingWorkId,@PathVariable String processId,@PathVariable String thisProcess){ |
| | | if(reportingWorkService.deleteWorkSv(reportingWorkId,processId,thisProcess)){ |
| | | return Result.seccess(); |
| | | }else { |
| | | throw new ServiceException(Constants.Code_500,"删除失败,请检查是否符合删除条件"); |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.example.erp.entity.sd.DeliveryDetail; |
| | | import com.example.erp.entity.sd.Order; |
| | | import com.example.erp.entity.sd.OrderGlassDetail; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDate; |
| | |
| | | //包装方式 |
| | | private String packagingMethod; |
| | | //报工时间 |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime reportingWorkTime; |
| | | //审核时间 |
| | | private LocalDate examineTime; |
| | |
| | | // private ReportingWork reportingWork; |
| | | @TableField(select = false,exist= false) |
| | | private ReportingWorkDetail reportingWorkDetail; |
| | | |
| | | @TableField(select = false,exist= false) |
| | | private OrderGlassDetail orderGlassDetail; |
| | | |
| | | |
| | | //定义的完工面积 |
| | | @TableField(select = false,exist= false) |
| | | private String completedArea; |
| | | //次破面积 |
| | | @TableField(select = false,exist= false) |
| | | private String wornArea; |
| | | } |
| | |
| | | Integer selectFlowCardCount(String orderId); |
| | | |
| | | List<Map<String, String>> flowCardDetailMp(String processId, FlowCard flowCard); |
| | | |
| | | Boolean deleteReportingWork(String processId); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.example.erp.entity.pp.BasicDataProduce; |
| | | import com.example.erp.entity.pp.ReportingWork; |
| | | import com.example.erp.entity.pp.ReportingWorkDetail; |
| | | import com.example.erp.entity.sd.OrderGlassDetail; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.sql.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | int selectFlowCardNum(String orderNumber, String technologyNumber, String processId, String thisProcess); |
| | | |
| | | List<Map<String,Object>> selectByReportingWorkId(String reportingWorkId,String nextProcess); |
| | | Map<String, Integer> getPageTotal(Integer offset, Integer pageSize, Date selectTime1, Date selectTime2, String orderId, ReportingWork reportingWork); |
| | | |
| | | String selectNextProcess(String reportingWorkId); |
| | | |
| | | Integer selectCountByProcessId(String processId, String nextProcess); |
| | | |
| | | List<Map<String, Object>> reportingWorkDate(String reportingWorkId); |
| | | |
| | | Boolean updateWorkProcess(String processId, Object orderNumber, Object technologyNumber, Object completedQuantity, Object breakageQuantity, String thisProcess); |
| | | |
| | | Boolean deleteWork(String reportingWorkId); |
| | | |
| | | String selectLastProcess(String processId); |
| | | |
| | | Map<String, Object> selectReceiptQuantity(String processId); |
| | | |
| | | Integer selectCompletedQuantity(String reportingWorkId); |
| | | |
| | | Boolean updateInventoryQuantity(String processId, Object orderNumber, Object technologyNumber, Object completedQuantity); |
| | | |
| | | List<ReportingWork> selectReportingWorkMp(Integer offset, Integer pageSize, Date selectTime1, Date selectTime2, String orderId, ReportingWork reportingWork); |
| | | } |
| | |
| | | |
| | | //修改分架状态 |
| | | flowCardMapper.updateDeleteState(orderId, processId); |
| | | //删除报工流程明细表数据 |
| | | flowCardMapper.deleteReportingWork(processId); |
| | | //删除分架明细 |
| | | flowCardMapper.deleteFlowCardMp(orderId, processId); |
| | | //判断该订单流程卡是否全部删除 |
| | |
| | | orderProcessDetailMapper.updateQuantity(reportingWork.getReportingWorkId(),reportingWork.getThisProcess(),"add"); |
| | | return true; |
| | | } |
| | | //报工管理查询 |
| | | public Map<String, Object> selectReportingWorkSv(Integer pageNum, Integer pageSize, java.sql.Date selectTime1, java.sql.Date selectTime2, String orderId, ReportingWork reportingWork) { |
| | | Integer offset = (pageNum - 1) * pageSize; |
| | | if (orderId.equals("null")) { |
| | | orderId = ""; |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", reportingWorkMapper.selectReportingWorkMp(offset, pageSize, selectTime1, selectTime2, orderId, reportingWork)); |
| | | map.put("total", reportingWorkMapper.getPageTotal(offset, pageSize, selectTime1, selectTime2, orderId, reportingWork)); |
| | | //System.out.println(map.get("data")); |
| | | return map; |
| | | } |
| | | |
| | | public Boolean deleteWorkSv(String reportingWorkId, String processId, String thisProcess) { |
| | | if (!reportingWorkId.isEmpty() && !processId.isEmpty() && !thisProcess.isEmpty()) { |
| | | //获取当前报工编号下工序 |
| | | String nextProcess = reportingWorkMapper.selectNextProcess(reportingWorkId); |
| | | //查询当前报工编号下工序是否报工 |
| | | Integer count = reportingWorkMapper.selectCountByProcessId(processId, nextProcess); |
| | | //获取最后一道工序 |
| | | String lastProcess = reportingWorkMapper.selectLastProcess(processId); |
| | | //判断是否是入库工序 |
| | | if (lastProcess.equals(thisProcess)) {//是入库工序 |
| | | //查询该流程卡数量、可入库数量、已入库数量 |
| | | Map<String, Object> list = reportingWorkMapper.selectReceiptQuantity(processId); |
| | | // System.out.println(list.get("quantity")+"--"+list.get("inventoryQuantity")+"---"+list.get("receivedQuantity")); |
| | | if (list.get("quantity") == list.get("receiptQuantity")) { |
| | | return false; |
| | | } else { |
| | | //转换类型:已入库数量 |
| | | Integer receiptQuantity = Integer.parseInt(list.get("receivedQuantity").toString()); |
| | | //转换类型:可入库数量 |
| | | Integer inventoryQuantity = Integer.parseInt(list.get("inventoryQuantity").toString()); |
| | | //查询该报工编号本工序完工数量 |
| | | Integer completedQuantity = reportingWorkMapper.selectCompletedQuantity(reportingWorkId); |
| | | //当该工序完工数量小于等于已入库数量时 |
| | | //System.out.println("inventoryQuantity:" + inventoryQuantity +"completedQuantity:" + completedQuantity + "---receiptQuantity:" + receiptQuantity); |
| | | //可入库数量-已入库数量>=报工编号本工序完工数量 |
| | | if (inventoryQuantity - receiptQuantity >= completedQuantity) { |
| | | //查询当前报工编号完工次破数量的数据 |
| | | List<Map<String, Object>> workDateList = reportingWorkMapper.reportingWorkDate(reportingWorkId); |
| | | for (Map<String, Object> item : workDateList) { |
| | | |
| | | //更新流程卡可入库数量 |
| | | reportingWorkMapper.updateInventoryQuantity(processId, item.get("order_number"), item.get("technology_number"), item.get("completed_quantity")); |
| | | //更新报工流程表数据 |
| | | reportingWorkMapper.updateWorkProcess(processId, item.get("order_number"), item.get("technology_number"), item.get("completed_quantity"), item.get("breakage_quantity"), thisProcess); |
| | | } |
| | | //删除报工,将审核状态改为-1 |
| | | reportingWorkMapper.deleteWork(reportingWorkId); |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | } |
| | | else{//不是入库工序 |
| | | if (count==0){ |
| | | //查询当前报工编号完工次破数量的数据 |
| | | List<Map<String, Object>> workDateList=reportingWorkMapper.reportingWorkDate(reportingWorkId); |
| | | for (Map<String, Object> item : workDateList) { |
| | | //更新报工流程表数据 |
| | | reportingWorkMapper.updateWorkProcess(processId,item.get("order_number"),item.get("technology_number"),item.get("completed_quantity"),item.get("breakage_quantity"),thisProcess); |
| | | } |
| | | //删除报工,将审核状态改为-1 |
| | | reportingWorkMapper.deleteWork(reportingWorkId); |
| | | return true; |
| | | } |
| | | else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | |
| | | a.founder, |
| | | c.processing_note, |
| | | if(a.layout_status=0,"不可排版",if(a.layout_status=1,"可排版","已排版")) as layout_status |
| | | from flow_card as a left join sd.`order` as b on a.order_Id=b.order_id |
| | | from (select id,order_id,process_id,order_number, quantity,founder,layout_status,create_time from flow_card group by process_Id,order_number) as a left join sd.`order` as b on a.order_Id=b.order_id |
| | | left join sd.order_detail as c on a.order_Id=c.order_id and a.order_Number=c.order_number |
| | | where a.create_time between #{selectTime1} and #{selectTime2} |
| | | <if test="flowCard.orderId != null and flowCard.orderId != ''"> |
| | |
| | | <update id="deleteFlowCardMp"> |
| | | delete |
| | | from flow_card as fc |
| | | where fc.process_id = #{processId} |
| | | where fc.production_id = left(#{processId},11) |
| | | </update> |
| | | |
| | | <!-- 分架新增明细查询--> |
| | |
| | | where fc.process_id = #{processId} |
| | | GROUP BY fc.order_id, fc.process_id, fc.order_number |
| | | </select> |
| | | |
| | | <delete id="deleteReportingWork"> |
| | | delete from sd.order_process_detail |
| | | where left(process_id,11) = left(#{processId},11) |
| | | </delete> |
| | | </mapper> |
| | |
| | | <result property="thisProcess" column="this_process"/> |
| | | <result property="reviewedState" column="reviewed_state"/> |
| | | <result property="previousProcessQuantity" column="previous_process_quantity"/> |
| | | <result property="reportingWorkTime" column="reporting_work_time"/> |
| | | <result property="thisCompletedQuantity" column="this_completed_quantity"/> |
| | | <result property="thisWornQuantity" column="this_worn_quantity"/> |
| | | <result property="deviceName" column="device_name"/> |
| | | <result property="teamsGroupsName" column="teams_groups_name"/> |
| | | <result property="reviewedState" column="reviewed_state"/> |
| | | <result property="reportingWorkId" column="reporting_work_id"/> |
| | | <result property="processId" column="process_id"/> |
| | | <result property="completedArea" column="completedArea"/> |
| | | <result property="wornArea" column="wornArea"/> |
| | | |
| | | <association property="order" javaType="com.example.erp.entity.sd.Order"> |
| | | <result property="customerId" column="customer_id"/> |
| | | <result property="customerName" column="customer_name"/> |
| | | <result property="project" column="project"/> |
| | | <result property="batch" column="batch"/> |
| | | </association> |
| | | <association property="flowCard" javaType="com.example.erp.entity.pp.FlowCard"> |
| | | <result property="orderId" column="order_id"/> |
| | |
| | | </association> |
| | | <association property="reportingWorkDetail" javaType="com.example.erp.entity.pp.ReportingWorkDetail"> |
| | | <result property="completedQuantity" column="completed_quantity"/> |
| | | </association> |
| | | <association property="orderGlassDetail" javaType="com.example.erp.entity.sd.OrderGlassDetail"> |
| | | <result property="area" column="area"/> |
| | | </association> |
| | | |
| | | </resultMap> |
| | |
| | | </if> |
| | | where a.reporting_work_id = #{reportingWorkId} |
| | | </select> |
| | | <select id="selectReportingWorkMp" resultMap="reportingWorkMap"> |
| | | select rw.reporting_work_id, |
| | | (rw.reporting_work_time) as reporting_work_time, |
| | | o.order_id, |
| | | rw.process_id, |
| | | o.project, |
| | | o.batch, |
| | | rw.this_process, |
| | | rw.this_completed_quantity, |
| | | (ogd.area * rw.this_completed_quantity) as completedArea, |
| | | rw.this_worn_quantity, |
| | | (ogd.area * rw.this_worn_quantity) as wornArea, |
| | | rw.device_name, |
| | | rw.teams_groups_name, |
| | | rw.reviewed_state |
| | | # (IF(rw.reviewed_state = 0, '未审核', IF(rw.reviewed_state = 1, '审核通过', '审核不通过'))) as reviewed_state |
| | | from sd.order as o |
| | | left join sd.order_glass_detail as ogd on ogd.order_id = o.order_id |
| | | left join reporting_work as rw on rw.order_id = ogd.order_id and rw.production_id = ogd.production_id |
| | | left join reporting_work_detail as rwd |
| | | on rwd.reporting_work_id = rw.reporting_work_id and rwd.order_number = ogd.order_number and |
| | | rwd.technology_number = ogd.technology_number |
| | | where rw.reviewed_state != 2 |
| | | and rw.reporting_work_time between #{selectTime1} and #{selectTime2} and position(#{orderId} in rw.order_id) |
| | | and rw.reviewed_state!=-1 |
| | | <if test="reportingWork.reportingWorkId != null and reportingWork.reportingWorkId != ''"> |
| | | and rw.reporting_work_id regexp #{reportingWork.reportingWorkId} |
| | | </if> |
| | | <if test="reportingWork.orderId != null and reportingWork.orderId != ''"> |
| | | and o.order_id regexp #{reportingWork.orderId} |
| | | </if> |
| | | <if test="reportingWork.processId != null and reportingWork.processId != ''"> |
| | | and rw.process_id regexp #{reportingWork.processId} |
| | | </if> |
| | | <if test="reportingWork.order.project != null and reportingWork.order.project != ''"> |
| | | and o.project regexp #{reportingWork.order.project} |
| | | </if> |
| | | <if test="reportingWork.order.batch != null and reportingWork.order.batch != ''"> |
| | | and o.batch regexp #{reportingWork.order.batch} |
| | | </if> |
| | | <if test="reportingWork.thisProcess != null and reportingWork.thisProcess != ''"> |
| | | and rw.this_process regexp #{reportingWork.thisProcess} |
| | | </if> |
| | | GROUP BY rw.reporting_work_id |
| | | ORDER BY rw.reporting_work_id desc |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="getPageTotal"> |
| | | select CEILING(count(rw.reporting_work_id)/#{pageSize}) as 'pageTotal', |
| | | count(distinct rw.reporting_work_id) as 'total' |
| | | from sd.order as o |
| | | left join sd.order_glass_detail as ogd on ogd.order_id = o.order_id |
| | | left join reporting_work as rw on rw.order_id = ogd.order_id and rw.production_id = ogd.production_id |
| | | left join reporting_work_detail as rwd |
| | | on rwd.reporting_work_id = rw.reporting_work_id and rwd.order_number = ogd.order_number and |
| | | rwd.technology_number = ogd.technology_number |
| | | where rw.reviewed_state != 2 |
| | | and rw.reporting_work_time between #{selectTime1} and #{selectTime2} and position(#{orderId} in rw.order_id) |
| | | and rw.reviewed_state!=-1 |
| | | ORDER BY rw.reporting_work_id desc |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | <!-- 根据报工编号查询下工序--> |
| | | <select id="selectNextProcess"> |
| | | select next_process from reporting_work where reporting_work_id=#{reportingWorkId} |
| | | </select> |
| | | <!-- 查询下工序是否报工--> |
| | | <select id="selectCountByProcessId"> |
| | | select count(reporting_work_id) from reporting_work where this_process=#{nextProcess} and process_id=#{processId} |
| | | </select> |
| | | |
| | | <!-- 查询完工次破数量--> |
| | | <select id="reportingWorkDate"> |
| | | select rw.process_id, |
| | | rwd.order_number, |
| | | rwd.technology_number, |
| | | rwd.completed_quantity, |
| | | IFNULL(SUM(dd.breakage_quantity), 0) as breakage_quantity |
| | | from reporting_work as rw |
| | | left join reporting_work_detail as rwd on rw.reporting_work_id = rwd.reporting_work_id |
| | | left join damage_details as dd |
| | | on dd.reporting_work_id = rwd.reporting_work_id and dd.order_number = rwd.order_number and |
| | | dd.technology_number = rwd.technology_number |
| | | where rw.reporting_work_id = #{reportingWorkId} |
| | | GROUP BY rwd.order_number, rwd.technology_number |
| | | </select> |
| | | |
| | | <!-- 修改报工流程卡表数据--> |
| | | <update id="updateWorkProcess"> |
| | | update sd.order_process_detail |
| | | set reporting_work_num_count=reporting_work_num_count - #{completedQuantity}, |
| | | reporting_work_num=reporting_work_num - #{completedQuantity}, |
| | | broken_num=broken_num - #{breakageQuantity} |
| | | where process_id = #{processId} |
| | | and order_number = #{orderNumber} |
| | | and technology_number = #{technologyNumber} |
| | | and process = #{thisProcess} |
| | | </update> |
| | | |
| | | <!-- 删除报工--> |
| | | <update id="deleteWork"> |
| | | update reporting_work set reviewed_state=-1 |
| | | where reporting_work_id = #{reportingWorkId} |
| | | </update> |
| | | <!-- 获取最后一道工序--> |
| | | <select id="selectLastProcess"> |
| | | select process |
| | | from sd.order_process_detail |
| | | where process_id = #{processId} |
| | | and order_number = 1 |
| | | and technology_number = 1 |
| | | order by id desc |
| | | LIMIT 1 |
| | | </select> |
| | | <!-- 查询可入库、已入库数量--> |
| | | <select id="selectReceiptQuantity"> |
| | | select ifnull(SUM(quantity),0) as quantity, |
| | | ifnull(SUM(inventory_quantity), 0) as inventoryQuantity, |
| | | ifnull(SUM(received_quantity), 0) as receivedQuantity |
| | | from flow_card |
| | | where process_id = #{processId} |
| | | and technology_number = 1 |
| | | GROUP BY process_id |
| | | </select> |
| | | <!-- 查询报工编号完工数量--> |
| | | <select id="selectCompletedQuantity"> |
| | | select ifnull(this_completed_quantity,0) from reporting_work where reporting_work_id=#{reportingWorkId} |
| | | </select> |
| | | <!-- 更新流程卡可入库数量--> |
| | | <update id="updateInventoryQuantity"> |
| | | update flow_card |
| | | set inventory_quantity = inventory_quantity - #{completedQuantity} |
| | | where process_id = #{processId} |
| | | and order_number = #{orderNumber} |
| | | and technology_number = #{technologyNumber} |
| | | </update> |
| | | </mapper> |
| | |
| | | a.founder, |
| | | c.processing_note, |
| | | if(a.layout_status=0,"不可排版",if(a.layout_status=1,"可排版","已排版")) as layout_status |
| | | from flow_card as a left join sd.`order` as b on a.order_Id=b.order_id |
| | | from (select id,order_id,process_id,order_number, quantity,founder,layout_status,create_time from flow_card group by process_Id,order_number) as a left join sd.`order` as b on a.order_Id=b.order_id |
| | | left join sd.order_detail as c on a.order_Id=c.order_id and a.order_Number=c.order_number |
| | | where a.create_time between #{selectTime1} and #{selectTime2} |
| | | <if test="flowCard.orderId != null and flowCard.orderId != ''"> |
| | |
| | | <update id="deleteFlowCardMp"> |
| | | delete |
| | | from flow_card as fc |
| | | where fc.process_id = #{processId} |
| | | where fc.production_id = left(#{processId},11) |
| | | </update> |
| | | |
| | | <!-- 分架新增明细查询--> |
| | |
| | | where fc.process_id = #{processId} |
| | | GROUP BY fc.order_id, fc.process_id, fc.order_number |
| | | </select> |
| | | |
| | | <delete id="deleteReportingWork"> |
| | | delete from sd.order_process_detail |
| | | where left(process_id,11) = left(#{processId},11) |
| | | </delete> |
| | | </mapper> |
| | |
| | | <result property="thisProcess" column="this_process"/> |
| | | <result property="reviewedState" column="reviewed_state"/> |
| | | <result property="previousProcessQuantity" column="previous_process_quantity"/> |
| | | <result property="reportingWorkTime" column="reporting_work_time"/> |
| | | <result property="thisCompletedQuantity" column="this_completed_quantity"/> |
| | | <result property="thisWornQuantity" column="this_worn_quantity"/> |
| | | <result property="deviceName" column="device_name"/> |
| | | <result property="teamsGroupsName" column="teams_groups_name"/> |
| | | <result property="reviewedState" column="reviewed_state"/> |
| | | <result property="reportingWorkId" column="reporting_work_id"/> |
| | | <result property="processId" column="process_id"/> |
| | | <result property="completedArea" column="completedArea"/> |
| | | <result property="wornArea" column="wornArea"/> |
| | | |
| | | <association property="order" javaType="com.example.erp.entity.sd.Order"> |
| | | <result property="customerId" column="customer_id"/> |
| | | <result property="customerName" column="customer_name"/> |
| | | <result property="project" column="project"/> |
| | | <result property="batch" column="batch"/> |
| | | </association> |
| | | <association property="flowCard" javaType="com.example.erp.entity.pp.FlowCard"> |
| | | <result property="orderId" column="order_id"/> |
| | |
| | | </association> |
| | | <association property="reportingWorkDetail" javaType="com.example.erp.entity.pp.ReportingWorkDetail"> |
| | | <result property="completedQuantity" column="completed_quantity"/> |
| | | </association> |
| | | <association property="orderGlassDetail" javaType="com.example.erp.entity.sd.OrderGlassDetail"> |
| | | <result property="area" column="area"/> |
| | | </association> |
| | | |
| | | </resultMap> |
| | |
| | | </if> |
| | | where a.reporting_work_id = #{reportingWorkId} |
| | | </select> |
| | | <select id="selectReportingWorkMp" resultMap="reportingWorkMap"> |
| | | select rw.reporting_work_id, |
| | | (rw.reporting_work_time) as reporting_work_time, |
| | | o.order_id, |
| | | rw.process_id, |
| | | o.project, |
| | | o.batch, |
| | | rw.this_process, |
| | | rw.this_completed_quantity, |
| | | (ogd.area * rw.this_completed_quantity) as completedArea, |
| | | rw.this_worn_quantity, |
| | | (ogd.area * rw.this_worn_quantity) as wornArea, |
| | | rw.device_name, |
| | | rw.teams_groups_name, |
| | | rw.reviewed_state |
| | | # (IF(rw.reviewed_state = 0, '未审核', IF(rw.reviewed_state = 1, '审核通过', '审核不通过'))) as reviewed_state |
| | | from sd.order as o |
| | | left join sd.order_glass_detail as ogd on ogd.order_id = o.order_id |
| | | left join reporting_work as rw on rw.order_id = ogd.order_id and rw.production_id = ogd.production_id |
| | | left join reporting_work_detail as rwd |
| | | on rwd.reporting_work_id = rw.reporting_work_id and rwd.order_number = ogd.order_number and |
| | | rwd.technology_number = ogd.technology_number |
| | | where rw.reviewed_state != 2 |
| | | and rw.reporting_work_time between #{selectTime1} and #{selectTime2} and position(#{orderId} in rw.order_id) |
| | | and rw.reviewed_state!=-1 |
| | | <if test="reportingWork.reportingWorkId != null and reportingWork.reportingWorkId != ''"> |
| | | and rw.reporting_work_id regexp #{reportingWork.reportingWorkId} |
| | | </if> |
| | | <if test="reportingWork.orderId != null and reportingWork.orderId != ''"> |
| | | and o.order_id regexp #{reportingWork.orderId} |
| | | </if> |
| | | <if test="reportingWork.processId != null and reportingWork.processId != ''"> |
| | | and rw.process_id regexp #{reportingWork.processId} |
| | | </if> |
| | | <if test="reportingWork.order.project != null and reportingWork.order.project != ''"> |
| | | and o.project regexp #{reportingWork.order.project} |
| | | </if> |
| | | <if test="reportingWork.order.batch != null and reportingWork.order.batch != ''"> |
| | | and o.batch regexp #{reportingWork.order.batch} |
| | | </if> |
| | | <if test="reportingWork.thisProcess != null and reportingWork.thisProcess != ''"> |
| | | and rw.this_process regexp #{reportingWork.thisProcess} |
| | | </if> |
| | | GROUP BY rw.reporting_work_id |
| | | ORDER BY rw.reporting_work_id desc |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="getPageTotal"> |
| | | select CEILING(count(rw.reporting_work_id)/#{pageSize}) as 'pageTotal', |
| | | count(distinct rw.reporting_work_id) as 'total' |
| | | from sd.order as o |
| | | left join sd.order_glass_detail as ogd on ogd.order_id = o.order_id |
| | | left join reporting_work as rw on rw.order_id = ogd.order_id and rw.production_id = ogd.production_id |
| | | left join reporting_work_detail as rwd |
| | | on rwd.reporting_work_id = rw.reporting_work_id and rwd.order_number = ogd.order_number and |
| | | rwd.technology_number = ogd.technology_number |
| | | where rw.reviewed_state != 2 |
| | | and rw.reporting_work_time between #{selectTime1} and #{selectTime2} and position(#{orderId} in rw.order_id) |
| | | and rw.reviewed_state!=-1 |
| | | ORDER BY rw.reporting_work_id desc |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | <!-- 根据报工编号查询下工序--> |
| | | <select id="selectNextProcess"> |
| | | select next_process from reporting_work where reporting_work_id=#{reportingWorkId} |
| | | </select> |
| | | <!-- 查询下工序是否报工--> |
| | | <select id="selectCountByProcessId"> |
| | | select count(reporting_work_id) from reporting_work where this_process=#{nextProcess} and process_id=#{processId} |
| | | </select> |
| | | |
| | | <!-- 查询完工次破数量--> |
| | | <select id="reportingWorkDate"> |
| | | select rw.process_id, |
| | | rwd.order_number, |
| | | rwd.technology_number, |
| | | rwd.completed_quantity, |
| | | IFNULL(SUM(dd.breakage_quantity), 0) as breakage_quantity |
| | | from reporting_work as rw |
| | | left join reporting_work_detail as rwd on rw.reporting_work_id = rwd.reporting_work_id |
| | | left join damage_details as dd |
| | | on dd.reporting_work_id = rwd.reporting_work_id and dd.order_number = rwd.order_number and |
| | | dd.technology_number = rwd.technology_number |
| | | where rw.reporting_work_id = #{reportingWorkId} |
| | | GROUP BY rwd.order_number, rwd.technology_number |
| | | </select> |
| | | |
| | | <!-- 修改报工流程卡表数据--> |
| | | <update id="updateWorkProcess"> |
| | | update sd.order_process_detail |
| | | set reporting_work_num_count=reporting_work_num_count - #{completedQuantity}, |
| | | reporting_work_num=reporting_work_num - #{completedQuantity}, |
| | | broken_num=broken_num - #{breakageQuantity} |
| | | where process_id = #{processId} |
| | | and order_number = #{orderNumber} |
| | | and technology_number = #{technologyNumber} |
| | | and process = #{thisProcess} |
| | | </update> |
| | | |
| | | <!-- 删除报工--> |
| | | <update id="deleteWork"> |
| | | update reporting_work set reviewed_state=-1 |
| | | where reporting_work_id = #{reportingWorkId} |
| | | </update> |
| | | <!-- 获取最后一道工序--> |
| | | <select id="selectLastProcess"> |
| | | select process |
| | | from sd.order_process_detail |
| | | where process_id = #{processId} |
| | | and order_number = 1 |
| | | and technology_number = 1 |
| | | order by id desc |
| | | LIMIT 1 |
| | | </select> |
| | | <!-- 查询可入库、已入库数量--> |
| | | <select id="selectReceiptQuantity"> |
| | | select ifnull(SUM(quantity),0) as quantity, |
| | | ifnull(SUM(inventory_quantity), 0) as inventoryQuantity, |
| | | ifnull(SUM(received_quantity), 0) as receivedQuantity |
| | | from flow_card |
| | | where process_id = #{processId} |
| | | and technology_number = 1 |
| | | GROUP BY process_id |
| | | </select> |
| | | <!-- 查询报工编号完工数量--> |
| | | <select id="selectCompletedQuantity"> |
| | | select ifnull(this_completed_quantity,0) from reporting_work where reporting_work_id=#{reportingWorkId} |
| | | </select> |
| | | <!-- 更新流程卡可入库数量--> |
| | | <update id="updateInventoryQuantity"> |
| | | update flow_card |
| | | set inventory_quantity = inventory_quantity - #{completedQuantity} |
| | | where process_id = #{processId} |
| | | and order_number = #{orderNumber} |
| | | and technology_number = #{technologyNumber} |
| | | </update> |
| | | </mapper> |