Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override
| | |
| | | {field: 'shippedQuantity',slots: { default: 'show'},width: 120, title: t('delivery.deliveryQuantity')}, |
| | | {field: 'inventory',slots: { default: 'show'},width: 120, title: t('productStock.inventoryQuantity')}, |
| | | {field: 'inventoryArea',slots: { default: 'show'},width: 120, title: t('report.inventoryArea')}, |
| | | {field: 'StorageArea',slots: { default: 'show'},width: 120, title: t('report.StorageArea')}, |
| | | {field: 'broken_num',width: 90, title: t('reportingWorks.quantityBroken')}, |
| | | ] |
| | | let column = [0,1,3,8,10,11,12,13] |
| | | let column = [0,1,3,8,10,11,12,13,14] |
| | | let orderType = ref(1) |
| | | |
| | | onMounted(()=>{ |
| | |
| | | gridOptions.columns.forEach(item =>{ |
| | | item.filterMethod = filterChanged |
| | | }) |
| | | list.value = ['quantity','inventory','inventoryArea','gross_area','shippedQuantity','glassQuantity'] |
| | | list.value = ['quantity','inventory','inventoryArea','gross_area','shippedQuantity','glassQuantity','StorageArea'] |
| | | title.value = res.data.title |
| | | res.data.title.forEach((item,index) =>{ |
| | | list.value.push('reportWorkQuantity.'+item.process) |
| | |
| | | finished :'معدل المنتجات النهائية', |
| | | finishedProductReport :'تقرير المنتجات النهائية', |
| | | workProcessName:'在制品名称', |
| | | StorageArea:'入库面积' |
| | | }, |
| | | productionBasicData:{ |
| | | page:{ |
| | |
| | | finished :'Rate of finished product', |
| | | finishedProductReport :'Finished product report', |
| | | workProcessName:'在制品名称', |
| | | StorageArea:'入库面积' |
| | | }, |
| | | productionBasicData:{ |
| | | page:{ |
| | |
| | | finished :'양품률', |
| | | finishedProductReport :'완제품 보고서', |
| | | workProcessName:'在制品名称', |
| | | StorageArea:'入库面积' |
| | | }, |
| | | productionBasicData:{ |
| | | page:{ |
| | |
| | | finished :'Коэффициент готовой продукции', |
| | | finishedProductReport :'Отчет о готовой продукции', |
| | | workProcessName:'在制品名称', |
| | | StorageArea:'入库面积' |
| | | }, |
| | | productionBasicData:{ |
| | | page:{ |
| | |
| | | finished :'成品率', |
| | | finishedProductReport :'成品报表', |
| | | workProcessName:'在制品名称', |
| | | StorageArea:'入库面积' |
| | | |
| | | }, |
| | | productionBasicData:{ |
| | | page:{ |
| | |
| | | |
| | | |
| | | function filterChanged(column){ |
| | | //gridOptions.loading=true |
| | | //筛选条件发生变化条件发生变化 |
| | | let value = column.datas[0]!=undefined?column.datas[0]:'' |
| | | value = value.trim() |
| | |
| | | total.pageTotal=parseInt(res.data.total) |
| | | pageNum.value=1 |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.reloadData(produceList) |
| | | xGrid.value.loadData(produceList) |
| | | gridOptions.loading=false |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | |
| | | }else{ |
| | | filterData.value[column.property] = value |
| | | } |
| | | gridOptions.loading = true |
| | | |
| | | const rawStart = new Date(form.date1[0]); |
| | | const rawEnd = new Date(form.date1[1]); |
| | |
| | | produceList.forEach(item => { |
| | | item.mmTotal = sumMmValues(item.workProcessName); |
| | | }); |
| | | xGrid.value.reloadData(produceList) |
| | | xGrid.value.loadData(produceList) |
| | | |
| | | gridOptions.loading=false |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | |
| | | function filterChanged(column){ |
| | | gridOptions.loading = true |
| | | //筛选条件发生变化条件发生变化 |
| | | let value = column.datas[0] != undefined ? column.datas[0] : '' |
| | | let value = column.datas[0]!=undefined?column.datas[0]:'' |
| | | value = value.trim() |
| | | //判断是否存在外键 |
| | | if (column.property.indexOf('.') > -1) { |
| | | const columnArr = column.property.split('.') |
| | | if (column.property.indexOf('.')>-1){ |
| | | const columnArr = column.property.split('.') |
| | | filterData.value[columnArr[0]] = { |
| | | [columnArr[1]]: value |
| | | [columnArr[1]]:value |
| | | } |
| | | } else { |
| | | }else{ |
| | | filterData.value[column.property] = value |
| | | } |
| | | |
| | |
| | | total.pageTotal = res.data.total.pageTotal |
| | | pageTotal.value = res.data.total |
| | | total.value = res.data.total |
| | | res.data.data.forEach(item => { |
| | | produceList = deepClone(res.data.data) |
| | | produceList.forEach(item => { |
| | | // 如果 shape 可能是字符串就用 ==,如果一定是数字就用 === |
| | | item.shape = (item.shape == 2) ? t('order.alien') : t('order.universalShape'); |
| | | }); |
| | | xGrid.value.reloadData(res.data.data) |
| | | xGrid.value.loadData(produceList) |
| | | gridOptions.loading = false |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | |
| | | useKey: true |
| | | }, |
| | | filterConfig: { //筛选配置项 |
| | | // remote: true |
| | | remote: true |
| | | }, |
| | | customConfig: { |
| | | storage: true |
| | |
| | | |
| | | @Mapper |
| | | public interface DamageDetailsMapper extends BaseMapper<DamageDetails> { |
| | | Integer getBehindDamageSum(String processId, String orderNumber, String technologyNumber, String behindProcess); |
| | | } |
| | |
| | | List<Map<String, Object>> getOptimizeOffsetsInfo(String processId); |
| | | |
| | | int deleteOptimizeOffcut(String projectNumber); |
| | | |
| | | void updateNormalDetails(Map<String, Object> detail, String processId); |
| | | |
| | | void deleteOffcutDetails(String processId); |
| | | |
| | | void addUpdateOffcut(Map<String, Object> detail, String processId, String glassType, String glassThickness); |
| | | } |
| | |
| | | String selectNextProcess(String processId, String technologyNumber, String thisProcess, String orderNumber); |
| | | |
| | | List<Map<String, String>> selectShiftQuantitySv(String creatorId, String startDatetime, String endDatetime, String step); |
| | | |
| | | String getBehindProcess(String processId, String orderNumber, String technologyNumber, String thisProcess,String orderId); |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | public Boolean updateOptimizeResult(Map<String, Object> object,String processId){ |
| | | public Boolean updateOptimizeResult(Map<String, Object> object, String processId) { |
| | | try { |
| | | ObjectMapper mapper = new ObjectMapper(); |
| | | |
| | | List<Map<String, Object>> objectMapList = (List<Map<String, Object>>) object.get("layouts"); |
| | | |
| | | Map<String, Object> glassInfo = glassOptimizeMapper.getGlassInfo(processId); |
| | | |
| | | for (Map<String, Object> objectMap : objectMapList) { |
| | | List<Map<String, Object>> objectMap2 = (List<Map<String, Object>>) objectMap.get("glassDetails"); |
| | | |
| | | // 分离 glassDetails 为两部分 |
| | | List<Map<String, Object>> normalDetails = new ArrayList<>(); // isRemain 为 false 的部分 |
| | | List<Map<String, Object>> offCutDetails = new ArrayList<>(); // isRemain 为 true 的部分 |
| | | |
| | | for (Map<String, Object> detail : objectMap2) { |
| | | boolean isRemain = false; |
| | | if (detail.containsKey("isRemain")) { |
| | | Object isRemainObj = detail.get("isRemain"); |
| | | if (isRemainObj != null) { |
| | | if (isRemainObj instanceof Number) { |
| | | // 数字类型: 1表示true,0表示false |
| | | isRemain = ((Number) isRemainObj).intValue() == 1; |
| | | } else if (isRemainObj instanceof Boolean) { |
| | | // 布尔类型 |
| | | isRemain = (Boolean) isRemainObj; |
| | | } else { |
| | | // 字符串类型: "1"/"true"表示true,"0"/"false"表示false |
| | | String isRemainStr = isRemainObj.toString().toLowerCase(); |
| | | isRemain = "1".equals(isRemainStr) || "true".equals(isRemainStr); |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (isRemain) { |
| | | offCutDetails.add(detail); |
| | | } else { |
| | | normalDetails.add(detail); |
| | | } |
| | | } |
| | | |
| | | // 保存所有数据到 optimize_detail |
| | | if (!normalDetails.isEmpty()) { |
| | | for (Map<String, Object> detail : normalDetails) { |
| | | glassOptimizeMapper.updateNormalDetails(detail, processId); |
| | | } |
| | | } |
| | | |
| | | // 例如对 remainDetails 部分先删除 offcut 再处理 |
| | | if (!offCutDetails.isEmpty()) { |
| | | glassOptimizeMapper.deleteOffcutDetails(processId); |
| | | if (glassInfo != null) { |
| | | String glassType = (String) glassInfo.get("glass_type"); |
| | | String glassThickness = (String) glassInfo.get("glass_thickness"); |
| | | // 余料存入optimizeoffcut |
| | | for (Map<String, Object> detail : offCutDetails) { |
| | | glassOptimizeMapper.addUpdateOffcut(detail, processId, glassType, glassThickness); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | // 更新优化结果文件 |
| | | String jsonString = mapper.writeValueAsString(object); |
| | | glassOptimizeMapper.updateOptimizeResult(jsonString,processId); |
| | | glassOptimizeMapper.updateOptimizeResult(jsonString, processId); |
| | | |
| | | return true; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | |
| | | import com.alibaba.fastjson.TypeReference; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.example.erp.dto.pp.*; |
| | | import com.example.erp.entity.pp.DamageDetails; |
| | | import com.example.erp.entity.pp.Report; |
| | | import com.example.erp.entity.sd.BasicData; |
| | | import com.example.erp.entity.sd.OrderDetail; |
| | | import com.example.erp.entity.sd.OrderGlassDetail; |
| | | import com.example.erp.entity.sd.ProductDetail; |
| | | import com.example.erp.mapper.pp.FlowCardMapper; |
| | | import com.example.erp.mapper.pp.ProductionSchedulingMapper; |
| | | import com.example.erp.mapper.pp.ReportMapper; |
| | | import com.example.erp.mapper.pp.ReportingWorkMapper; |
| | | import com.example.erp.mapper.pp.*; |
| | | import com.example.erp.mapper.sd.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | |
| | | private final BasicDataMapper basicDataMapper; |
| | | private final ProductDetailMapper productDetailMapper; |
| | | private final OrderDetailMapper orderDetailMapper; |
| | | private final DamageDetailsMapper damageDetailsMapper; |
| | | |
| | | FlowCardMapper flowCardMapper; |
| | | private ReportingWorkMapper reportingWorkMapper; |
| | |
| | | ProductionSchedulingMapper productionSchedulingMapper, FlowCardMapper flowCardMapper, |
| | | OrderGlassDetailMapper orderGlassDetailMapper, BasicDataMapper basicDataMapper, |
| | | ProductDetailMapper productDetailMapper, OrderDetailMapper orderDetailMapper, |
| | | ReportingWorkMapper reportingWorkMapper) { |
| | | ReportingWorkMapper reportingWorkMapper, DamageDetailsMapper damageDetailsMapper) { |
| | | this.reportMapper = reportMapper; |
| | | this.orderProcessDetailMapper = orderProcessDetailMapper; |
| | | this.productionSchedulingMapper = productionSchedulingMapper; |
| | |
| | | this.productDetailMapper = productDetailMapper; |
| | | this.orderDetailMapper = orderDetailMapper; |
| | | this.reportingWorkMapper = reportingWorkMapper; |
| | | this.damageDetailsMapper = damageDetailsMapper; |
| | | } |
| | | |
| | | //流程卡进度方法 |
| | |
| | | //判断磨边和磨边后工序 |
| | | //Objects.equals(basicData.getNickname(), "stepA") || Objects.equals(basicData.getNickname(), "stepC") |
| | | if(Objects.equals(basicData.getNickname(), "stepA") || Objects.equals(basicData.getNickname(), "stepC")){ |
| | | clos.put(uniqueList.get(i).get("process"), 15+i); |
| | | clos.put(uniqueList.get(i).get("process"), 16+i); |
| | | } |
| | | //判断中空和中空后工序 |
| | | //Objects.equals(basicData.getNickname(), "stepB") || Objects.equals(basicData.getNickname(), "stepD") |
| | |
| | | Map<String, String> data = JSON.parseObject(dataList.get(i).get("reportWorkQuantity"), |
| | | new TypeReference<Map<String, String>>() { |
| | | }); |
| | | Map<String, String> dataShow = JSON.parseObject(dataList.get(i).get("reportWorkQuantityShow"), |
| | | new TypeReference<Map<String, String>>() { |
| | | }); |
| | | //判断后工序此流程卡号是否有次破 |
| | | List<DamageDetails> hasBreak = damageDetailsMapper |
| | | .selectList(new LambdaQueryWrapper<DamageDetails>() |
| | | .eq(DamageDetails::getProcessId, dataList.get(i).get("processId")) |
| | | .eq(DamageDetails::getOrderNumber, dataList.get(i).get("order_number")) |
| | | .eq(DamageDetails::getTechnologyNumber, dataList.get(i).get("technology_number")) |
| | | .eq(DamageDetails::getPatchStatus, 0) |
| | | .gt(DamageDetails::getBreakageQuantity,0) |
| | | |
| | | ); |
| | | if(!hasBreak.isEmpty()){ |
| | | int finalI = i; |
| | | data.forEach((thisProcess, index)->{ |
| | | String behindProcess = orderProcessDetailMapper.getBehindProcess( |
| | | dataList.get(finalI).get("processId"), |
| | | String.valueOf(dataList.get(finalI).get("order_number")), |
| | | String.valueOf(dataList.get(finalI).get("technology_number")), |
| | | thisProcess, |
| | | orderId |
| | | ); |
| | | if(behindProcess!=null &&!behindProcess.isEmpty()){ |
| | | Integer behindDamageSum = damageDetailsMapper.getBehindDamageSum( |
| | | dataList.get(finalI).get("processId"), |
| | | String.valueOf(dataList.get(finalI).get("order_number")), |
| | | String.valueOf(dataList.get(finalI).get("technology_number")), |
| | | behindProcess |
| | | ); |
| | | if(behindDamageSum>0){ |
| | | data.put(thisProcess, String.valueOf(Integer.parseInt(data.get(thisProcess) )- behindDamageSum)); |
| | | dataShow.put(thisProcess, String.valueOf(Integer.parseInt(dataShow.get(thisProcess) )- behindDamageSum)); |
| | | } |
| | | |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | Integer max = orderGlassDetailMapper |
| | | .getMaxTechnologyNumberByGroup(dataList.get(i).get("order_id"), |
| | | String.valueOf(dataList.get(i).get("order_number")), |
| | |
| | | } |
| | | } |
| | | dataList.get(i).put("reportWorkQuantity",JSON.toJSONString(data)); |
| | | dataList.get(i).put("reportWorkQuantityShow",JSON.toJSONString(dataShow)); |
| | | |
| | | } |
| | | } |
| 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.DamageDetailsMapper"> |
| | | <select id="getBehindDamageSum"> |
| | | SELECT ifnull(SUM(a.breakage_quantity),0) |
| | | FROM pp.damage_details as a |
| | | left join pp.reporting_work as b |
| | | on a.reporting_work_id = b.reporting_work_id |
| | | WHERE a.process_id = #{processId} |
| | | and a.order_number = #{orderNumber} |
| | | and a.technology_number =#{technologyNumber} |
| | | and a.breakage_quantity>0 |
| | | and a.patch_status=0 |
| | | and b.reviewed_state>=0 |
| | | and b.this_process in (SUBSTRING_INDEX(#{behindProcess},',',1)) |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | stock_id, |
| | | width, |
| | | height, |
| | | realwidth, |
| | | realheight, |
| | | usage_rate, |
| | | stock_code, |
| | | up_trim, |
| | |
| | | #{glass.stockId}, |
| | | #{glass.width}, |
| | | #{glass.height}, |
| | | #{glass.realWidth}, |
| | | #{glass.realHeight}, |
| | | #{glass.usageRate}, |
| | | #{glass.stockCode}, |
| | | #{glass.upTrim}, |
| | |
| | | #{glassThickness} |
| | | |
| | | ) |
| | | </insert> |
| | | <insert id="addUpdateOffcut"> |
| | | INSERT INTO pp.optimize_offcut ( |
| | | project_no, |
| | | stock_id, |
| | | width, |
| | | height, |
| | | x_axis, |
| | | y_axis, |
| | | model, |
| | | thickness |
| | | ) VALUES ( |
| | | #{processId}, |
| | | 1, |
| | | #{detail.width}, |
| | | #{detail.height}, |
| | | #{detail.x}, |
| | | #{detail.y}, |
| | | #{glassType}, |
| | | #{glassThickness}) |
| | | </insert> |
| | | |
| | | |
| | |
| | | UPDATE pp.flow_card |
| | | SET rack = #{rackValue} |
| | | WHERE process_id = #{processId} AND technology_number = #{technologyNumber} |
| | | </update> |
| | | <update id="updateNormalDetails"> |
| | | UPDATE pp.optimize_detail |
| | | SET |
| | | x_axis = #{detail.x}, |
| | | y_axis = #{detail.y} |
| | | WHERE |
| | | project_no = #{processId} AND polys_id = #{detail.polySort} |
| | | </update> |
| | | |
| | | <select id="simulatedTypesettingUsingOpt"> |
| | |
| | | WHERE |
| | | project_no = #{projectNumber} |
| | | </delete> |
| | | <delete id="deleteOffcutDetails"> |
| | | delete from pp.optimize_offcut where project_no = #{processId} |
| | | </delete> |
| | | |
| | | |
| | | <select id="selectOptimizeProject"> |
| | |
| | | SELECT |
| | | width, |
| | | height, |
| | | realwidth, |
| | | realheight, |
| | | stock_id AS stockId, |
| | | stock_code AS stockCode, |
| | | usage_rate AS usageRate, |
| | |
| | | b.glass_child, |
| | | d.order_type, |
| | | concat(c.process_id, '/', c.technology_number) as process_id, |
| | | c.process_id as 'processId', |
| | | c.order_id, |
| | | c.order_number, |
| | | c.technology_number, |
| | |
| | | c.quantity-ifnull(c.termination_quantity,0) as glassQuantity, |
| | | |
| | | c.quantity-ifnull(c.termination_quantity,0) as quantityShow, |
| | | (c.quantity-ifnull(c.termination_quantity,0))*a.area as grossAreaShow, |
| | | (c.quantity-ifnull(c.termination_quantity,0))*a.compute_area as grossAreaShow, |
| | | ifnull(f.inventory, 0) as inventoryShow, |
| | | round(ifnull(f.inventory, 0) * a.area, 2) as inventoryAreaShow, |
| | | ifnull(dd.quantity, 0) as shippedQuantityShow, |
| | | round(ifnull(f.inventory, 0) * a.compute_area, 2) as inventoryAreaShow, -- 库存面积 |
| | | ifnull(dd.quantity, 0) as shippedQuantityShow, -- 发货数量 |
| | | (ifnull(c.received_quantity, 0))*a.compute_area as StorageAreaShow,-- 入库面积 |
| | | |
| | | if(c.technology_number=1,(c.quantity-ifnull(c.termination_quantity,0))*a.area,0) as grossArea, |
| | | if(c.technology_number=1,(c.quantity-ifnull(c.termination_quantity,0))*a.compute_area,0) as grossArea, |
| | | if(c.technology_number=1,ifnull(f.inventory, 0) ,0) as inventory, |
| | | if(c.technology_number=1,round(ifnull(f.inventory, 0) * a.area, 2),0) as inventoryArea, |
| | | if(c.technology_number=1,round(ifnull(f.inventory, 0) * a.compute_area, 2),0) as inventoryArea, |
| | | if(c.technology_number=1,ifnull(dd.quantity, 0) ,0) as shippedQuantity, |
| | | if(c.technology_number=1,(ifnull(c.received_quantity, 0))*a.compute_area,0) as StorageArea, |
| | | |
| | | |
| | | ifnull(JSON_UNQUOTE(JSON_EXTRACT(a.other_columns, '$.S01')),'') AS glassNumber, |
| | |
| | | group by e.order_number |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="getBehindProcess"> |
| | | select group_concat(process) from sd.order_process_detail as a |
| | | where a.order_id = #{orderId} |
| | | and a.process_id = #{processId} |
| | | and a.order_number =#{orderNumber} |
| | | and a.technology_number =#{technologyNumber} |
| | | and a.id>(select id |
| | | from sd.order_process_detail as b |
| | | where b.order_id = #{orderId} |
| | | and b.process_id = #{processId} |
| | | and b.order_number =#{orderNumber} |
| | | and b.technology_number =#{technologyNumber} |
| | | and b.process = #{thisProcess} |
| | | ) |
| | | </select> |
| | | </mapper> |