Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override
| | |
| | | }) |
| | | const getData = () => { |
| | | request.get(`/order/printOrderProductDetail/${props.orderId}/${selectedValues.value}`).then(res => { |
| | | console.log( res.data) |
| | | data.value= res.data |
| | | productIdData.value=data.value.orderProductDetail |
| | | data.value.orderProductDetail.forEach(item => { |
| | |
| | | <td>{{items.orderNumber}}</td> |
| | | <td>{{items.buildingNumber}}</td> |
| | | <td colspan="3" style="font-size: 20px;font-weight: bold;" v-if="items.otherColumns?.S02">{{items.otherColumns?.S02}}</td> |
| | | <td colspan="3" style="font-size: 20px;font-weight: bold;" v-else-if="items.differentSize=1"> |
| | | <template v-for="(orderGlassDetail, index1) in items.orderGlassDetails" > |
| | | ({{orderGlassDetail.childWidth}}x{{orderGlassDetail.childHeight}}) |
| | | </template> |
| | | </td> |
| | | <td colspan="3" style="font-size: 20px;font-weight: bold;" v-else>{{items.width}}x{{items.height}}</td> |
| | | <td style="font-size: 20px;font-weight: bold;">{{items.quantity}}</td> |
| | | <td style="font-size: 20px;font-weight: bold;">{{items.grossArea.toFixed(2)}}</td> |
| | |
| | | height: 30px; |
| | | } |
| | | .contactNumber{ |
| | | width: 150px; |
| | | width: 125px; |
| | | height:20px; |
| | | border: none; |
| | | box-shadow: none; |
| | |
| | | |
| | | } else { |
| | | |
| | | |
| | | // item.baiscQuantity = item.baiscQuantity * 1 + leftData[leftfilterIndex].quantity * 1 |
| | | // item.computeGrossArea=(item.width*item.height*item.baiscQuantity/1000000).toFixed(2) |
| | | //item.computeGrossArea=(item.width*item.height*item.baiscQuantity/1000000).toFixed(2) |
| | | // for (let i = 0; i <checkedList.length ; i++) { |
| | | // |
| | | // if (checkedList[i].orderNumber === item.orderNumber){ |
| | | // console.log(item.baiscQuantity +"---"+ checkedList[i].quantity ) |
| | | // item.baiscQuantity = item.baiscQuantity * 1 + checkedList[i].quantity * 1 |
| | | // } |
| | | // } |
| | | |
| | | delete item._X_ROW_KEY |
| | | $grid.insert(item) |
| | | |
| | |
| | | // 更新 item.processId |
| | | item.processId = newProcessId; |
| | | }); |
| | | // 获取剩余数据,用于对落架顺序重新赋值 |
| | | let remainingData = $gridLeft.getTableData().fullData; |
| | | // 按 processId 分组 |
| | | let groupedData = remainingData.reduce((acc, curr) => { |
| | | if (!acc[curr.processId]) { |
| | | acc[curr.processId] = []; |
| | | } |
| | | acc[curr.processId].push(curr); |
| | | return acc; |
| | | }, {}); |
| | | |
| | | // 按 processId 排序(倒序) |
| | | let sortedProcessIds = Object.keys(groupedData).sort((a, b) => b - a); |
| | | |
| | | // 更新每个分组的 landingSequence |
| | | sortedProcessIds.forEach((processId, index) => { |
| | | let group = groupedData[processId]; |
| | | |
| | | // 对每个 processId 分组内的数据,不改变顺序,直接赋相同的 landingSequence |
| | | group.forEach((item) => { |
| | | item.landingSequence = sortedProcessIds.length - index; // 按倒序设置 landingSequence |
| | | }); |
| | | }); |
| | | //清除两边复选框 |
| | | $gridLeft.clearCheckboxRow() |
| | | $grid.clearCheckboxRow() |
| | |
| | | } catch (e) { |
| | | ElMessage.warning(e.message) |
| | | } |
| | | //每次点击情况输入框 |
| | | if (checkedNum.value){ |
| | | checkedNum.value ='' |
| | | } |
| | | } |
| | | |
| | | |
| | | //向左边表格添加数据 |
| | | const addLeft = () => { |
| | | try { |
| | |
| | | <span>{{ item.processingNote }}</span> |
| | | </div> |
| | | </div> |
| | | <div style="width: 20px" v-if="id%2===0"></div> |
| | | <div style="width: 19px" v-if="id%2===0"></div> |
| | | <div class="element-to-break-after" style="width: 1px" v-if="id%2===1"></div> |
| | | </template> |
| | | </div> |
| | | |
| | |
| | | font-size: 8pt; |
| | | } |
| | | |
| | | |
| | | .element-to-break-after { |
| | | page-break-after: always; |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | <span>{{item.processing_note}}</span> |
| | | </div> |
| | | </div> |
| | | <div style="width: 20px" v-if="id%2===0"></div> |
| | | <div style="width: 19px" v-if="id%2===0"></div> |
| | | <div class="element-to-break-after" style="width: 1px" v-if="id%2===1"></div> |
| | | </template> |
| | | </div> |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | .element-to-break-after { |
| | | page-break-after: always; |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | request.post(`/order/saveOrderTitle`,order).then((res) => { |
| | | if(res.code==200){ |
| | | ElMessage.success(t('basicData.msg.saveSuccess')) |
| | | router.push({path:'/main/order/selectOrder'}) |
| | | router.push({path:'/main/order/createOrder',query:{ |
| | | orderId:titleUploadData.value.orderId, |
| | | random:Math.random()}}) |
| | | }else { |
| | | ElMessage.error(res.msg) |
| | | } |
| | |
| | | |
| | | </vxe-grid> |
| | | </div> |
| | | <el-dialog v-model="dialogTableVisible" :title="$t('order.processingNote')" style="width: 60%;height:75% "> |
| | | <el-dialog v-model="dialogTableVisible" :draggable="true" :title="$t('order.processingNote')" style="width: 60%;height:75% "> |
| | | <el-input |
| | | v-model="titleUploadData.processingNote" |
| | | type="textarea" |
| | |
| | | } |
| | | |
| | | |
| | | @ApiOperation("mes切割报工") |
| | | @PostMapping ("/mesMaterialOutbound") |
| | | public Result mesMaterialOutbound(@RequestBody Map<String,Object> reportingWork) { |
| | | return Result.seccess(materialInventoryService.mesMaterialOutbound(reportingWork)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | public class OptimizeUse { |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | private Integer projectNo; |
| | | private String projectNo; |
| | | private String rawStockCode; |
| | | private String stockCode; |
| | | private Integer type; |
| | |
| | | |
| | | Boolean updateMaterialInventoryAvailableInventoryOut(@Param("inventoryId") Long inventoryId, |
| | | @Param("quantity") Integer quantity); |
| | | |
| | | Boolean updateMaterialInventoryAvailableInventoryOutMes(@Param("inventoryId") Long inventoryId, |
| | | @Param("quantity") Integer quantity); |
| | | Boolean updateMaterialInventoryAvailableInventoryInt(@Param("inventoryId") Long inventoryId, |
| | | @Param("quantity") Integer quantity); |
| | | |
| | |
| | | |
| | | List<MaterialLog> exportMaterialLogReport(List<LocalDate> dates, String type); |
| | | |
| | | List<MaterialOutbound> getSelectMaterialOutboundProjectNo(@Param("projectNo") String projectNo); |
| | | |
| | | OptimizeUse getSelectOptimizeUses(@Param("projectNo") String projectNo,@Param("width") Double width,@Param("height") Double height); |
| | | |
| | | List<MaterialOutboundDetail> getSelectMaterialOutboundOptimizeUses(@Param("materialOutboundId") String materialOutboundId,@Param("useId") Integer useId); |
| | | |
| | | Boolean updateMaterialOutboundOptimizeUses(@Param("useId") Integer useId,@Param("quantity") Integer quantity); |
| | | |
| | | Boolean insertMaterialOutboundDetailOptimizeUses(@Param("materialOutboundId") String materialOutboundId,@Param("number") Integer number, |
| | | @Param("inventoryId") Long inventoryId,@Param("materialCode") Long materialCode,@Param("inventoryArea") String inventory_area, |
| | | @Param("useId") Integer useId,@Param("outboundQuantity") Integer outboundQuantity, |
| | | @Param("singlePieceArea") Double singlePieceArea,@Param("dateOfManufacture") LocalDate dateOfManufacture); |
| | | |
| | | Boolean insertMaterialOutboundOptimizeUses(@Param("materialOutboundId") String materialOutboundId,@Param("projectNo") String projectNo, |
| | | @Param("name") String name); |
| | | |
| | | Boolean updateOptimizeUsesMes(@Param("useId") Integer useId,@Param("quantity") Integer quantity); |
| | | |
| | | } |
| | |
| | | package com.example.erp.service.mm; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.example.erp.common.Constants; |
| | | import com.example.erp.dto.mm.FinishedOperateLogDTO; |
| | | import com.example.erp.entity.mm.*; |
| | | import com.example.erp.entity.pp.FlowCard; |
| | | import com.example.erp.entity.pp.OptimizeUse; |
| | | import com.example.erp.entity.pp.*; |
| | | import com.example.erp.entity.sd.Delivery; |
| | | import com.example.erp.entity.sd.DeliveryDetail; |
| | | import com.example.erp.entity.sd.OrderDetail; |
| | | import com.example.erp.entity.sd.OrderProcessDetail; |
| | | import com.example.erp.entity.userInfo.Log; |
| | | import com.example.erp.entity.userInfo.SysError; |
| | | import com.example.erp.exception.ServiceException; |
| | | import com.example.erp.mapper.mm.BasicWarehouseTypeMapper; |
| | | import com.example.erp.mapper.mm.MaterialInventoryMapper; |
| | | import com.example.erp.mapper.mm.MaterialLogMapper; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | import java.util.ArrayList; |
| | | |
| | |
| | | |
| | | |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean mesMaterialOutbound(Map<String, Object> reportingWorkMap) { |
| | | boolean saveState=true; |
| | | Object savePoint = TransactionAspectSupport.currentTransactionStatus().createSavepoint(); |
| | | try { |
| | | //接收解析主附表信息 |
| | | JSONObject reportingWorkJson = new JSONObject(reportingWorkMap); |
| | | String projectNo=reportingWorkJson.get("projectNo").toString(); |
| | | Double width= Double.valueOf(reportingWorkJson.get("width").toString()); |
| | | Double height= Double.valueOf(reportingWorkJson.get("height").toString()); |
| | | Integer quantity= Integer.valueOf(reportingWorkJson.get("quantity").toString()); |
| | | |
| | | List<MaterialOutbound> materialOutboundList=materialInventoryMapper.getSelectMaterialOutboundProjectNo(projectNo); |
| | | OptimizeUse optimizeUses=materialInventoryMapper.getSelectOptimizeUses(projectNo,width,height); |
| | | |
| | | |
| | | MaterialInventory materialInventory=materialInventoryMapper.getMaterialInventoryById(Long.valueOf(optimizeUses.getRawStockCode())); |
| | | if(materialOutboundList.size()==1){ |
| | | List<MaterialOutboundDetail> materialOutboundDetailList=materialInventoryMapper.getSelectMaterialOutboundOptimizeUses(materialOutboundList.get(0).getMaterialOutboundId(),optimizeUses.getId()); |
| | | List<MaterialOutboundDetail> materialOutboundDetailList1=materialInventoryMapper.getSelectMaterialOutboundOptimizeUses(materialOutboundList.get(0).getMaterialOutboundId(),null); |
| | | if(materialOutboundDetailList.size()==1){ |
| | | materialInventoryMapper.updateMaterialOutboundOptimizeUses(optimizeUses.getId(),quantity); |
| | | }else{ |
| | | materialInventoryMapper.insertMaterialOutboundDetailOptimizeUses(materialOutboundList.get(0).getMaterialOutboundId(), |
| | | materialOutboundDetailList1.size()+1,Long.valueOf(optimizeUses.getRawStockCode()),materialInventory.getMaterialCode(),materialInventory.getInventoryArea(), |
| | | optimizeUses.getId(),quantity,materialInventory.getSinglePieceArea(),materialInventory.getDateOfManufacture()); |
| | | } |
| | | }else if(materialOutboundList.isEmpty()){ |
| | | String oddNumber = orderNumberSetting("出库"); |
| | | materialInventoryMapper.insertMaterialOutboundOptimizeUses(oddNumber,projectNo,reportingWorkJson.get("userName").toString()); |
| | | materialInventoryMapper.insertMaterialOutboundDetailOptimizeUses(oddNumber, 1,Long.valueOf(optimizeUses.getRawStockCode()),materialInventory.getMaterialCode(),materialInventory.getInventoryArea(), |
| | | optimizeUses.getId(),quantity,materialInventory.getSinglePieceArea(),materialInventory.getDateOfManufacture()); |
| | | }else{ |
| | | return false; |
| | | } |
| | | materialInventoryMapper.updateMaterialInventoryAvailableInventoryOutMes(Long.valueOf(optimizeUses.getRawStockCode()),quantity); |
| | | materialInventoryMapper.updateOptimizeUsesMes(optimizeUses.getId(),quantity); |
| | | |
| | | //保存日志 |
| | | Log log = new Log(); |
| | | log.setContent(reportingWorkMap.toString()); |
| | | log.setFunction("mesMaterialOutbound报工新增"); |
| | | log.setOperatorId((String) reportingWorkJson.get("userId")); |
| | | log.setOperator((String) reportingWorkJson.get("userName")); |
| | | logService.saveLog(log); |
| | | } catch (Exception e) { |
| | | TransactionAspectSupport.currentTransactionStatus().rollbackToSavepoint(savePoint); |
| | | //将异常传入数据库 |
| | | SysError sysError = new SysError(); |
| | | sysError.setError(e+Arrays.toString(e.getStackTrace())); |
| | | sysError.setFunc("mesMaterialOutbound报工新增"); |
| | | sysErrorService.insert(sysError); |
| | | saveState = false; |
| | | |
| | | } |
| | | return saveState; |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | orderProductDetailMap.put("productId",map.get("productId")); |
| | | orderProductDetailMap.put("productName",map.get("productName")); |
| | | List<OrderDetail> orderDetails = orderDetailMapper.getOrderProductByProductId(map.get("productId"),orderId); |
| | | orderDetails.forEach(orderDetail->{ |
| | | |
| | | List<OrderGlassDetail> orderGlassDetails = |
| | | orderGlassDetailMapper.selectList( |
| | | new QueryWrapper<OrderGlassDetail>(). |
| | | eq("order_id",orderId). |
| | | eq("order_number",orderDetail.getOrderNumber()) |
| | | ); |
| | | Integer differentSize = orderGlassDetailMapper.getDifferentSizeNumber(orderId,orderDetail.getOrderNumber()); |
| | | orderDetail.setDifferentSize(differentSize); |
| | | orderDetail.setOrderGlassDetails(orderGlassDetails); |
| | | }); |
| | | |
| | | orderProductDetailMap.put("productDetail",orderDetails); |
| | | orderProductDetail.add(orderProductDetailMap); |
| | | }); |
| | |
| | | }else{ |
| | | orderProductDistinct = orderDetailMapper.getOrderProductDistinctById(orderId); |
| | | } |
| | | |
| | | List<Map<String,Object>> orderProductDetail = new ArrayList<>(); |
| | | orderProductDistinct.forEach(map->{ |
| | | Map<String,Object> orderProductDetailMap = new HashMap<>(); |
| | | orderProductDetailMap.put("productId",map.get("productId")); |
| | | orderProductDetailMap.put("productName",map.get("productName")); |
| | | List<OrderDetail> orderDetails = orderDetailMapper.getOrderProductByProductId(map.get("productId"),orderId); |
| | | orderDetails.forEach(orderDetail->{ |
| | | |
| | | List<OrderGlassDetail> orderGlassDetails = |
| | | orderGlassDetailMapper.selectList( |
| | | new QueryWrapper<OrderGlassDetail>(). |
| | | eq("order_id",orderId). |
| | | eq("order_number",orderDetail.getOrderNumber()) |
| | | ); |
| | | Integer differentSize = orderGlassDetailMapper.getDifferentSizeNumber(orderId,orderDetail.getOrderNumber()); |
| | | orderDetail.setDifferentSize(differentSize); |
| | | orderDetail.setOrderGlassDetails(orderGlassDetails); |
| | | }); |
| | | |
| | | |
| | | orderProductDetailMap.put("productDetail",orderDetails); |
| | |
| | | where id=#{inventoryId} |
| | | </update> |
| | | |
| | | <update id="updateMaterialInventoryAvailableInventoryOutMes"> |
| | | update mm.material_inventory |
| | | set available_quantity=available_quantity-#{quantity},inventory_quantity=inventory_quantity-#{quantity}, |
| | | plan_quantity=plan_quantity-#{quantity},total_area=inventory_quantity*single_piece_area |
| | | where id=#{inventoryId} |
| | | </update> |
| | | |
| | | |
| | | <update id="updateMaterialOutboundToExamine"> |
| | | update mm.material_outbound set reviewed_state=#{reviewedState},reviewed=#{reviewed},reviewed_time=now() |
| | |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="getSelectMaterialOutboundProjectNo"> |
| | | select * from mm.material_outbound mo where order_id=#{projectNo} |
| | | </select> |
| | | |
| | | <select id="getSelectOptimizeUses"> |
| | | select * from pp.optimize_use where project_no=#{projectNo} and width=#{width} and height=#{height} and state=1 |
| | | </select> |
| | | |
| | | <select id="getSelectMaterialOutboundOptimizeUses"> |
| | | select * from mm.material_outbound_detail mo |
| | | <where> |
| | | mo.material_outbound_id=#{materialOutboundId} |
| | | <if test="useId != null"> |
| | | and mo.use_id=#{useId} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="updateMaterialOutboundOptimizeUses"> |
| | | update mm.material_outbound_detail set outbound_quantity=outbound_quantity+#{quantity} where use_id=#{useId}; |
| | | </select> |
| | | |
| | | <select id="updateOptimizeUsesMes"> |
| | | update pp.optimize_use set not_use_count=not_use_count-#{quantity} where id=#{useId}; |
| | | </select> |
| | | |
| | | <insert id="insertMaterialOutboundDetailOptimizeUses" useGeneratedKeys="true" > |
| | | insert into mm.material_outbound_detail (material_outbound_id,material_outbound_number,material_code,use_id,inventory_id,inventory_organization, |
| | | outbound_quantity,single_piece_area,inventory_area,date_of_manufacture) |
| | | values ( |
| | | #{materialOutboundId} ,#{number},#{materialCode},#{useId},#{inventoryId},'原片库',#{outboundQuantity}, |
| | | #{singlePieceArea},#{inventoryArea},#{dateOfManufacture} |
| | | ) |
| | | </insert> |
| | | |
| | | <insert id="insertMaterialOutboundOptimizeUses" useGeneratedKeys="true" > |
| | | insert into mm.material_outbound(material_outbound_id,order_id,outbound_type, |
| | | warehouse_manager,material_requisition_date,reviewed_state,reviewed,create_time,reviewed_time) |
| | | values ( |
| | | #{materialOutboundId} ,#{projectNo},'标准出库',#{name},now(),1,#{name},now(),now() |
| | | ) |
| | | </insert> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | fc.quantity, |
| | | round(ogd.total_area, 2) as total_area, |
| | | od.perimeter, |
| | | if(od.bend_radius!=null,od.bend_radius,JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S04'))) as bend_radius, |
| | | if(od.bend_radius!=null || od.bend_radius!='',od.bend_radius,if(od.shape=2,JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S04')),'')) as bend_radius, |
| | | concat(IFNULL(od.processing_note, ''), IFNULL(od.remarks, '')) as remarks, |
| | | od.other_columns, |
| | | round(ogd.child_width) as width, |
| | |
| | | fc.quantity, |
| | | round(ogd.total_area, 2) as total_area, |
| | | od.perimeter, |
| | | if(od.bend_radius!=null,od.bend_radius,JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S04'))) as bend_radius, |
| | | if(od.bend_radius!=null || od.bend_radius!='',od.bend_radius,if(od.shape=2,JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S04')),'')) as bend_radius, |
| | | concat(IFNULL(od.processing_note, ''), IFNULL(od.remarks, '')) as remarks, |
| | | od.other_columns, |
| | | round(ogd.child_width) as width, |
| | |
| | | sum(pl.patch_num) as quantity, |
| | | round(ogd.total_area, 2) as total_area, |
| | | od.perimeter, |
| | | if(od.bend_radius!=null,od.bend_radius,JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S04'))) as bend_radius, |
| | | if(od.bend_radius!=null || od.bend_radius!='',od.bend_radius,if(od.shape=2,JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S04')),'')) as bend_radius, |
| | | concat(IFNULL(od.processing_note, ''), IFNULL(od.remarks, '')) as remarks, |
| | | od.other_columns, |
| | | round(ogd.child_width) as width, |