Merge remote-tracking branch 'origin/master'
| | |
| | | "name": "åææ°ç«ç¬MESæ°æ®åºè®¾è®¡", |
| | | "describe": "æè¿°åèªæ°ç«ç¬MESæ°æ®åºè®¾è®¡è¯¦æ
", |
| | | "avatar": "", |
| | | "version": "4.9.4", |
| | | "version": "4.9.2", |
| | | "createdTime": "2025-3-10 16:38:19", |
| | | "updatedTime": "2025-8-20 16:04:03", |
| | | "updatedTime": "2025-8-20 15:14:16", |
| | | "dbConns": [], |
| | | "profile": { |
| | | "default": { |
| | |
| | | "id": "FC8D8EFD-EDAD-42FD-81CA-B2B3962BD05F" |
| | | }, |
| | | { |
| | | "defKey": "publish_time", |
| | | "defName": "å叿¶é´", |
| | | "comment": "", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": false, |
| | | "refDict": "", |
| | | "baseType": "89D69E81-EA34-42EE-9FA2-93B8BD27E098", |
| | | "extProps": {}, |
| | | "domain": "7CFFA0D3-6A93-4DDC-BC10-DF21211064DC", |
| | | "id": "7BC5A8E6-31E0-4B70-BAC5-87EFF639FE63" |
| | | }, |
| | | { |
| | | "defKey": "request_status", |
| | | "defName": "请æ±ç¶æ", |
| | | "comment": "", |
| | |
| | | }, |
| | | { |
| | | "defKey": "original_warehouse_id", |
| | | "defName": "ååºåå°", |
| | | "defName": "èµ·å§åºåå°", |
| | | "comment": "", |
| | | "type": "", |
| | | "len": "", |
| | |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": false, |
| | | "domain": "16120F75-6AA7-4483-868D-F07F511BB081", |
| | | "domain": "73FD2BAD-2358-4336-B96D-45DC897BD792", |
| | | "refDict": "", |
| | | "extProps": {}, |
| | | "notes": {}, |
| | |
| | | "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64" |
| | | }, |
| | | { |
| | | "defKey": "priority", |
| | | "defName": "ä¼å
çº§ï¼æå¨ç±»åï¼", |
| | | "defKey": "material_transfer_category", |
| | | "defName": "æå¨ç±»å", |
| | | "comment": "", |
| | | "type": "", |
| | | "len": "", |
| | |
| | | "extProps": {}, |
| | | "domain": "7CFFA0D3-6A93-4DDC-BC10-DF21211064DC", |
| | | "id": "F0CEC477-F5FE-4622-83DB-FBFDA4344E30" |
| | | }, |
| | | { |
| | | "defKey": "material_number", |
| | | "defName": "ç©æç¼ç ", |
| | | "comment": "", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": false, |
| | | "domain": "BE09D493-E183-402D-ACC4-EEA21EB35B8E", |
| | | "refDict": "", |
| | | "extProps": {}, |
| | | "notes": {}, |
| | | "attr1": "", |
| | | "attr2": "", |
| | | "attr3": "", |
| | | "attr4": "", |
| | | "attr5": "", |
| | | "attr6": "", |
| | | "attr7": "", |
| | | "attr8": "", |
| | | "attr9": "", |
| | | "id": "0B5A2CD6-7472-4E18-ACB1-6418C2A8A109", |
| | | "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64" |
| | | }, |
| | | { |
| | | "defKey": "material_name", |
| | | "defName": "ç©æåç§°", |
| | | "comment": "", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": true, |
| | | "domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573", |
| | | "refDict": "", |
| | | "extProps": {}, |
| | | "notes": {}, |
| | | "attr1": "", |
| | | "attr2": "", |
| | | "attr3": "", |
| | | "attr4": "", |
| | | "attr5": "", |
| | | "attr6": "", |
| | | "attr7": "", |
| | | "attr8": "", |
| | | "attr9": "", |
| | | "id": "AFBDF9D2-3B49-4620-9541-C15731785905", |
| | | "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64" |
| | | }, |
| | | { |
| | | "defKey": "specified_quantity", |
| | | "defName": "ç论æå¨æ°é", |
| | | "comment": "", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": false, |
| | | "domain": "FF4459C5-6B45-4DBF-8FC0-E06239BC05B4", |
| | | "refDict": "", |
| | | "extProps": {}, |
| | | "notes": {}, |
| | | "attr1": "", |
| | | "attr2": "", |
| | | "attr3": "", |
| | | "attr4": "", |
| | | "attr5": "", |
| | | "attr6": "", |
| | | "attr7": "", |
| | | "attr8": "", |
| | | "attr9": "", |
| | | "id": "60A2C50B-3F37-4319-B53A-72AE3E55CAFC", |
| | | "baseType": "1A0BDC09-0792-4174-9E8E-80BE8DF44B8E" |
| | | }, |
| | | { |
| | | "defKey": "actual_quantity", |
| | | "defName": "å®é
æå¨æ°é", |
| | | "comment": "", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": false, |
| | | "domain": "FF4459C5-6B45-4DBF-8FC0-E06239BC05B4", |
| | | "refDict": "", |
| | | "extProps": {}, |
| | | "notes": {}, |
| | | "attr1": "", |
| | | "attr2": "", |
| | | "attr3": "", |
| | | "attr4": "", |
| | | "attr5": "", |
| | | "attr6": "", |
| | | "attr7": "", |
| | | "attr8": "", |
| | | "attr9": "", |
| | | "id": "AE123111-CDE3-4CFE-96ED-EFA3D3115CD2", |
| | | "baseType": "1A0BDC09-0792-4174-9E8E-80BE8DF44B8E" |
| | | }, |
| | | { |
| | | "defKey": "remaining_quantity", |
| | | "defName": "车é´å©ä½æ°é", |
| | | "comment": "", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": false, |
| | | "domain": "FF4459C5-6B45-4DBF-8FC0-E06239BC05B4", |
| | | "refDict": "", |
| | | "extProps": {}, |
| | | "notes": {}, |
| | | "attr1": "", |
| | | "attr2": "", |
| | | "attr3": "", |
| | | "attr4": "", |
| | | "attr5": "", |
| | | "attr6": "", |
| | | "attr7": "", |
| | | "attr8": "", |
| | | "attr9": "", |
| | | "id": "12249855-7F62-4734-B5B8-1AACBE2A50CC", |
| | | "baseType": "1A0BDC09-0792-4174-9E8E-80BE8DF44B8E" |
| | | } |
| | | ], |
| | | "correlations": [], |
| | |
| | | "attr9": "", |
| | | "id": "4B21EDEF-B9C4-48C7-BF6A-AC5ABA159B8A", |
| | | "baseType": "1A0BDC09-0792-4174-9E8E-80BE8DF44B8E" |
| | | } |
| | | ], |
| | | "correlations": [], |
| | | "indexes": [], |
| | | "type": "P" |
| | | }, |
| | | { |
| | | "id": "2FF92658-07FE-49BC-A690-E24FA5226BB3", |
| | | "env": { |
| | | "base": { |
| | | "nameSpace": "", |
| | | "codeRoot": "" |
| | | } |
| | | }, |
| | | "defKey": "mes_material_transfer_detail", |
| | | "defName": "ç©ææå¨æç»", |
| | | "comment": "", |
| | | "properties": { |
| | | "partitioned by": "(date string)", |
| | | "row format delimited": "", |
| | | "fields terminated by ','": "", |
| | | "collection items terminated by '-'": "", |
| | | "map keys terminated by ':'": "", |
| | | "store as textfile;": "" |
| | | }, |
| | | "sysProps": { |
| | | "nameTemplate": "{defKey}[{defName}]" |
| | | }, |
| | | "notes": {}, |
| | | "headers": [ |
| | | { |
| | | "refKey": "hideInGraph", |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "defKey", |
| | | "freeze": false, |
| | | "hideInGraph": false |
| | | }, |
| | | { |
| | | "refKey": "defName", |
| | | "freeze": false, |
| | | "hideInGraph": false |
| | | }, |
| | | { |
| | | "refKey": "primaryKey", |
| | | "freeze": false, |
| | | "hideInGraph": false |
| | | }, |
| | | { |
| | | "refKey": "notNull", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "autoIncrement", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "domain", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "type", |
| | | "freeze": false, |
| | | "hideInGraph": false |
| | | }, |
| | | { |
| | | "refKey": "len", |
| | | "freeze": false, |
| | | "hideInGraph": false |
| | | }, |
| | | { |
| | | "refKey": "scale", |
| | | "freeze": false, |
| | | "hideInGraph": false |
| | | }, |
| | | { |
| | | "refKey": "comment", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "refDict", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "defaultValue", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "isStandard", |
| | | "freeze": false, |
| | | "hideInGraph": false |
| | | }, |
| | | { |
| | | "refKey": "uiHint", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "extProps", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "attr1", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "attr2", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "attr3", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "attr4", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "attr5", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "attr6", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "attr7", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "attr8", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "attr9", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | } |
| | | ], |
| | | "fields": [ |
| | | { |
| | | "defKey": "id", |
| | | "defName": "主é®", |
| | | "comment": "", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": true, |
| | | "notNull": true, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": false, |
| | | "refDict": "", |
| | | "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64", |
| | | "extProps": {}, |
| | | "domain": "16120F75-6AA7-4483-868D-F07F511BB081", |
| | | "id": "F7E0BFAE-F178-43E0-8482-2DCE7CEFB184" |
| | | }, |
| | | { |
| | | "defKey": "create_by", |
| | | "defName": "å建人", |
| | | "comment": "", |
| | | "domain": "54611CCC-CA4B-42E1-9F32-4944C85B85A6", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": true, |
| | | "refDict": "", |
| | | "uiHint": "", |
| | | "id": "F445F433-E877-4D2A-8ECE-03043F0ACB7D", |
| | | "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64" |
| | | }, |
| | | { |
| | | "defKey": "create_time", |
| | | "defName": "å建æ¶é´", |
| | | "comment": "", |
| | | "domain": "7CFFA0D3-6A93-4DDC-BC10-DF21211064DC", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": true, |
| | | "refDict": "", |
| | | "uiHint": "", |
| | | "id": "E690295E-8BFF-49DA-8966-6A3FE3824883", |
| | | "baseType": "89D69E81-EA34-42EE-9FA2-93B8BD27E098" |
| | | }, |
| | | { |
| | | "defKey": "update_by", |
| | | "defName": "æ´æ°äºº", |
| | | "comment": "", |
| | | "domain": "54611CCC-CA4B-42E1-9F32-4944C85B85A6", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": true, |
| | | "refDict": "", |
| | | "uiHint": "", |
| | | "id": "E3C7E33A-8B8C-4F70-BA59-3B5A10C50734", |
| | | "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64" |
| | | }, |
| | | { |
| | | "defKey": "update_time", |
| | | "defName": "æ´æ°æ¶é´", |
| | | "comment": "", |
| | | "domain": "7CFFA0D3-6A93-4DDC-BC10-DF21211064DC", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": true, |
| | | "refDict": "", |
| | | "uiHint": "", |
| | | "id": "93258189-F627-4142-BC39-0295E3A52033", |
| | | "baseType": "89D69E81-EA34-42EE-9FA2-93B8BD27E098" |
| | | }, |
| | | { |
| | | "defKey": "del_flag", |
| | | "defName": "å 餿 è®°", |
| | | "comment": "", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": false, |
| | | "refDict": "", |
| | | "baseType": "1D764C4A-6F9F-421E-B11A-6F3E23B51811", |
| | | "extProps": {}, |
| | | "domain": "6BC8F04B-6CFA-4995-98D3-318F5CDD774E", |
| | | "id": "F80D66E7-8670-4B1C-9940-041DBAD0580A" |
| | | }, |
| | | { |
| | | "defKey": "request_id", |
| | | "defName": "ç³è¯·åID", |
| | | "comment": "", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": false, |
| | | "refDict": "", |
| | | "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64", |
| | | "extProps": {}, |
| | | "domain": "16120F75-6AA7-4483-868D-F07F511BB081", |
| | | "id": "850A2C7A-D321-4283-B735-7BCC56DF7933" |
| | | }, |
| | | { |
| | | "defKey": "material_number", |
| | | "defName": "ç©æç¼ç ", |
| | | "comment": "", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": false, |
| | | "domain": "BE09D493-E183-402D-ACC4-EEA21EB35B8E", |
| | | "refDict": "", |
| | | "extProps": {}, |
| | | "notes": {}, |
| | | "attr1": "", |
| | | "attr2": "", |
| | | "attr3": "", |
| | | "attr4": "", |
| | | "attr5": "", |
| | | "attr6": "", |
| | | "attr7": "", |
| | | "attr8": "", |
| | | "attr9": "", |
| | | "id": "E77D6EFA-7408-4891-888B-D6FC2CF8E6E5", |
| | | "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64" |
| | | }, |
| | | { |
| | | "defKey": "material_name", |
| | | "defName": "ç©æåç§°", |
| | | "comment": "", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": true, |
| | | "domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573", |
| | | "refDict": "", |
| | | "extProps": {}, |
| | | "notes": {}, |
| | | "attr1": "", |
| | | "attr2": "", |
| | | "attr3": "", |
| | | "attr4": "", |
| | | "attr5": "", |
| | | "attr6": "", |
| | | "attr7": "", |
| | | "attr8": "", |
| | | "attr9": "", |
| | | "id": "270E5417-96C7-4540-AC29-07C8FCC3CD38", |
| | | "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64" |
| | | }, |
| | | { |
| | | "defKey": "specified_quantity", |
| | | "defName": "ç论æå¨æ°é", |
| | | "comment": "", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": false, |
| | | "refDict": "", |
| | | "baseType": "1A0BDC09-0792-4174-9E8E-80BE8DF44B8E", |
| | | "extProps": {}, |
| | | "domain": "FF4459C5-6B45-4DBF-8FC0-E06239BC05B4", |
| | | "id": "D7028092-5311-4FC1-B6F2-19B1FFBFA85B" |
| | | }, |
| | | { |
| | | "defKey": "actual_quantity", |
| | | "defName": "å®é
æå¨æ°é", |
| | | "comment": "", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": false, |
| | | "refDict": "", |
| | | "baseType": "1A0BDC09-0792-4174-9E8E-80BE8DF44B8E", |
| | | "extProps": {}, |
| | | "domain": "FF4459C5-6B45-4DBF-8FC0-E06239BC05B4", |
| | | "id": "4E9708B3-14B0-45A0-A3B8-351D759C7B47" |
| | | }, |
| | | { |
| | | "defKey": "remaining_quantity", |
| | | "defName": "车é´å©ä½æ°é", |
| | | "comment": "", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": false, |
| | | "refDict": "", |
| | | "baseType": "1A0BDC09-0792-4174-9E8E-80BE8DF44B8E", |
| | | "extProps": {}, |
| | | "domain": "FF4459C5-6B45-4DBF-8FC0-E06239BC05B4", |
| | | "id": "FE041E9A-5D05-42EE-AA33-C563B66B99A5" |
| | | } |
| | | ], |
| | | "correlations": [], |
| | |
| | | "70FEB6D0-FC18-42C5-8608-34E8BBB4A406", |
| | | "D16FD5E0-8B16-4C0E-AD67-6E5C2FED1A65", |
| | | "5835D3E9-4B10-48DC-B116-584E447AA201", |
| | | "2FF92658-07FE-49BC-A690-E24FA5226BB3", |
| | | "23C6B8F0-0010-4453-B3C2-9305746C37AB", |
| | | "D3263A0C-1D6A-453A-B933-86651B5566FE" |
| | | ], |
| | |
| | | return Result.ok("æä½æåï¼"); |
| | | } |
| | | |
| | | |
| | | //@AutoLog(value = "线边ä»åºä¿¡æ¯-éè¿idæ¥è¯¢") |
| | | @ApiOperation(value="线边ä»åºä¿¡æ¯-éè¿idæ¥è¯¢", notes="线边ä»åºä¿¡æ¯-éè¿idæ¥è¯¢") |
| | | @GetMapping(value = "/queryByFactoryId") |
| | | public Result<LineSideWarehouse> queryByFactoryId(@RequestParam(name="factoryId") String factoryId) { |
| | | LineSideWarehouse lineSideWarehouse = lineSideWarehouseService.queryByFactoryId(factoryId); |
| | | if(lineSideWarehouse==null) { |
| | | return Result.error("æªæ¾å°å¯¹åºæ°æ®"); |
| | | } |
| | | return Result.OK(lineSideWarehouse); |
| | | } |
| | | |
| | | } |
| | |
| | | */ |
| | | public interface ILineSideWarehouseService extends IService<LineSideWarehouse> { |
| | | |
| | | /** |
| | | * æ ¹æ®æ¥è¯¢IDæ¥è¯¢çº¿è¾¹åº |
| | | * @param factoryId |
| | | * @return |
| | | */ |
| | | LineSideWarehouse queryByFactoryId(String factoryId); |
| | | } |
| | |
| | | package org.jeecg.modules.base.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.jeecg.modules.base.entity.LineSideWarehouse; |
| | | import org.jeecg.modules.base.mapper.LineSideWarehouseMapper; |
| | | import org.jeecg.modules.base.service.ILineSideWarehouseService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | |
| | | /** |
| | | * @Description: 线边ä»åºä¿¡æ¯ |
| | |
| | | @Service |
| | | public class LineSideWarehouseServiceImpl extends ServiceImpl<LineSideWarehouseMapper, LineSideWarehouse> implements ILineSideWarehouseService { |
| | | |
| | | @Override |
| | | public LineSideWarehouse queryByFactoryId(String factoryId) { |
| | | LambdaQueryWrapper<LineSideWarehouse> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(LineSideWarehouse::getFactoryId, factoryId); |
| | | LineSideWarehouse entity = this.getBaseMapper().selectOne(wrapper); |
| | | if(entity != null) { |
| | | entity.setWarehouseName(entity.getWarehouseName() + "(" + entity.getWarehouseCode() + ")"); |
| | | } |
| | | return entity; |
| | | } |
| | | } |
| | |
| | | package org.jeecg.modules.cms.controller; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | import java.io.IOException; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.net.URLDecoder; |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.common.util.oConvertUtils; |
| | | import org.jeecg.modules.cms.entity.CuttingInbound; |
| | | import org.jeecg.modules.cms.entity.CuttingInboundDetail; |
| | | import org.jeecg.modules.cms.entity.CuttingInboundInventory; |
| | | import org.jeecg.modules.cms.entity.CuttingInventory; |
| | | import org.jeecg.modules.cms.mapper.CuttingInboundMapper; |
| | | import org.jeecg.modules.cms.service.ICuttingInboundDetailService; |
| | | import org.jeecg.modules.cms.service.ICuttingInboundInventoryService; |
| | | import org.jeecg.modules.cms.service.ICuttingInboundService; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import org.jeecg.modules.cms.service.ICuttingInventoryService; |
| | | import org.jeecg.modules.cms.vo.CuttingInboundExportVo; |
| | | import org.jeecgframework.poi.excel.ExcelImportUtil; |
| | | import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
| | | import org.jeecgframework.poi.excel.entity.ExportParams; |
| | |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import org.springframework.web.multipart.MultipartHttpServletRequest; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | import com.alibaba.fastjson.JSON; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | |
| | | /** |
| | | /** |
| | | * @Description: åå
·å
¥åºå |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-07-28 |
| | | * @Date: 2025-07-28 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Api(tags="åå
·å
¥åºå") |
| | | @Api(tags = "åå
·å
¥åºå") |
| | | @RestController |
| | | @RequestMapping("/cms/cuttingInbound") |
| | | @Slf4j |
| | | public class CuttingInboundController extends JeecgController<CuttingInbound, ICuttingInboundService> { |
| | | @Autowired |
| | | private ICuttingInboundService cuttingInboundService; |
| | | @Autowired |
| | | private ICuttingInboundService cuttingInboundService; |
| | | |
| | | @Autowired |
| | | private ICuttingInboundDetailService cuttingInboundDetailService; |
| | | |
| | | /** |
| | | * å页å表æ¥è¯¢ |
| | | * |
| | | * @param cuttingInbound |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @param req |
| | | * @return |
| | | */ |
| | | //@AutoLog(value = "åå
·å
¥åºå-å页å表æ¥è¯¢") |
| | | @ApiOperation(value="åå
·å
¥åºå-å页å表æ¥è¯¢", notes="åå
·å
¥åºå-å页å表æ¥è¯¢") |
| | | @GetMapping(value = "/list") |
| | | public Result<IPage<CuttingInbound>> queryPageList(CuttingInbound cuttingInbound, |
| | | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
| | | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | QueryWrapper<CuttingInbound> queryWrapper = QueryGenerator.initQueryWrapper(cuttingInbound, req.getParameterMap()); |
| | | Page<CuttingInbound> page = new Page<CuttingInbound>(pageNo, pageSize); |
| | | IPage<CuttingInbound> pageList = cuttingInboundService.page(page, queryWrapper); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * |
| | | * @param jSONObject |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "åå
·å
¥åºå-æ·»å ") |
| | | @ApiOperation(value="åå
·å
¥åºå-æ·»å ", notes="åå
·å
¥åºå-æ·»å ") |
| | | //@RequiresPermissions("org.jeecg.modules:cms_cutting_inbound:add") |
| | | @PostMapping(value = "/add") |
| | | public Result<String> add(@RequestBody JSONObject jSONObject) { |
| | | CuttingInbound cuttingInbound = jSONObject.toJavaObject(CuttingInbound.class); |
| | | cuttingInbound.setOrderStatus("1"); |
| | | cuttingInboundService.saveOrUpdate(cuttingInbound); |
| | | //å é¤åå
³èæ°æ® |
| | | List<CuttingInboundDetail> cuttingInboundDetailList = cuttingInboundDetailService.lambdaQuery().eq(CuttingInboundDetail::getOrderId,cuttingInbound.getId()).list(); |
| | | cuttingInboundDetailService.removeBatchByIds(cuttingInboundDetailList); |
| | | //æ·»å æ°å
³èæ°æ® |
| | | JSONArray jsonArray = jSONObject.getJSONArray("detailData"); |
| | | List<CuttingInboundDetail> list = jsonArray.toJavaList(CuttingInboundDetail.class); |
| | | for (int i = 0; i < list.size(); i++) { |
| | | CuttingInboundDetail temp = list.get(i); |
| | | temp.setOrderId(cuttingInbound.getId()); |
| | | cuttingInboundDetailService.save(temp); |
| | | } |
| | | return Result.OK("å
¥åºæåï¼"); |
| | | } |
| | | |
| | | /** |
| | | * ç¼è¾ |
| | | * |
| | | * @param cuttingInbound |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "åå
·å
¥åºå-ç¼è¾") |
| | | @ApiOperation(value="åå
·å
¥åºå-ç¼è¾", notes="åå
·å
¥åºå-ç¼è¾") |
| | | //@RequiresPermissions("org.jeecg.modules:cms_cutting_inbound:edit") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
| | | public Result<String> edit(@RequestBody CuttingInbound cuttingInbound) { |
| | | cuttingInboundService.updateById(cuttingInbound); |
| | | return Result.OK("ç¼è¾æå!"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idå é¤ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "åå
·å
¥åºå-éè¿idå é¤") |
| | | @ApiOperation(value="åå
·å
¥åºå-éè¿idå é¤", notes="åå
·å
¥åºå-éè¿idå é¤") |
| | | //@RequiresPermissions("org.jeecg.modules:cms_cutting_inbound:delete") |
| | | @DeleteMapping(value = "/delete") |
| | | public Result<String> delete(@RequestParam(name="id",required=true) String id) { |
| | | cuttingInboundService.removeById(id); |
| | | return Result.OK("å 餿å!"); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "åå
·å
¥åºå-æ¹éå é¤") |
| | | @ApiOperation(value="åå
·å
¥åºå-æ¹éå é¤", notes="åå
·å
¥åºå-æ¹éå é¤") |
| | | //@RequiresPermissions("org.jeecg.modules:cms_cutting_inbound:deleteBatch") |
| | | @DeleteMapping(value = "/deleteBatch") |
| | | public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
| | | this.cuttingInboundService.removeByIds(Arrays.asList(ids.split(","))); |
| | | return Result.OK("æ¹éå 餿å!"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idæ¥è¯¢ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | //@AutoLog(value = "åå
·å
¥åºå-éè¿idæ¥è¯¢") |
| | | @ApiOperation(value="åå
·å
¥åºå-éè¿idæ¥è¯¢", notes="åå
·å
¥åºå-éè¿idæ¥è¯¢") |
| | | @GetMapping(value = "/queryById") |
| | | public Result<CuttingInbound> queryById(@RequestParam(name="id",required=true) String id) { |
| | | CuttingInbound cuttingInbound = cuttingInboundService.getById(id); |
| | | if(cuttingInbound==null) { |
| | | return Result.error("æªæ¾å°å¯¹åºæ°æ®"); |
| | | } |
| | | return Result.OK(cuttingInbound); |
| | | } |
| | | @Autowired |
| | | private ICuttingInboundDetailService cuttingInboundDetailService; |
| | | |
| | | @Autowired |
| | | private CuttingInboundMapper cuttingInboundMapper; |
| | | |
| | | @Autowired |
| | | private ICuttingInventoryService cuttingInventoryService; |
| | | @Autowired |
| | | private ICuttingInboundInventoryService cuttingInboundInventoryService; |
| | | /** |
| | | * 导åºexcel |
| | | * |
| | | * @param request |
| | | * @param cuttingInbound |
| | | */ |
| | | //@RequiresPermissions("org.jeecg.modules:cms_cutting_inbound:exportXls") |
| | | @RequestMapping(value = "/exportXls") |
| | | public ModelAndView exportXls(HttpServletRequest request, CuttingInbound cuttingInbound) { |
| | | return super.exportXls(request, cuttingInbound, CuttingInbound.class, "åå
·å
¥åºå"); |
| | | * å页å表æ¥è¯¢ |
| | | * |
| | | * @param cuttingInbound |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @param req |
| | | * @return |
| | | */ |
| | | //@AutoLog(value = "åå
·å
¥åºå-å页å表æ¥è¯¢") |
| | | @ApiOperation(value = "åå
·å
¥åºå-å页å表æ¥è¯¢", notes = "åå
·å
¥åºå-å页å表æ¥è¯¢") |
| | | @GetMapping(value = "/list") |
| | | public Result<IPage<CuttingInbound>> queryPageList(CuttingInbound cuttingInbound, |
| | | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | QueryWrapper<CuttingInbound> queryWrapper = QueryGenerator.initQueryWrapper(cuttingInbound, req.getParameterMap()); |
| | | Page<CuttingInbound> page = new Page<CuttingInbound>(pageNo, pageSize); |
| | | IPage<CuttingInbound> pageList = cuttingInboundService.page(page, queryWrapper); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | /** |
| | | * éè¿excel导å
¥æ°æ® |
| | | * |
| | | * @param request |
| | | * @param response |
| | | * @return |
| | | */ |
| | | * æ·»å |
| | | * |
| | | * @param jSONObject |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "åå
·å
¥åºå-æ·»å ") |
| | | @ApiOperation(value = "åå
·å
¥åºå-æ·»å ", notes = "åå
·å
¥åºå-æ·»å ") |
| | | //@RequiresPermissions("org.jeecg.modules:cms_cutting_inbound:add") |
| | | @PostMapping(value = "/add") |
| | | public Result<String> add(@RequestBody JSONObject jSONObject) { |
| | | CuttingInbound cuttingInbound = jSONObject.toJavaObject(CuttingInbound.class); |
| | | cuttingInbound.setOrderStatus("1"); |
| | | cuttingInboundService.saveOrUpdate(cuttingInbound); |
| | | //å é¤åå
³èæ°æ® |
| | | List<CuttingInboundDetail> cuttingInboundDetailList = cuttingInboundDetailService.lambdaQuery().eq(CuttingInboundDetail::getOrderId, cuttingInbound.getId()).list(); |
| | | cuttingInboundDetailService.removeBatchByIds(cuttingInboundDetailList); |
| | | //æ·»å æ°å
³èæ°æ® |
| | | JSONArray jsonArray = jSONObject.getJSONArray("detailData"); |
| | | List<CuttingInboundDetail> list = jsonArray.toJavaList(CuttingInboundDetail.class); |
| | | for (int i = 0; i < list.size(); i++) { |
| | | CuttingInboundDetail temp = list.get(i); |
| | | temp.setOrderId(cuttingInbound.getId()); |
| | | cuttingInboundDetailService.save(temp); |
| | | } |
| | | return Result.OK("å
¥åºæåï¼"); |
| | | } |
| | | |
| | | /** |
| | | * ç¼è¾ |
| | | * |
| | | * @param cuttingInbound |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "åå
·å
¥åºå-ç¼è¾") |
| | | @ApiOperation(value = "åå
·å
¥åºå-ç¼è¾", notes = "åå
·å
¥åºå-ç¼è¾") |
| | | //@RequiresPermissions("org.jeecg.modules:cms_cutting_inbound:edit") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) |
| | | public Result<String> edit(@RequestBody CuttingInbound cuttingInbound) { |
| | | cuttingInboundService.updateById(cuttingInbound); |
| | | return Result.OK("ç¼è¾æå!"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idå é¤ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "åå
·å
¥åºå-éè¿idå é¤") |
| | | @ApiOperation(value = "åå
·å
¥åºå-éè¿idå é¤", notes = "åå
·å
¥åºå-éè¿idå é¤") |
| | | //@RequiresPermissions("org.jeecg.modules:cms_cutting_inbound:delete") |
| | | @DeleteMapping(value = "/delete") |
| | | public Result<String> delete(@RequestParam(name = "id", required = true) String id) { |
| | | cuttingInboundService.removeById(id); |
| | | return Result.OK("å 餿å!"); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "åå
·å
¥åºå-æ¹éå é¤") |
| | | @ApiOperation(value = "åå
·å
¥åºå-æ¹éå é¤", notes = "åå
·å
¥åºå-æ¹éå é¤") |
| | | //@RequiresPermissions("org.jeecg.modules:cms_cutting_inbound:deleteBatch") |
| | | @DeleteMapping(value = "/deleteBatch") |
| | | public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) { |
| | | this.cuttingInboundService.removeByIds(Arrays.asList(ids.split(","))); |
| | | return Result.OK("æ¹éå 餿å!"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idæ¥è¯¢ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | //@AutoLog(value = "åå
·å
¥åºå-éè¿idæ¥è¯¢") |
| | | @ApiOperation(value = "åå
·å
¥åºå-éè¿idæ¥è¯¢", notes = "åå
·å
¥åºå-éè¿idæ¥è¯¢") |
| | | @GetMapping(value = "/queryById") |
| | | public Result<CuttingInbound> queryById(@RequestParam(name = "id", required = true) String id) { |
| | | CuttingInbound cuttingInbound = cuttingInboundService.getById(id); |
| | | if (cuttingInbound == null) { |
| | | return Result.error("æªæ¾å°å¯¹åºæ°æ®"); |
| | | } |
| | | return Result.OK(cuttingInbound); |
| | | } |
| | | |
| | | /** |
| | | * 导åºexcel |
| | | * |
| | | * @param request |
| | | * @param cuttingInbound |
| | | */ |
| | | //@RequiresPermissions("org.jeecg.modules:cms_cutting_inbound:exportXls") |
| | | @RequestMapping(value = "/exportXls") |
| | | public ModelAndView exportXls(CuttingInbound cuttingInbound, HttpServletRequest request) { |
| | | // return super.exportXls(request, cuttingInbound, CuttingInbound.class, "åå
·å
¥åºå"); |
| | | // è·åæ¥è¯¢æ¡ä»¶ |
| | | QueryWrapper<CuttingInbound> queryWrapper = QueryGenerator.initQueryWrapper(cuttingInbound, request.getParameterMap()); |
| | | |
| | | // æ¥è¯¢ä¸»è¡¨æ°æ® |
| | | List<CuttingInbound> pageList = cuttingInboundService.list(queryWrapper); |
| | | |
| | | // 为æ¯ä¸ªä¸»è¡¨æ°æ®è®¾ç½®æç»æ°æ® |
| | | List<CuttingInboundExportVo> exportList = new ArrayList<>(); |
| | | for (CuttingInbound item : pageList) { |
| | | CuttingInboundExportVo exportVo = new CuttingInboundExportVo(); |
| | | // å¤å¶ä¸»è¡¨å段 |
| | | exportVo.setId(item.getId()); |
| | | exportVo.setReceiver(item.getReceiver()); |
| | | exportVo.setReceiveTime(item.getReceiveTime()); |
| | | exportVo.setReceiveComment(item.getReceiveComment()); |
| | | exportVo.setConfirmer(item.getConfirmer()); |
| | | exportVo.setConfirmTime(item.getConfirmTime()); |
| | | exportVo.setConfirmComment(item.getConfirmComment()); |
| | | exportVo.setOrderStatus(item.getOrderStatus()); |
| | | |
| | | // æ¥è¯¢å¹¶è®¾ç½®æç»æ°æ® |
| | | List<CuttingInboundDetail> details = cuttingInboundDetailService.lambdaQuery() |
| | | .eq(CuttingInboundDetail::getOrderId, item.getId()) |
| | | .list(); |
| | | exportVo.setDetailList(details); |
| | | |
| | | exportList.add(exportVo); |
| | | } |
| | | |
| | | // 设置导åºåæ° |
| | | ExportParams params = new ExportParams("åå
·å
¥åºå", "å¯¼åºæ°æ®"); |
| | | |
| | | // è¿åExcelè§å¾ |
| | | ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); |
| | | mv.addObject(NormalExcelConstants.PARAMS, params); |
| | | mv.addObject(NormalExcelConstants.DATA_LIST, exportList); |
| | | mv.addObject(NormalExcelConstants.CLASS, CuttingInboundExportVo.class); |
| | | |
| | | return mv; |
| | | } |
| | | |
| | | /** |
| | | * éè¿excel导å
¥æ°æ® |
| | | * |
| | | * @param request |
| | | * @param response |
| | | * @return |
| | | */ |
| | | //@RequiresPermissions("cms_cutting_inbound:importExcel") |
| | | @RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
| | | public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
| | | return super.importExcel(request, response, CuttingInbound.class); |
| | | // return super.importExcel(request, response, CuttingInbound.class); |
| | | MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; |
| | | Map<String, MultipartFile> fileMap = multipartRequest.getFileMap(); |
| | | |
| | | for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) { |
| | | MultipartFile file = entity.getValue(); |
| | | ImportParams params = new ImportParams(); |
| | | params.setTitleRows(1); |
| | | params.setHeadRows(1); |
| | | try { |
| | | // è§£æExcelæä»¶ |
| | | List<CuttingInboundExportVo> list = ExcelImportUtil.importExcel(file.getInputStream(), CuttingInboundExportVo.class, params); |
| | | |
| | | // è°ç¨Serviceå±å¤ç导å
¥é»è¾ |
| | | return cuttingInboundService.importExcelData(list); |
| | | } catch (org.jeecgframework.poi.exception.excel.ExcelImportException e) { |
| | | log.error("Excel导å
¥å¼å¸¸", e); |
| | | return Result.error("Excelæ°æ®æ ¼å¼é误ï¼è¯·æ£æ¥æ°æ®æ¯å¦ç¬¦å模æ¿è¦æ±"); |
| | | } catch (Exception e) { |
| | | log.error("导å
¥å¤±è´¥", e); |
| | | return Result.error("导å
¥å¤±è´¥: " + e.getMessage()); |
| | | } |
| | | } |
| | | return Result.error("导å
¥å¤±è´¥"); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®å
¥åºidæ¥è¯¢å
¥åºæç» |
| | | * |
| | | * @param orderId |
| | | * @return |
| | | */ |
| | | @GetMapping("/detailList") |
| | | public Result<?> detailList(@RequestParam("orderId") String orderId) { |
| | | List<Map<String, Object>> list = cuttingInboundDetailService.detailList(orderId); |
| | | return Result.ok(list); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®å
¥åºidæ¥è¯¢å
¥åºæç» |
| | | * |
| | | * @param orderId |
| | | * @return |
| | | */ |
| | | @GetMapping("/detailList") |
| | | public Result<?> detailList(@RequestParam("orderId") String orderId) { |
| | | List<Map<String, Object>> list = cuttingInboundDetailService.detailList(orderId); |
| | | return Result.ok(list); |
| | | } |
| | | |
| | | |
| | | /* |
| | | * çæå¯ä¸æ¡ç çæ¹æ³ |
| | | */ |
| | | private String generateUniqueBarcode(String cuttingId, int index) { |
| | | // æ¡ç çæè§å示ä¾ï¼åå
·ID + åºå·(4ä½) + éæºæ° |
| | | return cuttingId + String.format("%04d", index + 1) + (int) (Math.random() * 10000); |
| | | } |
| | | @GetMapping("/submit") |
| | | public Result<?> submit(@RequestParam("orderId") String orderId) { |
| | | // cuttingInboundService.submit(orderId); |
| | | // return Result.ok("æäº¤æå"); |
| | | try { |
| | | // 1. æ´æ°å
¥åºåç¶æ |
| | | CuttingInbound cuttingInbound = cuttingInboundService.getById(orderId); |
| | | if (cuttingInbound == null) { |
| | | return Result.error("æªæ¾å°å¯¹åºçå
¥åºå"); |
| | | } |
| | | |
| | | // æ£æ¥å
¥åºåç¶æï¼åªå
è®¸ç¶æä¸º"1"çå
¥åºåæäº¤ |
| | | if (!"1".equals(cuttingInbound.getOrderStatus())) { |
| | | return Result.error("åªæç¶æä¸ºæªæäº¤çå
¥åºåæè½æ§è¡æäº¤æä½"); |
| | | } |
| | | |
| | | // 2. æ´æ°ç¶æä¸ºå·²æäº¤ |
| | | cuttingInbound.setOrderStatus("2"); |
| | | boolean updateResult = cuttingInboundService.updateById(cuttingInbound); |
| | | if (!updateResult) { |
| | | return Result.error("æ´æ°å
¥åºåç¶æå¤±è´¥"); |
| | | } |
| | | |
| | | // 3. è·åå
¥åºæç» |
| | | List<CuttingInboundDetail> detailList = cuttingInboundDetailService.lambdaQuery() |
| | | .eq(CuttingInboundDetail::getOrderId, orderId) |
| | | .list(); |
| | | |
| | | // ç¨äºç»è®¡æ»æ°é |
| | | |
| | | // 4. æ ¹æ®æç»æ°éçæåºåè®°å½åæ¡ç |
| | | int totalSubmitted = 0; |
| | | for (CuttingInboundDetail detail : detailList) { |
| | | // æ ¹æ®æç»ä¸çæ°éçæå¯¹åºæ°éçåºåè®°å½receive_number |
| | | int quantity = detail.getReceiveNumber() != null ? detail.getReceiveNumber() : 0; |
| | | totalSubmitted = 0; |
| | | for (int i = 0; i < quantity; i++) { |
| | | totalSubmitted += quantity; |
| | | // 为æ¯ä¸ªåå
·çæç¬ç«çåºåè®°å½ |
| | | CuttingInventory cuttingInventory = new CuttingInventory(); |
| | | cuttingInventory.setCuttingId(detail.getCuttingId()); |
| | | // 为æ¯ä¸ªåå
·çæå¯ä¸æ¡ç |
| | | cuttingInventory.setCuttingBarcode(generateUniqueBarcode(detail.getCuttingId(), i)); |
| | | // 设置åºåç¶æä¸ºå¨åº |
| | | cuttingInventory.setInventoryStatus("æ£å¸¸"); |
| | | // 设置å½å寿å½ä¸º100 |
| | | cuttingInventory.setCurrentLife(BigDecimal.valueOf(100)); |
| | | // ä¿åå°åºå表 |
| | | boolean saveResult = cuttingInventoryService.save(cuttingInventory); |
| | | if (!saveResult) { |
| | | return Result.error("ä¿ååºåè®°å½å¤±è´¥"); |
| | | } |
| | | |
| | | // 建ç«å
¥åºåä¸åºåçå
³èå
³ç³» |
| | | CuttingInboundInventory cuttingInboundInventory = new CuttingInboundInventory(); |
| | | cuttingInboundInventory.setOrderId(orderId); |
| | | cuttingInboundInventory.setInventoryId(cuttingInventory.getId()); |
| | | |
| | | // ä¿åå
³èå
³ç³» |
| | | boolean relationSaveResult = cuttingInboundInventoryService.save(cuttingInboundInventory); |
| | | if (!relationSaveResult) { |
| | | return Result.error("ä¿åå
³èå
³ç³»å¤±è´¥"); |
| | | } |
| | | } |
| | | } |
| | | Map<String, Object> result = new HashMap<>(); |
| | | result.put("message", "æäº¤æå"); |
| | | result.put("totalSubmitted", totalSubmitted); |
| | | return Result.ok("æäº¤æå"); |
| | | } catch (Exception e) { |
| | | log.error("æäº¤å
¥åºå失败ï¼orderId: " + orderId, e); |
| | | return Result.error("æäº¤å¤±è´¥: " + e.getMessage()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | @ApiModelProperty(value = "å
¥åºå") |
| | | private String orderId; |
| | | /**åå
·ID*/ |
| | | @Excel(name = "åå
·ID", width = 15) |
| | | @Excel(name = "åå
·ID", width = 15,dictTable = "cms_cutting_tool",dicCode = "id",dicText = "cutting_code") |
| | | @ApiModelProperty(value = "åå
·ID") |
| | | private String cuttingId; |
| | | /**å
¥åºæ°é*/ |
| | |
| | | /**åå
·ID*/ |
| | | @Excel(name = "åå
·ID", width = 15) |
| | | @ApiModelProperty(value = "åå
·ID") |
| | | @Dict(dictTable = "cms_cutting_tool",dicCode="id",dicText = "cutting_code") |
| | | private String cuttingId; |
| | | /**åå
·æ¡ç */ |
| | | @Excel(name = "åå
·æ¡ç ", width = 15) |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Constants; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.cms.entity.CuttingInbound; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.jeecg.modules.cms.vo.CuttingInboundExportVo; |
| | | |
| | | /** |
| | | * @Description: åå
·å
¥åºå |
| | |
| | | */ |
| | | public interface CuttingInboundMapper extends BaseMapper<CuttingInbound> { |
| | | |
| | | List<CuttingInboundExportVo> exportList(@Param(Constants.WRAPPER) QueryWrapper<CuttingInboundExportVo> queryWrapper); |
| | | |
| | | } |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.jeecg.modules.cms.mapper.CuttingInboundMapper"> |
| | | |
| | | <select id="exportList" resultType="org.jeecg.modules.cms.vo.CuttingInboundExportVo"> |
| | | SELECT |
| | | t1.id, |
| | | t1.order_status AS oderStatus, |
| | | t1.receiver AS receiver, |
| | | t1.receive_time AS receiveTime, |
| | | t1.receive_comment AS receiveComment, |
| | | t1.confirmer AS confirmer, |
| | | t1.confirm_time AS confirmTime, |
| | | t1.confirm_comment AS confirmComment, |
| | | t2.order_id AS orderId, |
| | | t2.cutting_id AS cuttingId, |
| | | t2.receive_number AS receiveNumber |
| | | FROM |
| | | cms_cutting_inbound t1 |
| | | LEFT JOIN |
| | | cms_cutting_inbound_detail t2 on t1.id=t2.order_id |
| | | </select> |
| | | </mapper> |
| | |
| | | public interface ICuttingInboundDetailService extends IService<CuttingInboundDetail> { |
| | | |
| | | public List<Map<String, Object>> detailList(String orderId); |
| | | |
| | | } |
| | |
| | | package org.jeecg.modules.cms.service; |
| | | |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.modules.cms.entity.CuttingInbound; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.cms.vo.CuttingInboundExportVo; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: åå
·å
¥åºå |
| | |
| | | * @Version: V1.0 |
| | | */ |
| | | public interface ICuttingInboundService extends IService<CuttingInbound> { |
| | | |
| | | Result<?> importExcelData(List<CuttingInboundExportVo> list); |
| | | } |
| | |
| | | package org.jeecg.modules.cms.service.impl; |
| | | |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.modules.cms.entity.CuttingInbound; |
| | | import org.jeecg.modules.cms.entity.CuttingInboundDetail; |
| | | import org.jeecg.modules.cms.mapper.CuttingInboundMapper; |
| | | import org.jeecg.modules.cms.service.ICuttingInboundService; |
| | | import org.jeecg.modules.cms.service.ICuttingInboundDetailService; |
| | | import org.jeecg.modules.cms.vo.CuttingInboundExportVo; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | /** |
| | | * @Description: åå
·å
¥åºå |
| | |
| | | */ |
| | | @Service |
| | | public class CuttingInboundServiceImpl extends ServiceImpl<CuttingInboundMapper, CuttingInbound> implements ICuttingInboundService { |
| | | @Autowired |
| | | private ICuttingInboundDetailService cuttingInboundDetailService; // 注å
¥ä»è¡¨æå¡ |
| | | /** |
| | | * éè¿Excel导å
¥åå
·å
¥åºåæ°æ® |
| | | * |
| | | * @param list å¾
导å
¥çæ°æ®å表 |
| | | * @return 导å
¥ç»æ |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Result<?> importExcelData(List<CuttingInboundExportVo> list) { |
| | | // try { |
| | | // for (CuttingInboundExportVo exportVo : list) { |
| | | // // ä¿åä¸»è¡¨æ°æ® |
| | | // CuttingInbound cuttingInbound = new CuttingInbound(); |
| | | // cuttingInbound.setReceiver(exportVo.getReceiver()); |
| | | // cuttingInbound.setReceiveTime(exportVo.getReceiveTime()); |
| | | // cuttingInbound.setReceiveComment(exportVo.getReceiveComment()); |
| | | // cuttingInbound.setConfirmer(exportVo.getConfirmer()); |
| | | // cuttingInbound.setConfirmTime(exportVo.getConfirmTime()); |
| | | // cuttingInbound.setConfirmComment(exportVo.getConfirmComment()); |
| | | // cuttingInbound.setOrderStatus(exportVo.getOrderStatus()); |
| | | // |
| | | // // ä¿åä¸»è¡¨æ°æ®ä»¥è·åID |
| | | // this.save(cuttingInbound); |
| | | // |
| | | // // è·å主表ID |
| | | // String orderId = cuttingInbound.getId(); |
| | | // |
| | | // // å¤çä»è¡¨æ°æ® |
| | | // List<CuttingInboundDetail> detailList = exportVo.getDetailList(); |
| | | // if (detailList != null && !detailList.isEmpty()) { |
| | | // for (CuttingInboundDetail detail : detailList) { |
| | | // detail.setOrderId(orderId); // 设置å¤é®å
³è |
| | | // cuttingInboundDetailService.save(detail); |
| | | // } |
| | | // } |
| | | // } |
| | | // return Result.ok("导å
¥æå"); |
| | | // } catch (Exception e) { |
| | | // log.error("导å
¥å¤±è´¥", e); |
| | | // return Result.error("导å
¥å¤±è´¥: " + e.getMessage()); |
| | | // } |
| | | // } |
| | | for (CuttingInboundExportVo exportVo : list) { |
| | | // ä¿åä¸»è¡¨æ°æ® |
| | | CuttingInbound cuttingInbound = new CuttingInbound(); |
| | | cuttingInbound.setReceiver(exportVo.getReceiver()); |
| | | cuttingInbound.setReceiveTime(exportVo.getReceiveTime()); |
| | | cuttingInbound.setReceiveComment(exportVo.getReceiveComment()); |
| | | cuttingInbound.setConfirmer(exportVo.getConfirmer()); |
| | | cuttingInbound.setConfirmTime(exportVo.getConfirmTime()); |
| | | cuttingInbound.setConfirmComment(exportVo.getConfirmComment()); |
| | | cuttingInbound.setOrderStatus(exportVo.getOrderStatus()); |
| | | |
| | | // ä¿åä¸»è¡¨æ°æ®ä»¥è·åID |
| | | this.save(cuttingInbound); |
| | | |
| | | // è·å主表ID |
| | | String orderId = cuttingInbound.getId(); |
| | | |
| | | // å¤çä»è¡¨æ°æ® |
| | | List<CuttingInboundDetail> detailList = exportVo.getDetailList(); |
| | | if (detailList != null && !detailList.isEmpty()) { |
| | | for (CuttingInboundDetail detail : detailList) { |
| | | detail.setOrderId(orderId); // 设置å¤é®å
³è |
| | | cuttingInboundDetailService.save(detail); |
| | | } |
| | | } |
| | | } |
| | | return Result.ok("导å
¥æå"); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.cms.vo; |
| | | |
| | | import org.jeecg.modules.cms.entity.CuttingInboundDetail; |
| | | import org.jeecgframework.poi.excel.annotation.Excel; |
| | | import org.jeecgframework.poi.excel.annotation.ExcelCollection; |
| | | import java.util.List; |
| | | |
| | | public class CuttingInboundExportVo { |
| | | /** ä¸»é® */ |
| | | @Excel(name = "å
¥åºå", width = 15) |
| | | private String id; |
| | | |
| | | /** å
¥åºäºº */ |
| | | @Excel(name = "å
¥åºäºº", width = 15,dictTable = "sys_user",dicCode = "id",dicText = "realname") |
| | | private String receiver; |
| | | |
| | | /** å
¥åºæ¶é´ */ |
| | | @Excel(name = "å
¥åºæ¶é´", width = 20, format = "yyyy-MM-dd HH:mm:ss") |
| | | private java.util.Date receiveTime; |
| | | |
| | | /** å
¥åºè¯´æ */ |
| | | @Excel(name = "å
¥åºè¯´æ", width = 15) |
| | | private String receiveComment; |
| | | |
| | | /** 确认人 */ |
| | | @Excel(name = "确认人", width = 15,dictTable = "sys_user",dicCode = "id",dicText = "realname") |
| | | private String confirmer; |
| | | |
| | | /** 确认æ¶é´ */ |
| | | @Excel(name = "确认æ¶é´", width = 20, format = "yyyy-MM-dd HH:mm:ss") |
| | | private java.util.Date confirmTime; |
| | | |
| | | /** 确认æè§ */ |
| | | @Excel(name = "确认æè§", width = 15) |
| | | private String confirmComment; |
| | | |
| | | /** 订åç¶æ */ |
| | | @Excel(name = "订åç¶æ", width = 15) |
| | | private String orderStatus; |
| | | |
| | | // æç»éå |
| | | @ExcelCollection(name = "å
¥åºæç»") |
| | | private List<CuttingInboundDetail> detailList; |
| | | |
| | | // getteråsetteræ¹æ³... |
| | | public String getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(String id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getReceiver() { |
| | | return receiver; |
| | | } |
| | | |
| | | public void setReceiver(String receiver) { |
| | | this.receiver = receiver; |
| | | } |
| | | |
| | | public java.util.Date getReceiveTime() { |
| | | return receiveTime; |
| | | } |
| | | |
| | | public void setReceiveTime(java.util.Date receiveTime) { |
| | | this.receiveTime = receiveTime; |
| | | } |
| | | |
| | | public String getReceiveComment() { |
| | | return receiveComment; |
| | | } |
| | | |
| | | public void setReceiveComment(String receiveComment) { |
| | | this.receiveComment = receiveComment; |
| | | } |
| | | |
| | | public String getConfirmer() { |
| | | return confirmer; |
| | | } |
| | | |
| | | public void setConfirmer(String confirmer) { |
| | | this.confirmer = confirmer; |
| | | } |
| | | |
| | | public java.util.Date getConfirmTime() { |
| | | return confirmTime; |
| | | } |
| | | |
| | | public void setConfirmTime(java.util.Date confirmTime) { |
| | | this.confirmTime = confirmTime; |
| | | } |
| | | |
| | | public String getConfirmComment() { |
| | | return confirmComment; |
| | | } |
| | | |
| | | public void setConfirmComment(String confirmComment) { |
| | | this.confirmComment = confirmComment; |
| | | } |
| | | |
| | | public String getOrderStatus() { |
| | | return orderStatus; |
| | | } |
| | | |
| | | public void setOrderStatus(String orderStatus) { |
| | | this.orderStatus = orderStatus; |
| | | } |
| | | |
| | | public List<CuttingInboundDetail> getDetailList() { |
| | | return detailList; |
| | | } |
| | | |
| | | public void setDetailList(List<CuttingInboundDetail> detailList) { |
| | | this.detailList = detailList; |
| | | } |
| | | } |
| | |
| | | String MAINTENANCE_CODE_RULE = "MaintenanceCodeRule"; |
| | | // 维修工åç¼ç è§å |
| | | String REPAIR_ORDER_CODE_RULE = "RepairOrderCodeRule"; |
| | | // ç©ææå¨ç¼ç è§å |
| | | String MATERIAL_TRANSFER_CODE_RULE = "MaterialTransferCodeRule"; |
| | | |
| | | /** |
| | | * å²ä½ç¼ç |
| | |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.modules.eam.constant.BusinessCodeConst; |
| | | import org.jeecg.modules.mes.entity.MesMaterialTransferRequest; |
| | | import org.jeecg.modules.mes.service.IMesMaterialTransferRequestService; |
| | | import org.jeecg.modules.system.service.ISysBusinessCodeRuleService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | | * @Description: ç©ææå¨ç³è¯· |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-07-04 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Api(tags="ç©ææå¨ç³è¯·") |
| | | * @Description: ç©ææå¨ç³è¯· |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-07-04 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Api(tags = "ç©ææå¨ç³è¯·") |
| | | @RestController |
| | | @RequestMapping("/mes/mesMaterialTransferRequest") |
| | | @Slf4j |
| | | public class MesMaterialTransferRequestController extends JeecgController<MesMaterialTransferRequest, IMesMaterialTransferRequestService> { |
| | | @Autowired |
| | | private IMesMaterialTransferRequestService mesMaterialTransferRequestService; |
| | | @Autowired |
| | | private IMesMaterialTransferRequestService mesMaterialTransferRequestService; |
| | | @Autowired |
| | | private ISysBusinessCodeRuleService businessCodeRuleService; |
| | | |
| | | /** |
| | | * å页å表æ¥è¯¢ |
| | | * |
| | | * @param mesMaterialTransferRequest |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @param req |
| | | * @return |
| | | */ |
| | | //@AutoLog(value = "ç©ææå¨ç³è¯·-å页å表æ¥è¯¢") |
| | | @ApiOperation(value="ç©ææå¨ç³è¯·-å页å表æ¥è¯¢", notes="ç©ææå¨ç³è¯·-å页å表æ¥è¯¢") |
| | | @GetMapping(value = "/list") |
| | | public Result<IPage<MesMaterialTransferRequest>> queryPageList(MesMaterialTransferRequest mesMaterialTransferRequest, |
| | | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
| | | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | QueryWrapper<MesMaterialTransferRequest> queryWrapper = QueryGenerator.initQueryWrapper(mesMaterialTransferRequest, req.getParameterMap()); |
| | | Page<MesMaterialTransferRequest> page = new Page<MesMaterialTransferRequest>(pageNo, pageSize); |
| | | IPage<MesMaterialTransferRequest> pageList = mesMaterialTransferRequestService.page(page, queryWrapper); |
| | | return Result.OK(pageList); |
| | | } |
| | | /** |
| | | * å页å表æ¥è¯¢ |
| | | * |
| | | * @param mesMaterialTransferRequest |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @param req |
| | | * @return |
| | | */ |
| | | //@AutoLog(value = "ç©ææå¨ç³è¯·-å页å表æ¥è¯¢") |
| | | @ApiOperation(value = "ç©ææå¨ç³è¯·-å页å表æ¥è¯¢", notes = "ç©ææå¨ç³è¯·-å页å表æ¥è¯¢") |
| | | @GetMapping(value = "/list") |
| | | public Result<IPage<MesMaterialTransferRequest>> queryPageList(MesMaterialTransferRequest mesMaterialTransferRequest, |
| | | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | QueryWrapper<MesMaterialTransferRequest> queryWrapper = QueryGenerator.initQueryWrapper(mesMaterialTransferRequest, req.getParameterMap()); |
| | | Page<MesMaterialTransferRequest> page = new Page<MesMaterialTransferRequest>(pageNo, pageSize); |
| | | IPage<MesMaterialTransferRequest> pageList = mesMaterialTransferRequestService.page(page, queryWrapper); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * |
| | | * @param mesMaterialTransferRequest |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "ç©ææå¨ç³è¯·-æ·»å ") |
| | | @ApiOperation(value="ç©ææå¨ç³è¯·-æ·»å ", notes="ç©ææå¨ç³è¯·-æ·»å ") |
| | | //@RequiresPermissions("org.jeecg.modules:mes_material_transfer_request:add") |
| | | @PostMapping(value = "/add") |
| | | public Result<String> add(@RequestBody MesMaterialTransferRequest mesMaterialTransferRequest) { |
| | | mesMaterialTransferRequestService.save(mesMaterialTransferRequest); |
| | | return Result.OK("æ·»å æåï¼"); |
| | | } |
| | | /** |
| | | * æ·»å |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "ç©ææå¨ç³è¯·-æ·»å ") |
| | | @ApiOperation(value = "ç©ææå¨ç³è¯·-æ·»å ", notes = "ç©ææå¨ç³è¯·-æ·»å ") |
| | | @PostMapping(value = "/add") |
| | | public Result<String> add(@RequestBody MesMaterialTransferRequest request) { |
| | | String codeSeq = businessCodeRuleService.generateBusinessCodeSeq(BusinessCodeConst.MATERIAL_TRANSFER_CODE_RULE); |
| | | request.setRequestCode(codeSeq); |
| | | boolean b = mesMaterialTransferRequestService.addMaterialTransferRequest(request); |
| | | if(!b) { |
| | | return Result.error("æ·»å 失败ï¼"); |
| | | } |
| | | return Result.OK("æ·»å æåï¼"); |
| | | } |
| | | |
| | | /** |
| | | * ç¼è¾ |
| | | * |
| | | * @param mesMaterialTransferRequest |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "ç©ææå¨ç³è¯·-ç¼è¾") |
| | | @ApiOperation(value="ç©ææå¨ç³è¯·-ç¼è¾", notes="ç©ææå¨ç³è¯·-ç¼è¾") |
| | | //@RequiresPermissions("org.jeecg.modules:mes_material_transfer_request:edit") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
| | | public Result<String> edit(@RequestBody MesMaterialTransferRequest mesMaterialTransferRequest) { |
| | | mesMaterialTransferRequestService.updateById(mesMaterialTransferRequest); |
| | | return Result.OK("ç¼è¾æå!"); |
| | | } |
| | | /** |
| | | * ç¼è¾ |
| | | * |
| | | * @param mesMaterialTransferRequest |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "ç©ææå¨ç³è¯·-ç¼è¾") |
| | | @ApiOperation(value = "ç©ææå¨ç³è¯·-ç¼è¾", notes = "ç©ææå¨ç³è¯·-ç¼è¾") |
| | | //@RequiresPermissions("org.jeecg.modules:mes_material_transfer_request:edit") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) |
| | | public Result<String> edit(@RequestBody MesMaterialTransferRequest mesMaterialTransferRequest) { |
| | | mesMaterialTransferRequestService.updateById(mesMaterialTransferRequest); |
| | | return Result.OK("ç¼è¾æå!"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idå é¤ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "ç©ææå¨ç³è¯·-éè¿idå é¤") |
| | | @ApiOperation(value="ç©ææå¨ç³è¯·-éè¿idå é¤", notes="ç©ææå¨ç³è¯·-éè¿idå é¤") |
| | | //@RequiresPermissions("org.jeecg.modules:mes_material_transfer_request:delete") |
| | | @DeleteMapping(value = "/delete") |
| | | public Result<String> delete(@RequestParam(name="id",required=true) String id) { |
| | | mesMaterialTransferRequestService.removeById(id); |
| | | return Result.OK("å 餿å!"); |
| | | } |
| | | /** |
| | | * éè¿idå é¤ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "ç©ææå¨ç³è¯·-éè¿idå é¤") |
| | | @ApiOperation(value = "ç©ææå¨ç³è¯·-éè¿idå é¤", notes = "ç©ææå¨ç³è¯·-éè¿idå é¤") |
| | | //@RequiresPermissions("org.jeecg.modules:mes_material_transfer_request:delete") |
| | | @DeleteMapping(value = "/delete") |
| | | public Result<String> delete(@RequestParam(name = "id", required = true) String id) { |
| | | mesMaterialTransferRequestService.removeById(id); |
| | | return Result.OK("å 餿å!"); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "ç©ææå¨ç³è¯·-æ¹éå é¤") |
| | | @ApiOperation(value="ç©ææå¨ç³è¯·-æ¹éå é¤", notes="ç©ææå¨ç³è¯·-æ¹éå é¤") |
| | | //@RequiresPermissions("org.jeecg.modules:mes_material_transfer_request:deleteBatch") |
| | | @DeleteMapping(value = "/deleteBatch") |
| | | public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
| | | this.mesMaterialTransferRequestService.removeByIds(Arrays.asList(ids.split(","))); |
| | | return Result.OK("æ¹éå 餿å!"); |
| | | } |
| | | /** |
| | | * æ¹éå é¤ |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "ç©ææå¨ç³è¯·-æ¹éå é¤") |
| | | @ApiOperation(value = "ç©ææå¨ç³è¯·-æ¹éå é¤", notes = "ç©ææå¨ç³è¯·-æ¹éå é¤") |
| | | //@RequiresPermissions("org.jeecg.modules:mes_material_transfer_request:deleteBatch") |
| | | @DeleteMapping(value = "/deleteBatch") |
| | | public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) { |
| | | this.mesMaterialTransferRequestService.removeByIds(Arrays.asList(ids.split(","))); |
| | | return Result.OK("æ¹éå 餿å!"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idæ¥è¯¢ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | //@AutoLog(value = "ç©ææå¨ç³è¯·-éè¿idæ¥è¯¢") |
| | | @ApiOperation(value="ç©ææå¨ç³è¯·-éè¿idæ¥è¯¢", notes="ç©ææå¨ç³è¯·-éè¿idæ¥è¯¢") |
| | | @GetMapping(value = "/queryById") |
| | | public Result<MesMaterialTransferRequest> queryById(@RequestParam(name="id",required=true) String id) { |
| | | MesMaterialTransferRequest mesMaterialTransferRequest = mesMaterialTransferRequestService.getById(id); |
| | | if(mesMaterialTransferRequest==null) { |
| | | return Result.error("æªæ¾å°å¯¹åºæ°æ®"); |
| | | } |
| | | return Result.OK(mesMaterialTransferRequest); |
| | | } |
| | | /** |
| | | * éè¿idæ¥è¯¢ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | //@AutoLog(value = "ç©ææå¨ç³è¯·-éè¿idæ¥è¯¢") |
| | | @ApiOperation(value = "ç©ææå¨ç³è¯·-éè¿idæ¥è¯¢", notes = "ç©ææå¨ç³è¯·-éè¿idæ¥è¯¢") |
| | | @GetMapping(value = "/queryById") |
| | | public Result<MesMaterialTransferRequest> queryById(@RequestParam(name = "id", required = true) String id) { |
| | | MesMaterialTransferRequest mesMaterialTransferRequest = mesMaterialTransferRequestService.getById(id); |
| | | if (mesMaterialTransferRequest == null) { |
| | | return Result.error("æªæ¾å°å¯¹åºæ°æ®"); |
| | | } |
| | | return Result.OK(mesMaterialTransferRequest); |
| | | } |
| | | |
| | | /** |
| | | * 导åºexcel |
| | | * |
| | | * @param request |
| | | * @param mesMaterialTransferRequest |
| | | */ |
| | | //@RequiresPermissions("org.jeecg.modules:mes_material_transfer_request:exportXls") |
| | | @RequestMapping(value = "/exportXls") |
| | | public ModelAndView exportXls(HttpServletRequest request, MesMaterialTransferRequest mesMaterialTransferRequest) { |
| | | return super.exportXls(request, mesMaterialTransferRequest, MesMaterialTransferRequest.class, "ç©ææå¨ç³è¯·"); |
| | | } |
| | | /** |
| | | * 导åºexcel |
| | | * |
| | | * @param request |
| | | * @param mesMaterialTransferRequest |
| | | */ |
| | | //@RequiresPermissions("org.jeecg.modules:mes_material_transfer_request:exportXls") |
| | | @RequestMapping(value = "/exportXls") |
| | | public ModelAndView exportXls(HttpServletRequest request, MesMaterialTransferRequest mesMaterialTransferRequest) { |
| | | return super.exportXls(request, mesMaterialTransferRequest, MesMaterialTransferRequest.class, "ç©ææå¨ç³è¯·"); |
| | | } |
| | | |
| | | /** |
| | | /** |
| | | * éè¿excel导å
¥æ°æ® |
| | | * |
| | | * @param request |
| | | * @param response |
| | | * @return |
| | | */ |
| | | //@RequiresPermissions("mes_material_transfer_request:importExcel") |
| | | @RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
| | | public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
| | | return super.importExcel(request, response, MesMaterialTransferRequest.class); |
| | | } |
| | | /* |
| | | * éè¿workOrderId æ¥è¯¢mesMaterialTransferRequestæ°æ® |
| | | *@param workOrderId |
| | | * */ |
| | | * |
| | | * @param request |
| | | * @param response |
| | | * @return |
| | | */ |
| | | //@RequiresPermissions("mes_material_transfer_request:importExcel") |
| | | @RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
| | | public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
| | | return super.importExcel(request, response, MesMaterialTransferRequest.class); |
| | | } |
| | | |
| | | /* |
| | | * éè¿workOrderId æ¥è¯¢mesMaterialTransferRequestæ°æ® |
| | | *@param workOrderId |
| | | * */ |
| | | @GetMapping(value = "/queryMaterialTransferRequestByWorkOrderId") |
| | | public Result<?> queryMaterialTransferRequestByWorkOrderId(@RequestParam(name="workOrderId",required=true) String workOrderId) { |
| | | return Result.OK(mesMaterialTransferRequestService.queryMaterialTransferRequestByWorkOrderId(workOrderId)); |
| | | public Result<?> queryMaterialTransferRequestByWorkOrderId(@RequestParam(name = "workOrderId", required = true) String workOrderId) { |
| | | return Result.OK(mesMaterialTransferRequestService.queryMaterialTransferRequestByWorkOrderId(workOrderId)); |
| | | } |
| | | |
| | | } |
| | |
| | | private String requestCode; |
| | | /**å·¥åID*/ |
| | | @ApiModelProperty(value = "å·¥åID") |
| | | @Dict(dictTable = "mes_production_work_order", dicText = "work_order_code", dicCode = "id") |
| | | private String workOrderId; |
| | | /**SAPé¢çå·*/ |
| | | @ApiModelProperty(value = "SAPé¢çå·") |
| | | private String reservationCode; |
| | | /**åå¸ç¶æ*/ |
| | | @Dict(dicCode = "publish_status") |
| | | @Dict(dicCode = "material_transfer_publish_status") |
| | | @ApiModelProperty(value = "åå¸ç¶æ") |
| | | private String publishStatus; |
| | | /**å叿¶é´*/ |
| | | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "å叿¶é´") |
| | | private Date publishTime; |
| | | /**请æ±ç¶æ*/ |
| | | @Dict(dicCode = "request_status") |
| | | @Dict(dicCode = "material_transfer_request_status") |
| | | @ApiModelProperty(value = "请æ±ç¶æ") |
| | | private String requestStatus; |
| | | /**è¯·æ±æ¶é´*/ |
| | |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "è¯·æ±æ¶é´") |
| | | private Date requestTime; |
| | | /**ååºåå°*/ |
| | | @ApiModelProperty(value = "ååºåå°") |
| | | /**èµ·è¿åºåå°*/ |
| | | @ApiModelProperty(value = "èµ·è¿åºåå°") |
| | | @Dict(dicCode = "original_warehouse_list") |
| | | private String originalWarehouseId; |
| | | /**ç®æ åºåå°*/ |
| | | @ApiModelProperty(value = "ç®æ åºåå°") |
| | | @Dict(dictTable = "base_line_side_warehouse", dicText = "warehouse_name", dicCode = "id") |
| | | private String targetWarehouseId; |
| | | /**ä¼å
çº§ï¼æå¨ç±»åï¼*/ |
| | | @Dict(dicCode = "material_transfer_category") |
| | | @ApiModelProperty(value = "æå¨ç±»å") |
| | | private String materialTransferCategory; |
| | | /**ææé
éæ¶é´*/ |
| | | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd") |
| | | @ApiModelProperty(value = "ææé
éæ¶é´") |
| | | private Date latestDeliveryTime; |
| | | /**ç©æç¼ç */ |
| | |
| | | /**å®é
æå¨æ°é*/ |
| | | @ApiModelProperty(value = "å®é
æå¨æ°é") |
| | | private Double actualQuantity; |
| | | /**车é´å©ä½æ°é*/ |
| | | @ApiModelProperty(value = "车é´å©ä½æ°é") |
| | | private Double remainingQuantity; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "å·¥åå·") |
| | | private String workOrderCode; |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "ç®æ åºåå°") |
| | | private String targetWarehouseName; |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "ååºåå°") |
| | | private String originalWarehouseName; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mes.enums; |
| | | |
| | | /** |
| | | * ç©ææå¨ åå¸ç¶æ |
| | | */ |
| | | public enum MaterialTransferPublishStatus { |
| | | WAIT_PUBLISH, //å¾
åå¸ |
| | | PUBLISHED, //å·²åå¸ |
| | | ; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mes.enums; |
| | | |
| | | /** |
| | | * ç©ææå¨è¯·æ±ç¶æ |
| | | */ |
| | | public enum MaterialTransferRequestStatus { |
| | | WAIT_REQUEST, //å¾
è¯·æ± |
| | | REQUESTED, //å·²è¯·æ± |
| | | CHECKED_IN, //å·²å
¥åº |
| | | ; |
| | | } |
| | |
| | | */ |
| | | public interface IMesMaterialTransferRequestService extends IService<MesMaterialTransferRequest> { |
| | | List<MesMaterialTransferRequest> queryMaterialTransferRequestByWorkOrderId(String workOrderId); |
| | | |
| | | /** |
| | | * ç©ææå¨æ°å¢ |
| | | * @param request |
| | | */ |
| | | boolean addMaterialTransferRequest(MesMaterialTransferRequest request); |
| | | } |
| | |
| | | package org.jeecg.modules.mes.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.exception.JeecgBootException; |
| | | import org.jeecg.modules.mes.entity.MesMaterialTransferRequest; |
| | | import org.jeecg.modules.mes.entity.MesProductionWorkOrder; |
| | | import org.jeecg.modules.mes.enums.MaterialTransferPublishStatus; |
| | | import org.jeecg.modules.mes.enums.MaterialTransferRequestStatus; |
| | | import org.jeecg.modules.mes.enums.ProductionWorkOrderStatus; |
| | | import org.jeecg.modules.mes.mapper.MesMaterialTransferRequestMapper; |
| | | import org.jeecg.modules.mes.service.IMesMaterialTransferRequestService; |
| | | import org.jeecg.modules.mes.service.IMesProductionWorkOrderService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | @Service |
| | | public class MesMaterialTransferRequestServiceImpl extends ServiceImpl<MesMaterialTransferRequestMapper, MesMaterialTransferRequest> implements IMesMaterialTransferRequestService { |
| | | |
| | | @Autowired |
| | | private IMesProductionWorkOrderService productionWorkOrderService; |
| | | |
| | | @Override |
| | | public List<MesMaterialTransferRequest> queryMaterialTransferRequestByWorkOrderId(String workOrderId) { |
| | | return baseMapper.queryMaterialTransferRequestByWorkOrderId(workOrderId); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean addMaterialTransferRequest(MesMaterialTransferRequest request) { |
| | | MesProductionWorkOrder order = productionWorkOrderService.getById(request.getWorkOrderId()); |
| | | if(order == null){ |
| | | throw new JeecgBootException("æäº§å·¥åä¸åå¨"); |
| | | } |
| | | if(!ProductionWorkOrderStatus.PUBLISHED.name().equals(order.getWorkOrderStatus())){ |
| | | throw new JeecgBootException("åªæåå¸ç¶æçæäº§å·¥åæå¯ç³è¯·ç©æ"); |
| | | } |
| | | request.setPublishStatus(MaterialTransferPublishStatus.WAIT_PUBLISH.name()); |
| | | request.setRequestStatus(MaterialTransferRequestStatus.WAIT_REQUEST.name()); |
| | | request.setDelFlag(CommonConstant.DEL_FLAG_0); |
| | | this.getBaseMapper().insert(request); |
| | | return true; |
| | | } |
| | | } |
| | |
| | | return Result.OK(list); |
| | | } |
| | | |
| | | /** |
| | | * ç©ææå¨éæ©ç©æä½¿ç¨ |
| | | * æ ¹æ®æåãåæåç©æå· æ¥è¯¢å¯éæ©çç©ææ°æ® |
| | | * @param materialNumber æåãåæåç©æç¼ç |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "ç©ææ¸
å-éè¿ç©æå·æ¥è¯¢", notes = "ç©ææ¸
å-éè¿ç©æå·æ¥è¯¢") |
| | | @GetMapping(value = "/queryByMaterialNumber") |
| | | public Result<?> queryByMaterialNumber(@RequestParam(name = "materialNumber") String materialNumber) { |
| | | List<PmsProcessBillMaterialsDetail> list = pmsProcessBillMaterialsDetailService.queryByMaterialNumber(materialNumber); |
| | | return Result.OK(list); |
| | | } |
| | | |
| | | } |
| | |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.pms.entity.PmsProcessBillMaterialsDetail; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | public interface PmsProcessBillMaterialsDetailMapper extends BaseMapper<PmsProcessBillMaterialsDetail> { |
| | | PmsProcessBillMaterialsDetail queryByMaterialId(@Param("materialId") String materialId); |
| | | IPage<Map<String, Object>> getpmsProcessBillMaterialsDetailListData(IPage<Map> pageData, @Param("params")Map<String, String> paramMap); |
| | | /** |
| | | * ç©ææå¨éæ©ç©æä½¿ç¨ |
| | | * æ ¹æ®æåãåæåç©æå· æ¥è¯¢å¯éæ©çç©ææ°æ® |
| | | * @param materialNumber æåãåæåç©æç¼ç |
| | | * @return |
| | | */ |
| | | List<PmsProcessBillMaterialsDetail> queryByMaterialNumber(String materialNumber); |
| | | } |
| | |
| | | AND material_name LIKE CONCAT('%', #{params.materialName}, '%') |
| | | </if> |
| | | </select> |
| | | <select id="queryByMaterialNumber" resultType="org.jeecg.modules.pms.entity.PmsProcessBillMaterialsDetail"> |
| | | select DISTINCT t1.material_number, t1.material_name, t1.production_unit |
| | | from pms_process_bill_materials_detail t1 |
| | | where EXISTS(select t2.id |
| | | from pms_process_bill_materials t2 |
| | | where t2.material_number = #{materialNumber} |
| | | and t1.material_id = t2.id) |
| | | |
| | | </select> |
| | | </mapper> |
| | |
| | | * @Version: V1.0 |
| | | */ |
| | | public interface IPmsProcessBillMaterialsDetailService extends IService<PmsProcessBillMaterialsDetail> { |
| | | /** |
| | | * æ ¹æ®ç©æIdæ¥è¯¢æç» |
| | | * @param materialId |
| | | * @return |
| | | */ |
| | | List<PmsProcessBillMaterialsDetail> queryByMaterialId(String materialId); |
| | | |
| | | /** |
| | |
| | | * @param collect |
| | | */ |
| | | void saveBatchDetail(String materialsId, List<OrderBomDTO> collect); |
| | | |
| | | /** |
| | | * ç©ææå¨éæ©ç©æä½¿ç¨ |
| | | * æ ¹æ®æåãåæåç©æå· æ¥è¯¢å¯éæ©çç©ææ°æ® |
| | | * @param materialNumber æåãåæåç©æç¼ç |
| | | * @return |
| | | */ |
| | | List<PmsProcessBillMaterialsDetail> queryByMaterialNumber(String materialNumber); |
| | | } |
| | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.jeecg.modules.pms.entity.PmsProcessBillMaterialsDetail; |
| | | import org.jeecg.modules.pms.mapper.PmsProcessBillMaterialsDetailMapper; |
| | | import org.jeecg.modules.pms.service.IPmsProcessBillMaterialsDetailService; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | List<PmsProcessBillMaterialsDetail> list = collect.stream().map(orderBomDTO -> new PmsProcessBillMaterialsDetail(materialsId, orderBomDTO)).collect(Collectors.toList()); |
| | | super.saveBatch(list); |
| | | } |
| | | |
| | | @Override |
| | | public List<PmsProcessBillMaterialsDetail> queryByMaterialNumber(String materialNumber) { |
| | | if (StringUtils.isBlank(materialNumber)) { |
| | | return Collections.emptyList(); |
| | | } |
| | | return this.getBaseMapper().queryByMaterialNumber(materialNumber); |
| | | } |
| | | } |