| | |
| | | return R.ok(mobileService.getDynamicFields()); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:asnOrderItem:list')") |
| | | @GetMapping("/palletConfig") |
| | | @ApiOperation("PDA组盘页配置(如是否强制WMS单号)") |
| | | public R getPdaPalletConfig() { |
| | | return mobileService.getPdaPalletConfig(); |
| | | } |
| | | |
| | | |
| | | @PreAuthorize("hasAuthority('manager:asnOrderItem:list')") |
| | | @ApiOperation("获取订单物料明细") |
| | |
| | | |
| | | List<Fields> getDynamicFields(); |
| | | |
| | | /** PDA 组盘:是否强制 WMS 单号 */ |
| | | R getPdaPalletConfig(); |
| | | |
| | | R getDeltByCode(Map<String, String> params); |
| | | |
| | | WaitPakin mergeItems(WaitPakinParam waitPakin, Long userId); |
| | |
| | | .eq(Fields::getStatus, 1).orderByAsc(Fields::getId)); |
| | | } |
| | | |
| | | @Override |
| | | public R getPdaPalletConfig() { |
| | | Map<String, Object> data = new HashMap<>(2); |
| | | data.put("pdaPakinAsnRequired", isPdaPakinAsnRequired()); |
| | | return R.ok(data); |
| | | } |
| | | |
| | | /** PDA 组盘是否强制传 WMS 单号(无配置或缺省时按 true) */ |
| | | private boolean isPdaPakinAsnRequired() { |
| | | Config c = configService.getOne(new LambdaQueryWrapper<Config>() |
| | | .eq(Config::getFlag, GlobalConfigCode.PDA_PAKIN_ASN_REQUIRED) |
| | | .eq(Config::getDeleted, 0) |
| | | .last("LIMIT 1")); |
| | | boolean required = true; |
| | | if (c != null && StringUtils.isNotBlank(c.getVal())) { |
| | | String v = c.getVal().trim(); |
| | | required = Boolean.parseBoolean(v) || "1".equals(v); |
| | | } |
| | | return required; |
| | | } |
| | | |
| | | /** |
| | | * @param |
| | | * @return |
| | |
| | | asnCode = null; |
| | | } |
| | | } |
| | | if (isPdaPakinAsnRequired() && Cools.isEmpty(asnCode)) { |
| | | return R.error("请先扫描WMS单号"); |
| | | } |
| | | String crushNo = params.get("fieldsIndex"); |
| | | String batch = params.get("batch"); |
| | | // String barcode = params.get("barcode"); |
| | |
| | | if (StringUtils.isBlank(waitPakin.getBarcode())) { |
| | | throw new CoolException("参数错误:料箱码为空!!"); |
| | | } |
| | | if (isPdaPakinAsnRequired()) { |
| | | for (PakinItem it : waitPakin.getItems()) { |
| | | if (StringUtils.isBlank(it.getAsnCode())) { |
| | | throw new CoolException("请先扫描WMS单号"); |
| | | } |
| | | } |
| | | } |
| | | WaitPakin pakin = waitPakinService.getOne(new LambdaQueryWrapper<WaitPakin>() |
| | | .eq(WaitPakin::getBarcode, waitPakin.getBarcode())); |
| | | |
| | |
| | | |
| | | return R.ok("Delete Success").add(pakinIds); |
| | | } |
| | | |
| | | private boolean isPdaPakinAsnRequired() { |
| | | Config c = configService.getOne(new LambdaQueryWrapper<Config>() |
| | | .eq(Config::getFlag, GlobalConfigCode.PDA_PAKIN_ASN_REQUIRED) |
| | | .eq(Config::getDeleted, 0) |
| | | .last("LIMIT 1")); |
| | | boolean required = true; |
| | | if (c != null && StringUtils.isNotBlank(c.getVal())) { |
| | | String v = c.getVal().trim(); |
| | | required = Boolean.parseBoolean(v) || "1".equals(v); |
| | | } |
| | | return required; |
| | | } |
| | | } |
| | |
| | | |
| | | public final static String EXECUTION = "Execution"; |
| | | |
| | | /** PDA 组盘页是否强制录入 WMS 单号(sys_config.type=1,val=true/1 必填;false/0 则物料与单号二选一) */ |
| | | public final static String PDA_PAKIN_ASN_REQUIRED = "PDA_PAKIN_ASN_REQUIRED"; |
| | | |
| | | /**直接组托*/ |
| | | public final static String DIRECT_WAIT_PAKIN = "DirectWaitPakin"; |
| | | /**收货时是否允许超收*/ |
| New file |
| | |
| | | -- 补收货区:ASN 单 2601-251226002 (id=7207) 与明细可组托查询一致 |
| | | -- 执行前请确认存在 type='receipt' 的 man_warehouse_areas;若你库字典值不同,改子查询条件 |
| | | -- tenant_id=1 与主单一致;可组托计算:anfme - 已组托 - qty,这里 qty/work_qty=0 |
| | | |
| | | SET @area_id = (SELECT id FROM man_warehouse_areas WHERE `type` = 'receipt' AND deleted = 0 ORDER BY id LIMIT 1); |
| | | SET @area_name = (SELECT `name` FROM man_warehouse_areas WHERE id = @area_id); |
| | | SET @now = NOW(); |
| | | |
| | | -- 可选:先清同单旧收货区行(需则取消注释) |
| | | -- DELETE FROM man_warehouse_areas_item WHERE asn_id = 7207; |
| | | |
| | | INSERT INTO man_warehouse_areas_item |
| | | (area_id, area_name, asn_id, asn_code, asn_item_id, plat_item_id, matnr_id, matnr_code, maktx, fields_index, |
| | | anfme, qty, work_qty, unit, stock_unit, ispt_result, track_code, batch, splr_batch, plat_order_code, plat_work_code, project_code, |
| | | status, deleted, tenant_id, create_time, update_time) |
| | | VALUES |
| | | (@area_id, @area_name, 7207, '2601-251226002', 32888, '11', 92970, '2010110031#20260429#001', '气开切断阀(插装式)', 'f85050e0496cf683651df1675d3a8a3a', |
| | | 1, 0, 0, 'PCS', 'PCS', 1, NULL, '', '', NULL, NULL, NULL, 1, 0, 1, @now, @now), |
| | | (@area_id, @area_name, 7207, '2601-251226002', 32889, '12', 92967, '2010110077#20260429#001', '溢流阀', 'dfc6199e1cfeb793dc6c6a36433c259c', |
| | | 1, 0, 0, 'PCS', 'PCS', 1, NULL, '', '', NULL, NULL, NULL, 1, 0, 1, @now, @now), |
| | | (@area_id, @area_name, 7207, '2601-251226002', 32890, '13', 92977, '2010710003#20260429#001', '动力水阀(双作用)', 'f5ea4ab7d09e063cffca94c0cc47d799', |
| | | 1, 0, 0, 'PCS', 'PCS', 1, NULL, '', '', NULL, NULL, NULL, 1, 0, 1, @now, @now), |
| | | (@area_id, @area_name, 7207, '2601-251226002', 32891, '14', 92973, '2010112077#20260429#001', '三通切断阀(插装式)', '273d3839133fa68a0aad8b87f21a44c0', |
| | | 1, 0, 0, 'PCS', 'PCS', 1, NULL, '', '', NULL, NULL, NULL, 1, 0, 1, @now, @now), |
| | | (@area_id, @area_name, 7207, '2601-251226002', 32892, '1', 92968, '2010710002#20260429#001', '动力水阀(单作用)', '7017d37d82961c4da955d4120d0437ef', |
| | | 2, 0, 0, 'PCS', 'PCS', 1, NULL, '', '', NULL, NULL, NULL, 1, 0, 1, @now, @now), |
| | | (@area_id, @area_name, 7207, '2601-251226002', 32893, '2', 92976, '2010710001#20260429#001', '动力水阀(单作用)', '16e2dcb1381ef58a00e89cffa58f631c', |
| | | 1, 0, 0, 'PCS', 'PCS', 1, NULL, '', '', NULL, NULL, NULL, 1, 0, 1, @now, @now), |
| | | (@area_id, @area_name, 7207, '2601-251226002', 32894, '3', 92977, '2010710003#20260429#001', '动力水阀(双作用)', 'f5ea4ab7d09e063cffca94c0cc47d799', |
| | | 10, 0, 0, 'PCS', 'PCS', 1, NULL, '', '', NULL, NULL, NULL, 1, 0, 1, @now, @now), |
| | | (@area_id, @area_name, 7207, '2601-251226002', 32895, '4', 92978, '2010112020#20260429#001', '闭环调节阀(插装式)', 'edce4de146dc6a2b4ebc13db91875902', |
| | | 3, 0, 0, 'PCS', 'PCS', 1, NULL, '', '', NULL, NULL, NULL, 1, 0, 1, @now, @now), |
| | | (@area_id, @area_name, 7207, '2601-251226002', 32896, '5', 92979, '2010110001#20260429#001', '闭环调节阀(插装式)', 'bd747ec5840a110a04c011ec330a180b', |
| | | 1, 0, 0, 'PCS', 'PCS', 1, NULL, '', '', NULL, NULL, NULL, 1, 0, 1, @now, @now), |
| | | (@area_id, @area_name, 7207, '2601-251226002', 32897, '6', 92972, '2010112028#20260429#001', '插装阀', 'd2a978e8e05f469ad3d3699204e3d88c', |
| | | 1, 0, 0, 'PCS', 'PCS', 1, NULL, '', '', NULL, NULL, NULL, 1, 0, 1, @now, @now), |
| | | (@area_id, @area_name, 7207, '2601-251226002', 32898, '7', 92971, '2010110022#20260429#001', '气闭切断阀(插装式)', 'c582b1d08f58a1588e4091bfb9870428', |
| | | 1, 0, 0, 'PCS', 'PCS', 1, NULL, '', '', NULL, NULL, NULL, 1, 0, 1, @now, @now), |
| | | (@area_id, @area_name, 7207, '2601-251226002', 32899, '8', 92975, '2010110041#20260429#001', '气开切断阀(插装式)', 'fc12cc177ca1994e1abb27ec4498ce1b', |
| | | 1, 0, 0, 'PCS', 'PCS', 1, NULL, '', '', NULL, NULL, NULL, 1, 0, 1, @now, @now), |
| | | (@area_id, @area_name, 7207, '2601-251226002', 32900, '9', 92974, '2010110047#20260429#001', '气开切断阀(插装式)', 'b9540e19710f2f51c1f2937ed704e2c1', |
| | | 1, 0, 0, 'PCS', 'PCS', 1, NULL, '', '', NULL, NULL, NULL, 1, 0, 1, @now, @now), |
| | | (@area_id, @area_name, 7207, '2601-251226002', 32901, '10', 92969, '2010112066#20260429#001', '三通切断阀(插装式)', '9ae7f8039161675dfe29e8429610e556', |
| | | 2, 0, 0, 'PCS', 'PCS', 1, NULL, '', '', NULL, NULL, NULL, 1, 0, 1, @now, @now); |
| | | |
| | | -- 校验 |
| | | -- SELECT COUNT(*) FROM man_warehouse_areas_item WHERE asn_id = 7207 AND deleted = 0; |
| New file |
| | |
| | | -- PDA 组盘:是否强制录入 WMS 单号(与 GlobalConfigCode.PDA_PAKIN_ASN_REQUIRED 一致) |
| | | -- type=1 布尔;val=true/1=强制;val=false/0=允许仅扫物料或仅单号(二选一,与旧版行为一致) |
| | | INSERT INTO `sys_config` (`uuid`, `name`, `flag`, `type`, `val`, `content`, `status`, `deleted`, `tenant_id`, `create_by`, `create_time`, `update_by`, `update_time`, `memo`) |
| | | SELECT UPPER(UUID()), 'PDA组盘WMS单号必填', 'PDA_PAKIN_ASN_REQUIRED', 1, 'true', |
| | | '组盘页是否必须录入WMS单号', 1, 0, 1, NULL, NOW(), NULL, NOW(), 'PDA matnrPalletising' |
| | | WHERE NOT EXISTS (SELECT 1 FROM `sys_config` WHERE `flag` = 'PDA_PAKIN_ASN_REQUIRED' AND (`deleted` = 0 OR `deleted` IS NULL)); |
| New file |
| | |
| | | -- 订单业务类型:B017 生产入库(入库分组,与 OrderWorkType.ORDER_WORK_TYPE_PROD_B017 一致) |
| | | |
| | | INSERT INTO `sys_dict_data` (`dict_type_id`, `dict_type_code`, `value`, `label`, `sort`, `group`, `status`, `deleted`, `tenant_id`, `create_by`, `create_time`, `update_by`, `update_time`, `memo`) |
| | | SELECT t.id, 'sys_order_work_type', 'B017', '生产入库-工单入库', 21, '1', 1, 0, 1, NULL, NOW(), NULL, NOW(), NULL |
| | | FROM sys_dict_type t |
| | | WHERE t.code = 'sys_order_work_type' |
| | | AND NOT EXISTS (SELECT 1 FROM sys_dict_data d WHERE d.dict_type_code = 'sys_order_work_type' AND d.value = 'B017' LIMIT 1); |
| | | |
| | | UPDATE sys_dict_data |
| | | SET `group` = '1' |
| | | WHERE dict_type_code = 'sys_order_work_type' |
| | | AND `value` = 'B017'; |
| | |
| | | -- 订单业务类型字典:D004 销售退货(与 OrderWorkType.ORDER_WORK_TYPE_SALES_RETURN_D004 一致) |
| | | |
| | | INSERT INTO `sys_dict_data` (`dict_type_id`, `dict_type_code`, `value`, `label`, `sort`, `group`, `status`, `deleted`, `tenant_id`, `create_by`, `create_time`, `update_by`, `update_time`, `memo`) |
| | | SELECT t.id, 'sys_order_work_type', 'D004', '销售退货', 20, '1', 1, 0, 1, NULL, NOW(), NULL, NOW(), NULL |
| | | SELECT t.id, 'sys_order_work_type', 'D004', '退货入库-销售退货', 20, '1', 1, 0, 1, NULL, NOW(), NULL, NOW(), NULL |
| | | FROM sys_dict_type t |
| | | WHERE t.code = 'sys_order_work_type' |
| | | AND NOT EXISTS (SELECT 1 FROM sys_dict_data d WHERE d.dict_type_code = 'sys_order_work_type' AND d.value = 'D004' LIMIT 1); |
| New file |
| | |
| | | -- ERP 单别与 OrderWorkType 字母码一致;group:1=入库,2=出库 |
| | | -- 与已有 b017/d004 脚本可同库多次执行:INSERT 用 NOT EXISTS,label 用 UPDATE 对齐 |
| | | |
| | | INSERT INTO `sys_dict_data` (`dict_type_id`, `dict_type_code`, `value`, `label`, `sort`, `group`, `status`, `deleted`, `tenant_id`, `create_by`, `create_time`, `update_by`, `update_time`, `memo`) |
| | | SELECT t.id, 'sys_order_work_type', v.val, v.lbl, v.srt, v.grp, 1, 0, 1, NULL, NOW(), NULL, NOW(), NULL |
| | | FROM sys_dict_type t |
| | | CROSS JOIN ( |
| | | SELECT 'D001' AS val, '销售出库' AS lbl, 22 AS srt, '2' AS grp UNION ALL |
| | | SELECT 'A008', '采购仓退', 23, '2' UNION ALL |
| | | SELECT 'B003', '领料出库-工单发料/超领', 24, '2' UNION ALL |
| | | SELECT 'C036', '借出-出库', 25, '2' UNION ALL |
| | | SELECT 'A005', '采购入库', 26, '1' UNION ALL |
| | | SELECT 'D022', '退货入库-工单退料', 27, '1' UNION ALL |
| | | SELECT 'B042', '生产入库-工单超入', 28, '1' UNION ALL |
| | | SELECT 'B007', '生产入库-入库上架', 29, '1' UNION ALL |
| | | SELECT 'C037', '调拨入库-借出归还', 30, '1' |
| | | ) v |
| | | WHERE t.code = 'sys_order_work_type' |
| | | AND NOT EXISTS (SELECT 1 FROM sys_dict_data d WHERE d.dict_type_code = 'sys_order_work_type' AND d.value = v.val LIMIT 1); |
| | | |
| | | UPDATE sys_dict_data |
| | | SET label = '退货入库-销售退货', update_time = NOW() |
| | | WHERE dict_type_code = 'sys_order_work_type' AND `value` = 'D004'; |
| | | |
| | | UPDATE sys_dict_data |
| | | SET label = '生产入库-工单入库', update_time = NOW() |
| | | WHERE dict_type_code = 'sys_order_work_type' AND `value` = 'B017'; |
| | |
| | | UPDATE sys_dict_data |
| | | SET `group` = '1' |
| | | WHERE dict_type_code = 'sys_order_work_type' |
| | | AND value IN ('1', '2', '3', '4', '5', '6', 'D004'); |
| | | AND value IN ('1', '2', '3', '4', '5', '6', 'D004', 'A005', 'D022', 'B017', 'B042', 'B007', 'C037'); |
| | | |
| | | UPDATE sys_dict_data |
| | | SET `group` = '2' |
| | | WHERE dict_type_code = 'sys_order_work_type' |
| | | AND value IN ('11', '12', '13', '14', '15', '18', '19'); |
| | | AND value IN ('11', '12', '13', '14', '15', '18', '19', 'D001', 'A008', 'B003', 'C036'); |
| | | |
| | | UPDATE sys_dict_data |
| | | SET `group` = '3' |