Merge branch 'refs/heads/dev_business' into fix/hsy/20260811
已修改64个文件
已添加51个文件
已删除1个文件
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | - generic [active]: å·¥ä¸AIæºé å¹³å° |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | - generic [active]: å·¥ä¸AIæºé å¹³å° |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | - generic [ref=f1e7]: |
| | | - complementary [ref=f1e8]: |
| | | - generic [ref=f1e9]: |
| | | - generic [ref=f1e10] [cursor=pointer] |
| | | - link "å·¥ä¸AIæºé å¹³å° å·¥ä¸AIæºé å¹³å°" [ref=f1e15] [cursor=pointer]: |
| | | - /url: javascript:void 0 |
| | | - img "å·¥ä¸AIæºé å¹³å°" [ref=f1e18] |
| | | - generic [ref=f1e19]: å·¥ä¸AIæºé å¹³å° |
| | | - menu [ref=f1e22]: |
| | | - menuitem "é¦é¡µ" [ref=f1e23] [cursor=pointer] |
| | | - listitem [ref=f1e30]: |
| | | - generic [ref=f1e31] [cursor=pointer]: åºç¡æ°æ® |
| | | - listitem [ref=f1e39]: |
| | | - generic [ref=f1e40] [cursor=pointer]: éè´ç®¡ç |
| | | - listitem [ref=f1e46]: |
| | | - generic [ref=f1e47] [cursor=pointer]: è¥é管ç |
| | | - listitem [ref=f1e53]: |
| | | - generic [ref=f1e54] [cursor=pointer]: 设å¤ç®¡ç |
| | | - listitem [ref=f1e61]: |
| | | - generic [ref=f1e62] [cursor=pointer]: ä»å¨ç©æµ |
| | | - listitem [ref=f1e70]: |
| | | - generic [ref=f1e71] [cursor=pointer]: çäº§ç®¡æ§ |
| | | - listitem [ref=f1e78]: |
| | | - generic [ref=f1e79] [cursor=pointer]: è´¨é管ç |
| | | - listitem [ref=f1e85]: |
| | | - generic [ref=f1e86] [cursor=pointer]: å³çBIå¤§å± |
| | | - listitem [ref=f1e92]: |
| | | - generic [ref=f1e93] [cursor=pointer]: åååå
¬ |
| | | - list [ref=f1e99]: |
| | | - listitem [ref=f1e100]: |
| | | - generic [ref=f1e101] [cursor=pointer]: æµç¨ç®¡ç |
| | | - list [ref=f1e107]: |
| | | - menuitem "æµç¨æ¨¡å" [ref=f1e108] [cursor=pointer] |
| | | - menuitem "æµç¨è¡¨å" [ref=f1e113] [cursor=pointer] |
| | | - menuitem "æµç¨åç±»" [ref=f1e118] [cursor=pointer] |
| | | - menuitem "ç¨æ·åç»" [ref=f1e123] [cursor=pointer] |
| | | - menuitem "æµç¨çå¬å¨" [ref=f1e128] [cursor=pointer] |
| | | - menuitem "æµç¨è¡¨è¾¾å¼" [ref=f1e133] [cursor=pointer] |
| | | - menuitem "æµç¨å®ä¾" [ref=f1e138] [cursor=pointer] |
| | | - menuitem "æµç¨ä»»å¡" [ref=f1e143] [cursor=pointer] |
| | | - listitem [ref=f1e148]: |
| | | - generic [ref=f1e149] [cursor=pointer]: 审æ¹ä¸å¿ |
| | | - menuitem "APIå¯é¥ç®¡ç" [ref=f1e155] [cursor=pointer] |
| | | - menuitem "模å管ç" [ref=f1e161] [cursor=pointer] |
| | | - menuitem "ç¥è¯åºç®¡ç" [ref=f1e166] [cursor=pointer] |
| | | - menuitem "éç¥å
Œ" [ref=f1e172] [cursor=pointer] |
| | | - listitem [ref=f1e177]: |
| | | - generic [ref=f1e178] [cursor=pointer]: 人åèµæº |
| | | - listitem [ref=f1e184]: |
| | | - generic [ref=f1e185] [cursor=pointer]: å®å管ç |
| | | - listitem [ref=f1e191]: |
| | | - generic [ref=f1e192] [cursor=pointer]: åºç¡è®¾æ½ |
| | | - listitem [ref=f1e198]: |
| | | - generic [ref=f1e199] [cursor=pointer]: ç³»ç»ç®¡ç |
| | | - listitem [ref=f1e205]: |
| | | - generic [ref=f1e206] [cursor=pointer]: IM 峿¶é讯 |
| | | - generic [ref=f1e214] [cursor=pointer] |
| | | - generic [ref=f1e219]: |
| | | - generic [ref=f1e220]: |
| | | - banner [ref=f1e221]: |
| | | - button [ref=f1e222] [cursor=pointer] |
| | | - button [ref=f1e225] [cursor=pointer] |
| | | - navigation "breadcrumb" [ref=f1e230]: |
| | | - list [ref=f1e231]: |
| | | - listitem [ref=f1e232]: |
| | | - link "åååå
¬" [ref=f1e233] [cursor=pointer]: |
| | | - /url: javascript:void 0 |
| | | - listitem [ref=f1e237] |
| | | - listitem [ref=f1e240]: |
| | | - link "æµç¨ç®¡ç" [ref=f1e241] [cursor=pointer]: |
| | | - /url: javascript:void 0 |
| | | - listitem [ref=f1e245] |
| | | - listitem [ref=f1e248]: |
| | | - link "æµç¨æ¨¡å" [disabled] [ref=f1e249] |
| | | - generic [ref=f1e254]: |
| | | - generic [ref=f1e256] [cursor=pointer]: |
| | | - generic [ref=f1e260]: æç´¢ |
| | | - generic [ref=f1e261]: Ctrl K |
| | | - button [ref=f1e263] [cursor=pointer] |
| | | - button "dark" [ref=f1e268] [cursor=pointer] |
| | | - button [ref=f1e277] [cursor=pointer] |
| | | - button [ref=f1e283] [cursor=pointer] |
| | | - button [ref=f1e286] [cursor=pointer] |
| | | - button [ref=f1e292] [cursor=pointer]: |
| | | - button [ref=f1e294] |
| | | - button "å·¥ä½å°" [ref=f1e299] [cursor=pointer] |
| | | - button [ref=f1e303] [cursor=pointer]: |
| | | - img "è¶
级管çå" [ref=f1e308] |
| | | - generic [ref=f1e310]: |
| | | - generic [ref=f1e315]: |
| | | - generic [ref=f1e316] [cursor=pointer]: é¦é¡µ |
| | | - generic [ref=f1e334] [cursor=pointer]: æµç¨æ¨¡å |
| | | - generic [ref=f1e351]: |
| | | - button [ref=f1e352] [cursor=pointer] |
| | | - generic [ref=f1e359] [cursor=pointer] |
| | | - generic [ref=f1e363] [cursor=pointer] |
| | | - main [ref=f1e370]: |
| | | - generic [ref=f1e376]: |
| | | - generic [ref=f1e377]: æµç¨æ¨¡å |
| | | - generic [ref=f1e379]: |
| | | - textbox "æç´¢æµç¨" [ref=f1e381] |
| | | - button "æ°å»ºæ¨¡å" [ref=f1e383] [cursor=pointer] |
| | | - button [ref=f1e387] [cursor=pointer] |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | # æ¹æ¬¡è¿½æº¯æ©å± - å端èè°æ¹æ¡ |
| | | |
| | | ## æ¦è¿° |
| | | |
| | | å¨ç°ææ¹æ¬¡è¿½æº¯ï¼åå/ååï¼åºç¡ä¸ï¼æ©å± 4 个è½åï¼è¡¥é½æ¹æ¬¡å
¨é¾è·¯è¿½æº¯ï¼ |
| | | |
| | | 1. **éè´æ¥æº**ï¼ä»æ¹æ¬¡åæ¥éè´å
¥åºå + IQC è´¨æ£ç»è®ºï¼åæä¾§æé¾æéï¼ |
| | | 2. **éå®å»å**ï¼ä»æ¹æ¬¡åæ¥éå®åºåºå + OQC è´¨æ£ç»è®ºï¼æåä¾§æé¾æéï¼ |
| | | 3. **å·¥åºæµè½¬**ï¼ä»æ¹æ¬¡æ¥ç产åº/æå
¥çå·¥åºçº§äºä»¶ï¼æ é建表ï¼å¨æèåï¼ |
| | | 4. **SN 忥**ï¼è¾å
¥ SN åºåå·ç´æ¥å®ä½æ¹æ¬¡å¹¶è·³è½¬è¯¦æ
|
| | | |
| | | å端 4 ä¸ªæ°æ¥å£å已宿并ç¼è¯éè¿ï¼æ¬ææ¡£æå¯¼å端对æ¥ã |
| | | |
| | | --- |
| | | |
| | | ## ä¸ãæ¶åé¡µé¢ |
| | | |
| | | | é¡µé¢ | è·¯å¾ | æ¹å¨è¯´æ | |
| | | |------|------|----------| |
| | | | æ¹æ¬¡è¿½æº¯é¡µ | `src/views/mes/qc/batchtrace/index.vue` | 顶鍿°å¢ SN 忥è¾å
¥æ¡ | |
| | | | 追溯详æ
å¼¹çª | `src/views/mes/qc/batchtrace/modules/trace-detail.vue` | åé¡µç¾æ©å±ä¸º 5 个ï¼ç产/éè´æ¥æº/éå®å»å/å·¥åºæµè½¬/è´¨æ£ï¼ | |
| | | | éè´æ¥æºåå表 | `src/views/mes/qc/batchtrace/modules/purchase-source-list.vue` | æ°å¢åç»ä»¶ | |
| | | | éå®å»ååå表 | `src/views/mes/qc/batchtrace/modules/sales-target-list.vue` | æ°å¢åç»ä»¶ | |
| | | | å·¥åºæµè½¬åå表 | `src/views/mes/qc/batchtrace/modules/process-trace-list.vue` | æ°å¢åç»ä»¶ | |
| | | | æ¹æ¬¡ API | `src/api/mes/wm/batch/index.ts` | æ°å¢ 4 个æ¥å£å½æ° | |
| | | | åå®ä¹ | `src/views/mes/qc/batchtrace/data.ts` | æ°å¢ 3 ç»åé
ç½® | |
| | | |
| | | --- |
| | | |
| | | ## äºãAPI æ¥å£ |
| | | |
| | | ### 2.1 æ¹æ¬¡éè´æ¥æº |
| | | |
| | | **è¯·æ±æ¹å¼**ï¼GET |
| | | |
| | | **请æ±è·¯å¾**ï¼`/mes/wm/batch/purchase-sources` |
| | | |
| | | **请æ±åæ°**ï¼ |
| | | |
| | | | åæ° | ç±»å | å¿
å¡« | 说æ | |
| | | |------|------|------|------| |
| | | | code | String | æ¯ | æ¹æ¬¡ç¼ç | |
| | | |
| | | **ååº**ï¼ |
| | | |
| | | ```json |
| | | { |
| | | "code": 0, |
| | | "data": [ |
| | | { |
| | | "receiptCode": "IR20250713001", |
| | | "receiptDate": "2026-08-01 10:00:00", |
| | | "purchaseOrderCode": "PO20250701001", |
| | | "vendorId": 20, |
| | | "vendorCode": "VENDOR001", |
| | | "vendorName": "ä¾åºåA", |
| | | "iqcCode": "IQC20250713001", |
| | | "checkResult": 1, |
| | | "itemId": 100, |
| | | "itemCode": "ITEM001", |
| | | "itemName": "åæA", |
| | | "batchCode": "BT20260731001", |
| | | "receivedQuantity": 100 |
| | | } |
| | | ] |
| | | } |
| | | ``` |
| | | |
| | | **åæ®µè¯´æ**ï¼ |
| | | |
| | | | åæ®µ | ç±»å | 说æ | |
| | | |------|------|------| |
| | | | receiptCode | String | éè´å
¥åºåå· | |
| | | | receiptDate | Date | å
¥åºæ¥æ | |
| | | | purchaseOrderCode | String | éè´è®¢åå· | |
| | | | vendorCode / vendorName | String | ä¾åºåç¼ç /åç§°ï¼å端å¯åï¼ | |
| | | | iqcCode | String | IQC è´¨æ£åå·ï¼å¯è½ä¸ºç©ºï¼ | |
| | | | checkResult | Integer | IQC è´¨æ£ç»è®ºï¼åå
¸ `mes_qc_check_result` | |
| | | | itemCode / itemName | String | ç©æç¼ç /åç§°ï¼å端å¯åï¼ | |
| | | | batchCode | String | æ¹æ¬¡ç¼ç | |
| | | | receivedQuantity | BigDecimal | å
¥åºæ°é | |
| | | |
| | | ### 2.2 æ¹æ¬¡éå®å»å |
| | | |
| | | **è¯·æ±æ¹å¼**ï¼GET |
| | | |
| | | **请æ±è·¯å¾**ï¼`/mes/wm/batch/sales-targets` |
| | | |
| | | **请æ±åæ°**ï¼ |
| | | |
| | | | åæ° | ç±»å | å¿
å¡« | 说æ | |
| | | |------|------|------|------| |
| | | | code | String | æ¯ | æ¹æ¬¡ç¼ç | |
| | | |
| | | **ååº**ï¼ |
| | | |
| | | ```json |
| | | { |
| | | "code": 0, |
| | | "data": [ |
| | | { |
| | | "salesCode": "SS20250713001", |
| | | "salesDate": "2026-08-05 14:00:00", |
| | | "salesOrderCode": "SO20250701001", |
| | | "clientId": 30, |
| | | "clientName": "客æ·A", |
| | | "oqcCode": "OQC20250713001", |
| | | "checkResult": 1, |
| | | "itemId": 100, |
| | | "itemCode": "ITEM001", |
| | | "itemName": "æåA", |
| | | "batchCode": "BT20260804001", |
| | | "quantity": 50, |
| | | "qualityStatus": 1 |
| | | } |
| | | ] |
| | | } |
| | | ``` |
| | | |
| | | **åæ®µè¯´æ**ï¼ |
| | | |
| | | | åæ®µ | ç±»å | 说æ | |
| | | |------|------|------| |
| | | | salesCode | String | éå®åºåºåå· | |
| | | | salesDate | Date | åºåºæ¥æ | |
| | | | salesOrderCode | String | éå®è®¢åå· | |
| | | | clientName | String | 客æ·åç§°ï¼å端å¯åï¼æ³¨æï¼å®¢æ·æ ç¼ç åæ®µï¼ | |
| | | | oqcCode | String | OQC è´¨æ£åå·ï¼å¯è½ä¸ºç©ºï¼ | |
| | | | checkResult | Integer | OQC è´¨æ£ç»è®ºï¼åå
¸ `mes_qc_check_result` | |
| | | | itemCode / itemName | String | ç©æç¼ç /åç§°ï¼å端å¯åï¼ | |
| | | | batchCode | String | æ¹æ¬¡ç¼ç | |
| | | | quantity | BigDecimal | åºåºæ°é | |
| | | | qualityStatus | Integer | è´¨éç¶æï¼åå
¸ `mes_wm_quality_status` | |
| | | |
| | | ### 2.3 æ¹æ¬¡å·¥åºæµè½¬ |
| | | |
| | | **è¯·æ±æ¹å¼**ï¼GET |
| | | |
| | | **请æ±è·¯å¾**ï¼`/mes/wm/batch/process-trace` |
| | | |
| | | **请æ±åæ°**ï¼ |
| | | |
| | | | åæ° | ç±»å | å¿
å¡« | 说æ | |
| | | |------|------|------|------| |
| | | | code | String | æ¯ | æ¹æ¬¡ç¼ç | |
| | | |
| | | **ååº**ï¼ |
| | | |
| | | ```json |
| | | { |
| | | "code": 0, |
| | | "data": [ |
| | | { |
| | | "eventType": "IN", |
| | | "workOrderId": 50, |
| | | "workOrderCode": "WO20260730001", |
| | | "processId": 10, |
| | | "processCode": "P001", |
| | | "processName": "䏿", |
| | | "batchCode": "BT20260804001", |
| | | "quantity": 100, |
| | | "qualityStatus": null, |
| | | "eventTime": "2026-08-04 09:00:00", |
| | | "processSort": 1 |
| | | }, |
| | | { |
| | | "eventType": "OUT", |
| | | "workOrderId": 50, |
| | | "workOrderCode": "WO20260730001", |
| | | "processId": 10, |
| | | "processCode": "P001", |
| | | "processName": "䏿", |
| | | "batchCode": "BT20260804001", |
| | | "quantity": 90, |
| | | "qualityStatus": 1, |
| | | "eventTime": "2026-08-04 10:00:00", |
| | | "processSort": 1 |
| | | } |
| | | ] |
| | | } |
| | | ``` |
| | | |
| | | **åæ®µè¯´æ**ï¼ |
| | | |
| | | | åæ®µ | ç±»å | 说æ | |
| | | |------|------|------| |
| | | | eventType | String | äºä»¶ç±»åï¼`OUT` = 产åºã`IN` = æå
¥ | |
| | | | workOrderCode | String | å·¥åå·ï¼å端å¯åï¼ | |
| | | | processCode / processName | String | å·¥åºç¼ç /åç§°ï¼å端å¯åï¼ | |
| | | | batchCode | String | æ¹æ¬¡ç¼ç | |
| | | | quantity | BigDecimal | æ°éï¼OUT=äº§åºæ°éï¼IN=æå
¥æ°éï¼ | |
| | | | qualityStatus | Integer | è´¨éç¶æï¼ä»
OUT ä¾§æå¼ï¼IN 侧为 nullï¼ | |
| | | | eventTime | Date | äºä»¶æ¶é´ï¼OUT=äº§åºæ¥æï¼IN=æ¶èæ¥æï¼ | |
| | | | processSort | Integer | å·¥åºåºå·ï¼ç¨äºå±ç¤ºå·¥åºå
åï¼ | |
| | | |
| | | **æåºè§å**ï¼å端已æ `workOrderId asc â processSort ascï¼ç©ºå¼ç½®åï¼â eventTime asc` æåºï¼åç«¯ç´æ¥æè¿å顺åºå±ç¤ºå³å¯ã |
| | | |
| | | ### 2.4 SN åæ¥æ¹æ¬¡ |
| | | |
| | | **è¯·æ±æ¹å¼**ï¼GET |
| | | |
| | | **请æ±è·¯å¾**ï¼`/mes/wm/batch/get-by-sn` |
| | | |
| | | **请æ±åæ°**ï¼ |
| | | |
| | | | åæ° | ç±»å | å¿
å¡« | 说æ | |
| | | |------|------|------|------| |
| | | | sn | String | æ¯ | SN åºåå· | |
| | | |
| | | **ååº**ï¼ä¸ `GET /mes/wm/batch/get` å®å
¨ä¸è´ï¼`MesWmBatchRespVO`ï¼ï¼æªå½ä¸è¿å `data: null`ï¼ |
| | | |
| | | ```json |
| | | { |
| | | "code": 0, |
| | | "data": { |
| | | "id": 1, |
| | | "code": "BT20260804001", |
| | | "itemId": 100, |
| | | "itemCode": "ITEM001", |
| | | "itemName": "æåA", |
| | | "vendorCode": "VENDOR001", |
| | | "vendorName": "ä¾åºåA", |
| | | "clientName": "客æ·A", |
| | | "workOrderCode": "WO20260730001", |
| | | "taskCode": "TASK001", |
| | | "workstationCode": "WS001", |
| | | "toolCode": "TOOL001", |
| | | "lotNumber": "LOT20260801" |
| | | } |
| | | } |
| | | ``` |
| | | |
| | | **说æ**ï¼SN å¨ `mes_wm_sn` 表éè¿ `code` å¯ä¸å¹é
ï¼å½ä¸ååå
¶ `batch_code` åæ¥æ¹æ¬¡ãåç«¯æ ¹æ® `data` æ¯å¦ä¸ºç©ºå¤ææ¯å¦æç¤º"æªæ¾å°å¯¹åºæ¹æ¬¡"ã |
| | | |
| | | --- |
| | | |
| | | ## ä¸ãåæ®µå±ç¤ºè§å |
| | | |
| | | | åè½ | å±ç¤ºä½ç½® | åæ®µè¯´æ | |
| | | |------|----------|----------| |
| | | | éè´æ¥æº | 详æ
å¼¹çªå页ç¾"éè´æ¥æº" | å
¥åºåå·ãå
¥åºæ¥æãéè´è®¢åãä¾åºåãIQCåå·ãIQCç»è®ºãç©æãæ°é | |
| | | | éå®å»å | 详æ
å¼¹çªå页ç¾"éå®å»å" | åºåºåå·ãåºåºæ¥æãéå®è®¢åã客æ·ãOQCåå·ãOQCç»è®ºãç©æãæ°éãè´¨éç¶æ | |
| | | | å·¥åºæµè½¬ | 详æ
å¼¹çªå页ç¾"å·¥åºæµè½¬" | äºä»¶ç±»åãå·¥åå·ãå·¥åºç¼ç /åç§°ãæ°éãæ¶é´ãè´¨éç¶æ | |
| | | | SN 忥 | 追溯页顶é¨è¾å
¥æ¡ | è¾å
¥ SN â å½ä¸ç´æ¥æå¼æ¹æ¬¡è¯¦æ
å¼¹çª | |
| | | |
| | | **åå
¸è¯´æ**ï¼ |
| | | |
| | | | åå
¸ | åå¼ | |
| | | |------|------| |
| | | | `mes_qc_check_result` | 1=åæ ¼ã2=ç¹éã3=éè´§ã4=æ¥åº | |
| | | | `mes_wm_quality_status` | 0=å¾
æ£ã1=åæ ¼ã2=ä¸åæ ¼ | |
| | | |
| | | --- |
| | | |
| | | ## åãæ°æ®å¸¦å
¥è¯´æ |
| | | |
| | | | åºæ¯ | 带å
¥è¯´æ | |
| | | |------|----------| |
| | | | 追溯页 â éè´æ¥æº | ç¹å»æ¹æ¬¡è¡ï¼æºå¸¦è¯¥è¡ç `code` è°ç¨ `getPurchaseSourceList(code)` | |
| | | | 追溯页 â éå®å»å | ç¹å»æ¹æ¬¡è¡ï¼æºå¸¦è¯¥è¡ç `code` è°ç¨ `getSalesTargetList(code)` | |
| | | | 追溯页 â å·¥åºæµè½¬ | ç¹å»æ¹æ¬¡è¡ï¼æºå¸¦è¯¥è¡ç `code` è°ç¨ `getProcessTraceList(code)` | |
| | | | SN è¾å
¥æ¡ â 详æ
| è¾å
¥ SN è°ç¨ `getBatchBySn(sn)`ï¼è¿åç `code` ä½ä¸ºè¯¦æ
å¼¹çªæ¥è¯¢ä¾æ®ï¼æç´æ¥ä½¿ç¨è¿åæ°æ®ï¼ | |
| | | |
| | | --- |
| | | |
| | | ## äºãæ¥å£è°ç¨æ¶åº |
| | | |
| | | 1. 追溯页å è½½æ¹æ¬¡å表ï¼`/mes/wm/batch/page`ï¼ |
| | | 2. ç¹å»ææ¹æ¬¡è¡ â æå¼è¯¦æ
å¼¹çªï¼å¼¹çªå
é»è®¤å±ç¤º"ç产"页ç¾ï¼åå/ååè¿½æº¯ï¼ |
| | | 3. 忢"éè´æ¥æº/éå®å»å/å·¥åºæµè½¬"é¡µç¾æ¶ï¼æéè°ç¨å¯¹åºæ¥å£ï¼å»ºè®®æå è½½ï¼é¦æ¬¡åæ¢æè¯·æ±ï¼ |
| | | 4. é¡¶é¨ SN è¾å
¥æ¡ â æå车æç¹å»æç´¢ â `getBatchBySn` â å½ä¸æå¼è¯¦æ
å¼¹çªï¼æªå½ä¸æç¤ºæ è®°å½ |
| | | |
| | | --- |
| | | |
| | | ## å
ãä¸å¡è§å说æ |
| | | |
| | | | åºæ¯ | è§å | |
| | | |------|------| |
| | | | åææ¹æ¬¡ | æéè´æ¥æºï¼å
¥åº+IQCï¼ï¼æ éå®å»åï¼å·¥åºæµè½¬ä»¥ IN æå
¥ä¸ºä¸» | |
| | | | æåæ¹æ¬¡ | æéå®å»åï¼åºåº+OQCï¼ï¼æ éè´æ¥æºï¼å·¥åºæµè½¬ä»¥ OUT 产åºä¸ºä¸» | |
| | | | ä¸é´æ¹æ¬¡ | åæ¶åå¨ IN ä¸ OUT äºä»¶ï¼ä½ç°å·¥åºçº§æµè½¬ | |
| | | | è´¨æ£å缺失 | `iqcCode`/`oqcCode` å¯è½ä¸ºç©ºï¼åæ®æªå
³èï¼ï¼ç»è®ºåå±ç¤º"-" | |
| | | | SN æªå½ä¸ | `get-by-sn` è¿å `data: null`ï¼å端æç¤º"æªæ¾å°è¯¥ SN 对åºçæ¹æ¬¡" | |
| | | | æ°æ®ä¸ºç©º | ä¸ä¸ªåå表æ¥å£åå¯è½è¿å空æ°ç»ï¼é¡µé¢å±ç¤ºç©ºææç¤º | |
| | | |
| | | --- |
| | | |
| | | ## ä¸ã注æäºé¡¹ |
| | | |
| | | - ä¸ä¸ªå表æ¥å£ä¸æ¢æ forward/backward ç¸åï¼åéè¦ `mes:wm-batch:query` æé |
| | | - å页ç¾å»ºè®®æå è½½ + ç¼åï¼é¿å
æ¯æ¬¡åæ¢éå¤è¯·æ± |
| | | - å·¥åºæµè½¬ç `processSort` ç±å端æå¥½åºï¼å端å¿åæåº |
| | | - éå®ä¾§ `qualityStatus` 为åå
¸å¼ï¼å±ç¤ºç¨ `mes_wm_quality_status` åå
¸ç¿»è¯ |
| | | - æµè¯ç¯å¢å¯è½å卿 `batchCode` çéå®åºåºè¡æ°æ®ï¼å±åå²èæ°æ®ï¼åç«¯å¯¹ç©ºåæ®µåå
åºå±ç¤ºå³å¯ |
| | | |
| | | --- |
| | | |
| | | ## å
«ãç¸å
³æ¥å£æ±æ» |
| | | |
| | | | æ¹æ³ | è·¯å¾ | 说æ | |
| | | |------|------|------| |
| | | | GET | /mes/wm/batch/purchase-sources | æ¹æ¬¡éè´æ¥æºï¼å
¥åº + IQCï¼ | |
| | | | GET | /mes/wm/batch/sales-targets | æ¹æ¬¡éå®å»åï¼åºåº + OQCï¼ | |
| | | | GET | /mes/wm/batch/process-trace | æ¹æ¬¡å·¥åºæµè½¬ï¼äº§åº/æå
¥ï¼ | |
| | | | GET | /mes/wm/batch/get-by-sn | SN åæ¥æ¹æ¬¡ | |
| | |
| | | ALTER TABLE `erp_sale_order` |
| | | ADD COLUMN `contract_id` bigint DEFAULT NULL COMMENT 'å
³è CRM ååç¼å·' AFTER `customer_id`, |
| | | ADD COLUMN `contract_no` varchar(32) DEFAULT NULL COMMENT 'CRM åååå·' AFTER `contract_id`; |
| | | |
| | | ALTER TABLE `erp_sale_order` |
| | | MODIFY COLUMN `deposit_price` decimal(24,6) NOT NULL DEFAULT 0 COMMENT 'å®ééé¢ï¼åä½ï¼å
'; |
| | | ``` |
| | | |
| | | --- |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | # ERP éè´æ¥ç¥¨å»æå®¡æ ¸ - å端èè°æ¹æ¡ |
| | | |
| | | ## åæ´èæ¯ |
| | | |
| | | éè´æ¥ç¥¨ï¼`erp_purchase_invoice`ï¼ä¸åéè¦å®¡æ ¸æµç¨ï¼æ¥ç¥¨å建åç´æ¥çæãå¯ç´æ¥ç¨äºä»æ¬¾ãå端已å é¤å®¡æ ¸ç¶æå段ï¼`auditStatus`ï¼ä¸å·¥ä½æµæ®çåæ®µï¼`processInstanceId`ï¼ï¼å¹¶ç§»é¤äºå®¡æ ¸ç¸å
³æ¥å£ï¼ä»æ¬¾å建æ¶ä¸åæ ¡éª"æ¥ç¥¨å¿
é¡»å®¡æ ¸éè¿"ã |
| | | |
| | | ## æ¶åé¡µé¢ |
| | | |
| | | - éè´æ¥ç¥¨ç®¡ç页ï¼`views/erp/purchase/invoice/`ï¼ |
| | | - 仿¬¾å管ç页ï¼`views/erp/finance/payment/`ï¼ä»
è¡ä¸ºååï¼æ 鿹代ç ï¼ |
| | | |
| | | ## æ¥å£åæ´ |
| | | |
| | | ### å·²å 餿¥å£ |
| | | |
| | | | æ¹æ³ | è·¯å¾ | 说æ | |
| | | |------|------|------| |
| | | | PUT | /erp/purchase-invoice/update-status | å®¡æ ¸/åå®¡æ ¸ï¼å端éå é¤å¯¹åºæé®ä¸ API 彿° | |
| | | | GET | /erp/purchase-invoice/audit-count | å¾
å®¡æ ¸æ¥ç¥¨æ°éï¼å端éå é¤å¯¹åº API 彿° | |
| | | |
| | | ### ååºå段åå |
| | | |
| | | | æ¥å£ | åå | |
| | | |------|------| |
| | | | /erp/purchase-invoice/page | ååºç§»é¤ `auditStatus`ã`processInstanceId` åæ®µ | |
| | | | /erp/purchase-invoice/get | ååºç§»é¤ `auditStatus`ã`processInstanceId` åæ®µ | |
| | | | /erp/purchase-invoice/simple-list | ååºç§»é¤ `auditStatus` åæ®µï¼ä¸ååªè¿å"å®¡æ ¸éè¿"æ¥ç¥¨ï¼æ¹ä¸ºè¿å该ä¾åºå/订åä¸"å·²ä¸ä¼ éä»¶ä¸å©ä½å¯ä» > 0"çå
¨é¨æ¥ç¥¨ | |
| | | | /erp/finance-payment/getã/page | åµå¥ `invoice` 对象ä¸ä¸åå
å« `auditStatus` åæ®µ | |
| | | |
| | | ### æ ¡éªè§åååï¼å端ï¼åç«¯æ æ¹å¨ï¼ |
| | | |
| | | | åºæ¯ | åå | |
| | | |------|------| |
| | | | 仿¬¾å建/æ´æ° | 廿"å
³èæ¥ç¥¨å¿
é¡»å®¡æ ¸éè¿"æ ¡éªï¼å
¶ä½æ ¡éªï¼æ¥ç¥¨åå¨ãå·²ä¼ éä»¶ãä¾åºåä¸è´ãéé¢ä¸è¶
å©ä½å¯ä»ï¼ä¿ç | |
| | | |
| | | ## å端修æ¹ç¹ |
| | | |
| | | ### 1. API å®ä¹ï¼`src/api/erp/purchase/invoice/index.ts`ï¼ |
| | | |
| | | - `PurchaseInvoice` ç±»åï¼å é¤ `auditStatus`ã`processInstanceId` åæ®µ |
| | | - `PurchaseInvoiceSimple` ç±»åï¼å é¤ `auditStatus` åæ®µ |
| | | - å é¤å½æ°ï¼`updatePurchaseInvoiceStatus`ã`getAuditPurchaseInvoiceCount` |
| | | - æ´æ° `getPurchaseInvoiceSimpleList` 注é说æ |
| | | |
| | | ### 2. æ¥ç¥¨å表页ï¼`src/views/erp/purchase/invoice/index.vue`ï¼ |
| | | |
| | | - å é¤"å®¡æ ¸""åå®¡æ ¸"æä½æé®å对åºå¤ç彿° |
| | | - å é¤"审æ¹ç¶æ"åçç¶æ Tag æ¨¡æ¿ |
| | | - ç¼è¾æé®ä¸åæå®¡æ ¸ç¶ææ§å¶æ¾éï¼ä»»æç¶æå¯ç¼è¾ï¼ |
| | | - å 餿é®ä¸åæå®¡æ ¸ç¶ææ§å¶æ¾éï¼æ¯å¦å¯å ç±åç«¯æ ¡éª"å·²æææä»æ¬¾å"å³å®ï¼ |
| | | |
| | | ### 3. æ¥ç¥¨å表é
ç½®ï¼`src/views/erp/purchase/invoice/data.ts`ï¼ |
| | | |
| | | - æç´¢è¡¨åï¼å é¤"å®¡æ ¸ç¶æ"çé项 |
| | | - å表åï¼å é¤"审æ¹ç¶æ"å |
| | | |
| | | ## ä¸å¡è§å说æ |
| | | |
| | | | åºæ¯ | è§å | |
| | | |------|------| |
| | | | æ¥ç¥¨å建 | å建å³çæï¼æ å®¡æ ¸ç¯è | |
| | | | æ¥ç¥¨ç¼è¾ | ä»»æç¶æå¯ç¼è¾ | |
| | | | æ¥ç¥¨å é¤ | å·²æææä»æ¬¾åï¼ä»æ¬¾éé¢ > 0ï¼å
³èçæ¥ç¥¨ä¸å¯å é¤ï¼å端ä¼è¿åé误æç¤º | |
| | | | 仿¬¾éæ©æ¥ç¥¨ | 䏿åªå±ç¤º"å·²ä¸ä¼ éä»¶ä¸å©ä½å¯ä» > 0"çæ¥ç¥¨ï¼ä¸åæ"å¾
å®¡æ ¸"æ¥ç¥¨ | |
| | | |
| | | ## 注æäºé¡¹ |
| | | |
| | | - 仿¬¾æ¨¡åï¼`views/erp/finance/payment/`ï¼æªå¼ç¨ `auditStatus`ï¼æ éä¿®æ¹ï¼å
¶"å
³èæ¥ç¥¨"䏿å¯éèå´éå端 simple-list é»è¾èªå¨ååã |
| | | - å岿¥ç¥¨æ°æ®ï¼æ°æ®åºå·²å é¤ `audit_status`ã`process_instance_id` 两åï¼å岿¥ç¥¨å
¨é¨è§ä¸ºææï¼å¯ç´æ¥ç¨äºä»æ¬¾ã |
| | | - å端æ¥å£å é¤åï¼è¯·åæ¥æ£æ¥æ¯å¦æå
¶å®é¡µé¢ï¼å¦å·¥ä½å°/å¾
åï¼è°ç¨å·²å é¤çæ¥å£ï¼å½åæªåç°ã |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | # MES 计éå¨å
·ä¸è®¡éæ£æµè®°å½ - å端èè°æ¹æ¡ |
| | | |
| | | ## æ¶åé¡µé¢ |
| | | |
| | | | é¡µé¢ | èåè·¯å¾ | è·¯ç±è·¯å¾ | component_name | |
| | | |------|----------|----------|----------------| |
| | | | 计éå¨å
· | 设å¤ç®¡ç -> 计éå¨å
· | `mes/dv/metering/index` | MesDvMetering | |
| | | | è®¡éæ£æµè®°å½ | 设å¤ç®¡ç -> è®¡éæ£æµè®°å½ | `mes/dv/meteringcheck/index` | MesDvMeteringCheck | |
| | | |
| | | > 两个页é¢ä¸ºå¹³çº§èåãæ£æµè®°å½é¡µå¯éè¿ã计éå¨å
·ã䏿çéï¼ä»
æ¥çæå°å¨å
·çæ£æµåå²ã |
| | | |
| | | ## ä¸å¡æµç¨ä¸æ°æ®å¸¦å
¥ |
| | | |
| | | 1. 计éå¨å
·å表 -> æ°å¢/ç¼è¾è¡¨åï¼å½å
¥å¨å
·ç¼ç ãåç§°ãç±»å«ãæ ¡å卿ã使ç¨é¨é¨ã责任人çã |
| | | 2. è®¡éæ£æµè®°å½ -> æ°å¢/ç¼è¾è¡¨åï¼éæ©ã计éå¨å
·ãï¼ä» `/mes/dv/metering/simple-list` 带å
¥ `meteringId`ã`code`ã`name`ï¼ã |
| | | 3. æ£æµè®°å½ä¿ååï¼å端èªå¨è®¡ç® `nextCheckDate` å¹¶**åå**å°è®¡éå¨å
·ç `lastCheckDate`ã`nextCheckDate`ï¼ |
| | | - `nextCheckDate` ä¼ ç©ºæ¶ = `checkDate + æ ¡å卿(æ)`ï¼èªå¨è®¡ç®ï¼ï¼ |
| | | - `nextCheckDate` ä¼ å¼æ¶ = ä»¥ä¼ å
¥å¼ä¸ºåï¼æå¨æå®ï¼ã |
| | | 4. 计éå¨å
·å表å±ç¤º `expireStatus` å°æç¶ææ è®°ï¼ç±å端æ `nextCheckDate` ä¸å
¨å±é
ç½®çæé天æ°è®¡ç®ã |
| | | |
| | | ## API |
| | | |
| | | ### 计éå¨å
· |
| | | |
| | | | æ¹æ³ | è·¯å¾ | 说æ | æé | |
| | | |------|------|------|------| |
| | | | POST | /mes/dv/metering/create | å建计éå¨å
· | mes:dv-metering:create | |
| | | | PUT | /mes/dv/metering/update | æ´æ°è®¡éå¨å
· | mes:dv-metering:update | |
| | | | DELETE | /mes/dv/metering/delete?id= | å é¤è®¡éå¨å
·ï¼æå
³èæ£æµè®°å½æ¶æç»ï¼ | mes:dv-metering:delete | |
| | | | GET | /mes/dv/metering/get?id= | è·å¾è®¡éå¨å
·è¯¦æ
| mes:dv-metering:query | |
| | | | GET | /mes/dv/metering/page | 计éå¨å
·å页 | mes:dv-metering:query | |
| | | | GET | /mes/dv/metering/export-excel | å¯¼åº Excel | mes:dv-metering:export | |
| | | | GET | /mes/dv/metering/simple-list | ç²¾ç®å表ï¼ä¸æéé¡¹ï¼ | mes:dv-metering:query | |
| | | |
| | | **å页çéåæ°ï¼page æ¥å£ï¼ï¼** |
| | | |
| | | | åæ° | ç±»å | å¿
å¡« | 说æ | |
| | | |------|------|------|------| |
| | | | code | String | å¦ | å¨å
·ç¼ç æ¨¡ç³ | |
| | | | name | String | å¦ | å¨å
·åç§°æ¨¡ç³ | |
| | | | brand | String | å¦ | åç/ç产åå®¶æ¨¡ç³ | |
| | | | category | Integer | å¦ | å¨å
·ç±»å«ï¼åå
¸ï¼ | |
| | | | deptId | Long | å¦ | 使ç¨é¨é¨ | |
| | | | chargeUserId | Long | å¦ | 责任人 | |
| | | | status | Integer | å¦ | ç¶æï¼åå
¸ï¼ | |
| | | | expireStatus | Integer | å¦ | å°æç¶æï¼1 å·²è¿æ / 2 å³å°å°æ / 3 æ£å¸¸ | |
| | | |
| | | ### è®¡éæ£æµè®°å½ |
| | | |
| | | | æ¹æ³ | è·¯å¾ | 说æ | æé | |
| | | |------|------|------|------| |
| | | | POST | /mes/dv/metering-check/create | åå»ºæ£æµè®°å½ | mes:dv-metering-check:create | |
| | | | PUT | /mes/dv/metering-check/update | æ´æ°æ£æµè®°å½ | mes:dv-metering-check:update | |
| | | | DELETE | /mes/dv/metering-check/delete?id= | å 餿£æµè®°å½ | mes:dv-metering-check:delete | |
| | | | GET | /mes/dv/metering-check/get?id= | è·å¾æ£æµè®°å½è¯¦æ
| mes:dv-metering-check:query | |
| | | | GET | /mes/dv/metering-check/page | æ£æµè®°å½å页 | mes:dv-metering-check:query | |
| | | | GET | /mes/dv/metering-check/export-excel | å¯¼åº Excel | mes:dv-metering-check:export | |
| | | |
| | | **å页çéåæ°ï¼page æ¥å£ï¼ï¼** |
| | | |
| | | | åæ° | ç±»å | å¿
å¡« | 说æ | |
| | | |------|------|------|------| |
| | | | meteringId | Long | å¦ | 计éå¨å
·ï¼ä»å¨å
·å表带å
¥ï¼ | |
| | | | checkCode | String | å¦ | æ£æµç¼å·æ¨¡ç³ | |
| | | | checkResult | Integer | å¦ | æ£æµç»è®ºï¼åå
¸ï¼ | |
| | | | checkDate | LocalDate[] | å¦ | æ£æµæ¥æåºé´ | |
| | | |
| | | ### ååºå段æ°å¢è¯´æ |
| | | |
| | | 计éå¨å
·å表/详æ
ååºé¢å¤è¿åï¼ |
| | | |
| | | | åæ®µ | ç±»å | 说æ | |
| | | |------|------|------| |
| | | | deptName | String | 使ç¨é¨é¨åç§° | |
| | | | chargeUserNickname | String | 责任人æµç§° | |
| | | | expireStatus | Integer | å°æç¶æï¼1 å·²è¿æ / 2 å³å°å°æ / 3 æ£å¸¸ | |
| | | | expireDays | Long | è·å°æå¤©æ°ï¼æ£æ°æªå°ãè´æ°å·²è¿æï¼ | |
| | | |
| | | è®¡éæ£æµè®°å½å表/详æ
ååºé¢å¤è¿åï¼ |
| | | |
| | | | åæ®µ | ç±»å | 说æ | |
| | | |------|------|------| |
| | | | meteringCode | String | 计éå¨å
·ç¼ç | |
| | | | meteringName | String | 计éå¨å
·åç§° | |
| | | | checkUserNickname | String | æ£æµäººæµç§° | |
| | | |
| | | ## åæ®µå±ç¤ºè§å |
| | | |
| | | | åæ®µ | å±ç¤ºä½ç½® | 说æ | |
| | | |------|----------|------| |
| | | | expireStatus | 计éå¨å
·å表 | 1 å·²è¿æ=å±é©(danger)ï¼2 å³å°å°æ=è¦å(warning)ï¼3 æ£å¸¸=æå(success) | |
| | | | status | 计éå¨å
·å表ã表å | åå
¸ mes_dv_metering_statusï¼å¨ç¨=success/åç¨=info/æ¥åº=dangerï¼ | |
| | | | category | 计éå¨å
·å表ã表å | åå
¸ mes_dv_metering_category | |
| | | | nextCheckDate | ä¸¤ä¸ªé¡µé¢ | 计éå¨å
·å±ç¤ºä¸ºã䏿¬¡æ£æµæ¥æãåï¼æ£æµè®°å½ä¿åæ¶åå | |
| | | | checkResult | æ£æµè®°å½å表ã表å | åå
¸ mes_dv_metering_check_resultï¼åæ ¼=success/ä¸åæ ¼=dangerï¼ | |
| | | | meteringCode/meteringName | æ£æµè®°å½å表 | ä»å¨å
·å¸¦å
¥å±ç¤º | |
| | | | deptName/chargeUserNickname | 计éå¨å
·å表 | é¨é¨ã责任人åç§° | |
| | | |
| | | ## ä¸å¡è§å说æ |
| | | |
| | | | åºæ¯ | è§å | |
| | | |------|------| |
| | | | æ£æµè®°å½æ°å¢ | æªå¡« nextCheckDate æ¶æ `checkDate + æ ¡å卿` èªå¨è®¡ç®å¹¶ä¿å | |
| | | | æ£æµè®°å½æ´æ° | éæ°è®¡ç® nextCheckDateï¼å¹¶ååå¨å
· | |
| | | | æ£æµè®°å½å é¤ | å¨å
·æå©ä½ãææ°ä¸æ¡è®°å½ãæ´ä½éç®ååï¼æ è®°å½å lastCheckDate/nextCheckDate ç½®ç©ºï¼ | |
| | | | 计éå¨å
·å é¤ | å·²å
³èæ£æµè®°å½æ¶æç»å é¤ï¼æç¤ºã计éå¨å
·å·²å
³èæ£æµè®°å½ï¼æ æ³å é¤ã | |
| | | | å°ææé | å°æå N 天ï¼å
¨å±é
ç½® `mes.dv-metering.remind-days`ï¼é»è®¤ 30ï¼åéç«å
ä¿¡ç»è´£ä»»äººï¼åä¸å¨å
·åä¸å°ææ¥ 60 天å
åªæé䏿¬¡ | |
| | | | ç¼ç /ç¼å·å¯ä¸ | å¨å
· codeãæ£æµ checkCode åå¯ä¸ï¼é夿¶å端æ¥é | |
| | | |
| | | ## 注æäºé¡¹ |
| | | |
| | | - expireStatus ç±å端计ç®å¹¶è¿åï¼å端åªéæä¸ææ¸²æ tag é¢è²ï¼æ éèªè¡è®¡ç®å¤©æ°ã |
| | | - å é¤å¨å
·åé确认æ å
³èæ£æµè®°å½ï¼å 餿£æµè®°å½åå¨å
·çå°ææ¥ä¼éä¹ååï¼å端åºå·æ°å¨å
·å表ã |
| | | - æ£æµè®°å½é¡µä¾èµè®¡éå¨å
·æ°æ®ï¼åºå
åå¨å¨å
·åç»è®°æ£æµè®°å½ã |
| | | - æé天æ°å¯å¨ãåºç¡è®¾æ½ -> é
置管çãä¸ä¿®æ¹ `mes.dv-metering.remind-days`ï¼æ¹åç«å³çæã |
| | | - ä¸ä¸ªæ°åå
¸å¯å¨ãç³»ç»ç®¡ç -> åå
¸ç®¡çãä¸ç»´æ¤ï¼mes_dv_metering_categoryãmes_dv_metering_statusãmes_dv_metering_check_resultã |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | # MES ç©æç¶ææ§å¶ - å端èè°æ¹æ¡ |
| | | |
| | | ## åæ´æ¦è¿° |
| | | |
| | | - MES 模å**ä¸åå
许æ§å¶ç©æç¶æ**ï¼ç¶æåªè½ç±åºç¡æ°æ®ï¼MDMï¼ç©æç®¡çæ§å¶ã |
| | | - ç§»é¤ MES æ¥å£ `PUT /mes/md/item/update-status`ã |
| | | - MDM ç©æåæ¥å° MES æ¶ä¼ éç¶æï¼å¯ç¨/ç¦ç¨ï¼ï¼MES ç©æç¶æè·é MDM ä¿æåæ¥ã |
| | | |
| | | ## æ¶åé¡µé¢ |
| | | |
| | | - MES ç©æå表页ï¼`src/views/mes/md/item/index.vue`ï¼ç§»é¤ç¶æå¼å
³ï¼æ¹ä¸ºåªè¯»å±ç¤ºï¼ |
| | | - MES ç©ææ°å¢/ç¼è¾è¡¨åï¼`src/views/mes/md/item/modules/form.vue`ï¼ç¶æå段æ¹ä¸ºç¦ç¨/åªè¯»ï¼ |
| | | - åºç¡æ°æ®ç©æç®¡ç页ï¼`src/views/basicData/mdm/index.vue`ï¼ç¶ææ§å¶å
¥å£ï¼ä¿æä¸åï¼ |
| | | |
| | | ## API |
| | | |
| | | | æ¹æ³ | è·¯å¾ | 说æ | |
| | | |------|------|------| |
| | | | PUTï¼å·²ç§»é¤ï¼ | `/mes/md/item/update-status` | MES ä¾§ç¶ææ§å¶æ¥å£ï¼å·²åºå¼ï¼å端**ä¸å¾åè°ç¨** | |
| | | |
| | | MDM ç¶ææ§å¶æ¥å£ï¼ä¿æä¸åï¼ç¶æä¼åæ¥å° MESï¼ï¼ |
| | | |
| | | | æ¹æ³ | è·¯å¾ | 说æ | |
| | | |------|------|------| |
| | | | POST | `/mdm/item/create` | åå»ºç©æï¼status é忥另å
¥ MES | |
| | | | PUT | `/mdm/item/update` | æ´æ°ç©æï¼status é忥另å
¥ MES | |
| | | | PUT | `/mdm/item/update-status` | æ´æ°ç©æç¶æï¼å®æ¶åæ¥å° MES | |
| | | |
| | | ## æ°æ®å¸¦å
¥è¯´æ |
| | | |
| | | 1. MDM å建/ç¼è¾ç©ææ¶ï¼`status`ï¼0=å¯ç¨ï¼1=ç¦ç¨ï¼é忥é¾è·¯å¸¦å
¥ MESï¼MES ç©ææ°å»ºæ²¿ç¨ MDM ç¶æã |
| | | 2. MDM ç©æå¯ç¨/ç¦ç¨ï¼`update-status`ï¼ï¼ç¶æå®æ¶åæ¥å° MESã |
| | | 3. MES æ¬å°æ°å¢ç©æï¼ä¸ç»è¿ MDM 忥ï¼é»è®¤ç¶æä¸º**ç¦ç¨**ï¼ä¸ MES ä¾§æ æ³èªè¡å¯ç¨ï¼é¡»å¨ MDM ä¸å¯ç¨å忥å MESã |
| | | |
| | | ## åæ®µå±ç¤ºè§å |
| | | |
| | | | åæ®µ | å±ç¤ºä½ç½® | 说æ | |
| | | |------|----------|------| |
| | | | ç¶æ | MES ç©æå表 | åªè¯»å±ç¤ºï¼æ¥æºä¸º MDM åæ¥ç¶æï¼ä¸åæä¾å¼å
³åæ¢ | |
| | | | ç¶æ | MES æ°å¢/ç¼è¾è¡¨å | ç¦ç¨/éèï¼ä¸å
è®¸ä¿®æ¹ | |
| | | | ç¶æ | MDM ç©æå表/表å | å¯ç¼è¾ï¼ä¸ºç¶æå¯ä¸æ§å¶å
¥å£ | |
| | | |
| | | ## ä¸å¡è§å说æ |
| | | |
| | | | åºæ¯ | è§å | |
| | | |------|------| |
| | | | MDM å建/ç¼è¾ç©æ | ç¶æéåæ¥å° MESï¼MES ç©æç¶æä¿æä¸è´ | |
| | | | MDM å¯ç¨/ç¦ç¨ç©æ | ç¶æå®æ¶åæ¥å° MES | |
| | | | MES æ¬å°æ°å¢ç©æ | é»è®¤ç¦ç¨ï¼MES ä¾§æ æ³å¯ç¨ï¼é¡»å¨ MDM ä¸å¯ç¨ | |
| | | | MES ç¼è¾ç©æ | ä¸å
许修æ¹ç¶æå段 | |
| | | | MES ç¶ææ§å¶ | ä¸åæä¾å¯ç¨/ç¦ç¨å
¥å£ | |
| | | |
| | | ## 注æäºé¡¹ |
| | | |
| | | - MES å表页éç§»é¤ç¶æå¼å
³ï¼`updateItemStatus` ç¸å
³è°ç¨ï¼ï¼ç¶æåæ¹ä¸ºåªè¯»ææ¬/æ ç¾å±ç¤ºï¼æä¿çå±ç¤ºåä½å»æå¯åæ¢è½åã |
| | | - MES æ°å¢/ç¼è¾è¡¨åä¸çç¶æåæ®µéç¦ç¨æéèï¼é¿å
è¯¯ä¼ å¯¼è´ç¶æè¢«ä¿®æ¹ã |
| | | - å端 `src/api/mes/md/item/index.ts` ä¸ç `updateItemStatus` 彿°å¯ä¸å¹¶æ¸
çï¼æ¥å£å·²ç§»é¤ï¼ã |
| | | - MDM å¯ç¨ç©ææ¶ï¼è¥è¯¥ç©æå¨ MES ä¾§å¯ç¨äºæ¹æ¬¡ç®¡ç使ªé
ç½®æ¹æ¬¡å±æ§ãæä¸ºäº§å使ªé
ç½® BOMï¼MES åæ¥æ ¡éªå¯è½æ¦æªå¯ç¨æä½ï¼éå
å¨ MES ä¾§è¡¥é½å¯¹åºé
ç½®ã |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | # MES 产åé¡¹ç®æ¥å
¥ BPM å®¡æ¹ - å端èè°æ¹æ¡ |
| | | |
| | | ## æ¶åé¡µé¢ |
| | | |
| | | - ç产管æ§-产å设计-产åé¡¹ç® å表页ï¼`src/views/mes/pd/project/index.vue`ï¼ |
| | | - 产åé¡¹ç® è¯¦æ
页ï¼`src/views/mes/pd/project/detail/index.vue`ï¼ |
| | | - 产åé¡¹ç® æµç¨è¿åº¦ç»ä»¶ï¼`src/views/mes/pd/project/modules/workflow-timeline.vue`ï¼ |
| | | |
| | | ## ä¸å¡æµç¨ä¸æ°æ®å¸¦å
¥ |
| | | |
| | | 1. å¾
å®¡æ ¸(2) â å表/详æ
ç¹ãæäº¤å®¡æ¹ãï¼å
è° `GET /mes/pd/project/approve-process-list` è·åå¯ç¨ BPM æµç¨ â æå¼æµç¨éæ©å¼¹çª â é䏿µç¨åè° `PUT /mes/pd/project/submit-approval?id={id}&processDefinitionKey={key}` â 项ç®ç¶æå为 **审æ¹ä¸(5)** |
| | | 2. BPM åå°å®¡æ¹éè¿ â å端çå¬å¨åè° â 项ç®ç¶æå为 **å¾
彿¡£(3)**ï¼å®¡æ¹é©³å/åæ¶ â ç¶æåå° **å¾
å®¡æ ¸(2)**ï¼å¯éæ°æäº¤ |
| | | 3. 审æ¹ä¸(5) â å表/详æ
æ¾ç¤ºãæ¥ç审æ¹ãæé® â 跳转 BPM æµç¨è¯¦æ
页æ¥ç审æ¹è¿åº¦ |
| | | 4. å¾
彿¡£(3) â ç¹ã彿¡£ãâ `PUT /mes/pd/project/archive?id={id}` â ç¶æå为 **已彿¡£(4)** |
| | | |
| | | ## API |
| | | |
| | | | æ¹æ³ | è·¯å¾ | 说æ | |
| | | |------|------|------| |
| | | | GET | /mes/pd/project/approve-process-list | è·å¾å¯ç¨ BPM å®¡æ¹æµç¨å表 | |
| | | | PUT | /mes/pd/project/submit-approval | æäº¤å®¡æ¹ï¼å¾
å®¡æ ¸â审æ¹ä¸ï¼ | |
| | | | PUT | /mes/pd/project/archive | 彿¡£ï¼å¾
彿¡£â已彿¡£ï¼ | |
| | | |
| | | **请æ±åæ°ï¼submit-approvalï¼ï¼** |
| | | |
| | | | åæ° | ç±»å | å¿
å¡« | 说æ | |
| | | |------|------|------|------| |
| | | | id | Long | æ¯ | 项ç®ç¼å· | |
| | | | processDefinitionKey | String | æ¯ | éä¸ç BPM æµç¨å®ä¹ Key | |
| | | |
| | | **ååºåæ®µåæ´ï¼/getã/pageï¼ï¼** |
| | | |
| | | | åæ®µ | ç±»å | 说æ | |
| | | |------|------|------| |
| | | | processInstanceId | String | BPM æµç¨å®ä¾ç¼å·ï¼å®¡æ¹ä¸å以åæå¼ | |
| | | |
| | | **ååºç¤ºä¾ï¼approve-process-listï¼ï¼** |
| | | |
| | | ```json |
| | | { |
| | | "code": 0, |
| | | "data": [ |
| | | { "id": "xxx", "name": "产å项ç®å®¡æ¹æµç¨", "key": "mes-pd-project-audit" } |
| | | ] |
| | | } |
| | | ``` |
| | | |
| | | ## åæ®µå±ç¤ºè§å |
| | | |
| | | | åæ®µ | å±ç¤ºä½ç½® | 说æ | |
| | | |------|----------|------| |
| | | | ç¶æ | å表ã详æ
| æ°å¢åå
¸å¼ã审æ¹ä¸ã(value=5)ï¼å表 `CellDict` èªå¨æ¸²æ | |
| | | | processInstanceId | å表/详æ
ãæ¥ç审æ¹ã | æå¼ææ¾ç¤ºãæ¥ç审æ¹ãæé® | |
| | | |
| | | ## 页颿¹å¨ |
| | | |
| | | ### 1. å表页 index.vue |
| | | |
| | | - ãå®¡æ ¸ãæé®æ¹ä¸ºãæäº¤å®¡æ¹ãï¼`ifShow` ä»ä¸º `status === PENDING_AUDIT`ï¼ç¹å»å
æ¥æµç¨å表ï¼ç©ºåæç¤ºãææ å¯ç¨å®¡æ¹æµç¨ï¼è¯·å
é
ç½® BPM æµç¨ãï¼ï¼æåæå¼æµç¨éæ©å¼¹çª |
| | | - æ°å¢ãæ¥ç审æ¹ãæé®ï¼`ifShow` 为 `status === APPROVING` ä¸ `processInstanceId` æå¼ï¼ç¹å»è·³ BPM æµç¨è¯¦æ
|
| | | - æ°å¢æµç¨éæ©å¼¹çªç»ä»¶ `process-select-modal.vue`ï¼Select 䏿鿵ç¨ï¼é»è®¤é第ä¸ä¸ªï¼ç¡®è®¤åè° submit-approvalï¼ |
| | | |
| | | ### 2. 详æ
页 detail/index.vue |
| | | |
| | | - ãå®¡æ ¸éè¿ãæé®æ¹ä¸ºãæäº¤å®¡æ¹ãï¼é»è¾åä¸ï¼æååå·æ°è¯¦æ
|
| | | - æ°å¢ãæ¥ç审æ¹ãæé®ï¼`ifShow` 为审æ¹ä¸ç¶æï¼ç¹å»è·³ BPM æµç¨è¯¦æ
|
| | | - 顶鍿é®åºæ°å¢å®¡æ¹ä¸å¤æ |
| | | |
| | | ### 3. æµç¨è¿åº¦ç»ä»¶ workflow-timeline.vue |
| | | |
| | | - æ¥éª¤ç± 5 æ¥æ©ä¸º 6 æ¥ï¼å¾
åå¸ â å¾
ä¸ä¼ â å¾
å®¡æ ¸ â **审æ¹ä¸** â å¾
彿¡£ â 已彿¡£ |
| | | - ç¶æå¼å°æ¥éª¤ç´¢å¼çæ å°éæ¾å¼å¤çï¼å®¡æ¹ä¸ value=5 æå¨å¾
å®¡æ ¸ä¹åï¼ |
| | | |
| | | ## ä¸å¡è§å说æ |
| | | |
| | | | åºæ¯ | è§å | |
| | | |------|------| |
| | | | æäº¤å®¡æ¹ | ä»
å¾
å®¡æ ¸(2)ç¶æå¯æäº¤ï¼è¥é¡¹ç®ä¸å卿ªå®¡æ ¸çè®¾è®¡èµæï¼å端è¿åé误ã该项ç®ä¸å卿ªå®¡æ ¸çèµæã | |
| | | | 审æ¹éè¿ | ç¶æ â å¾
彿¡£(3)ï¼å¯æ§è¡å½æ¡£ | |
| | | | 审æ¹é©³å/åæ¶ | ç¶æ â å¾
å®¡æ ¸(2)ï¼å¯ä¿®æ¹åéæ°æäº¤ | |
| | | | 彿¡£ | ä»
å¾
彿¡£(3)ç¶æå¯å½æ¡£ï¼å½æ¡£åçæå°è´¦è®°å½ã项ç®ä¸å¯åä¿®æ¹ | |
| | | |
| | | ## 注æäºé¡¹ |
| | | |
| | | - éå
å¨ BPM åå°æå·¥é¨ç½²å®¡æ¹æµç¨ï¼æµç¨ key=`mes-pd-project-audit`ï¼åç±»=`mes_pd_project_approve`ï¼ï¼å¦åãæäº¤å®¡æ¹ãæç¤ºææ å¯ç¨æµç¨ |
| | | - æªæäº¤å®¡æ¹ï¼processInstanceId ä¸ºç©ºï¼æ¶ç¹ãæ¥ç审æ¹ãåºæç¤ºã该项ç®å°æªæäº¤å®¡æ¹ã |
| | | - å岿°æ® status 0-4 ä¸åå½±åï¼æ¶é´çº¿ç»ä»¶éå
¼å®¹ç¶æå¼å°æ¥éª¤çéè¿ç»æ å° |
| | |
| | | `total_tax_price` decimal(24, 6) NOT NULL COMMENT 'å计ç¨é¢ï¼åä½ï¼å
', |
| | | `discount_percent` decimal(24, 6) NOT NULL COMMENT '伿 çï¼ç¾åæ¯', |
| | | `discount_price` decimal(24, 6) NOT NULL COMMENT '伿 éé¢ï¼åä½ï¼å
', |
| | | `deposit_price` decimal(24, 6) NOT NULL COMMENT 'å®ééé¢ï¼åä½ï¼å
', |
| | | `deposit_price` decimal(24, 6) NOT NULL DEFAULT 0 COMMENT 'å®ééé¢ï¼åä½ï¼å
', |
| | | `file_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT 'éä»¶å°å', |
| | | `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '夿³¨', |
| | | `process_instance_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT 'BPM æµç¨å®ä¾ç¼å·', |
| | |
| | | |
| | | ## æ¶åé¡µé¢ |
| | | |
| | | - éè´æ¥ç¥¨ç®¡ç页ï¼**æ°å»ºé¡µé¢**ï¼åèéè´ç³è¯·/éè´è®¢å页é¢ç»æï¼ |
| | | - éè´æ¥ç¥¨ç®¡çé¡µï¼æ¥ç¥¨åè¡¨ãæ°å¢/ç¼è¾/详æ
å¼¹çªï¼ |
| | | - éè´è®¢å详æ
页ï¼å±ç¤ºè¯¥è®¢åä¸å·²å
³èçæ¥ç¥¨ä¿¡æ¯ï¼ |
| | | - 仿¬¾å管çé¡µï¼æ°å»º/ç¼è¾å¼¹çªãå表ã详æ
ï¼ |
| | | - 仿¬¾å详æ
页ï¼å±ç¤ºå
³èçæ¥ç¥¨ä¿¡æ¯ï¼ |
| | |
| | | ## ä¸å¡æµç¨ä¸æ°æ®å¸¦å
¥ |
| | | |
| | | 1. éè´è®¢åï¼å®¡æ ¸éè¿ï¼-> å建æ¥ç¥¨ï¼`purchaseOrderId` å¿
éï¼ä¾åºåèªå¨å¸¦åºï¼ä»¥éè´è®¢åçä¾åºå为åï¼å端æ éä¼ `supplierId`ï¼ç±å端æéè´è®¢åæ¥è¯¢è®¾ç½®ï¼ã |
| | | 2. æ¥ç¥¨å建å -> ä¸ä¼ å票éä»¶ï¼èµ° system 模å Storage APIï¼ã |
| | | 3. æ¥ç¥¨æäº¤å®¡æ¹ -> 审æ¹éè¿ -> æå¯ä½ä¸ºä»æ¬¾å
³è对象ã |
| | | 4. æ°å»ºä»æ¬¾å -> éæ©å
³èæ¥ç¥¨ï¼`invoiceId` å¿
å¡«ï¼ï¼ä» `GET /erp/purchase-invoice/simple-list?supplierId=&purchaseOrderId=` éæ©ï¼ä»
æ¾ç¤º"审æ¹éè¿ + å·²ä¸ä¼ éä»¶ + å©ä½å¯ä»éé¢ > 0"çæ¥ç¥¨ï¼éæ©å `remainingInvoicePrice` å¯ç¨äºé¢å¡«ä»æ¬¾éé¢ä¸éã |
| | | 2. æ¥ç¥¨å建å -> ä¸ä¼ å票éä»¶ï¼èµ° system 模å Storage APIï¼ã**æ¥ç¥¨å建å³çæï¼æ å®¡æ ¸ç¯è**ã |
| | | 3. æ°å»ºä»æ¬¾å -> éæ©å
³èæ¥ç¥¨ï¼`invoiceId` å¿
å¡«ï¼ï¼ä» `GET /erp/purchase-invoice/simple-list?supplierId=&purchaseOrderId=` éæ©ï¼ä»
æ¾ç¤º"å·²ä¸ä¼ éä»¶ + å©ä½å¯ä»éé¢ > 0"çæ¥ç¥¨ï¼éæ©å `remainingInvoicePrice` å¯ç¨äºé¢å¡«ä»æ¬¾éé¢ä¸éã |
| | | |
| | | 对åºå
³ç³»ï¼**éè´è®¢å(1) -> æ¥ç¥¨(N) -> 仿¬¾(M)**ã |
| | | |
| | | ## API |
| | | |
| | | ### 1. æ¥ç¥¨ç®¡çï¼æ°ï¼ |
| | | ### 1. æ¥ç¥¨ç®¡ç |
| | | |
| | | | æ¹æ³ | è·¯å¾ | 说æ | |
| | | |------|------|------| |
| | |
| | | | GET | /erp/purchase-invoice/get?id= | è·å¾æ¥ç¥¨è¯¦æ
| |
| | | | GET | /erp/purchase-invoice/page | æ¥ç¥¨å页 | |
| | | | GET | /erp/purchase-invoice/export-excel | å¯¼åºæ¥ç¥¨ Excel | |
| | | | PUT | /erp/purchase-invoice/submit?id= | æäº¤æ¥ç¥¨å®¡æ¹ | |
| | | | GET | /erp/purchase-invoice/audit-count | å¾
å®¡æ ¸æ¥ç¥¨æ°é | |
| | | | GET | /erp/purchase-invoice/simple-list?supplierId=&purchaseOrderId= | ç²¾ç®å表ï¼ä»æ¬¾è¡¨åéæ¥ç¥¨ï¼ | |
| | | |
| | | > å·²ç§»é¤æ¥å£ï¼`/erp/purchase-invoice/update-status`ï¼å®¡æ ¸/åå®¡æ ¸ï¼ã`/erp/purchase-invoice/audit-count`ï¼å¾
å®¡æ ¸æ°éï¼ãåç«¯è¯·åæ¥å é¤å¯¹åºæé®ä¸æ¥å£è°ç¨ã |
| | | |
| | | **å建/æ´æ°æ¥ç¥¨è¯·æ±åæ°ï¼** |
| | | |
| | |
| | | | remark | String | å¦ | 夿³¨ | |
| | | | blobIds | List\<Long\> | å¦ | å票éä»¶ blobId å表 | |
| | | |
| | | **æ¥ç¥¨å页/详æ
ååºæ°å¢å段ï¼** |
| | | **æ¥ç¥¨å页/详æ
ååºå段ï¼** |
| | | |
| | | | åæ®µ | ç±»å | 说æ | |
| | | |------|------|------| |
| | | | no | String | æ¥ç¥¨ç¼å·ï¼å端çæï¼åç¼ FPDï¼ | |
| | | | supplierName | String | ä¾åºååç§° | |
| | | | order | Object | éè´è®¢åä¿¡æ¯ï¼åµå¥ï¼ | |
| | | | auditStatus | Integer | 审æ¹ç¶æï¼0æªæäº¤/10审æ¹ä¸/20å®¡æ ¸éè¿/30å®¡æ ¸ä¸éè¿/40å·²åæ¶ï¼ | |
| | | | attachmentList | List | å票éä»¶å表 | |
| | | | hasAttachment | Boolean | æ¯å¦å·²ä¸ä¼ å票éä»¶ | |
| | | | remainingInvoicePrice | BigDecimal | å©ä½å¯ä»éé¢ = æ¥ç¥¨éé¢ - 该æ¥ç¥¨å·²ä»æ¬¾éé¢ | |
| | | |
| | | > 已移é¤ååºå段ï¼`auditStatus`ï¼å®¡æ¹ç¶æï¼ã`processInstanceId`ï¼å·¥ä½æµç¼å·ï¼ã |
| | | |
| | | **simple-list ååºï¼** |
| | | |
| | |
| | | | price | BigDecimal | æ¥ç¥¨éé¢ | |
| | | | supplierId | Long | ä¾åºåç¼å· | |
| | | | purchaseOrderId | Long | éè´è®¢åç¼å· | |
| | | | auditStatus | Integer | 审æ¹ç¶æ | |
| | | | hasAttachment | Boolean | æ¯å¦å·²ä¸ä¼ éä»¶ï¼æä¸º trueï¼ | |
| | | | remainingInvoicePrice | BigDecimal | å©ä½å¯ä»éé¢ | |
| | | |
| | | ### 2. 仿¬¾åï¼æ¥å£åæ´ï¼ |
| | | ### 2. 仿¬¾å |
| | | |
| | | | æ¹æ³ | è·¯å¾ | 说æ | |
| | | |------|------|------| |
| | | | POST | /erp/finance-payment/create | åå»ºä»æ¬¾åï¼è¯·æ±ä½æ°å¢ `invoiceId`ï¼å¿
å¡«ï¼ | |
| | | | PUT | /erp/finance-payment/update | æ´æ°ä»æ¬¾åï¼è¯·æ±ä½æ°å¢ `invoiceId`ï¼å¿
å¡«ï¼ | |
| | | | GET | /erp/finance-payment/get | ååºæ°å¢ `invoiceId`ã`invoice` åµå¥å¯¹è±¡ | |
| | | | GET | /erp/finance-payment/page | ååºæ°å¢ `invoiceId`ã`invoice` åµå¥å¯¹è±¡ | |
| | | | POST | /erp/finance-payment/create | åå»ºä»æ¬¾åï¼è¯·æ±ä½å« `invoiceId`ï¼å¿
å¡«ï¼ | |
| | | | PUT | /erp/finance-payment/update | æ´æ°ä»æ¬¾åï¼è¯·æ±ä½å« `invoiceId`ï¼å¿
å¡«ï¼ | |
| | | | GET | /erp/finance-payment/get | ååºå« `invoiceId`ã`invoice` åµå¥å¯¹è±¡ | |
| | | | GET | /erp/finance-payment/page | ååºå« `invoiceId`ã`invoice` åµå¥å¯¹è±¡ | |
| | | |
| | | **请æ±åæ°æ°å¢ï¼** |
| | | |
| | |
| | | | åæ®µ | ç±»å | 说æ | |
| | | |------|------|------| |
| | | | invoiceId | Long | å
³èçæ¥ç¥¨ç¼å· | |
| | | | invoice | Object | å
³èçæ¥ç¥¨ä¿¡æ¯ï¼å« noãinvoiceNoãinvoiceTitleãpriceãauditStatus çï¼ | |
| | | | invoice | Object | å
³èçæ¥ç¥¨ä¿¡æ¯ï¼å« noãinvoiceNoãinvoiceTitleãprice çï¼ | |
| | | |
| | | **ååºç¤ºä¾ï¼** |
| | | |
| | |
| | | "no": "FPD20260810000001", |
| | | "invoiceNo": "02564178", |
| | | "invoiceTitle": "XXç§ææéå
¬å¸", |
| | | "price": 9000.00, |
| | | "auditStatus": 20 |
| | | "price": 9000.00 |
| | | }, |
| | | "paymentPrice": 5000.00 |
| | | } |
| | |
| | | | å票å·ç /æ¬å¤´ | æ¥ç¥¨å表ã详æ
| å½å
¥å段 | |
| | | | æ¥ç¥¨éé¢ | æ¥ç¥¨å表ã详æ
ã仿¬¾è¡¨å | å
| |
| | | | æ¥ç¥¨æ¥æ | æ¥ç¥¨å表ã详æ
| | |
| | | | 审æ¹ç¶æ | æ¥ç¥¨å表ã详æ
| åå
¸å±ç¤º | |
| | | | å票éä»¶ | æ¥ç¥¨è¯¦æ
ãæ¥ç¥¨å表 | ä¸ä¼ /é¢è§/ä¸è½½ | |
| | | | å票éä»¶ | æ¥ç¥¨è¯¦æ
ãæ¥ç¥¨å表 | ä¸ä¼ /é¢è§/ä¸è½½ï¼æéä»¶æ¾ç¤º"å·²ä¸ä¼ "Tag | |
| | | | å©ä½å¯ä»éé¢ | æ¥ç¥¨å表ã仿¬¾è¡¨å | æ¥ç¥¨éé¢ - 已仿¬¾éé¢ | |
| | | | å
³èæ¥ç¥¨ | 仿¬¾å表ã仿¬¾è¯¦æ
| å±ç¤º invoice.no / invoice.invoiceNo / invoice.price | |
| | | |
| | | > 已移é¤å±ç¤ºåæ®µï¼æ¥ç¥¨å表ç"审æ¹ç¶æ"åãæç´¢æ¡ä»¶"å®¡æ ¸ç¶æ"ã"å®¡æ ¸/åå®¡æ ¸"æä½æé®ã |
| | | |
| | | ## ä¸å¡è§å说æ |
| | | |
| | | | åºæ¯ | è§å | |
| | | |------|------| |
| | | | æ¥ç¥¨å建 | éè´è®¢åå¿
é¡»å®¡æ ¸éè¿ï¼æ¥ç¥¨ä¾åºåä¸éè´è®¢åä¸è´ï¼æ¥ç¥¨éé¢ä¸è¶
è¿è®¢åå©ä½å¯å¼ç¥¨éé¢ | |
| | | | æ¥ç¥¨ç¼è¾ | ä»
"æªæäº¤"ç¶æå¯ç¼è¾ | |
| | | | æ¥ç¥¨å é¤ | 审æ¹éè¿åä¸å¯å é¤ | |
| | | | æ¥ç¥¨æäº¤å®¡æ¹ | ä»
"æªæäº¤"ç¶æå¯æäº¤ï¼æäº¤åè¿å
¥å®¡æ¹ä¸ | |
| | | | 仿¬¾éæ©æ¥ç¥¨ | ä»
审æ¹éè¿ + å·²ä¸ä¼ å票éä»¶çæ¥ç¥¨å¯é | |
| | | | æ¥ç¥¨å建 | éè´è®¢åå¿
é¡»å®¡æ ¸éè¿ï¼æ¥ç¥¨ä¾åºåä¸éè´è®¢åä¸è´ï¼æ¥ç¥¨éé¢ä¸è¶
è¿è®¢åå©ä½å¯å¼ç¥¨éé¢ï¼**å建å³çæï¼æ éå®¡æ ¸** | |
| | | | æ¥ç¥¨ç¼è¾ | ä»»æç¶æå¯ç¼è¾ï¼æ å®¡æ ¸ç¶æéå¶ | |
| | | | æ¥ç¥¨å é¤ | å·²æææä»æ¬¾åï¼æªä½åºä¸ä»æ¬¾éé¢ > 0ï¼å
³èçæ¥ç¥¨ä¸å¯å é¤ï¼å
¶ä½å¯å é¤ | |
| | | | 仿¬¾éæ©æ¥ç¥¨ | å·²ä¸ä¼ å票éä»¶ä¸å©ä½å¯ä»éé¢ > 0 çæ¥ç¥¨å¯éï¼**ä¸åè¦æ±å®¡æ ¸éè¿**ï¼ | |
| | | | 仿¬¾éé¢ä¸é | 仿¬¾éé¢ <= 该æ¥ç¥¨éé¢ - 该æ¥ç¥¨å·²ä»æ¬¾éé¢ï¼æªå®¡æ ¸+审æ¹ä¸+å·²å®¡æ ¸ä»æ¬¾ï¼æé¤ä½åºï¼ | |
| | | | ä¾åºåä¸è´æ§ | 仿¬¾çä¾åºåå¿
é¡»ä¸å
³èæ¥ç¥¨çä¾åºåä¸è´ | |
| | | | åé仿¬¾å | invoiceId 为空çåé仿¬¾åï¼ç¼è¾æ¶ééæ°éæ©åæ ¼æ¥ç¥¨ | |
| | |
| | | - 仿¬¾è¡¨åéæ©æ¥ç¥¨æ¶ï¼å
æä¾åºåè¿æ»¤ï¼`supplierId`ï¼ï¼å¯éè®¢åæ¶ä¼ `purchaseOrderId` è¿ä¸æ¥è¿æ»¤ã |
| | | - `remainingInvoicePrice` ä¸ºè´æ°æ 0 çæ¥ç¥¨ä¸ä¼åºç°å¨ simple-list ä¸ï¼å端å¯ç´æ¥æè¿åå表渲æã |
| | | - 仿¬¾é颿 ¡éªå¨å端ï¼å端å¯å°æ¥ç¥¨ç `remainingInvoicePrice` ä½ä¸ºä»æ¬¾éé¢è¾å
¥ä¸éæç¤ºã |
| | | - æ¥ç¥¨å®¡æ¹ç¶æååéè¿ BPM åè°æ´æ°ï¼å端æ éå¤çï¼å页æ¥å£ç´æ¥è¿åææ°ç¶æã |
| | | - æ¥ç¥¨å票éä»¶ä¸ä¼ ä½¿ç¨ system 模å Storage APIï¼upload -> bindï¼ï¼ä¸è¦ä½¿ç¨æ§ç /infra/file æ¥å£ã |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | -- ERP éè´æ¥ç¥¨å»æå®¡æ ¸ï¼å é¤å®¡æ ¸ç¶æå段ä¸å·¥ä½æµæ®çåæ®µ |
| | | -- èæ¯ï¼æ¥ç¥¨å建å³çæï¼æ éå®¡æ ¸ï¼ä»æ¬¾ä¸åæ ¡éª"æ¥ç¥¨å®¡æ ¸éè¿" |
| | | -- æ§è¡æ¶æºï¼æ°å端é¨ç½²åçåæçªå£æ§è¡ï¼æ§ä»£ç 读åè¿ä¸¤åï¼å
å åä¼å¯¼è´è¿è¡æ¶æ¥éï¼ |
| | | |
| | | ALTER TABLE erp_purchase_invoice DROP COLUMN audit_status; |
| | | ALTER TABLE erp_purchase_invoice DROP COLUMN process_instance_id; |
| | | |
| | | -- æ¸
çå¤å¿èåæéï¼å¯¹åºå·²å é¤ç /update-status å®¡æ ¸æ¥å£ï¼ |
| | | DELETE FROM system_menu WHERE permission = 'erp:purchase-invoice:update-status'; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | # SRM èµè´¨éä»¶ä¸ä¼ - å端èè°æ¹æ¡ |
| | | |
| | | ## æ¶åé¡µé¢ |
| | | |
| | | - éè´ç®¡ç-SRM-ä¾åºå管ç-èµè´¨è¯ä¹¦å表页 |
| | | - éè´ç®¡ç-SRM-ä¾åºå管ç-èµè´¨è¯ä¹¦æ°å¢/ç¼è¾å¼¹çª |
| | | - éè´ç®¡ç-SRM-ææ é¡¹ç®-æ°å¢/ç¼è¾å¼¹çªï¼å«åå¸ä¸/ææ ä¸çé¨åæ´æ°ï¼ |
| | | - éè´ç®¡ç-SRM-ææ é¡¹ç®-详æ
页 |
| | | |
| | | ## ä¸å¡æµç¨ä¸æ°æ®å¸¦å
¥ |
| | | |
| | | 1. ç¨æ·å¨è¡¨åä¸éè¿ä¸ä¼ ç»ä»¶éæ©æä»¶ |
| | | 2. ä¸ä¼ ç»ä»¶è°ç¨ `/system/storage-blob/upload` è·å¾ `blobId` |
| | | 3. ä¿åä¸å¡è®°å½ï¼èµè´¨è¯ä¹¦ / ææ é¡¹ç®ï¼æ¶ï¼å°æä»¶ ID å表 `blobIds` éä¸å¡æ°æ®ä¸å¹¶æäº¤ |
| | | 4. å端å¨ä¸å¡è®°å½ä¿ååï¼éè¿ `recordType + recordId` å°æä»¶ç»å®å° `system_storage_attachment` ä¸é´è¡¨ |
| | | 5. æ¥è¯¢ä¸å¡è®°å½ï¼è¯¦æ
ãåé¡µï¼æ¶ï¼å端è¿å `attachmentList`ï¼å«æä»¶ URLãåç§°ï¼ï¼å端å±ç¤ºä¸è½½é¾æ¥ |
| | | |
| | | ## API |
| | | |
| | | ### 1. èµè´¨è¯ä¹¦éä»¶ |
| | | |
| | | | æ¹æ³ | è·¯å¾ | 说æ | |
| | | |------|------|------| |
| | | | POST | /system/storage-blob/upload | ä¸ä¼ æä»¶ï¼å
¥å multipart ç `files`ï¼è¿å Blob å表ï¼å« `id`ï¼ | |
| | | | POST | /srm/supplier-certificate/create | å建èµè´¨è¯ä¹¦ï¼æ°å¢å
¥å `blobIds` | |
| | | | PUT | /srm/supplier-certificate/update | æ´æ°èµè´¨è¯ä¹¦ï¼æ°å¢å
¥å `blobIds`ï¼å¢éæ´æ°éä»¶ï¼ | |
| | | | DELETE | /srm/supplier-certificate/delete | å é¤èµè´¨è¯ä¹¦ï¼åæ¥å é¤éä»¶ | |
| | | | GET | /srm/supplier-certificate/page | å页æ¥è¯¢ï¼ååºæ°å¢ `attachmentList` | |
| | | | GET | /srm/supplier-certificate/get | 详æ
æ¥è¯¢ï¼ååºæ°å¢ `attachmentList` | |
| | | | GET | /srm/supplier-certificate/list-by-supplier | æä¾åºåæ¥è¯¢ï¼ååºæ°å¢ `attachmentList` | |
| | | |
| | | **请æ±åæ°ï¼create/update æ°å¢å段ï¼ï¼** |
| | | |
| | | | åæ° | ç±»å | å¿
å¡« | 说æ | |
| | | |------|------|------|------| |
| | | | blobIds | Array\<Long\> | å¦ | èµè´¨è¯ä¹¦éä»¶æä»¶ ID å表 | |
| | | |
| | | **ååºå段æ°å¢ï¼attachmentList æ°ç»å
ç´ ï¼ï¼** |
| | | |
| | | | åæ®µ | ç±»å | 说æ | |
| | | |------|------|------| |
| | | | id | Long | æä»¶ ID | |
| | | | name | String | åæä»¶å | |
| | | | url | String | æä»¶è®¿é®å°å | |
| | | | previewURL | String | é¢è§å°å | |
| | | | downloadURL | String | ä¸è½½å°å | |
| | | |
| | | **ååºç¤ºä¾ï¼** |
| | | |
| | | ```json |
| | | { |
| | | "code": 0, |
| | | "data": { |
| | | "id": 1, |
| | | "supplierId": 10, |
| | | "certificateName": "ISO9001è´¨é管çä½ç³»", |
| | | "attachmentList": [ |
| | | { |
| | | "id": 1001, |
| | | "name": "iso9001_cert.pdf", |
| | | "url": "https://example.com/files/xxx.pdf" |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | ``` |
| | | |
| | | ### 2. ææ é¡¹ç®èµè´¨è¦æ±éä»¶ |
| | | |
| | | | æ¹æ³ | è·¯å¾ | 说æ | |
| | | |------|------|------| |
| | | | POST | /system/storage-blob/upload | ä¸ä¼ æä»¶ï¼å
¥å multipart ç `files`ï¼è¿å Blob å表ï¼å« `id`ï¼ | |
| | | | POST | /srm/tender-project/create | åå»ºææ é¡¹ç®ï¼æ°å¢å
¥å `blobIds` | |
| | | | PUT | /srm/tender-project/update | æ´æ°ææ 项ç®ï¼æ°å¢å
¥å `blobIds`ï¼è稿/åå¸ä¸/ææ ä¸åå¢éæ´æ°éä»¶ï¼ | |
| | | | PUT | /srm/tender-project/update-info | é¨åæ´æ°ï¼åå¸ä¸/ææ ä¸ï¼ï¼æ°å¢å
¥å `blobIds` | |
| | | | DELETE | /srm/tender-project/delete | å 餿æ 项ç®ï¼åæ¥å é¤éä»¶ | |
| | | | GET | /srm/tender-project/get | 详æ
æ¥è¯¢ï¼ååºæ°å¢ `attachmentList` | |
| | | | GET | /srm/tender-project/page | å页æ¥è¯¢ï¼ååºæ°å¢ `attachmentList` | |
| | | |
| | | **请æ±åæ°ï¼create/update/update-info æ°å¢å段ï¼ï¼** |
| | | |
| | | | åæ° | ç±»å | å¿
å¡« | 说æ | |
| | | |------|------|------|------| |
| | | | blobIds | Array\<Long\> | å¦ | èµè´¨è¦æ±éä»¶æä»¶ ID å表 | |
| | | |
| | | **ååºå段æ°å¢ï¼** åèµè´¨è¯ä¹¦ï¼`attachmentList` æ°ç»å
ç´ å« `id`ã`name`ã`url`ã`previewURL`ã`downloadURL`ã |
| | | |
| | | ## åæ®µå±ç¤ºè§å |
| | | |
| | | | åæ®µ | å±ç¤ºä½ç½® | 说æ | |
| | | |------|----------|------| |
| | | | è¯ä¹¦éä»¶ | èµè´¨è¯ä¹¦å表 | æ°å¢ãéä»¶ãåï¼æ¾ç¤ºéä»¶åç§°é¾æ¥ï¼ç¹å»æ°çªå£æå¼ï¼æ éä»¶æ¾ç¤º `--` | |
| | | | è¯ä¹¦éä»¶ | èµè´¨è¯ä¹¦æ°å¢/ç¼è¾å¼¹çª | ãè¯ä¹¦éä»¶ãä¸ä¼ é¡¹ï¼æ¯æå¤æä»¶ï¼ç¼è¾æ¶åæ¾å·²ä¸ä¼ æä»¶ | |
| | | | èµè´¨è¦æ±éä»¶ | ææ é¡¹ç®æ°å¢/ç¼è¾å¼¹çª | ãèµè´¨è¦æ±éä»¶ãä¸ä¼ é¡¹ï¼æ¯æå¤æä»¶ï¼ç¼è¾æ¶åæ¾å·²ä¸ä¼ æä»¶ | |
| | | | èµè´¨è¦æ±éä»¶ | ææ é¡¹ç®è¯¦æ
页 | ãèµè´¨è¦æ±ãæå 颿¿å
å±ç¤ºéä»¶åç§°é¾æ¥ï¼ç¹å»æ°çªå£æå¼ | |
| | | |
| | | ## ä¸å¡è§å说æ |
| | | |
| | | | åºæ¯ | è§å | |
| | | |------|------| |
| | | | ç¼è¾åæ¾ | ç¼è¾æ¶å端è¿å `attachmentList`ï¼å端å°å
¶æ å°ä¸ºä¸ä¼ ç»ä»¶æä»¶å¯¹è±¡ï¼`uid`ã`name`ã`url`ã`status='done'`ã`id`ï¼å¹¶èµç» `blobIds`ï¼æäº¤æ¶æ `valueKey='id'` æåæä»¶ ID æäº¤ | |
| | | | éä»¶æ´æ° | å端æãå¢éæ´æ°ãå¤çï¼ä»¥æ¬æ¬¡æäº¤ç `blobIds` 为åï¼èªå¨å é¤å·²ç§»é¤çæä»¶ç»å®ãæ°å¢æ°ä¸ä¼ çæä»¶ç»å® | |
| | | | å é¤ä¸å¡è®°å½ | å é¤èµè´¨è¯ä¹¦/ææ é¡¹ç®æ¶ï¼åç«¯åæ¥å é¤å
¶éä»¶ | |
| | | | åå¸ä¸/ææ ä¸ç¼è¾ | ææ é¡¹ç®å¨åå¸ä¸/ææ ä¸é¶æ®µéè¿ `update-info` æ¥å£ä»
è½ä¿®æ¹ææ 说æãèµè´¨è¦æ±åèµè´¨è¦æ±éä»¶ | |
| | | | ä¸ä¼ æ ¼å¼ | æ¯æ jpgãjpegãpngãpdfãdocãdocxï¼å个æä»¶ä¸è¶
è¿ 2MB | |
| | | |
| | | ## 注æäºé¡¹ |
| | | |
| | | - ä¸ä¼ å¿
须走 `/system/storage-blob/upload`ï¼ç¦æ¢ä½¿ç¨æ§ç `/infra/file/*` æ¥å£ã |
| | | - èµè´¨è¯ä¹¦ä¸ææ 项ç®ä½¿ç¨ä¸åç `recordType`ï¼èµè´¨è¯ä¹¦ä¸º `srm_supplier_certificate`ï¼ææ 项ç®ä¸º `srm_tender_project`ï¼å端æ éå
³å¿ï¼ç±å端å¤çã |
| | | - ç¼è¾åæ¾æ¶è¥ç¨æ·æªæ¹å¨éä»¶ï¼æäº¤ç `blobIds` ä»åºå
å«åææä»¶ IDï¼ç±ä¸ä¼ ç»ä»¶åæ¾å¯¹è±¡æºå¸¦ï¼ï¼é¿å
é件被误å ã |
| | | - ææ é¡¹ç®é¨åæ´æ°ï¼`update-info`ï¼è¯·æ±ä½åæ ·éæºå¸¦ `blobIds`ã |
| | | - å表页é件龿¥å»ºè®® `target="_blank"` æ°çªå£æå¼ï¼ä¾¿äºé¢è§ PDF/å¾çã |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | # SRM ä¾åºåææ é人 & 䏿 èªå¨åå
¥ - å端èè°æ¹æ¡ |
| | | |
| | | ## æ¶åé¡µé¢ |
| | | |
| | | - ææ é¡¹ç®è¯¦æ
é¡µï¼ææ 管ç Tabãè¯æ Tab çä¾åºåéæ©ï¼ |
| | | - SRM ä¾åºå管ç页é¢ï¼ä»
æ°å¢ `getSupplierList` APIï¼é¡µé¢æ¬èº«æ æ¹å¨ï¼ |
| | | |
| | | ## èæ¯ä¸éæ± |
| | | |
| | | 1. ææ é¡¹ç®è¯¦æ
页ä¸ãæ°å¢ææ ããè¯æ ãæ¶éæ©ä¾åºåï¼**ä¸åè¿æ»¤åå
¥ç¶æ**ï¼ç´æ¥æ¥è¯¢ä¾åºåæ¡£æ¡å表ã |
| | | 2. 䏿 å¹¶çæéè´è®¢åæ¶ï¼å¦æä¾åºåå°æªåå
¥ï¼å端ä¼èªå¨å建åå
¥ç³è¯·å¹¶ç½®ä¸ºå·²éè¿ï¼å端æ éé¢å¤å¤çã |
| | | |
| | | ## API |
| | | |
| | | | æ¹æ³ | è·¯å¾ | 说æ | |
| | | |------|------|------| |
| | | | GET | /srm/supplier/list | è·åä¾åºåæ¡£æ¡å表ï¼ä¸è¿æ»¤åå
¥ç¶æï¼ | |
| | | |
| | | **请æ±åæ°ï¼** æ |
| | | |
| | | **ååºï¼** |
| | | |
| | | | åæ®µ | ç±»å | 说æ | |
| | | |------|------|------| |
| | | | id | number | ä¾åºå ID | |
| | | | name | string | ä¾åºååç§° | |
| | | | code | string | ä¾åºåç¼ç | |
| | | | status | number | ç¶æï¼0 å¯ç¨ï¼1 ç¦ç¨ï¼ | |
| | | |
| | | **ååºç¤ºä¾ï¼** |
| | | |
| | | ```json |
| | | { |
| | | "code": 0, |
| | | "data": [ |
| | | { "id": 1, "code": "SUP001", "name": "ææå
¬å¸", "status": 0 } |
| | | ] |
| | | } |
| | | ``` |
| | | |
| | | ## å端修æ¹ç¹ |
| | | |
| | | ### 1. æ°å¢ API 彿° |
| | | |
| | | å¨ `src/api/srm/supplier/index.ts` 䏿°å¢ `getSupplierList()`ï¼è¯·æ± `/srm/supplier/list`ã |
| | | |
| | | > åæç `getSupplierSimpleList()`ï¼è¯·æ± `/srm/supplier/simple-list`ï¼ä»
è¿åå·²åå
¥ä¾åºåï¼**ä¿çä¸å¨**ï¼å
¶å®é¡µé¢ï¼éè´è®¢åãéè´å
¥åºãIQC çï¼ä»ä½¿ç¨å®ã |
| | | |
| | | ### 2. ææ é¡¹ç®è¯¦æ
页æ¹ç¨æ¡£æ¡å表 |
| | | |
| | | `src/views/srm/tender/detail.vue` ä¸ï¼ |
| | | |
| | | - å° `getSupplierSimpleList` ç import æ¿æ¢ä¸º `getSupplierList` |
| | | - å° `onMounted` ä¸å è½½ä¾åºåæ°æ®çè°ç¨æ¹ä¸º `getSupplierList` |
| | | |
| | | 该页é¢çãææ 管çãä¾åºå鿩䏿ããè¯æ ãä¾åºå鿩䏿ï¼å使ç¨åä¸ä¸ª `supplierList`ï¼æ¿æ¢åä¸¤ä¸ªä¸æé½ä¼å±ç¤ºå
¨é¨ä¾åºåæ¡£æ¡ï¼ä¸è¿æ»¤åå
¥ï¼ã |
| | | |
| | | ## åæ®µå±ç¤ºè§å |
| | | |
| | | | åæ®µ | å±ç¤ºä½ç½® | 说æ | |
| | | |------|----------|------| |
| | | | id | 䏿 value | ä¾åºå IDï¼æäº¤ç»å端 | |
| | | | name | 䏿 label | ä¾åºååç§° | |
| | | |
| | | ## ä¸å¡è§å说æ |
| | | |
| | | | åºæ¯ | è§å | |
| | | |------|------| |
| | | | ææ æ¶éæ©ä¾åºå | å±ç¤ºå
¨é¨ä¾åºåæ¡£æ¡ï¼ä¸åè¿æ»¤åå
¥ç¶æ | |
| | | | è¯æ æ¶éæ©ä¾åºå | åææ ï¼å±ç¤ºå
¨é¨ä¾åºåæ¡£æ¡ | |
| | | | 䏿 çæéè´è®¢å | è¥ä¾åºåæªåå
¥ï¼å端èªå¨å建åå
¥ç³è¯·å¹¶ç´æ¥ç½®ä¸ºå·²éè¿ï¼åçæéè´è®¢åï¼å端æ éè°ç¨åå
¥ç¸å
³æ¥å£ | |
| | | | æªåå
¥ä¾åºåè½å¦ææ | å¯ä»¥ï¼ææ ä¸ååå
¥ç¶æéå¶ | |
| | | |
| | | ## 注æäºé¡¹ |
| | | |
| | | - `getSupplierList` è¿åçæ°ç»å
ç´ å« `id`ã`name`ï¼å¯ç´æ¥ç¨äºä¸æé项ï¼`{ id, name }`ï¼ã |
| | | - ä¾åºå被ç¦ç¨ï¼status = 1ï¼æ¶æ¯å¦å
è®¸ææ ï¼æ¬æ¥å£ä¸è¿æ»¤åå
¥ç¶æï¼`status` åæ®µç±å端å³å®æ¯å¦è¿æ»¤å±ç¤ºï¼ç®åææ è¯¦æ
页䏿ä¸è¿æ»¤ã |
| | | - 䏿 èªå¨åå
¥æ¯å端è¡ä¸ºï¼å端ãç¡®è®¤ä¸æ ããçæéè´è®¢åãæé®çè°ç¨æ¹å¼ä¸åã |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | -- ============================================ |
| | | -- MES 设å¤ç®¡ç-计éå¨å
· & è®¡éæ£æµè®°å½ 模ååå§åèæ¬ |
| | | -- 1. 建表 2. èå 3. åå
¸ 4. ç«å
ä¿¡æ¨¡æ¿ 5. å
¨å±é
ç½® |
| | | -- ============================================ |
| | | |
| | | -- 1. 建表 |
| | | DROP TABLE IF EXISTS `mes_dv_metering_check`; |
| | | DROP TABLE IF EXISTS `mes_dv_metering`; |
| | | CREATE TABLE `mes_dv_metering` ( |
| | | `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主é®ID', |
| | | `code` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '计éå¨å
·ç¼ç ', |
| | | `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '计éå¨å
·åç§°', |
| | | `specification` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT 'è§æ ¼åå·', |
| | | `brand` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT 'åç/ç产åå®¶', |
| | | `category` int NULL DEFAULT NULL COMMENT 'å¨å
·ç±»å«ï¼å¡å°º/ååå°º/åå表çï¼ï¼åå
¸ mes_dv_metering_category', |
| | | `precision` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '精度', |
| | | `range` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT 'éç¨', |
| | | `dept_id` bigint NULL DEFAULT NULL COMMENT '使ç¨é¨é¨ç¼å·', |
| | | `charge_user_id` bigint NULL DEFAULT NULL COMMENT '责任人ç¼å·ï¼ç«å
ä¿¡åé对象ï¼', |
| | | `check_cycle_count` int NOT NULL COMMENT 'æ ¡åå¨æï¼æï¼', |
| | | `use_date` date NULL DEFAULT NULL COMMENT 'æå
¥ä½¿ç¨æ¥æ', |
| | | `last_check_date` date NULL DEFAULT NULL COMMENT '䏿¬¡æ£æµæ¥æ', |
| | | `next_check_date` date NULL DEFAULT NULL COMMENT '䏿¬¡æ£æµæ¥æï¼å°ææ¥ï¼', |
| | | `status` int NOT NULL COMMENT 'ç¶æï¼å¨ç¨/åç¨/æ¥åºï¼ï¼åå
¸ mes_dv_metering_status', |
| | | `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '夿³¨', |
| | | |
| | | -- æ ååæ®µ |
| | | `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT 'å建è
', |
| | | `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'å建æ¶é´', |
| | | `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT 'æ´æ°è
', |
| | | `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'æ´æ°æ¶é´', |
| | | `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT 'æ¯å¦å é¤', |
| | | PRIMARY KEY (`id`) USING BTREE, |
| | | UNIQUE INDEX `uk_code` (`code`), |
| | | INDEX `idx_dept_id` (`dept_id`), |
| | | INDEX `idx_charge_user_id` (`charge_user_id`), |
| | | INDEX `idx_next_check_date` (`next_check_date`) |
| | | ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'MES 计éå¨å
·' ROW_FORMAT = Dynamic; |
| | | |
| | | CREATE TABLE `mes_dv_metering_check` ( |
| | | `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主é®ID', |
| | | `metering_id` bigint NOT NULL COMMENT '计éå¨å
·ID', |
| | | `check_code` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'æ£æµç¼å·', |
| | | `check_date` date NULL DEFAULT NULL COMMENT 'æ£æµæ¥æ', |
| | | `check_org` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT 'æ£æµæºæ', |
| | | `check_result` int NULL DEFAULT NULL COMMENT 'æ£æµç»è®ºï¼åæ ¼/ä¸åæ ¼ï¼ï¼åå
¸ mes_dv_metering_check_result', |
| | | `cert_no` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT 'è¯ä¹¦ç¼å·', |
| | | `check_user_id` bigint NULL DEFAULT NULL COMMENT 'æ£æµäººç¼å·', |
| | | `next_check_date` date NULL DEFAULT NULL COMMENT '䏿¬¡æ£æµæ¥æï¼èªå¨è®¡ç®ææå¨æå®ï¼', |
| | | `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '夿³¨', |
| | | |
| | | -- æ ååæ®µ |
| | | `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT 'å建è
', |
| | | `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'å建æ¶é´', |
| | | `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT 'æ´æ°è
', |
| | | `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'æ´æ°æ¶é´', |
| | | `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT 'æ¯å¦å é¤', |
| | | PRIMARY KEY (`id`) USING BTREE, |
| | | UNIQUE INDEX `uk_check_code` (`check_code`), |
| | | INDEX `idx_metering_id` (`metering_id`), |
| | | INDEX `idx_check_date` (`check_date`) |
| | | ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'MES è®¡éæ£æµè®°å½' ROW_FORMAT = Dynamic; |
| | | |
| | | -- 2. èåï¼ç¶èå 5300 设å¤ç®¡çï¼ |
| | | INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) |
| | | VALUES (5380, '计éå¨å
·', '', 2, 8, 5300, 'metering', 'ep:scale-to-original', 'mes/dv/metering/index', 'MesDvMetering', 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0'); |
| | | |
| | | INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) |
| | | VALUES |
| | | (5381, '计éå¨å
·æ¥è¯¢', 'mes:dv-metering:query', 3, 1, 5380, '', '', '', '', 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0'), |
| | | (5382, '计éå¨å
ጌȼ', 'mes:dv-metering:create', 3, 2, 5380, '', '', '', '', 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0'), |
| | | (5383, '计éå¨å
·æ´æ°', 'mes:dv-metering:update', 3, 3, 5380, '', '', '', '', 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0'), |
| | | (5384, '计éå¨å
·å é¤', 'mes:dv-metering:delete', 3, 4, 5380, '', '', '', '', 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0'), |
| | | (5385, '计éå¨å
·å¯¼åº', 'mes:dv-metering:export', 3, 5, 5380, '', '', '', '', 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0'); |
| | | |
| | | INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) |
| | | VALUES (5386, 'è®¡éæ£æµè®°å½', '', 2, 9, 5300, 'metering-check', 'ep:checked', 'mes/dv/meteringcheck/index', 'MesDvMeteringCheck', 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0'); |
| | | |
| | | INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) |
| | | VALUES |
| | | (5387, 'æ£æµè®°å½æ¥è¯¢', 'mes:dv-metering-check:query', 3, 1, 5386, '', '', '', '', 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0'), |
| | | (5388, 'æ£æµè®°å½å建', 'mes:dv-metering-check:create', 3, 2, 5386, '', '', '', '', 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0'), |
| | | (5389, 'æ£æµè®°å½æ´æ°', 'mes:dv-metering-check:update', 3, 3, 5386, '', '', '', '', 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0'), |
| | | (5390, 'æ£æµè®°å½å é¤', 'mes:dv-metering-check:delete', 3, 4, 5386, '', '', '', '', 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0'), |
| | | (5391, 'æ£æµè®°å½å¯¼åº', 'mes:dv-metering-check:export', 3, 5, 5386, '', '', '', '', 0, b'1', b'1', b'1', '1', NOW(), '1', NOW(), b'0'); |
| | | |
| | | -- 3. åå
¸ç±»å |
| | | INSERT INTO `system_dict_type` (`name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) |
| | | VALUES |
| | | ('MES 计éå¨å
·ç±»å«', 'mes_dv_metering_category', 0, '计éå¨å
·ç±»å«', '1', NOW(), '1', NOW(), b'0'), |
| | | ('MES 计éå¨å
·ç¶æ', 'mes_dv_metering_status', 0, '计éå¨å
·ç¶æ', '1', NOW(), '1', NOW(), b'0'), |
| | | ('MES è®¡éæ£æµç»è®º', 'mes_dv_metering_check_result', 0, 'è®¡éæ£æµç»è®º', '1', NOW(), '1', NOW(), b'0'); |
| | | |
| | | -- 4. åå
¸æ°æ® |
| | | INSERT INTO `system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) |
| | | VALUES |
| | | -- å¨å
·ç±»å« |
| | | (1, 'å¡å°º', '1', 'mes_dv_metering_category', 0, '', '', 'å¡å°º', '1', NOW(), '1', NOW(), b'0'), |
| | | (2, 'ååå°º', '2', 'mes_dv_metering_category', 0, '', '', 'ååå°º', '1', NOW(), '1', NOW(), b'0'), |
| | | (3, 'åå表', '3', 'mes_dv_metering_category', 0, '', '', 'åå表', '1', NOW(), '1', NOW(), b'0'), |
| | | (4, '温度计', '4', 'mes_dv_metering_category', 0, '', '', '温度计', '1', NOW(), '1', NOW(), b'0'), |
| | | (5, 'ä¸ç¨è¡¨', '5', 'mes_dv_metering_category', 0, '', '', 'ä¸ç¨è¡¨', '1', NOW(), '1', NOW(), b'0'), |
| | | (6, '天平ç ç ', '6', 'mes_dv_metering_category', 0, '', '', '天平ç ç ', '1', NOW(), '1', NOW(), b'0'), |
| | | (7, 'å
¶ä»', '7', 'mes_dv_metering_category', 0, '', '', 'å
¶ä»', '1', NOW(), '1', NOW(), b'0'), |
| | | -- å¨å
·ç¶æ |
| | | (1, 'å¨ç¨', '1', 'mes_dv_metering_status', 0, 'success', '', 'å¨ç¨', '1', NOW(), '1', NOW(), b'0'), |
| | | (2, 'åç¨', '2', 'mes_dv_metering_status', 0, 'info', '', 'åç¨', '1', NOW(), '1', NOW(), b'0'), |
| | | (3, 'æ¥åº', '3', 'mes_dv_metering_status', 0, 'danger', '', 'æ¥åº', '1', NOW(), '1', NOW(), b'0'), |
| | | -- æ£æµç»è®º |
| | | (1, 'åæ ¼', '1', 'mes_dv_metering_check_result', 0, 'success', '', 'åæ ¼', '1', NOW(), '1', NOW(), b'0'), |
| | | (2, 'ä¸åæ ¼', '2', 'mes_dv_metering_check_result', 0, 'danger', '', 'ä¸åæ ¼', '1', NOW(), '1', NOW(), b'0'); |
| | | |
| | | -- 5. ç«å
ä¿¡æ¨¡æ¿ |
| | | INSERT INTO `system_notify_template` (`name`, `code`, `nickname`, `content`, `type`, `params`, `status`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) |
| | | VALUES ('计éå¨å
·å°ææé', 'mes_metering_expire_remind', 'MES ç³»ç»', '计éå¨å
·ã{meteringCode}ã{meteringName} å°äº {nextCheckDate} å°æï¼è¯·åæ¶å®ææ ¡å/æ£å®ã', 2, '["meteringCode","meteringName","nextCheckDate"]', 0, '1', NOW(), '1', NOW(), b'0'); |
| | | |
| | | -- 6. å
¨å±é
ç½®ï¼æé天æ°ï¼é»è®¤ 30 å¤©ï¼ |
| | | INSERT INTO `infra_config` (`category`, `type`, `name`, `config_key`, `value`, `visible`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) |
| | | VALUES ('biz', 2, 'MES 计éå¨å
·å°ææé天æ°', 'mes.dv-metering.remind-days', '30', 0, '计éå¨å
·ä¸æ¬¡æ£æµæ¥æå°æå N 天æéï¼ç«å
ä¿¡åéç»è´£ä»»äººï¼', '1', NOW(), '1', NOW(), b'0'); |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.iocoder.yudao.module.bpm.controller.admin.attach; |
| | | |
| | | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| | | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| | | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| | | import cn.iocoder.yudao.module.bpm.controller.admin.attach.vo.attach.BpmBusinessAttachPageReqVO; |
| | | import cn.iocoder.yudao.module.bpm.controller.admin.attach.vo.attach.BpmBusinessAttachRespVO; |
| | | import cn.iocoder.yudao.module.bpm.controller.admin.attach.vo.attach.BpmBusinessAttachSaveReqVO; |
| | | import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmBusinessAttachDO; |
| | | import cn.iocoder.yudao.module.bpm.service.attach.BpmBusinessAttachService; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.annotation.Resource; |
| | | import jakarta.validation.Valid; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| | | |
| | | @Tag(name = "管çåå° - BPM ä¸å¡éä»¶é
ç½®") |
| | | @RestController |
| | | @RequestMapping("/bpm/business-attach") |
| | | @Validated |
| | | public class BpmBusinessAttachController { |
| | | |
| | | @Resource |
| | | private BpmBusinessAttachService businessAttachService; |
| | | |
| | | @PostMapping("/create") |
| | | @Operation(summary = "å建ä¸å¡éä»¶é
ç½®") |
| | | @PreAuthorize("@ss.hasPermission('bpm:business-attach:create')") |
| | | public CommonResult<Long> createBusinessAttach(@Valid @RequestBody BpmBusinessAttachSaveReqVO createReqVO) { |
| | | return success(businessAttachService.createBusinessAttach(createReqVO)); |
| | | } |
| | | |
| | | @PutMapping("/update") |
| | | @Operation(summary = "æ´æ°ä¸å¡éä»¶é
ç½®") |
| | | @PreAuthorize("@ss.hasPermission('bpm:business-attach:update')") |
| | | public CommonResult<Boolean> updateBusinessAttach(@Valid @RequestBody BpmBusinessAttachSaveReqVO updateReqVO) { |
| | | businessAttachService.updateBusinessAttach(updateReqVO); |
| | | return success(true); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "å é¤ä¸å¡éä»¶é
ç½®") |
| | | @Parameter(name = "id", description = "ç¼å·", required = true) |
| | | @PreAuthorize("@ss.hasPermission('bpm:business-attach:delete')") |
| | | public CommonResult<Boolean> deleteBusinessAttach(@RequestParam("id") Long id) { |
| | | businessAttachService.deleteBusinessAttach(id); |
| | | return success(true); |
| | | } |
| | | |
| | | @GetMapping("/get") |
| | | @Operation(summary = "è·å¾ä¸å¡éä»¶é
ç½®") |
| | | @Parameter(name = "id", description = "ç¼å·", required = true, example = "1024") |
| | | @PreAuthorize("@ss.hasPermission('bpm:business-attach:query')") |
| | | public CommonResult<BpmBusinessAttachRespVO> getBusinessAttach(@RequestParam("id") Long id) { |
| | | BpmBusinessAttachDO attach = businessAttachService.getBusinessAttach(id); |
| | | return success(BeanUtils.toBean(attach, BpmBusinessAttachRespVO.class)); |
| | | } |
| | | |
| | | @GetMapping("/page") |
| | | @Operation(summary = "è·å¾ä¸å¡éä»¶é
ç½®å页") |
| | | @PreAuthorize("@ss.hasPermission('bpm:business-attach:query')") |
| | | public CommonResult<PageResult<BpmBusinessAttachRespVO>> getBusinessAttachPage(@Valid BpmBusinessAttachPageReqVO pageReqVO) { |
| | | PageResult<BpmBusinessAttachDO> pageResult = businessAttachService.getBusinessAttachPage(pageReqVO); |
| | | return success(BeanUtils.toBean(pageResult, BpmBusinessAttachRespVO.class)); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.iocoder.yudao.module.bpm.controller.admin.attach.vo.attach; |
| | | |
| | | import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; |
| | | import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| | | import cn.iocoder.yudao.framework.common.validation.InEnum; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.ToString; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
| | | |
| | | @Schema(description = "管çåå° - BPM ä¸å¡éä»¶é
ç½®å页 Request VO") |
| | | @Data |
| | | public class BpmBusinessAttachPageReqVO extends PageParam { |
| | | |
| | | @Schema(description = "æµç¨å®ä¹ç Key", example = "purchase_approve") |
| | | private String processDefinitionKey; |
| | | |
| | | @Schema(description = "ä¸å¡ç±»åï¼ä¾å¦ erp_purchase_order", example = "erp_purchase_order") |
| | | private String businessType; |
| | | |
| | | @Schema(description = "ä¸å¡è¯¦æ
ç»ä»¶è·¯å¾ï¼ä¾å¦ /erp/purchase/order/detail/index.vue") |
| | | private String componentPath; |
| | | |
| | | @Schema(description = "ç¶æï¼åè§ CommonStatusEnum æä¸¾", example = "1") |
| | | @InEnum(CommonStatusEnum.class) |
| | | private Integer status; |
| | | |
| | | @Schema(description = "å建æ¶é´") |
| | | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
| | | private LocalDateTime[] createTime; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.iocoder.yudao.module.bpm.controller.admin.attach.vo.attach; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Schema(description = "管çåå° - BPM ä¸å¡éä»¶é
ç½® Response VO") |
| | | @Data |
| | | public class BpmBusinessAttachRespVO { |
| | | |
| | | @Schema(description = "ç¼å·", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") |
| | | private Long id; |
| | | |
| | | @Schema(description = "æµç¨å®ä¹ç Key", requiredMode = Schema.RequiredMode.REQUIRED, example = "purchase_approve") |
| | | private String processDefinitionKey; |
| | | |
| | | @Schema(description = "ä¸å¡ç±»åï¼ä¾å¦ erp_purchase_order", example = "erp_purchase_order") |
| | | private String businessType; |
| | | |
| | | @Schema(description = "ä¸å¡è¯¦æ
ç»ä»¶è·¯å¾ï¼ä¾å¦ /erp/purchase/order/detail/index.vue", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | private String componentPath; |
| | | |
| | | @Schema(description = "ç¶æï¼åè§ CommonStatusEnum æä¸¾", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") |
| | | private Integer status; |
| | | |
| | | @Schema(description = "夿³¨", example = "éè´è®¢å审æ¹å±ç¤ºéè´è®¢å详æ
") |
| | | private String remark; |
| | | |
| | | @Schema(description = "å建æ¶é´", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | private LocalDateTime createTime; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.iocoder.yudao.module.bpm.controller.admin.attach.vo.attach; |
| | | |
| | | import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; |
| | | import cn.iocoder.yudao.framework.common.validation.InEnum; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import jakarta.validation.constraints.NotEmpty; |
| | | import jakarta.validation.constraints.NotNull; |
| | | import lombok.Data; |
| | | |
| | | @Schema(description = "管çåå° - BPM ä¸å¡éä»¶é
ç½®æ°å¢/ä¿®æ¹ Request VO") |
| | | @Data |
| | | public class BpmBusinessAttachSaveReqVO { |
| | | |
| | | @Schema(description = "ç¼å·", example = "1024") |
| | | private Long id; |
| | | |
| | | @Schema(description = "æµç¨å®ä¹ç Key", requiredMode = Schema.RequiredMode.REQUIRED, example = "purchase_approve") |
| | | @NotEmpty(message = "æµç¨å®ä¹ç Key ä¸è½ä¸ºç©º") |
| | | private String processDefinitionKey; |
| | | |
| | | @Schema(description = "ä¸å¡ç±»åï¼ä¾å¦ erp_purchase_order", example = "erp_purchase_order") |
| | | private String businessType; |
| | | |
| | | @Schema(description = "ä¸å¡è¯¦æ
ç»ä»¶è·¯å¾ï¼ä¾å¦ /erp/purchase/order/detail/index.vue", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @NotEmpty(message = "ä¸å¡è¯¦æ
ç»ä»¶è·¯å¾ä¸è½ä¸ºç©º") |
| | | private String componentPath; |
| | | |
| | | @Schema(description = "ç¶æï¼åè§ CommonStatusEnum æä¸¾", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") |
| | | @NotNull(message = "ç¶æä¸è½ä¸ºç©º") |
| | | @InEnum(CommonStatusEnum.class) |
| | | private Integer status; |
| | | |
| | | @Schema(description = "夿³¨", example = "éè´è®¢å审æ¹å±ç¤ºéè´è®¢å详æ
") |
| | | private String remark; |
| | | |
| | | } |
| | |
| | | import cn.iocoder.yudao.module.bpm.convert.task.BpmProcessInstanceConvert; |
| | | import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmCategoryDO; |
| | | import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmProcessDefinitionInfoDO; |
| | | import cn.iocoder.yudao.module.bpm.service.attach.BpmBusinessAttachService; |
| | | import cn.iocoder.yudao.module.bpm.service.definition.BpmCategoryService; |
| | | import cn.iocoder.yudao.module.bpm.service.definition.BpmProcessDefinitionService; |
| | | import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceService; |
| | |
| | | private BpmProcessDefinitionService processDefinitionService; |
| | | @Resource |
| | | private BpmCategoryService categoryService; |
| | | @Resource |
| | | private BpmBusinessAttachService businessAttachService; |
| | | |
| | | @Resource |
| | | private AdminUserApi adminUserApi; |
| | |
| | | List<HistoricTaskInstance> tasks = taskService.getFinishedTaskListByProcessInstanceIdWithoutCancel(processInstanceId); |
| | | Map<Long, AdminUserRespDTO> userMap = adminUserApi.getUserMap( |
| | | convertSet(tasks, item -> Long.valueOf(item.getAssignee()))); |
| | | return success(BpmProcessInstanceConvert.INSTANCE.buildProcessInstancePrintData(historicProcessInstance, |
| | | BpmProcessPrintDataRespVO printData = BpmProcessInstanceConvert.INSTANCE.buildProcessInstancePrintData( |
| | | historicProcessInstance, |
| | | processDefinitionService.getProcessDefinitionInfo(historicProcessInstance.getProcessDefinitionId()), |
| | | tasks, userMap, |
| | | new UserSimpleBaseVO().setNickname(startUser.getNickname()).setDeptName(dept.getName()))); |
| | | new UserSimpleBaseVO().setNickname(startUser.getNickname()).setDeptName(dept.getName())); |
| | | // å¡«å
ä¸å¡éä»¶é
ç½®ï¼å®ç°æå°èªå¨å±ç¤ºå¤é¨ä¸å¡ä¿¡æ¯ |
| | | businessAttachService.fillBusinessForm(printData.getProcessInstance().getProcessDefinition(), |
| | | processDefinitionService.getProcessDefinition(historicProcessInstance.getProcessDefinitionId()).getKey(), |
| | | historicProcessInstance.getBusinessKey()); |
| | | return success(printData); |
| | | } |
| | | |
| | | } |
| | |
| | | List<DeptRespDTO> startDepts = metaInfo != null ? convertList(metaInfo.getStartDeptIds(), deptMap::get) : null; |
| | | return buildModel0(model, metaInfo, form, category, deployment, processDefinition, startUsers, startDepts); |
| | | }); |
| | | // æåº |
| | | result.sort(Comparator.comparing(BpmModelMetaInfoVO::getSort)); |
| | | // æåºï¼æå·¥é¨ç½²ï¼DB ç´æï¼ç模åå¯è½æ²¡æ metaInfo/sortï¼å
åºæå°æå |
| | | result.sort(Comparator.comparing(BpmModelMetaInfoVO::getSort, |
| | | Comparator.nullsLast(Comparator.naturalOrder()))); |
| | | return result; |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.iocoder.yudao.module.bpm.dal.dataobject.definition; |
| | | |
| | | import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; |
| | | import com.baomidou.mybatisplus.annotation.KeySequence; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | /** |
| | | * BPM ä¸å¡éä»¶é
ç½® DO |
| | | * |
| | | * ç¨äºå»ºç«ãæµç¨å®ä¹ Key -> ä¸å¡è¯¦æ
ç»ä»¶ãçæ å°ï¼å®ç°å®¡æ¹è¯¦æ
èªå¨å±ç¤ºå¤é¨ä¸å¡ä¿¡æ¯ |
| | | * |
| | | * @author è¶
级管çå |
| | | */ |
| | | @TableName("bpm_business_attach") |
| | | @KeySequence("bpm_business_attach_seq") // ç¨äº OracleãPostgreSQLãKingbaseãDB2ãH2 æ°æ®åºç主é®èªå¢ãå¦ææ¯ MySQL çæ°æ®åºï¼å¯ä¸åã |
| | | @Data |
| | | @Builder |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | public class BpmBusinessAttachDO extends BaseDO { |
| | | |
| | | /** |
| | | * ç¼å· |
| | | */ |
| | | @TableId |
| | | private Long id; |
| | | /** |
| | | * æµç¨å®ä¹ç Key |
| | | */ |
| | | private String processDefinitionKey; |
| | | /** |
| | | * ä¸å¡ç±»åï¼ä¾å¦ erp_purchase_order |
| | | */ |
| | | private String businessType; |
| | | /** |
| | | * ä¸å¡è¯¦æ
ç»ä»¶è·¯å¾ï¼ä¾å¦ /erp/purchase/order/detail/index.vue |
| | | */ |
| | | private String componentPath; |
| | | /** |
| | | * ç¶æ |
| | | * |
| | | * æä¸¾ {@link cn.iocoder.yudao.framework.common.enums.CommonStatusEnum} |
| | | */ |
| | | private Integer status; |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | private String remark; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.iocoder.yudao.module.bpm.dal.mysql.attach; |
| | | |
| | | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| | | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; |
| | | import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; |
| | | import cn.iocoder.yudao.module.bpm.controller.admin.attach.vo.attach.BpmBusinessAttachPageReqVO; |
| | | import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmBusinessAttachDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * BPM ä¸å¡éä»¶é
ç½® Mapper |
| | | * |
| | | * @author è¶
级管çå |
| | | */ |
| | | @Mapper |
| | | public interface BpmBusinessAttachMapper extends BaseMapperX<BpmBusinessAttachDO> { |
| | | |
| | | default PageResult<BpmBusinessAttachDO> selectPage(BpmBusinessAttachPageReqVO reqVO) { |
| | | return selectPage(reqVO, new LambdaQueryWrapperX<BpmBusinessAttachDO>() |
| | | .likeIfPresent(BpmBusinessAttachDO::getProcessDefinitionKey, reqVO.getProcessDefinitionKey()) |
| | | .likeIfPresent(BpmBusinessAttachDO::getBusinessType, reqVO.getBusinessType()) |
| | | .likeIfPresent(BpmBusinessAttachDO::getComponentPath, reqVO.getComponentPath()) |
| | | .eqIfPresent(BpmBusinessAttachDO::getStatus, reqVO.getStatus()) |
| | | .betweenIfPresent(BpmBusinessAttachDO::getCreateTime, reqVO.getCreateTime()) |
| | | .orderByDesc(BpmBusinessAttachDO::getId)); |
| | | } |
| | | |
| | | default BpmBusinessAttachDO selectByProcessDefinitionKey(String processDefinitionKey) { |
| | | return selectOne(BpmBusinessAttachDO::getProcessDefinitionKey, processDefinitionKey); |
| | | } |
| | | |
| | | } |
| | |
| | | // ========== BPM æµç¨è¡¨è¾¾å¼ 1-009-014-000 ========== |
| | | ErrorCode PROCESS_EXPRESSION_NOT_EXISTS = new ErrorCode(1_009_014_000, "æµç¨è¡¨è¾¾å¼ä¸åå¨"); |
| | | |
| | | // ========== BPM ä¸å¡éä»¶é
ç½® 1-009-015-000 ========== |
| | | ErrorCode BUSINESS_ATTACH_NOT_EXISTS = new ErrorCode(1_009_015_000, "ä¸å¡éä»¶é
ç½®ä¸åå¨"); |
| | | ErrorCode BUSINESS_ATTACH_PROCESS_DEFINITION_KEY_DUPLICATE = new ErrorCode(1_009_015_001, "æµç¨å®ä¹ç Key({})å·²åå¨"); |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.iocoder.yudao.module.bpm.service.attach; |
| | | |
| | | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| | | import cn.iocoder.yudao.module.bpm.controller.admin.attach.vo.attach.BpmBusinessAttachPageReqVO; |
| | | import cn.iocoder.yudao.module.bpm.controller.admin.attach.vo.attach.BpmBusinessAttachSaveReqVO; |
| | | import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process.BpmProcessDefinitionRespVO; |
| | | import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmBusinessAttachDO; |
| | | import jakarta.validation.Valid; |
| | | |
| | | /** |
| | | * BPM ä¸å¡éä»¶é
ç½® Service æ¥å£ |
| | | * |
| | | * @author è¶
级管çå |
| | | */ |
| | | public interface BpmBusinessAttachService { |
| | | |
| | | /** |
| | | * å建ä¸å¡éä»¶é
ç½® |
| | | * |
| | | * @param createReqVO åå»ºä¿¡æ¯ |
| | | * @return ç¼å· |
| | | */ |
| | | Long createBusinessAttach(@Valid BpmBusinessAttachSaveReqVO createReqVO); |
| | | |
| | | /** |
| | | * æ´æ°ä¸å¡éä»¶é
ç½® |
| | | * |
| | | * @param updateReqVO æ´æ°ä¿¡æ¯ |
| | | */ |
| | | void updateBusinessAttach(@Valid BpmBusinessAttachSaveReqVO updateReqVO); |
| | | |
| | | /** |
| | | * å é¤ä¸å¡éä»¶é
ç½® |
| | | * |
| | | * @param id ç¼å· |
| | | */ |
| | | void deleteBusinessAttach(Long id); |
| | | |
| | | /** |
| | | * è·å¾ä¸å¡éä»¶é
ç½® |
| | | * |
| | | * @param id ç¼å· |
| | | * @return ä¸å¡éä»¶é
ç½® |
| | | */ |
| | | BpmBusinessAttachDO getBusinessAttach(Long id); |
| | | |
| | | /** |
| | | * è·å¾ä¸å¡éä»¶é
ç½®å页 |
| | | * |
| | | * @param pageReqVO å页æ¥è¯¢ |
| | | * @return ä¸å¡éä»¶é
ç½®å页 |
| | | */ |
| | | PageResult<BpmBusinessAttachDO> getBusinessAttachPage(BpmBusinessAttachPageReqVO pageReqVO); |
| | | |
| | | /** |
| | | * è·å¾ä¸å¡éä»¶é
ç½®ï¼åºäºæµç¨å®ä¹ Key |
| | | * |
| | | * @param processDefinitionKey æµç¨å®ä¹ Key |
| | | * @return ä¸å¡éä»¶é
ç½® |
| | | */ |
| | | BpmBusinessAttachDO getBusinessAttachByProcessDefinitionKey(String processDefinitionKey); |
| | | |
| | | /** |
| | | * å¡«å
ä¸å¡è¡¨åä¿¡æ¯å°æµç¨å®ä¹ Response |
| | | * |
| | | * è¥è¯¥æµç¨å®ä¹é
ç½®äºä¸å¡éä»¶ï¼ä¸å·²å¯ç¨ãå½åæ¯ NORMAL æµç¨è¡¨åãåå¨ä¸å¡ä¸»é®ï¼ï¼ |
| | | * åå° formType è¦ç为 CUSTOM 并注å
¥ä¸å¡è¯¦æ
ç»ä»¶è·¯å¾ï¼å®ç°å®¡æ¹è¯¦æ
èªå¨å±ç¤ºä¸å¡ä¿¡æ¯ |
| | | * |
| | | * @param definitionResp æµç¨å®ä¹ Response |
| | | * @param processDefinitionKey æµç¨å®ä¹ Key |
| | | * @param businessKey ä¸å¡çå¯ä¸æ è¯ï¼æªåèµ·æ¶ä¸º nullï¼ |
| | | */ |
| | | void fillBusinessForm(BpmProcessDefinitionRespVO definitionResp, String processDefinitionKey, String businessKey); |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.iocoder.yudao.module.bpm.service.attach; |
| | | |
| | | import cn.hutool.core.util.ObjUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; |
| | | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| | | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| | | import cn.iocoder.yudao.module.bpm.controller.admin.attach.vo.attach.BpmBusinessAttachPageReqVO; |
| | | import cn.iocoder.yudao.module.bpm.controller.admin.attach.vo.attach.BpmBusinessAttachSaveReqVO; |
| | | import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process.BpmProcessDefinitionRespVO; |
| | | import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmBusinessAttachDO; |
| | | import cn.iocoder.yudao.module.bpm.dal.mysql.attach.BpmBusinessAttachMapper; |
| | | import cn.iocoder.yudao.module.bpm.enums.definition.BpmModelFormTypeEnum; |
| | | import jakarta.annotation.Resource; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.validation.annotation.Validated; |
| | | |
| | | import java.util.Objects; |
| | | |
| | | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; |
| | | import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.BUSINESS_ATTACH_NOT_EXISTS; |
| | | import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.BUSINESS_ATTACH_PROCESS_DEFINITION_KEY_DUPLICATE; |
| | | |
| | | /** |
| | | * BPM ä¸å¡éä»¶é
ç½® Service å®ç°ç±» |
| | | * |
| | | * @author è¶
级管çå |
| | | */ |
| | | @Service |
| | | @Validated |
| | | public class BpmBusinessAttachServiceImpl implements BpmBusinessAttachService { |
| | | |
| | | @Resource |
| | | private BpmBusinessAttachMapper businessAttachMapper; |
| | | |
| | | @Override |
| | | public Long createBusinessAttach(BpmBusinessAttachSaveReqVO createReqVO) { |
| | | // æ ¡éªæµç¨å®ä¹ Key å¯ä¸ |
| | | validateProcessDefinitionKeyUnique(createReqVO); |
| | | // æå
¥ |
| | | BpmBusinessAttachDO attach = BeanUtils.toBean(createReqVO, BpmBusinessAttachDO.class); |
| | | businessAttachMapper.insert(attach); |
| | | return attach.getId(); |
| | | } |
| | | |
| | | @Override |
| | | public void updateBusinessAttach(BpmBusinessAttachSaveReqVO updateReqVO) { |
| | | // æ ¡éªåå¨ |
| | | validateBusinessAttachExists(updateReqVO.getId()); |
| | | // æ ¡éªæµç¨å®ä¹ Key å¯ä¸ |
| | | validateProcessDefinitionKeyUnique(updateReqVO); |
| | | // æ´æ° |
| | | BpmBusinessAttachDO updateObj = BeanUtils.toBean(updateReqVO, BpmBusinessAttachDO.class); |
| | | businessAttachMapper.updateById(updateObj); |
| | | } |
| | | |
| | | private void validateProcessDefinitionKeyUnique(BpmBusinessAttachSaveReqVO reqVO) { |
| | | BpmBusinessAttachDO attach = businessAttachMapper.selectByProcessDefinitionKey(reqVO.getProcessDefinitionKey()); |
| | | if (attach == null || ObjUtil.equal(attach.getId(), reqVO.getId())) { |
| | | return; |
| | | } |
| | | throw exception(BUSINESS_ATTACH_PROCESS_DEFINITION_KEY_DUPLICATE, reqVO.getProcessDefinitionKey()); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteBusinessAttach(Long id) { |
| | | // æ ¡éªåå¨ |
| | | validateBusinessAttachExists(id); |
| | | // å é¤ |
| | | businessAttachMapper.deleteById(id); |
| | | } |
| | | |
| | | private BpmBusinessAttachDO validateBusinessAttachExists(Long id) { |
| | | BpmBusinessAttachDO attach = businessAttachMapper.selectById(id); |
| | | if (attach == null) { |
| | | throw exception(BUSINESS_ATTACH_NOT_EXISTS); |
| | | } |
| | | return attach; |
| | | } |
| | | |
| | | @Override |
| | | public BpmBusinessAttachDO getBusinessAttach(Long id) { |
| | | return businessAttachMapper.selectById(id); |
| | | } |
| | | |
| | | @Override |
| | | public PageResult<BpmBusinessAttachDO> getBusinessAttachPage(BpmBusinessAttachPageReqVO pageReqVO) { |
| | | return businessAttachMapper.selectPage(pageReqVO); |
| | | } |
| | | |
| | | @Override |
| | | public BpmBusinessAttachDO getBusinessAttachByProcessDefinitionKey(String processDefinitionKey) { |
| | | return businessAttachMapper.selectByProcessDefinitionKey(processDefinitionKey); |
| | | } |
| | | |
| | | @Override |
| | | public void fillBusinessForm(BpmProcessDefinitionRespVO definitionResp, String processDefinitionKey, String businessKey) { |
| | | // æªåèµ· / æ ä¸å¡ä¸»é®ï¼ä¸æ³¨å
¥ |
| | | if (definitionResp == null || StrUtil.isBlank(businessKey)) { |
| | | return; |
| | | } |
| | | // é NORMAL æµç¨è¡¨åï¼å·²æå¨é
ç½® CUSTOMï¼ï¼ä¸è¦ç |
| | | if (!Objects.equals(definitionResp.getFormType(), BpmModelFormTypeEnum.NORMAL.getType())) { |
| | | return; |
| | | } |
| | | // æªå½ä¸é
ç½® / é
置被ç¦ç¨ï¼ä¿æåæ · |
| | | BpmBusinessAttachDO attach = getBusinessAttachByProcessDefinitionKey(processDefinitionKey); |
| | | if (attach == null || !Objects.equals(attach.getStatus(), CommonStatusEnum.ENABLE.getStatus())) { |
| | | return; |
| | | } |
| | | // è¦ç为 CUSTOMï¼æ³¨å
¥ä¸å¡è¯¦æ
ç»ä»¶è·¯å¾ |
| | | definitionResp.setFormType(BpmModelFormTypeEnum.CUSTOM.getType()); |
| | | definitionResp.setFormCustomViewPath(attach.getComponentPath()); |
| | | // æ¸
空æ®é表ååæ®µï¼è¯¦æ
页 CUSTOM 忝ä¸è¯»ï¼æå°é¡µæ formFields.length == 0 å¤ææ¸²æä¸å¡ç»ä»¶ |
| | | definitionResp.setFormFields(null); |
| | | definitionResp.setFormConf(null); |
| | | } |
| | | |
| | | } |
| | |
| | | import cn.iocoder.yudao.module.bpm.framework.flowable.core.util.BpmnModelUtils; |
| | | import cn.iocoder.yudao.module.bpm.framework.flowable.core.util.FlowableUtils; |
| | | import cn.iocoder.yudao.module.bpm.framework.flowable.core.util.SimpleModelUtils; |
| | | import cn.iocoder.yudao.module.bpm.service.attach.BpmBusinessAttachService; |
| | | import cn.iocoder.yudao.module.bpm.service.definition.BpmProcessDefinitionService; |
| | | import cn.iocoder.yudao.module.bpm.service.message.BpmMessageService; |
| | | import cn.iocoder.yudao.module.system.api.dept.DeptApi; |
| | |
| | | |
| | | @Resource |
| | | private BpmProcessIdRedisDAO processIdRedisDAO; |
| | | |
| | | @Resource |
| | | private BpmBusinessAttachService businessAttachService; |
| | | |
| | | // ========== Query æ¥è¯¢ç¸å
³æ¹æ³ ========== |
| | | |
| | |
| | | Map<String, String> formFieldsPermission = getFormFieldsPermission(bpmnModel, reqVO.getActivityId(), taskId); |
| | | |
| | | // 3. æ¼æ¥æ°æ® |
| | | return BpmProcessInstanceConvert.INSTANCE.buildApprovalDetail(bpmnModel, processDefinition, |
| | | processDefinitionInfo, processInstance, |
| | | BpmApprovalDetailRespVO detailRespVO = BpmProcessInstanceConvert.INSTANCE.buildApprovalDetail(bpmnModel, |
| | | processDefinition, processDefinitionInfo, processInstance, |
| | | processInstanceStatus, approveNodes, todoTask, formFieldsPermission, userMap, deptMap); |
| | | |
| | | // 4. å¡«å
ä¸å¡éä»¶é
ç½®ï¼å®ç°å®¡æ¹è¯¦æ
èªå¨å±ç¤ºå¤é¨ä¸å¡ä¿¡æ¯ |
| | | businessAttachService.fillBusinessForm(detailRespVO.getProcessDefinition(), processDefinition.getKey(), |
| | | processInstance != null ? processInstance.getBusinessKey() : null); |
| | | return detailRespVO; |
| | | } |
| | | |
| | | /** |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | import java.util.stream.Stream; |
| | | |
| | | import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT; |
| | |
| | | List<CrmBusinessProductDO> businessProducts = businessService.getBusinessProductListByBusinessId(businessVO.getId()); |
| | | Map<Long, MdmItemRespDTO> itemMap = mdmItemApi.getItemMap( |
| | | convertSet(businessProducts, CrmBusinessProductDO::getItemId)); |
| | | Map<Long, MdmUnitMeasureRespDTO> unitMap = mdmUnitMeasureApi.getUnitMeasureMap( |
| | | convertSet(businessProducts, CrmBusinessProductDO::getItemUnitId)); |
| | | // æ¶éææéè¦æ¥è¯¢çåä½IDï¼ä¸»åä½ + è¾
åä½1 + è¾
åä½2ï¼ |
| | | Set<Long> unitIds = new HashSet<>(); |
| | | unitIds.addAll(convertSet(businessProducts, CrmBusinessProductDO::getItemUnitId)); |
| | | itemMap.values().forEach(item -> { |
| | | if (item.getUnitMeasureId2() != null) { |
| | | unitIds.add(item.getUnitMeasureId2()); |
| | | } |
| | | if (item.getUnitMeasureId3() != null) { |
| | | unitIds.add(item.getUnitMeasureId3()); |
| | | } |
| | | }); |
| | | Map<Long, MdmUnitMeasureRespDTO> unitMap = mdmUnitMeasureApi.getUnitMeasureMap(unitIds); |
| | | businessVO.setProducts(BeanUtils.toBean(businessProducts, CrmBusinessRespVO.Product.class, businessProductVO -> |
| | | MapUtils.findAndThen(itemMap, businessProductVO.getItemId(), |
| | | item -> businessProductVO.setItemName(item.getName()) |
| | | .setItemCode(item.getCode()) |
| | | .setBarCode(item.getBarCode()) |
| | | .setItemSpecification(item.getSpecification())))); |
| | | // å¡«å
åä½åç§° |
| | | // å¡«å
åä½åç§°ï¼ä¸»åä½ + è¾
åä½1 + è¾
åä½2ï¼ |
| | | businessVO.getProducts().forEach(product -> { |
| | | MapUtils.findAndThen(unitMap, product.getItemUnitId(), |
| | | unit -> product.setItemUnitName(unit.getName())); |
| | | // å¡«å
è¾
åä½åç§° |
| | | MapUtils.findAndThen(itemMap, product.getItemId(), item -> { |
| | | if (item.getUnitMeasureId2() != null) { |
| | | MapUtils.findAndThen(unitMap, item.getUnitMeasureId2(), |
| | | unit -> product.setItemUnitName2(unit.getName())); |
| | | } |
| | | if (item.getUnitMeasureId3() != null) { |
| | | MapUtils.findAndThen(unitMap, item.getUnitMeasureId3(), |
| | | unit -> product.setItemUnitName3(unit.getName())); |
| | | } |
| | | }); |
| | | }); |
| | | return businessVO; |
| | | } |
| | |
| | | private Long itemUnitId; |
| | | @Schema(description = "计éåä½åç§°", example = "个") |
| | | private String itemUnitName; |
| | | @Schema(description = "è¾
åä½1åç§°") |
| | | private String itemUnitName2; |
| | | @Schema(description = "è¾
åä½2åç§°") |
| | | private String itemUnitName3; |
| | | |
| | | @Schema(description = "ç©ææ¡ç ", example = "12345678") |
| | | private String barCode; |
| | |
| | | private List<Long> contactIds; |
| | | |
| | | @Schema(description = "å¾ç URL å表") |
| | | private List<String> picUrls; |
| | | private Object picUrls; // æ¥ååç¬¦ä¸²ææ°ç» |
| | | |
| | | /** |
| | | * è·åå¾ç URL å表 |
| | | */ |
| | | public List<String> getPicUrlList() { |
| | | if (picUrls == null) { |
| | | return null; |
| | | } |
| | | if (picUrls instanceof List) { |
| | | return (List<String>) picUrls; |
| | | } |
| | | if (picUrls instanceof String) { |
| | | String str = (String) picUrls; |
| | | if (str.isEmpty()) { |
| | | return null; |
| | | } |
| | | return java.util.Arrays.asList(str.split(",")); |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | |
| | | // 1. æå»ºç©ææç» |
| | | if (CollUtil.isNotEmpty(productList)) { |
| | | Map<Long, MdmItemRespDTO> itemMap = mdmItemApi.getItemMap(convertSet(productList, CrmSaleQuotationProductDO::getItemId)); |
| | | java.util.Set<Long> unitIds = new java.util.HashSet<>(convertSet(productList, CrmSaleQuotationProductDO::getItemUnitId)); |
| | | itemMap.values().forEach(item -> { |
| | | if (item.getUnitMeasureId2() != null) { |
| | | unitIds.add(item.getUnitMeasureId2()); |
| | | } |
| | | }); |
| | | Map<Long, MdmUnitMeasureRespDTO> unitMap = convertMap( |
| | | mdmUnitMeasureApi.getUnitMeasureList( |
| | | convertSet(productList, CrmSaleQuotationProductDO::getItemUnitId)).getCheckedData(), |
| | | mdmUnitMeasureApi.getUnitMeasureList(unitIds).getCheckedData(), |
| | | MdmUnitMeasureRespDTO::getId); |
| | | respVO.setItems(BeanUtils.toBean(productList, CrmSaleQuotationRespVO.Item.class, item -> { |
| | | MdmItemRespDTO mdmItem = itemMap.get(item.getItemId()); |
| | |
| | | item.setItemCode(mdmItem.getCode()); |
| | | item.setItemName(mdmItem.getName()); |
| | | item.setItemBarCode(mdmItem.getBarCode()); |
| | | item.setItemSpecification(mdmItem.getSpecification()); |
| | | item.setItemUnitId2(mdmItem.getUnitMeasureId2()); |
| | | item.setItemUnitId3(mdmItem.getUnitMeasureId3()); |
| | | } |
| | | MapUtils.findAndThen(unitMap, item.getItemUnitId(), unit -> item.setItemUnitName(unit.getName())); |
| | | MapUtils.findAndThen(unitMap, item.getItemUnitId2(), unit -> item.setItemUnitName2(unit.getName())); |
| | | MapUtils.findAndThen(unitMap, item.getItemUnitId3(), unit -> item.setItemUnitName3(unit.getName())); |
| | | })); |
| | | } |
| | | // 2. å¡«å
客æ·åç§° |
| | |
| | | Map<Long, List<CrmSaleQuotationProductDO>> productMap = convertMultiMap(productList, CrmSaleQuotationProductDO::getQuotationId); |
| | | // 1.2 ç©æä¿¡æ¯ |
| | | Map<Long, MdmItemRespDTO> itemMap = mdmItemApi.getItemMap(convertSet(productList, CrmSaleQuotationProductDO::getItemId)); |
| | | java.util.Set<Long> unitIds = new java.util.HashSet<>(convertSet(productList, CrmSaleQuotationProductDO::getItemUnitId)); |
| | | itemMap.values().forEach(item -> { |
| | | if (item.getUnitMeasureId2() != null) { |
| | | unitIds.add(item.getUnitMeasureId2()); |
| | | } |
| | | }); |
| | | Map<Long, MdmUnitMeasureRespDTO> unitMap = convertMap( |
| | | mdmUnitMeasureApi.getUnitMeasureList(unitIds).getCheckedData(), |
| | | MdmUnitMeasureRespDTO::getId); |
| | | // 1.3 客æ·ä¿¡æ¯ |
| | | Map<Long, CrmCustomerDO> customerMap = customerService.getCustomerMap( |
| | | convertSet(pageResult.getList(), CrmSaleQuotationDO::getCustomerId)); |
| | |
| | | // 2. å¼å§æ¼æ¥ |
| | | return BeanUtils.toBean(pageResult, CrmSaleQuotationRespVO.class, vo -> { |
| | | vo.setItems(BeanUtils.toBean(productMap.get(vo.getId()), CrmSaleQuotationRespVO.Item.class, |
| | | item -> MapUtils.findAndThen(itemMap, item.getItemId(), mdmItem -> item.setItemCode(mdmItem.getCode()) |
| | | .setItemName(mdmItem.getName()).setItemBarCode(mdmItem.getBarCode())))); |
| | | item -> { |
| | | MapUtils.findAndThen(itemMap, item.getItemId(), mdmItem -> item |
| | | .setItemCode(mdmItem.getCode()) |
| | | .setItemName(mdmItem.getName()) |
| | | .setItemBarCode(mdmItem.getBarCode()) |
| | | .setItemSpecification(mdmItem.getSpecification()) |
| | | .setItemUnitId2(mdmItem.getUnitMeasureId2()) |
| | | .setItemUnitId3(mdmItem.getUnitMeasureId3())); |
| | | MapUtils.findAndThen(unitMap, item.getItemUnitId(), unit -> item.setItemUnitName(unit.getName())); |
| | | MapUtils.findAndThen(unitMap, item.getItemUnitId2(), unit -> item.setItemUnitName2(unit.getName())); |
| | | MapUtils.findAndThen(unitMap, item.getItemUnitId3(), unit -> item.setItemUnitName3(unit.getName())); |
| | | })); |
| | | MapUtils.findAndThen(customerMap, vo.getCustomerId(), customer -> vo.setCustomerName(customer.getName())); |
| | | MapUtils.findAndThen(userMap, vo.getOwnerUserId(), user -> vo.setOwnerUserName(user.getNickname())); |
| | | MapUtils.findAndThen(deptMap, vo.getOwnerUserId(), dept -> vo.setOwnerUserDeptName(dept.getName())); |
| | |
| | | private String itemName; |
| | | @Schema(description = "ç©ææ¡ç ", example = "BAR001") |
| | | private String itemBarCode; |
| | | @Schema(description = "è§æ ¼åå·", example = "M8*20") |
| | | private String itemSpecification; |
| | | @Schema(description = "计éåä½ç¼å·", example = "1") |
| | | private Long itemUnitId; |
| | | @Schema(description = "计éåä½åç§°", example = "个") |
| | | private String itemUnitName; |
| | | @Schema(description = "è¾
åä½1ç¼å·", example = "2") |
| | | private Long itemUnitId2; |
| | | @Schema(description = "è¾
åä½1åç§°", example = "ç®±") |
| | | private String itemUnitName2; |
| | | @Schema(description = "è¾
åä½2ç¼å·", example = "3") |
| | | private Long itemUnitId3; |
| | | @Schema(description = "è¾
åä½2åç§°", example = "æ") |
| | | private String itemUnitName3; |
| | | |
| | | @Schema(description = "ç©æåä»·", requiredMode = Schema.RequiredMode.REQUIRED, example = "100.00") |
| | | private BigDecimal itemPrice; |
| | |
| | | @Override |
| | | @CrmPermission(bizTypeValue = "#createReqVO.bizType", bizId = "#createReqVO.bizId", level = CrmPermissionLevelEnum.WRITE) |
| | | public Long createFollowUpRecord(CrmFollowUpRecordSaveReqVO createReqVO) { |
| | | // 1. å建æ´è¿è®°å½ |
| | | // 1. å建è·è¿è®°å½ |
| | | CrmFollowUpRecordDO record = BeanUtils.toBean(createReqVO, CrmFollowUpRecordDO.class); |
| | | // æå¨å¤ç picUrls åæ®µ |
| | | record.setPicUrls(createReqVO.getPicUrlList()); |
| | | crmFollowUpRecordMapper.insert(record); |
| | | storageAttachmentApi.bindAttachments("file", "crm_follow_up_record", |
| | | record.getId(), createReqVO.getBlobIds()); |
| | |
| | | import cn.iocoder.yudao.module.erp.controller.admin.purchase.vo.order.ErpPurchaseOrderRespVO; |
| | | import cn.iocoder.yudao.module.erp.dal.dataobject.purchase.ErpPurchaseInvoiceDO; |
| | | import cn.iocoder.yudao.module.erp.dal.dataobject.purchase.ErpPurchaseOrderDO; |
| | | import cn.iocoder.yudao.module.erp.enums.ErpPurchaseInvoiceAuditStatusEnum; |
| | | import cn.iocoder.yudao.module.erp.service.finance.ErpFinancePaymentService; |
| | | import cn.iocoder.yudao.module.erp.service.purchase.ErpPurchaseInvoiceService; |
| | | import cn.iocoder.yudao.module.erp.service.purchase.ErpPurchaseInvoiceServiceImpl; |
| | |
| | | }); |
| | | } |
| | | |
| | | @PutMapping("/update-status") |
| | | @Operation(summary = "æ´æ°æ¥ç¥¨çç¶æï¼å®¡æ ¸/åå®¡æ ¸ï¼") |
| | | @PreAuthorize("@ss.hasPermission('erp:purchase-invoice:update-status')") |
| | | public CommonResult<Boolean> updatePurchaseInvoiceStatus(@RequestParam("id") Long id, |
| | | @RequestParam("status") Integer status) { |
| | | invoiceService.updatePurchaseInvoiceStatus(id, status); |
| | | return success(true); |
| | | } |
| | | |
| | | @GetMapping("/audit-count") |
| | | @Operation(summary = "è·å¾å¾
å®¡æ ¸æ¥ç¥¨æ°é") |
| | | @PreAuthorize("@ss.hasPermission('erp:purchase-invoice:query')") |
| | | public CommonResult<Long> getAuditInvoiceCount() { |
| | | return success(invoiceService.getAuditInvoiceCount()); |
| | | } |
| | | |
| | | @GetMapping("/simple-list") |
| | | @Operation(summary = "è·å¾æ¥ç¥¨ç²¾ç®å表", description = "åªå
å«å®¡æ ¸éè¿ä¸å·²ä¸ä¼ å票éä»¶çæ¥ç¥¨ï¼ä¸»è¦ç¨äºä»æ¬¾å建æ¶éæ©å
³èæ¥ç¥¨") |
| | | @Operation(summary = "è·å¾æ¥ç¥¨ç²¾ç®å表", description = "åªå
å«å·²ä¸ä¼ å票éä»¶çæ¥ç¥¨ï¼ä¸»è¦ç¨äºä»æ¬¾å建æ¶éæ©å
³èæ¥ç¥¨") |
| | | @Parameter(name = "supplierId", description = "ä¾åºåç¼å·", required = true) |
| | | @Parameter(name = "purchaseOrderId", description = "éè´è®¢åç¼å·ï¼å¯éï¼ç¨äºæè®¢åè¿æ»¤ï¼") |
| | | @PreAuthorize("@ss.hasPermission('erp:purchase-invoice:query')") |
| | |
| | | @RequestParam(value = "purchaseOrderId", required = false) Long purchaseOrderId) { |
| | | List<ErpPurchaseInvoiceDO> invoices; |
| | | if (purchaseOrderId != null) { |
| | | invoices = invoiceService.getPurchaseInvoiceListByOrderIdAndStatus(purchaseOrderId, |
| | | List.of(ErpPurchaseInvoiceAuditStatusEnum.APPROVE.getStatus())); |
| | | invoices = invoiceService.getPurchaseInvoiceListByOrderId(purchaseOrderId); |
| | | } else { |
| | | invoices = invoiceService.getPurchaseInvoiceListBySupplierIdAndStatus(supplierId, |
| | | List.of(ErpPurchaseInvoiceAuditStatusEnum.APPROVE.getStatus())); |
| | | invoices = invoiceService.getPurchaseInvoiceListBySupplierId(supplierId); |
| | | } |
| | | if (CollUtil.isEmpty(invoices)) { |
| | | return success(Collections.emptyList()); |
| | |
| | | .setId(invoice.getId()).setNo(invoice.getNo()).setInvoiceNo(invoice.getInvoiceNo()) |
| | | .setInvoiceTitle(invoice.getInvoiceTitle()).setPrice(invoice.getPrice()) |
| | | .setSupplierId(invoice.getSupplierId()).setPurchaseOrderId(invoice.getPurchaseOrderId()) |
| | | .setAuditStatus(invoice.getAuditStatus()).setHasAttachment(true) |
| | | .setHasAttachment(true) |
| | | .setRemainingInvoicePrice(remainingPrice)); |
| | | } |
| | | return success(result); |
| | |
| | | package cn.iocoder.yudao.module.erp.controller.admin.purchase.vo.invoice; |
| | | |
| | | import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| | | import cn.iocoder.yudao.framework.common.validation.InEnum; |
| | | import cn.iocoder.yudao.module.erp.enums.ErpPurchaseInvoiceAuditStatusEnum; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | |
| | | |
| | | @Schema(description = "éè´è®¢åç¼å·", example = "17386") |
| | | private Long purchaseOrderId; |
| | | |
| | | @Schema(description = "审æ¹ç¶æ", example = "20") |
| | | @InEnum(ErpPurchaseInvoiceAuditStatusEnum.class) |
| | | private Integer auditStatus; |
| | | |
| | | } |
| | |
| | | package cn.iocoder.yudao.module.erp.controller.admin.purchase.vo.invoice; |
| | | |
| | | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| | | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| | | import cn.iocoder.yudao.module.erp.controller.admin.purchase.vo.order.ErpPurchaseOrderRespVO; |
| | | import cn.iocoder.yudao.module.erp.enums.DictTypeConstants; |
| | | import cn.iocoder.yudao.module.system.api.storage.dto.StorageBlobRespDTO; |
| | | import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
| | | import cn.idev.excel.annotation.ExcelProperty; |
| | |
| | | @Schema(description = "æ¥ç¥¨æ¥æ", requiredMode = Schema.RequiredMode.REQUIRED, example = "2024-02-02") |
| | | @ExcelProperty("æ¥ç¥¨æ¥æ") |
| | | private LocalDateTime invoiceTime; |
| | | |
| | | @Schema(description = "审æ¹ç¶æ", requiredMode = Schema.RequiredMode.REQUIRED, example = "0") |
| | | @ExcelProperty(value = "审æ¹ç¶æ", converter = DictConvert.class) |
| | | @DictFormat(DictTypeConstants.AUDIT_STATUS) |
| | | private Integer auditStatus; |
| | | |
| | | @Schema(description = "工使µç¼å·", example = "1043") |
| | | @ExcelProperty("工使µç¼å·") |
| | | private String processInstanceId; |
| | | |
| | | @Schema(description = "夿³¨", example = "夿³¨") |
| | | @ExcelProperty("夿³¨") |
| | |
| | | package cn.iocoder.yudao.module.erp.dal.dataobject.purchase; |
| | | |
| | | import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; |
| | | import cn.iocoder.yudao.module.erp.enums.ErpPurchaseInvoiceAuditStatusEnum; |
| | | import com.baomidou.mybatisplus.annotation.KeySequence; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | |
| | | * 夿³¨ |
| | | */ |
| | | private String remark; |
| | | /** |
| | | * 工使µç¼å· |
| | | * |
| | | * å
³è ProcessInstance ç id 屿§ |
| | | */ |
| | | private String processInstanceId; |
| | | /** |
| | | * 审æ¹ç¶æ |
| | | * |
| | | * æä¸¾ {@link ErpPurchaseInvoiceAuditStatusEnum} |
| | | */ |
| | | private Integer auditStatus; |
| | | |
| | | } |
| | |
| | | import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; |
| | | import cn.iocoder.yudao.module.erp.controller.admin.purchase.vo.invoice.ErpPurchaseInvoicePageReqVO; |
| | | import cn.iocoder.yudao.module.erp.dal.dataobject.purchase.ErpPurchaseInvoiceDO; |
| | | import cn.iocoder.yudao.module.erp.enums.ErpPurchaseInvoiceAuditStatusEnum; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | return selectOne(ErpPurchaseInvoiceDO::getNo, no); |
| | | } |
| | | |
| | | default int updateByIdAndStatus(Long id, Integer status, ErpPurchaseInvoiceDO updateObj) { |
| | | return update(updateObj, new LambdaUpdateWrapper<ErpPurchaseInvoiceDO>() |
| | | .eq(ErpPurchaseInvoiceDO::getId, id).eq(ErpPurchaseInvoiceDO::getAuditStatus, status)); |
| | | } |
| | | |
| | | default PageResult<ErpPurchaseInvoiceDO> selectPage(ErpPurchaseInvoicePageReqVO reqVO) { |
| | | return selectPage(reqVO, new LambdaQueryWrapperX<ErpPurchaseInvoiceDO>() |
| | | .likeIfPresent(ErpPurchaseInvoiceDO::getNo, reqVO.getNo()) |
| | | .eqIfPresent(ErpPurchaseInvoiceDO::getSupplierId, reqVO.getSupplierId()) |
| | | .eqIfPresent(ErpPurchaseInvoiceDO::getPurchaseOrderId, reqVO.getPurchaseOrderId()) |
| | | .eqIfPresent(ErpPurchaseInvoiceDO::getAuditStatus, reqVO.getAuditStatus()) |
| | | .orderByDesc(ErpPurchaseInvoiceDO::getId)); |
| | | } |
| | | |
| | | default List<ErpPurchaseInvoiceDO> selectListByOrderIdAndStatus(Long orderId, Collection<Integer> auditStatuses) { |
| | | default List<ErpPurchaseInvoiceDO> selectListByOrderId(Long orderId) { |
| | | return selectList(new LambdaQueryWrapperX<ErpPurchaseInvoiceDO>() |
| | | .eq(ErpPurchaseInvoiceDO::getPurchaseOrderId, orderId) |
| | | .in(ErpPurchaseInvoiceDO::getAuditStatus, auditStatuses)); |
| | | .eq(ErpPurchaseInvoiceDO::getPurchaseOrderId, orderId)); |
| | | } |
| | | |
| | | default List<ErpPurchaseInvoiceDO> selectListBySupplierIdAndStatus(Long supplierId, Collection<Integer> auditStatuses) { |
| | | default List<ErpPurchaseInvoiceDO> selectListBySupplierId(Long supplierId) { |
| | | return selectList(new LambdaQueryWrapperX<ErpPurchaseInvoiceDO>() |
| | | .eq(ErpPurchaseInvoiceDO::getSupplierId, supplierId) |
| | | .in(ErpPurchaseInvoiceDO::getAuditStatus, auditStatuses)); |
| | | } |
| | | |
| | | default Long selectCountByAudit() { |
| | | return selectCount(ErpPurchaseInvoiceDO::getAuditStatus, ErpPurchaseInvoiceAuditStatusEnum.PROCESS.getStatus()); |
| | | .eq(ErpPurchaseInvoiceDO::getSupplierId, supplierId)); |
| | | } |
| | | |
| | | } |
| | |
| | | // ========== ERP éè´æ¥ç¥¨ï¼1-030-105-000ï¼ ========== |
| | | ErrorCode PURCHASE_INVOICE_NOT_EXISTS = new ErrorCode(1_030_105_000, "æ¥ç¥¨ä¸åå¨"); |
| | | ErrorCode PURCHASE_INVOICE_NO_EXISTS = new ErrorCode(1_030_105_001, "çææ¥ç¥¨ç¼å·å¤±è´¥ï¼è¯·éæ°æäº¤"); |
| | | ErrorCode PURCHASE_INVOICE_UPDATE_FAIL_EDITING_PROHIBITED = new ErrorCode(1_030_105_002, "æ¥ç¥¨({})䏿¯æªå®¡æ ¸ç¶æï¼æ æ³ä¿®æ¹"); |
| | | ErrorCode PURCHASE_INVOICE_DELETE_FAIL_IS_APPROVE = new ErrorCode(1_030_105_003, "å 餿¥ç¥¨å¤±è´¥ï¼åå ï¼æ¥ç¥¨å®¡æ¹å·²éè¿"); |
| | | ErrorCode PURCHASE_INVOICE_UPDATE_AUDIT_STATUS_FAIL_NOT_PROCESS = new ErrorCode(1_030_105_005, "æ´æ°æ¥ç¥¨å®¡æ ¸ç¶æå¤±è´¥ï¼åå ï¼æ¥ç¥¨ä¸æ¯å®¡æ ¸ä¸ç¶æ"); |
| | | ErrorCode PURCHASE_INVOICE_DELETE_FAIL_HAS_PAYMENT = new ErrorCode(1_030_105_004, "å 餿¥ç¥¨å¤±è´¥ï¼åå ï¼æ¥ç¥¨å·²å卿æä»æ¬¾å"); |
| | | ErrorCode PURCHASE_INVOICE_CREATE_FAIL_ORDER_NOT_APPROVE = new ErrorCode(1_030_105_006, "å建æ¥ç¥¨å¤±è´¥ï¼åå ï¼éè´è®¢å䏿¯å®¡æ ¸éè¿ç¶æ"); |
| | | ErrorCode PURCHASE_INVOICE_CREATE_FAIL_SUPPLIER_MISMATCH = new ErrorCode(1_030_105_007, "å建æ¥ç¥¨å¤±è´¥ï¼åå ï¼æ¥ç¥¨ä¾åºåä¸éè´è®¢åä¸ä¸è´"); |
| | | ErrorCode PURCHASE_INVOICE_CREATE_FAIL_PRICE_EXCEEDS_LIMIT = new ErrorCode(1_030_105_008, "å建æ¥ç¥¨å¤±è´¥ï¼åå ï¼æ¥ç¥¨éé¢è¶
åºéè´è®¢åéé¢ï¼ç®åå¯å¼ç¥¨ï¼{} å
"); |
| | | ErrorCode PURCHASE_INVOICE_APPROVE_FAIL = new ErrorCode(1_030_105_009, "å®¡æ ¸å¤±è´¥ï¼åªææªå®¡æ ¸çæ¥ç¥¨æè½å®¡æ ¸"); |
| | | ErrorCode PURCHASE_INVOICE_PROCESS_FAIL = new ErrorCode(1_030_105_010, "åå®¡æ ¸å¤±è´¥ï¼åªæå·²å®¡æ ¸çæ¥ç¥¨æè½åå®¡æ ¸"); |
| | | |
| | | // ========== ERP éè´éè´§ï¼1-030-103-000ï¼ ========== |
| | | ErrorCode PURCHASE_RETURN_NOT_EXISTS = new ErrorCode(1_030_103_000, "éè´éè´§åä¸åå¨"); |
| | |
| | | ErrorCode FINANCE_PAYMENT_NO_EXISTS = new ErrorCode(1_030_601_004, "çæä»æ¬¾åå·å¤±è´¥ï¼è¯·éæ°æäº¤"); |
| | | ErrorCode FINANCE_PAYMENT_UPDATE_FAIL_APPROVE = new ErrorCode(1_030_601_005, "仿¬¾å({})å·²å®¡æ ¸ï¼æ æ³ä¿®æ¹"); |
| | | ErrorCode FINANCE_PAYMENT_CREATE_FAIL_INVOICE_NOT_EXISTS = new ErrorCode(1_030_601_006, "åå»ºä»æ¬¾å失败ï¼åå ï¼å
³èçæ¥ç¥¨ä¸åå¨"); |
| | | ErrorCode FINANCE_PAYMENT_CREATE_FAIL_INVOICE_NOT_APPROVE = new ErrorCode(1_030_601_007, "åå»ºä»æ¬¾å失败ï¼åå ï¼å
³èçæ¥ç¥¨ä¸æ¯å®¡æ¹éè¿ç¶æ"); |
| | | ErrorCode FINANCE_PAYMENT_CREATE_FAIL_INVOICE_NOT_ATTACHMENT = new ErrorCode(1_030_601_008, "åå»ºä»æ¬¾å失败ï¼åå ï¼å
³èçæ¥ç¥¨æªä¸ä¼ å票éä»¶"); |
| | | ErrorCode FINANCE_PAYMENT_CREATE_FAIL_INVOICE_SUPPLIER_MISMATCH = new ErrorCode(1_030_601_009, "åå»ºä»æ¬¾å失败ï¼åå ï¼å
³èçæ¥ç¥¨ä¸æéä¾åºåä¸å¹é
"); |
| | | ErrorCode FINANCE_PAYMENT_CREATE_FAIL_INVOICE_PRICE_EXCEEDS = new ErrorCode(1_030_601_010, "åå»ºä»æ¬¾å失败ï¼åå ï¼ä»æ¬¾éé¢è¶
åºè¯¥æ¥ç¥¨å©ä½å¯ä»éé¢ï¼ç®åå¯ä»ï¼{} å
"); |
| | |
| | | import cn.iocoder.yudao.module.erp.dal.mysql.finance.ErpFinancePaymentMapper; |
| | | import cn.iocoder.yudao.module.erp.dal.redis.no.ErpNoRedisDAO; |
| | | import cn.iocoder.yudao.module.erp.enums.ErpAuditStatus; |
| | | import cn.iocoder.yudao.module.erp.enums.ErpPurchaseInvoiceAuditStatusEnum; |
| | | import cn.iocoder.yudao.module.erp.service.purchase.ErpPurchaseInvoiceService; |
| | | import cn.iocoder.yudao.module.erp.service.purchase.ErpPurchaseInvoiceServiceImpl; |
| | | import cn.iocoder.yudao.module.erp.service.purchase.ErpSupplierService; |
| | |
| | | } |
| | | |
| | | /** |
| | | * æ ¡éªä»æ¬¾åå
³èçæ¥ç¥¨ï¼åå¨ã审æ¹éè¿ãå·²ä¸ä¼ å票éä»¶ãä¾åºå䏿¥ç¥¨ä¸è´ |
| | | * æ ¡éªä»æ¬¾åå
³èçæ¥ç¥¨ï¼åå¨ãå·²ä¸ä¼ å票éä»¶ãä¾åºå䏿¥ç¥¨ä¸è´ |
| | | * |
| | | * @param invoiceId æ¥ç¥¨ç¼å· |
| | | * @param supplierId ä¾åºåç¼å· |
| | |
| | | if (invoice == null) { |
| | | throw exception(FINANCE_PAYMENT_CREATE_FAIL_INVOICE_NOT_EXISTS); |
| | | } |
| | | // 2. æ ¡éªæ¥ç¥¨å®¡æ¹éè¿ |
| | | if (ObjectUtil.notEqual(invoice.getAuditStatus(), ErpPurchaseInvoiceAuditStatusEnum.APPROVE.getStatus())) { |
| | | throw exception(FINANCE_PAYMENT_CREATE_FAIL_INVOICE_NOT_APPROVE); |
| | | } |
| | | // 3. æ ¡éªå·²ä¸ä¼ å票éä»¶ |
| | | // 2. æ ¡éªå·²ä¸ä¼ å票éä»¶ |
| | | if (CollUtil.isEmpty(storageAttachmentApi.listAttachments( |
| | | ErpPurchaseInvoiceServiceImpl.PURCHASE_INVOICE_RECORD_TYPE, invoiceId))) { |
| | | throw exception(FINANCE_PAYMENT_CREATE_FAIL_INVOICE_NOT_ATTACHMENT); |
| | | } |
| | | // 4. æ ¡éªä¾åºå䏿¥ç¥¨ä¸è´ï¼é²èæ°æ®ï¼ |
| | | // 3. æ ¡éªä¾åºå䏿¥ç¥¨ä¸è´ï¼é²èæ°æ®ï¼ |
| | | if (ObjectUtil.notEqual(invoice.getSupplierId(), supplierId)) { |
| | | throw exception(FINANCE_PAYMENT_CREATE_FAIL_INVOICE_SUPPLIER_MISMATCH); |
| | | } |
| | |
| | | void deletePurchaseInvoice(Long id); |
| | | |
| | | /** |
| | | * æ´æ°æ¥ç¥¨çç¶æï¼å®¡æ ¸/åå®¡æ ¸ï¼ |
| | | * |
| | | * @param id ç¼å· |
| | | * @param status ç¶æ |
| | | */ |
| | | void updatePurchaseInvoiceStatus(Long id, Integer status); |
| | | |
| | | /** |
| | | * è·å¾æ¥ç¥¨ |
| | | * |
| | | * @param id ç¼å· |
| | |
| | | PageResult<ErpPurchaseInvoiceDO> getPurchaseInvoicePage(ErpPurchaseInvoicePageReqVO pageReqVO); |
| | | |
| | | /** |
| | | * æ ¹æ®éè´è®¢åç¼å·å审æ¹ç¶æè·å¾æ¥ç¥¨å表 |
| | | * æ ¹æ®éè´è®¢åç¼å·è·å¾æ¥ç¥¨å表 |
| | | * |
| | | * @param orderId éè´è®¢åç¼å· |
| | | * @param auditStatuses 审æ¹ç¶æéå |
| | | * @return æ¥ç¥¨å表 |
| | | */ |
| | | List<ErpPurchaseInvoiceDO> getPurchaseInvoiceListByOrderIdAndStatus(Long orderId, Collection<Integer> auditStatuses); |
| | | List<ErpPurchaseInvoiceDO> getPurchaseInvoiceListByOrderId(Long orderId); |
| | | |
| | | /** |
| | | * æ ¹æ®ä¾åºåç¼å·å审æ¹ç¶æè·å¾æ¥ç¥¨å表 |
| | | * æ ¹æ®ä¾åºåç¼å·è·å¾æ¥ç¥¨å表 |
| | | * |
| | | * @param supplierId ä¾åºåç¼å· |
| | | * @param auditStatuses 审æ¹ç¶æéå |
| | | * @return æ¥ç¥¨å表 |
| | | */ |
| | | List<ErpPurchaseInvoiceDO> getPurchaseInvoiceListBySupplierIdAndStatus(Long supplierId, Collection<Integer> auditStatuses); |
| | | |
| | | /** |
| | | * è·å¾å¾
å®¡æ ¸æ¥ç¥¨æ°é |
| | | * |
| | | * @return æ°é |
| | | */ |
| | | Long getAuditInvoiceCount(); |
| | | List<ErpPurchaseInvoiceDO> getPurchaseInvoiceListBySupplierId(Long supplierId); |
| | | |
| | | } |
| | |
| | | import cn.iocoder.yudao.module.erp.controller.admin.purchase.vo.invoice.ErpPurchaseInvoiceSaveReqVO; |
| | | import cn.iocoder.yudao.module.erp.dal.dataobject.purchase.ErpPurchaseInvoiceDO; |
| | | import cn.iocoder.yudao.module.erp.dal.dataobject.purchase.ErpPurchaseOrderDO; |
| | | import cn.iocoder.yudao.module.erp.dal.mysql.finance.ErpFinancePaymentMapper; |
| | | import cn.iocoder.yudao.module.erp.dal.mysql.purchase.ErpPurchaseInvoiceMapper; |
| | | import cn.iocoder.yudao.module.erp.dal.redis.no.ErpNoRedisDAO; |
| | | import cn.iocoder.yudao.module.erp.enums.ErpPurchaseInvoiceAuditStatusEnum; |
| | | import cn.iocoder.yudao.module.system.api.storage.StorageAttachmentApi; |
| | | import jakarta.annotation.Resource; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | import java.math.BigDecimal; |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; |
| | | import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.getSumValue; |
| | |
| | | private ErpPurchaseInvoiceMapper invoiceMapper; |
| | | |
| | | @Resource |
| | | private ErpFinancePaymentMapper financePaymentMapper; |
| | | |
| | | @Resource |
| | | private ErpNoRedisDAO noRedisDAO; |
| | | |
| | | @Resource |
| | |
| | | throw exception(PURCHASE_INVOICE_NO_EXISTS); |
| | | } |
| | | |
| | | // 2.1 æå
¥æ¥ç¥¨ï¼å建åå³ä¸ºæªå®¡æ ¸ç¶æï¼ |
| | | ErpPurchaseInvoiceDO invoice = BeanUtils.toBean(createReqVO, ErpPurchaseInvoiceDO.class) |
| | | .setNo(no).setAuditStatus(ErpPurchaseInvoiceAuditStatusEnum.PROCESS.getStatus()); |
| | | // 2.1 æå
¥æ¥ç¥¨ï¼å建åå³ä¸ºææç¶æï¼æ éå®¡æ ¸ï¼ |
| | | ErpPurchaseInvoiceDO invoice = BeanUtils.toBean(createReqVO, ErpPurchaseInvoiceDO.class).setNo(no); |
| | | invoiceMapper.insert(invoice); |
| | | |
| | | // 2.2 ç»å®å票éä»¶ |
| | |
| | | } |
| | | |
| | | private void validatePurchaseInvoicePriceExceedsLimit(ErpPurchaseInvoiceSaveReqVO reqVO) { |
| | | // 1. 计ç®å©ä½å¯å¼ç¥¨éé¢ï¼ä¸å
æ¬ reqVO èªèº«ï¼å®¡æ¹ä¸ä¹å ç¨é¢åº¦ï¼é²æ¢ç´¯è®¡æ¥ç¥¨è¶
è¿éè´è®¢åéé¢ï¼ |
| | | // 1. 计ç®å©ä½å¯å¼ç¥¨éé¢ï¼ä¸å
æ¬ reqVO èªèº«ï¼æææææ¥ç¥¨é½å ç¨é¢åº¦ï¼é²æ¢ç´¯è®¡æ¥ç¥¨è¶
è¿éè´è®¢åéé¢ï¼ |
| | | ErpPurchaseOrderDO purchaseOrder = purchaseOrderService.getPurchaseOrder(reqVO.getPurchaseOrderId()); |
| | | List<ErpPurchaseInvoiceDO> invoices = invoiceMapper.selectListByOrderIdAndStatus(reqVO.getPurchaseOrderId(), |
| | | List.of(ErpPurchaseInvoiceAuditStatusEnum.DRAFT.getStatus(), |
| | | ErpPurchaseInvoiceAuditStatusEnum.PROCESS.getStatus(), |
| | | ErpPurchaseInvoiceAuditStatusEnum.APPROVE.getStatus())); |
| | | List<ErpPurchaseInvoiceDO> invoices = invoiceMapper.selectListByOrderId(reqVO.getPurchaseOrderId()); |
| | | if (reqVO.getId() != null) { |
| | | invoices.removeIf(invoice -> ObjectUtil.equal(invoice.getId(), reqVO.getId())); |
| | | } |
| | |
| | | public void updatePurchaseInvoice(ErpPurchaseInvoiceSaveReqVO updateReqVO) { |
| | | Assert.notNull(updateReqVO.getId(), "æ¥ç¥¨ç¼å·ä¸è½ä¸ºç©º"); |
| | | // 1.1 æ ¡éªåå¨ |
| | | ErpPurchaseInvoiceDO oldInvoice = validatePurchaseInvoiceExists(updateReqVO.getId()); |
| | | // 1.2 åªææªå®¡æ ¸å¯ä»¥ç¼è¾ |
| | | if (ObjectUtil.notEqual(oldInvoice.getAuditStatus(), ErpPurchaseInvoiceAuditStatusEnum.PROCESS.getStatus())) { |
| | | throw exception(PURCHASE_INVOICE_UPDATE_FAIL_EDITING_PROHIBITED, oldInvoice.getNo()); |
| | | } |
| | | // 1.3 æ ¡éªå
³èæ°æ® + å¯å¼ç¥¨éé¢ |
| | | validatePurchaseInvoiceExists(updateReqVO.getId()); |
| | | // 1.2 æ ¡éªå
³èæ°æ® + å¯å¼ç¥¨éé¢ |
| | | validateRelationDataExists(updateReqVO); |
| | | validatePurchaseInvoicePriceExceedsLimit(updateReqVO); |
| | | |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void deletePurchaseInvoice(Long id) { |
| | | // 1.1 æ ¡éªåå¨ |
| | | ErpPurchaseInvoiceDO invoice = validatePurchaseInvoiceExists(id); |
| | | // 1.2 审æ¹éè¿æ¶ï¼ä¸å
许å é¤ |
| | | if (ObjectUtil.equal(invoice.getAuditStatus(), ErpPurchaseInvoiceAuditStatusEnum.APPROVE.getStatus())) { |
| | | throw exception(PURCHASE_INVOICE_DELETE_FAIL_IS_APPROVE); |
| | | validatePurchaseInvoiceExists(id); |
| | | // 1.2 å·²æææä»æ¬¾åå
³èçæ¥ç¥¨ï¼ä¸å
许å é¤ï¼ä¿ææ¥ç¥¨ä¸ä»æ¬¾çå
³è宿´æ§ï¼ |
| | | Map<Long, BigDecimal> paidMap = financePaymentMapper.selectPaymentPriceMapByInvoiceId(List.of(id)); |
| | | if (paidMap.getOrDefault(id, BigDecimal.ZERO).compareTo(BigDecimal.ZERO) > 0) { |
| | | throw exception(PURCHASE_INVOICE_DELETE_FAIL_HAS_PAYMENT); |
| | | } |
| | | |
| | | // 2.1 å é¤å票éä»¶ |
| | | storageAttachmentApi.deleteAttachmentsByRecord(PURCHASE_INVOICE_RECORD_TYPE, id); |
| | | // 2.2 å 餿¥ç¥¨ |
| | | invoiceMapper.deleteById(id); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void updatePurchaseInvoiceStatus(Long id, Integer status) { |
| | | boolean approve = ErpPurchaseInvoiceAuditStatusEnum.APPROVE.getStatus().equals(status); |
| | | // 1.1 æ ¡éªåå¨ |
| | | ErpPurchaseInvoiceDO invoice = validatePurchaseInvoiceExists(id); |
| | | // 1.2 æ ¡éªç¶æ |
| | | if (invoice.getAuditStatus().equals(status)) { |
| | | throw exception(approve ? PURCHASE_INVOICE_APPROVE_FAIL : PURCHASE_INVOICE_PROCESS_FAIL); |
| | | } |
| | | |
| | | // 2. æ´æ°ç¶æ |
| | | int updateCount = invoiceMapper.updateByIdAndStatus(id, invoice.getAuditStatus(), |
| | | new ErpPurchaseInvoiceDO().setAuditStatus(status)); |
| | | if (updateCount == 0) { |
| | | throw exception(approve ? PURCHASE_INVOICE_APPROVE_FAIL : PURCHASE_INVOICE_PROCESS_FAIL); |
| | | } |
| | | } |
| | | |
| | | private ErpPurchaseInvoiceDO validatePurchaseInvoiceExists(Long id) { |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<ErpPurchaseInvoiceDO> getPurchaseInvoiceListByOrderIdAndStatus(Long orderId, Collection<Integer> auditStatuses) { |
| | | return invoiceMapper.selectListByOrderIdAndStatus(orderId, auditStatuses); |
| | | public List<ErpPurchaseInvoiceDO> getPurchaseInvoiceListByOrderId(Long orderId) { |
| | | return invoiceMapper.selectListByOrderId(orderId); |
| | | } |
| | | |
| | | @Override |
| | | public List<ErpPurchaseInvoiceDO> getPurchaseInvoiceListBySupplierIdAndStatus(Long supplierId, Collection<Integer> auditStatuses) { |
| | | return invoiceMapper.selectListBySupplierIdAndStatus(supplierId, auditStatuses); |
| | | } |
| | | |
| | | @Override |
| | | public Long getAuditInvoiceCount() { |
| | | return invoiceMapper.selectCountByAudit(); |
| | | public List<ErpPurchaseInvoiceDO> getPurchaseInvoiceListBySupplierId(Long supplierId) { |
| | | return invoiceMapper.selectListBySupplierId(supplierId); |
| | | } |
| | | |
| | | } |
| | |
| | | // 2.1 æå
¥è®¢å |
| | | ErpSaleOrderDO saleOrder = BeanUtils.toBean(createReqVO, ErpSaleOrderDO.class, in -> in |
| | | .setNo(no).setStatus(ErpAuditStatus.PROCESS.getStatus()) |
| | | .setDepositPrice(ObjectUtil.defaultIfNull(createReqVO.getDepositPrice(), BigDecimal.ZERO)) |
| | | .setOutCount(BigDecimal.ZERO).setOutStatus(ErpSaleOrderOutStatusEnum.NOT_OUT.getStatus())); |
| | | calculateTotalPrice(saleOrder, saleOrderItems); |
| | | saleOrderMapper.insert(saleOrder); |
| | |
| | | |
| | | // 2.1 æ´æ°è®¢å |
| | | ErpSaleOrderDO updateObj = BeanUtils.toBean(updateReqVO, ErpSaleOrderDO.class); |
| | | updateObj.setDepositPrice(ObjectUtil.defaultIfNull(updateReqVO.getDepositPrice(), BigDecimal.ZERO)); |
| | | calculateTotalPrice(updateObj, saleOrderItems); |
| | | saleOrderMapper.updateById(updateObj); |
| | | // 2.2 æ´æ°è®¢å项 |
| | |
| | | syncReqDTO.setMaxStock(reqVO.getMaxStock()); |
| | | syncReqDTO.setHighValue(reqVO.getIsHighValue()); |
| | | syncReqDTO.setBatchFlag(reqVO.getIsBatchManaged()); |
| | | syncReqDTO.setStatus(reqVO.getStatus()); |
| | | syncReqDTO.setRemark(reqVO.getRemark()); |
| | | // æ¹æ¬¡é
ç½®åæ®µ |
| | | syncReqDTO.setProduceDateFlag(reqVO.getProduceDateFlag()); |
| | |
| | | @Schema(description = "夿³¨", example = "夿³¨") |
| | | private String remark; |
| | | |
| | | @Schema(description = "ç¶æ", example = "1") |
| | | private Integer status; |
| | | |
| | | // ========== æ¹æ¬¡å±æ§é
ç½® ========== |
| | | |
| | | @Schema(description = "çäº§æ¥æå¿
å¡«", example = "true") |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.iocoder.yudao.module.mes.controller.admin.dv.metering; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; |
| | | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| | | import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| | | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| | | import cn.iocoder.yudao.framework.common.util.collection.MapUtils; |
| | | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| | | import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.dv.metering.vo.MesDvMeteringPageReqVO; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.dv.metering.vo.MesDvMeteringRespVO; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.dv.metering.vo.MesDvMeteringSaveReqVO; |
| | | import cn.iocoder.yudao.module.mes.dal.dataobject.dv.metering.MesDvMeteringDO; |
| | | import cn.iocoder.yudao.module.mes.enums.dv.MesDvMeteringExpireStatusEnum; |
| | | import cn.iocoder.yudao.module.mes.service.dv.metering.MesDvMeteringService; |
| | | import cn.iocoder.yudao.module.system.api.dept.DeptApi; |
| | | import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO; |
| | | import cn.iocoder.yudao.module.system.api.user.AdminUserApi; |
| | | import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.annotation.Resource; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import jakarta.validation.Valid; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.io.IOException; |
| | | import java.time.LocalDate; |
| | | import java.time.temporal.ChronoUnit; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT; |
| | | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| | | import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet; |
| | | |
| | | @Tag(name = "管çåå° - MES 计éå¨å
·") |
| | | @RestController |
| | | @RequestMapping("/mes/dv/metering") |
| | | @Validated |
| | | public class MesDvMeteringController { |
| | | |
| | | @Resource |
| | | private MesDvMeteringService meteringService; |
| | | @Resource |
| | | private DeptApi deptApi; |
| | | @Resource |
| | | private AdminUserApi adminUserApi; |
| | | |
| | | @PostMapping("/create") |
| | | @Operation(summary = "å建计éå¨å
·") |
| | | @PreAuthorize("@ss.hasPermission('mes:dv-metering:create')") |
| | | public CommonResult<Long> createMetering(@Valid @RequestBody MesDvMeteringSaveReqVO createReqVO) { |
| | | return success(meteringService.createMetering(createReqVO)); |
| | | } |
| | | |
| | | @PutMapping("/update") |
| | | @Operation(summary = "æ´æ°è®¡éå¨å
·") |
| | | @PreAuthorize("@ss.hasPermission('mes:dv-metering:update')") |
| | | public CommonResult<Boolean> updateMetering(@Valid @RequestBody MesDvMeteringSaveReqVO updateReqVO) { |
| | | meteringService.updateMetering(updateReqVO); |
| | | return success(true); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "å é¤è®¡éå¨å
·") |
| | | @Parameter(name = "id", description = "ç¼å·", required = true) |
| | | @PreAuthorize("@ss.hasPermission('mes:dv-metering:delete')") |
| | | public CommonResult<Boolean> deleteMetering(@RequestParam("id") Long id) { |
| | | meteringService.deleteMetering(id); |
| | | return success(true); |
| | | } |
| | | |
| | | @GetMapping("/get") |
| | | @Operation(summary = "è·å¾è®¡éå¨å
·") |
| | | @Parameter(name = "id", description = "ç¼å·", required = true, example = "1024") |
| | | @PreAuthorize("@ss.hasPermission('mes:dv-metering:query')") |
| | | public CommonResult<MesDvMeteringRespVO> getMetering(@RequestParam("id") Long id) { |
| | | MesDvMeteringDO metering = meteringService.getMetering(id); |
| | | if (metering == null) { |
| | | return success(null); |
| | | } |
| | | return success(buildMeteringRespVOList(Collections.singletonList(metering)).get(0)); |
| | | } |
| | | |
| | | @GetMapping("/page") |
| | | @Operation(summary = "è·å¾è®¡éå¨å
·å页") |
| | | @PreAuthorize("@ss.hasPermission('mes:dv-metering:query')") |
| | | public CommonResult<PageResult<MesDvMeteringRespVO>> getMeteringPage(@Valid MesDvMeteringPageReqVO pageReqVO) { |
| | | PageResult<MesDvMeteringDO> pageResult = meteringService.getMeteringPage(pageReqVO); |
| | | return success(new PageResult<>(buildMeteringRespVOList(pageResult.getList()), pageResult.getTotal())); |
| | | } |
| | | |
| | | @GetMapping("/export-excel") |
| | | @Operation(summary = "导åºè®¡éå¨å
· Excel") |
| | | @PreAuthorize("@ss.hasPermission('mes:dv-metering:export')") |
| | | @ApiAccessLog(operateType = EXPORT) |
| | | public void exportMeteringExcel(@Valid MesDvMeteringPageReqVO pageReqVO, |
| | | HttpServletResponse response) throws IOException { |
| | | pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); |
| | | List<MesDvMeteringDO> list = meteringService.getMeteringPage(pageReqVO).getList(); |
| | | ExcelUtils.write(response, "计éå¨å
·.xls", "æ°æ®", MesDvMeteringRespVO.class, |
| | | buildMeteringRespVOList(list)); |
| | | } |
| | | |
| | | @GetMapping("/simple-list") |
| | | @Operation(summary = "è·å¾è®¡éå¨å
·ç²¾ç®å表", description = "主è¦ç¨äºå端ç䏿é项") |
| | | @PreAuthorize("@ss.hasPermission('mes:dv-metering:query')") |
| | | public CommonResult<List<MesDvMeteringRespVO>> getMeteringSimpleList() { |
| | | List<MesDvMeteringDO> list = meteringService.getMeteringList(); |
| | | return success(buildMeteringRespVOList(list)); |
| | | } |
| | | |
| | | // ==================== æ¼æ¥ VO ==================== |
| | | |
| | | @SuppressWarnings("DuplicatedCode") |
| | | private List<MesDvMeteringRespVO> buildMeteringRespVOList(List<MesDvMeteringDO> list) { |
| | | if (CollUtil.isEmpty(list)) { |
| | | return Collections.emptyList(); |
| | | } |
| | | // 1. æ¹éè·åå
³èæ°æ® |
| | | int remindDays = meteringService.getRemindDays(); |
| | | Map<Long, DeptRespDTO> deptMap = CollUtil.isNotEmpty(convertSet(list, MesDvMeteringDO::getDeptId)) |
| | | ? deptApi.getDeptMap(convertSet(list, MesDvMeteringDO::getDeptId)) : Collections.emptyMap(); |
| | | Map<Long, AdminUserRespDTO> userMap = CollUtil.isNotEmpty(convertSet(list, MesDvMeteringDO::getChargeUserId)) |
| | | ? adminUserApi.getUserMap(convertSet(list, MesDvMeteringDO::getChargeUserId)) : Collections.emptyMap(); |
| | | // 2. æ¼æ¥ VO |
| | | return BeanUtils.toBean(list, MesDvMeteringRespVO.class, vo -> { |
| | | // 计ç®å°æç¶æä¸å©ä½å¤©æ° |
| | | vo.setExpireStatus(MesDvMeteringExpireStatusEnum.compute(vo.getNextCheckDate(), remindDays)); |
| | | if (vo.getNextCheckDate() != null) { |
| | | vo.setExpireDays(ChronoUnit.DAYS.between(LocalDate.now(), vo.getNextCheckDate())); |
| | | } |
| | | MapUtils.findAndThen(deptMap, vo.getDeptId(), dept -> vo.setDeptName(dept.getName())); |
| | | MapUtils.findAndThen(userMap, vo.getChargeUserId(), |
| | | user -> vo.setChargeUserNickname(user.getNickname())); |
| | | }); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.iocoder.yudao.module.mes.controller.admin.dv.metering.vo; |
| | | |
| | | import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.ToString; |
| | | |
| | | import java.time.LocalDate; |
| | | |
| | | @Schema(description = "管çåå° - MES 计éå¨å
·å页 Request VO") |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ToString(callSuper = true) |
| | | public class MesDvMeteringPageReqVO extends PageParam { |
| | | |
| | | @Schema(description = "计éå¨å
·ç¼ç ", example = "MD-001") |
| | | private String code; |
| | | |
| | | @Schema(description = "计éå¨å
·åç§°", example = "æ°æ¾å¡å°º") |
| | | private String name; |
| | | |
| | | @Schema(description = "åç/ç产åå®¶", example = "ä¸ä¸°") |
| | | private String brand; |
| | | |
| | | @Schema(description = "å¨å
·ç±»å«", example = "1") |
| | | private Integer category; |
| | | |
| | | @Schema(description = "使ç¨é¨é¨ç¼å·", example = "100") |
| | | private Long deptId; |
| | | |
| | | @Schema(description = "责任人ç¼å·", example = "200") |
| | | private Long chargeUserId; |
| | | |
| | | @Schema(description = "ç¶æ", example = "1") |
| | | private Integer status; |
| | | |
| | | @Schema(description = "å°æç¶æï¼1 å·²è¿æ/2 å³å°å°æ/3 æ£å¸¸ï¼", example = "2") |
| | | private Integer expireStatus; |
| | | |
| | | @Schema(description = "䏿¬¡æ£æµæ¥æå¼å§ï¼ç±åç«¯æ ¹æ®å°æç¶æèªå¨å¡«å
ï¼", hidden = true) |
| | | private LocalDate nextCheckDateBegin; |
| | | |
| | | @Schema(description = "䏿¬¡æ£æµæ¥æç»æï¼ç±åç«¯æ ¹æ®å°æç¶æèªå¨å¡«å
ï¼", hidden = true) |
| | | private LocalDate nextCheckDateEnd; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.iocoder.yudao.module.mes.controller.admin.dv.metering.vo; |
| | | |
| | | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| | | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| | | import cn.iocoder.yudao.module.mes.enums.DictTypeConstants; |
| | | import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
| | | import cn.idev.excel.annotation.ExcelProperty; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Schema(description = "管çåå° - MES 计éå¨å
· Response VO") |
| | | @Data |
| | | @ExcelIgnoreUnannotated |
| | | public class MesDvMeteringRespVO { |
| | | |
| | | @Schema(description = "ç¼å·", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") |
| | | @ExcelProperty("ç¼å·") |
| | | private Long id; |
| | | |
| | | @Schema(description = "计éå¨å
·ç¼ç ", requiredMode = Schema.RequiredMode.REQUIRED, example = "MD-001") |
| | | @ExcelProperty("计éå¨å
·ç¼ç ") |
| | | private String code; |
| | | |
| | | @Schema(description = "计éå¨å
·åç§°", requiredMode = Schema.RequiredMode.REQUIRED, example = "æ°æ¾å¡å°º") |
| | | @ExcelProperty("计éå¨å
·åç§°") |
| | | private String name; |
| | | |
| | | @Schema(description = "è§æ ¼åå·", example = "0-150mm") |
| | | @ExcelProperty("è§æ ¼åå·") |
| | | private String specification; |
| | | |
| | | @Schema(description = "åç/ç产åå®¶", example = "ä¸ä¸°") |
| | | @ExcelProperty("åç/ç产åå®¶") |
| | | private String brand; |
| | | |
| | | @Schema(description = "å¨å
·ç±»å«", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") |
| | | @ExcelProperty(value = "å¨å
·ç±»å«", converter = DictConvert.class) |
| | | @DictFormat(DictTypeConstants.MES_DV_METERING_CATEGORY) |
| | | private Integer category; |
| | | |
| | | @Schema(description = "精度", example = "0.01mm") |
| | | @ExcelProperty("精度") |
| | | private String precision; |
| | | |
| | | @Schema(description = "éç¨", example = "0-150mm") |
| | | @ExcelProperty("éç¨") |
| | | private String range; |
| | | |
| | | @Schema(description = "使ç¨é¨é¨ç¼å·", example = "100") |
| | | private Long deptId; |
| | | |
| | | @Schema(description = "使ç¨é¨é¨åç§°", example = "è´¨æ£é¨") |
| | | @ExcelProperty("使ç¨é¨é¨") |
| | | private String deptName; |
| | | |
| | | @Schema(description = "责任人ç¼å·", example = "200") |
| | | private Long chargeUserId; |
| | | |
| | | @Schema(description = "责任人åç§°", example = "å¼ ä¸") |
| | | @ExcelProperty("责任人") |
| | | private String chargeUserNickname; |
| | | |
| | | @Schema(description = "æ ¡åå¨æï¼æï¼", requiredMode = Schema.RequiredMode.REQUIRED, example = "12") |
| | | @ExcelProperty("æ ¡å卿(æ)") |
| | | private Integer checkCycleCount; |
| | | |
| | | @Schema(description = "æå
¥ä½¿ç¨æ¥æ") |
| | | @ExcelProperty("æå
¥ä½¿ç¨æ¥æ") |
| | | private LocalDate useDate; |
| | | |
| | | @Schema(description = "䏿¬¡æ£æµæ¥æ") |
| | | @ExcelProperty("䏿¬¡æ£æµæ¥æ") |
| | | private LocalDate lastCheckDate; |
| | | |
| | | @Schema(description = "䏿¬¡æ£æµæ¥æï¼å°ææ¥ï¼") |
| | | @ExcelProperty("䏿¬¡æ£æµæ¥æ") |
| | | private LocalDate nextCheckDate; |
| | | |
| | | @Schema(description = "å°æç¶æï¼1 å·²è¿æ/2 å³å°å°æ/3 æ£å¸¸ï¼", example = "2") |
| | | @ExcelProperty("å°æç¶æ") |
| | | private Integer expireStatus; |
| | | |
| | | @Schema(description = "è·ç¦»å°æå¤©æ°ï¼æ£æ°æªå°ï¼è´æ°å·²è¿æï¼", example = "10") |
| | | @ExcelProperty("å©ä½å¤©æ°") |
| | | private Long expireDays; |
| | | |
| | | @Schema(description = "ç¶æ", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") |
| | | @ExcelProperty(value = "ç¶æ", converter = DictConvert.class) |
| | | @DictFormat(DictTypeConstants.MES_DV_METERING_STATUS) |
| | | private Integer status; |
| | | |
| | | @Schema(description = "夿³¨", example = "夿³¨") |
| | | @ExcelProperty("夿³¨") |
| | | private String remark; |
| | | |
| | | @Schema(description = "å建æ¶é´", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @ExcelProperty("å建æ¶é´") |
| | | private LocalDateTime createTime; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.iocoder.yudao.module.mes.controller.admin.dv.metering.vo; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import jakarta.validation.constraints.NotEmpty; |
| | | import jakarta.validation.constraints.NotNull; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDate; |
| | | |
| | | @Schema(description = "管çåå° - MES 计éå¨å
·æ°å¢/ä¿®æ¹ Request VO") |
| | | @Data |
| | | public class MesDvMeteringSaveReqVO { |
| | | |
| | | @Schema(description = "ç¼å·", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") |
| | | private Long id; |
| | | |
| | | @Schema(description = "计éå¨å
·ç¼ç ", requiredMode = Schema.RequiredMode.REQUIRED, example = "MD-001") |
| | | @NotEmpty(message = "计éå¨å
·ç¼ç ä¸è½ä¸ºç©º") |
| | | private String code; |
| | | |
| | | @Schema(description = "计éå¨å
·åç§°", requiredMode = Schema.RequiredMode.REQUIRED, example = "æ°æ¾å¡å°º") |
| | | @NotEmpty(message = "计éå¨å
·åç§°ä¸è½ä¸ºç©º") |
| | | private String name; |
| | | |
| | | @Schema(description = "è§æ ¼åå·", example = "0-150mm") |
| | | private String specification; |
| | | |
| | | @Schema(description = "åç/ç产åå®¶", example = "ä¸ä¸°") |
| | | private String brand; |
| | | |
| | | @Schema(description = "å¨å
·ç±»å«", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") |
| | | @NotNull(message = "å¨å
·ç±»å«ä¸è½ä¸ºç©º") |
| | | private Integer category; |
| | | |
| | | @Schema(description = "精度", example = "0.01mm") |
| | | private String precision; |
| | | |
| | | @Schema(description = "éç¨", example = "0-150mm") |
| | | private String range; |
| | | |
| | | @Schema(description = "使ç¨é¨é¨ç¼å·", example = "100") |
| | | private Long deptId; |
| | | |
| | | @Schema(description = "责任人ç¼å·", example = "200") |
| | | private Long chargeUserId; |
| | | |
| | | @Schema(description = "æ ¡åå¨æï¼æï¼", requiredMode = Schema.RequiredMode.REQUIRED, example = "12") |
| | | @NotNull(message = "æ ¡å卿ä¸è½ä¸ºç©º") |
| | | private Integer checkCycleCount; |
| | | |
| | | @Schema(description = "æå
¥ä½¿ç¨æ¥æ") |
| | | private LocalDate useDate; |
| | | |
| | | @Schema(description = "ç¶æ", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") |
| | | @NotNull(message = "ç¶æä¸è½ä¸ºç©º") |
| | | private Integer status; |
| | | |
| | | @Schema(description = "夿³¨", example = "夿³¨") |
| | | private String remark; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.iocoder.yudao.module.mes.controller.admin.dv.meteringcheck; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; |
| | | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| | | import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| | | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| | | import cn.iocoder.yudao.framework.common.util.collection.MapUtils; |
| | | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| | | import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.dv.meteringcheck.vo.MesDvMeteringCheckPageReqVO; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.dv.meteringcheck.vo.MesDvMeteringCheckRespVO; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.dv.meteringcheck.vo.MesDvMeteringCheckSaveReqVO; |
| | | import cn.iocoder.yudao.module.mes.dal.dataobject.dv.metering.MesDvMeteringDO; |
| | | import cn.iocoder.yudao.module.mes.dal.dataobject.dv.meteringcheck.MesDvMeteringCheckDO; |
| | | import cn.iocoder.yudao.module.mes.service.dv.metering.MesDvMeteringService; |
| | | import cn.iocoder.yudao.module.mes.service.dv.meteringcheck.MesDvMeteringCheckService; |
| | | import cn.iocoder.yudao.module.system.api.user.AdminUserApi; |
| | | import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.annotation.Resource; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import jakarta.validation.Valid; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT; |
| | | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| | | import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet; |
| | | |
| | | @Tag(name = "管çåå° - MES è®¡éæ£æµè®°å½") |
| | | @RestController |
| | | @RequestMapping("/mes/dv/metering-check") |
| | | @Validated |
| | | public class MesDvMeteringCheckController { |
| | | |
| | | @Resource |
| | | private MesDvMeteringCheckService meteringCheckService; |
| | | @Resource |
| | | private MesDvMeteringService meteringService; |
| | | @Resource |
| | | private AdminUserApi adminUserApi; |
| | | |
| | | @PostMapping("/create") |
| | | @Operation(summary = "åå»ºè®¡éæ£æµè®°å½") |
| | | @PreAuthorize("@ss.hasPermission('mes:dv-metering-check:create')") |
| | | public CommonResult<Long> createMeteringCheck(@Valid @RequestBody MesDvMeteringCheckSaveReqVO createReqVO) { |
| | | return success(meteringCheckService.createMeteringCheck(createReqVO)); |
| | | } |
| | | |
| | | @PutMapping("/update") |
| | | @Operation(summary = "æ´æ°è®¡éæ£æµè®°å½") |
| | | @PreAuthorize("@ss.hasPermission('mes:dv-metering-check:update')") |
| | | public CommonResult<Boolean> updateMeteringCheck(@Valid @RequestBody MesDvMeteringCheckSaveReqVO updateReqVO) { |
| | | meteringCheckService.updateMeteringCheck(updateReqVO); |
| | | return success(true); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "å é¤è®¡éæ£æµè®°å½") |
| | | @Parameter(name = "id", description = "ç¼å·", required = true) |
| | | @PreAuthorize("@ss.hasPermission('mes:dv-metering-check:delete')") |
| | | public CommonResult<Boolean> deleteMeteringCheck(@RequestParam("id") Long id) { |
| | | meteringCheckService.deleteMeteringCheck(id); |
| | | return success(true); |
| | | } |
| | | |
| | | @GetMapping("/get") |
| | | @Operation(summary = "è·å¾è®¡éæ£æµè®°å½") |
| | | @Parameter(name = "id", description = "ç¼å·", required = true, example = "1024") |
| | | @PreAuthorize("@ss.hasPermission('mes:dv-metering-check:query')") |
| | | public CommonResult<MesDvMeteringCheckRespVO> getMeteringCheck(@RequestParam("id") Long id) { |
| | | MesDvMeteringCheckDO check = meteringCheckService.getMeteringCheck(id); |
| | | if (check == null) { |
| | | return success(null); |
| | | } |
| | | return success(buildMeteringCheckRespVOList(Collections.singletonList(check)).get(0)); |
| | | } |
| | | |
| | | @GetMapping("/page") |
| | | @Operation(summary = "è·å¾è®¡éæ£æµè®°å½å页") |
| | | @PreAuthorize("@ss.hasPermission('mes:dv-metering-check:query')") |
| | | public CommonResult<PageResult<MesDvMeteringCheckRespVO>> getMeteringCheckPage( |
| | | @Valid MesDvMeteringCheckPageReqVO pageReqVO) { |
| | | PageResult<MesDvMeteringCheckDO> pageResult = meteringCheckService.getMeteringCheckPage(pageReqVO); |
| | | return success(new PageResult<>(buildMeteringCheckRespVOList(pageResult.getList()), pageResult.getTotal())); |
| | | } |
| | | |
| | | @GetMapping("/export-excel") |
| | | @Operation(summary = "导åºè®¡éæ£æµè®°å½ Excel") |
| | | @PreAuthorize("@ss.hasPermission('mes:dv-metering-check:export')") |
| | | @ApiAccessLog(operateType = EXPORT) |
| | | public void exportMeteringCheckExcel(@Valid MesDvMeteringCheckPageReqVO pageReqVO, |
| | | HttpServletResponse response) throws IOException { |
| | | pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); |
| | | List<MesDvMeteringCheckDO> list = meteringCheckService.getMeteringCheckPage(pageReqVO).getList(); |
| | | ExcelUtils.write(response, "è®¡éæ£æµè®°å½.xls", "æ°æ®", MesDvMeteringCheckRespVO.class, |
| | | buildMeteringCheckRespVOList(list)); |
| | | } |
| | | |
| | | // ==================== æ¼æ¥ VO ==================== |
| | | |
| | | @SuppressWarnings("DuplicatedCode") |
| | | private List<MesDvMeteringCheckRespVO> buildMeteringCheckRespVOList(List<MesDvMeteringCheckDO> list) { |
| | | if (CollUtil.isEmpty(list)) { |
| | | return Collections.emptyList(); |
| | | } |
| | | // 1. æ¹éè·åå
³èæ°æ® |
| | | Map<Long, MesDvMeteringDO> meteringMap = meteringService.getMeteringMap( |
| | | convertSet(list, MesDvMeteringCheckDO::getMeteringId)); |
| | | Map<Long, AdminUserRespDTO> userMap = CollUtil.isNotEmpty(convertSet(list, MesDvMeteringCheckDO::getCheckUserId)) |
| | | ? adminUserApi.getUserMap(convertSet(list, MesDvMeteringCheckDO::getCheckUserId)) : Collections.emptyMap(); |
| | | // 2. æ¼æ¥ VO |
| | | return BeanUtils.toBean(list, MesDvMeteringCheckRespVO.class, vo -> { |
| | | MapUtils.findAndThen(meteringMap, vo.getMeteringId(), |
| | | metering -> vo.setMeteringCode(metering.getCode()).setMeteringName(metering.getName())); |
| | | MapUtils.findAndThen(userMap, vo.getCheckUserId(), |
| | | user -> vo.setCheckUserNickname(user.getNickname())); |
| | | }); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.iocoder.yudao.module.mes.controller.admin.dv.meteringcheck.vo; |
| | | |
| | | import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.ToString; |
| | | |
| | | import java.time.LocalDate; |
| | | |
| | | @Schema(description = "管çåå° - MES è®¡éæ£æµè®°å½å页 Request VO") |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ToString(callSuper = true) |
| | | public class MesDvMeteringCheckPageReqVO extends PageParam { |
| | | |
| | | @Schema(description = "计éå¨å
·ç¼å·", example = "100") |
| | | private Long meteringId; |
| | | |
| | | @Schema(description = "æ£æµç¼å·", example = "CK-001") |
| | | private String checkCode; |
| | | |
| | | @Schema(description = "æ£æµç»è®º", example = "1") |
| | | private Integer checkResult; |
| | | |
| | | @Schema(description = "æ£æµæ¥æ") |
| | | private LocalDate[] checkDate; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.iocoder.yudao.module.mes.controller.admin.dv.meteringcheck.vo; |
| | | |
| | | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| | | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| | | import cn.iocoder.yudao.module.mes.enums.DictTypeConstants; |
| | | import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
| | | import cn.idev.excel.annotation.ExcelProperty; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Schema(description = "管çåå° - MES è®¡éæ£æµè®°å½ Response VO") |
| | | @Data |
| | | @ExcelIgnoreUnannotated |
| | | public class MesDvMeteringCheckRespVO { |
| | | |
| | | @Schema(description = "ç¼å·", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") |
| | | @ExcelProperty("ç¼å·") |
| | | private Long id; |
| | | |
| | | @Schema(description = "计éå¨å
·ç¼å·", requiredMode = Schema.RequiredMode.REQUIRED, example = "100") |
| | | private Long meteringId; |
| | | |
| | | @Schema(description = "计éå¨å
·ç¼ç ", example = "MD-001") |
| | | @ExcelProperty("计éå¨å
·ç¼ç ") |
| | | private String meteringCode; |
| | | |
| | | @Schema(description = "计éå¨å
·åç§°", example = "æ°æ¾å¡å°º") |
| | | @ExcelProperty("计éå¨å
·åç§°") |
| | | private String meteringName; |
| | | |
| | | @Schema(description = "æ£æµç¼å·", requiredMode = Schema.RequiredMode.REQUIRED, example = "CK-001") |
| | | @ExcelProperty("æ£æµç¼å·") |
| | | private String checkCode; |
| | | |
| | | @Schema(description = "æ£æµæ¥æ", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @ExcelProperty("æ£æµæ¥æ") |
| | | private LocalDate checkDate; |
| | | |
| | | @Schema(description = "æ£æµæºæ", example = "å¸è®¡éé¢") |
| | | @ExcelProperty("æ£æµæºæ") |
| | | private String checkOrg; |
| | | |
| | | @Schema(description = "æ£æµç»è®º", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") |
| | | @ExcelProperty(value = "æ£æµç»è®º", converter = DictConvert.class) |
| | | @DictFormat(DictTypeConstants.MES_DV_METERING_CHECK_RESULT) |
| | | private Integer checkResult; |
| | | |
| | | @Schema(description = "è¯ä¹¦ç¼å·", example = "CN-2026-001") |
| | | @ExcelProperty("è¯ä¹¦ç¼å·") |
| | | private String certNo; |
| | | |
| | | @Schema(description = "æ£æµäººç¼å·", example = "200") |
| | | private Long checkUserId; |
| | | |
| | | @Schema(description = "æ£æµäººåç§°", example = "æå") |
| | | @ExcelProperty("æ£æµäºº") |
| | | private String checkUserNickname; |
| | | |
| | | @Schema(description = "䏿¬¡æ£æµæ¥æ") |
| | | @ExcelProperty("䏿¬¡æ£æµæ¥æ") |
| | | private LocalDate nextCheckDate; |
| | | |
| | | @Schema(description = "夿³¨", example = "夿³¨") |
| | | @ExcelProperty("夿³¨") |
| | | private String remark; |
| | | |
| | | @Schema(description = "å建æ¶é´", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @ExcelProperty("å建æ¶é´") |
| | | private LocalDateTime createTime; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.iocoder.yudao.module.mes.controller.admin.dv.meteringcheck.vo; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import jakarta.validation.constraints.NotEmpty; |
| | | import jakarta.validation.constraints.NotNull; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDate; |
| | | |
| | | @Schema(description = "管çåå° - MES è®¡éæ£æµè®°å½æ°å¢/ä¿®æ¹ Request VO") |
| | | @Data |
| | | public class MesDvMeteringCheckSaveReqVO { |
| | | |
| | | @Schema(description = "ç¼å·", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") |
| | | private Long id; |
| | | |
| | | @Schema(description = "计éå¨å
·ç¼å·", requiredMode = Schema.RequiredMode.REQUIRED, example = "100") |
| | | @NotNull(message = "计éå¨å
·ä¸è½ä¸ºç©º") |
| | | private Long meteringId; |
| | | |
| | | @Schema(description = "æ£æµç¼å·", requiredMode = Schema.RequiredMode.REQUIRED, example = "CK-001") |
| | | @NotEmpty(message = "æ£æµç¼å·ä¸è½ä¸ºç©º") |
| | | private String checkCode; |
| | | |
| | | @Schema(description = "æ£æµæ¥æ", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @NotNull(message = "æ£æµæ¥æä¸è½ä¸ºç©º") |
| | | private LocalDate checkDate; |
| | | |
| | | @Schema(description = "æ£æµæºæ", example = "å¸è®¡éé¢") |
| | | private String checkOrg; |
| | | |
| | | @Schema(description = "æ£æµç»è®º", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") |
| | | @NotNull(message = "æ£æµç»è®ºä¸è½ä¸ºç©º") |
| | | private Integer checkResult; |
| | | |
| | | @Schema(description = "è¯ä¹¦ç¼å·", example = "CN-2026-001") |
| | | private String certNo; |
| | | |
| | | @Schema(description = "æ£æµäººç¼å·", example = "200") |
| | | private Long checkUserId; |
| | | |
| | | @Schema(description = "䏿¬¡æ£æµæ¥æï¼ä¸ºç©ºåæ æ£æµæ¥æ + æ ¡å卿 èªå¨è®¡ç®ï¼") |
| | | private LocalDate nextCheckDate; |
| | | |
| | | @Schema(description = "夿³¨", example = "夿³¨") |
| | | private String remark; |
| | | |
| | | } |
| | |
| | | import cn.iocoder.yudao.module.mes.service.md.unitmeasure.MesMdUnitMeasureService; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.Parameters; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.annotation.Resource; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | |
| | | @PreAuthorize("@ss.hasPermission('mes:md-item:update')") |
| | | public CommonResult<Boolean> updateItem(@Valid @RequestBody MesMdItemSaveReqVO updateReqVO) { |
| | | itemService.updateItem(updateReqVO); |
| | | return success(true); |
| | | } |
| | | |
| | | @PutMapping("/update-status") |
| | | @Operation(summary = "æ´æ°ç©æäº§åç¶æ") |
| | | @Parameters({ |
| | | @Parameter(name = "id", description = "ç¼å·", required = true), |
| | | @Parameter(name = "status", description = "ç¶æ", required = true) |
| | | }) |
| | | @PreAuthorize("@ss.hasPermission('mes:md-item:update')") |
| | | public CommonResult<Boolean> updateItemStatus(@RequestParam("id") Long id, |
| | | @RequestParam("status") Integer status) { |
| | | itemService.updateItemStatus(id, status); |
| | | return success(true); |
| | | } |
| | | |
| | |
| | | @Schema(description = "夿³¨", example = "夿³¨") |
| | | private String remark; |
| | | |
| | | @Schema(description = "ç¶æ", example = "1") |
| | | private Integer status; |
| | | |
| | | @Schema(description = "æ¯å¦åæ¥å° MDM", example = "true") |
| | | private Boolean syncMdm; |
| | | |
| | |
| | | return success(true); |
| | | } |
| | | |
| | | @PutMapping("/audit") |
| | | @Operation(summary = "å®¡æ ¸è®¾è®¡é¡¹ç®ï¼å¾
å®¡æ ¸âå¾
彿¡£ï¼") |
| | | @PutMapping("/submit-approval") |
| | | @Operation(summary = "æäº¤è®¾è®¡é¡¹ç®å®¡æ¹ï¼å¾
å®¡æ ¸â审æ¹ä¸ï¼") |
| | | @Parameter(name = "id", description = "ç¼å·", required = true) |
| | | @Parameter(name = "processDefinitionKey", description = "æµç¨å®ä¹ Key", required = true) |
| | | @PreAuthorize("@ss.hasPermission('mes:pd-project:update')") |
| | | public CommonResult<Boolean> auditProject(@RequestParam("id") Long id) { |
| | | projectService.auditProject(id); |
| | | public CommonResult<Boolean> submitProjectApproval(@RequestParam("id") Long id, |
| | | @RequestParam("processDefinitionKey") String processDefinitionKey) { |
| | | projectService.submitProjectApproval(id, processDefinitionKey); |
| | | return success(true); |
| | | } |
| | | |
| | | @GetMapping("/approve-process-list") |
| | | @Operation(summary = "è·å¾è®¾è®¡é¡¹ç®å®¡æ¹æµç¨å表") |
| | | @PreAuthorize("@ss.hasPermission('mes:pd-project:update')") |
| | | public CommonResult<List<Map<String, Object>>> getProjectApproveProcessDefinitionList() { |
| | | return success(projectService.getProjectApproveProcessDefinitionList()); |
| | | } |
| | | |
| | | @PutMapping("/archive") |
| | | @Operation(summary = "彿¡£è®¾è®¡é¡¹ç®ï¼å¾
彿¡£â已彿¡£ï¼ï¼åæ¶èªå¨åå»ºå½æ¡£å°è´¦") |
| | | @Parameter(name = "id", description = "ç¼å·", required = true) |
| | |
| | | @ExcelProperty("夿³¨") |
| | | private String remark; |
| | | |
| | | @Schema(description = "BPM æµç¨å®ä¾ç¼å·") |
| | | private String processInstanceId; |
| | | |
| | | @Schema(description = "å建æ¶é´", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | @ExcelProperty("å建æ¶é´") |
| | | private LocalDateTime createTime; |
| | |
| | | import cn.iocoder.yudao.framework.common.util.collection.MapUtils; |
| | | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.wm.batch.vo.MesWmBatchPageReqVO; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.wm.batch.vo.MesWmBatchProcessTraceRespVO; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.wm.batch.vo.MesWmBatchPurchaseSourceRespVO; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.wm.batch.vo.MesWmBatchRespVO; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.wm.batch.vo.MesWmBatchSalesTargetRespVO; |
| | | import cn.iocoder.yudao.module.crm.api.customer.CrmCustomerApi; |
| | | import cn.iocoder.yudao.module.crm.api.customer.dto.CrmCustomerRespDTO; |
| | | import cn.iocoder.yudao.module.srm.api.supplier.SrmSupplierApi; |
| | |
| | | import cn.iocoder.yudao.module.mdm.api.item.dto.MdmItemRespDTO; |
| | | |
| | | import cn.iocoder.yudao.module.mes.dal.dataobject.md.workstation.MesMdWorkstationDO; |
| | | import cn.iocoder.yudao.module.mes.dal.dataobject.pro.process.MesProProcessDO; |
| | | import cn.iocoder.yudao.module.mes.dal.dataobject.pro.task.MesProTaskDO; |
| | | import cn.iocoder.yudao.module.mes.dal.dataobject.pro.workorder.MesProWorkOrderDO; |
| | | import cn.iocoder.yudao.module.mes.dal.dataobject.tm.tool.MesTmToolDO; |
| | |
| | | import cn.iocoder.yudao.module.mdm.api.unit.dto.MdmUnitMeasureRespDTO; |
| | | |
| | | import cn.iocoder.yudao.module.mes.service.md.workstation.MesMdWorkstationService; |
| | | import cn.iocoder.yudao.module.mes.service.pro.process.MesProProcessService; |
| | | import cn.iocoder.yudao.module.mes.service.pro.task.MesProTaskService; |
| | | import cn.iocoder.yudao.module.mes.service.pro.workorder.MesProWorkOrderService; |
| | | import cn.iocoder.yudao.module.mes.service.tm.tool.MesTmToolService; |
| | |
| | | private MesMdWorkstationService workstationService; |
| | | @Resource |
| | | private MesTmToolService toolService; |
| | | @Resource |
| | | private MesProProcessService processService; |
| | | |
| | | @GetMapping("/get") |
| | | @Operation(summary = "è·å¾æ¹æ¬¡è¯¦æ
") |
| | |
| | | public CommonResult<List<MesWmBatchRespVO>> getBackwardList(@RequestParam("code") @Valid String code) { |
| | | List<MesWmBatchDO> list = batchService.getBackwardBatchList(code); |
| | | return success(buildBatchRespVOList(list)); |
| | | } |
| | | |
| | | @GetMapping("/purchase-sources") |
| | | @Operation(summary = "æ¹æ¬¡éè´æ¥æºï¼éè´å
¥åºå + IQCï¼") |
| | | @Parameter(name = "code", description = "æ¹æ¬¡ç¼ç ", required = true, example = "BATCH20250314001") |
| | | @PreAuthorize("@ss.hasPermission('mes:wm-batch:query')") |
| | | public CommonResult<List<MesWmBatchPurchaseSourceRespVO>> getPurchaseSourceList(@RequestParam("code") @Valid String code) { |
| | | List<MesWmBatchPurchaseSourceRespVO> list = batchService.getPurchaseSourceList(code); |
| | | return success(buildPurchaseSourceRespVOList(list)); |
| | | } |
| | | |
| | | @GetMapping("/sales-targets") |
| | | @Operation(summary = "æ¹æ¬¡éå®å»åï¼éå®åºåºå + OQCï¼") |
| | | @Parameter(name = "code", description = "æ¹æ¬¡ç¼ç ", required = true, example = "BATCH20250314001") |
| | | @PreAuthorize("@ss.hasPermission('mes:wm-batch:query')") |
| | | public CommonResult<List<MesWmBatchSalesTargetRespVO>> getSalesTargetList(@RequestParam("code") @Valid String code) { |
| | | List<MesWmBatchSalesTargetRespVO> list = batchService.getSalesTargetList(code); |
| | | return success(buildSalesTargetRespVOList(list)); |
| | | } |
| | | |
| | | @GetMapping("/process-trace") |
| | | @Operation(summary = "æ¹æ¬¡å·¥åºæµè½¬ï¼äº§åº/æå
¥äºä»¶ï¼") |
| | | @Parameter(name = "code", description = "æ¹æ¬¡ç¼ç ", required = true, example = "BATCH20250314001") |
| | | @PreAuthorize("@ss.hasPermission('mes:wm-batch:query')") |
| | | public CommonResult<List<MesWmBatchProcessTraceRespVO>> getProcessTraceList(@RequestParam("code") @Valid String code) { |
| | | List<MesWmBatchProcessTraceRespVO> list = batchService.getProcessTraceList(code); |
| | | return success(buildProcessTraceRespVOList(list)); |
| | | } |
| | | |
| | | @GetMapping("/get-by-sn") |
| | | @Operation(summary = "æ ¹æ® SN ç åæ¥æ¹æ¬¡") |
| | | @Parameter(name = "sn", description = "SN åºåå·", required = true, example = "SN20250314001") |
| | | @PreAuthorize("@ss.hasPermission('mes:wm-batch:query')") |
| | | public CommonResult<MesWmBatchRespVO> getBatchBySn(@RequestParam("sn") @Valid String sn) { |
| | | MesWmBatchDO batch = batchService.getBatchBySn(sn); |
| | | return success(buildBatchRespVO(batch)); |
| | | } |
| | | |
| | | // ==================== æ¼æ¥ VO ==================== |
| | |
| | | return buildBatchRespVOList(Collections.singletonList(batch)).get(0); |
| | | } |
| | | |
| | | private List<MesWmBatchPurchaseSourceRespVO> buildPurchaseSourceRespVOList(List<MesWmBatchPurchaseSourceRespVO> list) { |
| | | if (CollUtil.isEmpty(list)) { |
| | | return Collections.emptyList(); |
| | | } |
| | | Map<Long, MdmItemRespDTO> itemMap = mdmItemApi.getItemMap( |
| | | convertSet(list, MesWmBatchPurchaseSourceRespVO::getItemId)); |
| | | Map<Long, SrmSupplierRespDTO> vendorMap = srmSupplierApi.getSupplierList( |
| | | convertSet(list, MesWmBatchPurchaseSourceRespVO::getVendorId)).getCheckedData().stream() |
| | | .collect(Collectors.toMap(SrmSupplierRespDTO::getId, s -> s)); |
| | | list.forEach(vo -> { |
| | | MapUtils.findAndThen(itemMap, vo.getItemId(), item -> { |
| | | vo.setItemCode(item.getCode()).setItemName(item.getName()); |
| | | }); |
| | | MapUtils.findAndThen(vendorMap, vo.getVendorId(), |
| | | vendor -> vo.setVendorCode(vendor.getCode()).setVendorName(vendor.getName())); |
| | | }); |
| | | return list; |
| | | } |
| | | |
| | | private List<MesWmBatchSalesTargetRespVO> buildSalesTargetRespVOList(List<MesWmBatchSalesTargetRespVO> list) { |
| | | if (CollUtil.isEmpty(list)) { |
| | | return Collections.emptyList(); |
| | | } |
| | | Map<Long, MdmItemRespDTO> itemMap = mdmItemApi.getItemMap( |
| | | convertSet(list, MesWmBatchSalesTargetRespVO::getItemId)); |
| | | Map<Long, CrmCustomerRespDTO> clientMap = customerApi.getCustomerMap( |
| | | convertSet(list, MesWmBatchSalesTargetRespVO::getClientId)); |
| | | list.forEach(vo -> { |
| | | MapUtils.findAndThen(itemMap, vo.getItemId(), item -> { |
| | | vo.setItemCode(item.getCode()).setItemName(item.getName()); |
| | | }); |
| | | MapUtils.findAndThen(clientMap, vo.getClientId(), |
| | | client -> vo.setClientName(client.getName())); |
| | | }); |
| | | return list; |
| | | } |
| | | |
| | | private List<MesWmBatchProcessTraceRespVO> buildProcessTraceRespVOList(List<MesWmBatchProcessTraceRespVO> list) { |
| | | if (CollUtil.isEmpty(list)) { |
| | | return Collections.emptyList(); |
| | | } |
| | | Map<Long, MesProWorkOrderDO> workOrderMap = workOrderService.getWorkOrderMap( |
| | | convertSet(list, MesWmBatchProcessTraceRespVO::getWorkOrderId)); |
| | | Map<Long, MesProProcessDO> processMap = processService.getProcessMap( |
| | | convertSet(list, MesWmBatchProcessTraceRespVO::getProcessId)); |
| | | list.forEach(vo -> { |
| | | MapUtils.findAndThen(workOrderMap, vo.getWorkOrderId(), |
| | | workOrder -> vo.setWorkOrderCode(workOrder.getCode())); |
| | | MapUtils.findAndThen(processMap, vo.getProcessId(), |
| | | process -> vo.setProcessCode(process.getCode()).setProcessName(process.getName())); |
| | | }); |
| | | return list; |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.iocoder.yudao.module.mes.controller.admin.wm.batch.vo; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Schema(description = "管çåå° - MES æ¹æ¬¡å·¥åºæµè½¬ Response VO") |
| | | @Data |
| | | public class MesWmBatchProcessTraceRespVO { |
| | | |
| | | @Schema(description = "äºä»¶ç±»åï¼IN-å·¥åºæå
¥ / OUT-å·¥åºäº§åº", example = "OUT") |
| | | private String eventType; |
| | | |
| | | @Schema(description = "ç产工å ID", example = "1") |
| | | private Long workOrderId; |
| | | |
| | | @Schema(description = "ç产工åç¼å·", example = "WO20250801001") |
| | | private String workOrderCode; |
| | | |
| | | @Schema(description = "å·¥åº ID", example = "1") |
| | | private Long processId; |
| | | |
| | | @Schema(description = "å·¥åºç¼ç ", example = "PROC001") |
| | | private String processCode; |
| | | |
| | | @Schema(description = "å·¥åºåç§°", example = "CNC å å·¥") |
| | | private String processName; |
| | | |
| | | @Schema(description = "æ¹æ¬¡å·", example = "BATCH20250801001") |
| | | private String batchCode; |
| | | |
| | | @Schema(description = "æ°é", example = "100") |
| | | private BigDecimal quantity; |
| | | |
| | | @Schema(description = "è´¨éç¶æï¼åå
¸ mes_wm_quality_statusï¼ï¼ä»
产åºä¾§æå¼", example = "1") |
| | | private Integer qualityStatus; |
| | | |
| | | @Schema(description = "äºä»¶æ¶é´") |
| | | private LocalDateTime eventTime; |
| | | |
| | | @Schema(description = "å·¥åºåºå·ï¼æåºç¨ï¼", example = "1") |
| | | private Integer processSort; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.iocoder.yudao.module.mes.controller.admin.wm.batch.vo; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Schema(description = "管çåå° - MES æ¹æ¬¡éè´æ¥æº Response VO") |
| | | @Data |
| | | public class MesWmBatchPurchaseSourceRespVO { |
| | | |
| | | @Schema(description = "éè´å
¥åºåå·", example = "IR20250731001") |
| | | private String receiptCode; |
| | | |
| | | @Schema(description = "å
¥åºæ¥æ") |
| | | private LocalDateTime receiptDate; |
| | | |
| | | @Schema(description = "éè´è®¢åç¼å·", example = "PO20250731001") |
| | | private String purchaseOrderCode; |
| | | |
| | | @Schema(description = "ä¾åºå ID", example = "1") |
| | | private Long vendorId; |
| | | |
| | | @Schema(description = "ä¾åºåç¼ç ", example = "V001") |
| | | private String vendorCode; |
| | | |
| | | @Schema(description = "ä¾åºååç§°", example = "ä¾åºåA") |
| | | private String vendorName; |
| | | |
| | | @Schema(description = "æ¥ææ£éªåå·ï¼IQCï¼", example = "IQC20250731001") |
| | | private String iqcCode; |
| | | |
| | | @Schema(description = "IQC æ£éªç»è®ºï¼åå
¸ mes_qc_check_resultï¼", example = "1") |
| | | private Integer checkResult; |
| | | |
| | | @Schema(description = "ç©æ ID", example = "1") |
| | | private Long itemId; |
| | | |
| | | @Schema(description = "ç©æç¼ç ", example = "ITEM001") |
| | | private String itemCode; |
| | | |
| | | @Schema(description = "ç©æåç§°", example = "产åA") |
| | | private String itemName; |
| | | |
| | | @Schema(description = "æ¹æ¬¡å·", example = "BATCH20250731001") |
| | | private String batchCode; |
| | | |
| | | @Schema(description = "å
¥åºæ°é", example = "100") |
| | | private BigDecimal receivedQuantity; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.iocoder.yudao.module.mes.controller.admin.wm.batch.vo; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Schema(description = "管çåå° - MES æ¹æ¬¡éå®å»å Response VO") |
| | | @Data |
| | | public class MesWmBatchSalesTargetRespVO { |
| | | |
| | | @Schema(description = "éå®åºåºåå·", example = "SO20250801001") |
| | | private String salesCode; |
| | | |
| | | @Schema(description = "åºåºæ¥æ") |
| | | private LocalDateTime salesDate; |
| | | |
| | | @Schema(description = "éå®è®¢åç¼å·", example = "SO20250801001") |
| | | private String salesOrderCode; |
| | | |
| | | @Schema(description = "å®¢æ· ID", example = "1") |
| | | private Long clientId; |
| | | |
| | | @Schema(description = "客æ·ç¼ç ", example = "C001") |
| | | private String clientCode; |
| | | |
| | | @Schema(description = "客æ·åç§°", example = "客æ·A") |
| | | private String clientName; |
| | | |
| | | @Schema(description = "åºåæ£éªåå·ï¼OQCï¼", example = "OQC20250801001") |
| | | private String oqcCode; |
| | | |
| | | @Schema(description = "OQC æ£éªç»è®ºï¼åå
¸ mes_qc_check_resultï¼", example = "1") |
| | | private Integer checkResult; |
| | | |
| | | @Schema(description = "ç©æ ID", example = "1") |
| | | private Long itemId; |
| | | |
| | | @Schema(description = "ç©æç¼ç ", example = "ITEM001") |
| | | private String itemCode; |
| | | |
| | | @Schema(description = "ç©æåç§°", example = "产åA") |
| | | private String itemName; |
| | | |
| | | @Schema(description = "æ¹æ¬¡å·", example = "BATCH20250801001") |
| | | private String batchCode; |
| | | |
| | | @Schema(description = "åºåºæ°é", example = "100") |
| | | private BigDecimal quantity; |
| | | |
| | | @Schema(description = "è´¨éç¶æï¼åå
¸ mes_wm_quality_statusï¼", example = "1") |
| | | private Integer qualityStatus; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.iocoder.yudao.module.mes.dal.dataobject.dv.metering; |
| | | |
| | | import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; |
| | | import cn.iocoder.yudao.module.mes.enums.DictTypeConstants; |
| | | import com.baomidou.mybatisplus.annotation.KeySequence; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.*; |
| | | |
| | | import java.time.LocalDate; |
| | | |
| | | /** |
| | | * MES 计éå¨å
· DO |
| | | * |
| | | * @author è¶
级管çå |
| | | */ |
| | | @TableName("mes_dv_metering") |
| | | @KeySequence("mes_dv_metering_seq") // ç¨äº OracleãPostgreSQLãKingbaseãDB2ãH2 æ°æ®åºç主é®èªå¢ãå¦ææ¯ MySQL çæ°æ®åºï¼å¯ä¸åã |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ToString(callSuper = true) |
| | | @Builder |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | public class MesDvMeteringDO extends BaseDO { |
| | | |
| | | /** |
| | | * ç¼å· |
| | | */ |
| | | @TableId |
| | | private Long id; |
| | | /** |
| | | * 计éå¨å
·ç¼ç |
| | | */ |
| | | private String code; |
| | | /** |
| | | * 计éå¨å
·åç§° |
| | | */ |
| | | private String name; |
| | | /** |
| | | * è§æ ¼åå· |
| | | */ |
| | | private String specification; |
| | | /** |
| | | * åç/ç产åå®¶ |
| | | */ |
| | | private String brand; |
| | | /** |
| | | * å¨å
·ç±»å« |
| | | * |
| | | * åå
¸ {@link DictTypeConstants#MES_DV_METERING_CATEGORY} |
| | | */ |
| | | private Integer category; |
| | | /** |
| | | * 精度 |
| | | */ |
| | | @TableField("`precision`") |
| | | private String precision; |
| | | /** |
| | | * éç¨ |
| | | */ |
| | | @TableField("`range`") |
| | | private String range; |
| | | /** |
| | | * 使ç¨é¨é¨ç¼å· |
| | | */ |
| | | private Long deptId; |
| | | /** |
| | | * 责任人ç¼å· |
| | | */ |
| | | private Long chargeUserId; |
| | | /** |
| | | * æ ¡åå¨æï¼æï¼ |
| | | */ |
| | | private Integer checkCycleCount; |
| | | /** |
| | | * æå
¥ä½¿ç¨æ¥æ |
| | | */ |
| | | private LocalDate useDate; |
| | | /** |
| | | * 䏿¬¡æ£æµæ¥æ |
| | | */ |
| | | private LocalDate lastCheckDate; |
| | | /** |
| | | * 䏿¬¡æ£æµæ¥æï¼å°ææ¥ï¼ |
| | | */ |
| | | private LocalDate nextCheckDate; |
| | | /** |
| | | * ç¶æ |
| | | * |
| | | * åå
¸ {@link DictTypeConstants#MES_DV_METERING_STATUS} |
| | | */ |
| | | private Integer status; |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | private String remark; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.iocoder.yudao.module.mes.dal.dataobject.dv.meteringcheck; |
| | | |
| | | import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; |
| | | import cn.iocoder.yudao.module.mes.enums.DictTypeConstants; |
| | | import com.baomidou.mybatisplus.annotation.KeySequence; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.*; |
| | | |
| | | import java.time.LocalDate; |
| | | |
| | | /** |
| | | * MES è®¡éæ£æµè®°å½ DO |
| | | * |
| | | * @author è¶
级管çå |
| | | */ |
| | | @TableName("mes_dv_metering_check") |
| | | @KeySequence("mes_dv_metering_check_seq") // ç¨äº OracleãPostgreSQLãKingbaseãDB2ãH2 æ°æ®åºç主é®èªå¢ãå¦ææ¯ MySQL çæ°æ®åºï¼å¯ä¸åã |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ToString(callSuper = true) |
| | | @Builder |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | public class MesDvMeteringCheckDO extends BaseDO { |
| | | |
| | | /** |
| | | * ç¼å· |
| | | */ |
| | | @TableId |
| | | private Long id; |
| | | /** |
| | | * 计éå¨å
·ç¼å· |
| | | * |
| | | * å
³è {@link cn.iocoder.yudao.module.mes.dal.dataobject.dv.metering.MesDvMeteringDO#getId()} |
| | | */ |
| | | private Long meteringId; |
| | | /** |
| | | * æ£æµç¼å· |
| | | */ |
| | | private String checkCode; |
| | | /** |
| | | * æ£æµæ¥æ |
| | | */ |
| | | private LocalDate checkDate; |
| | | /** |
| | | * æ£æµæºæ |
| | | */ |
| | | private String checkOrg; |
| | | /** |
| | | * æ£æµç»è®º |
| | | * |
| | | * åå
¸ {@link DictTypeConstants#MES_DV_METERING_CHECK_RESULT} |
| | | */ |
| | | private Integer checkResult; |
| | | /** |
| | | * è¯ä¹¦ç¼å· |
| | | */ |
| | | private String certNo; |
| | | /** |
| | | * æ£æµäººç¼å· |
| | | */ |
| | | private Long checkUserId; |
| | | /** |
| | | * 䏿¬¡æ£æµæ¥æï¼èªå¨è®¡ç®ææå¨æå®ï¼ |
| | | */ |
| | | private LocalDate nextCheckDate; |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | private String remark; |
| | | |
| | | } |
| | |
| | | */ |
| | | private Integer status; |
| | | /** |
| | | * BPM æµç¨å®ä¾ç¼å· |
| | | */ |
| | | private String processInstanceId; |
| | | /** |
| | | * BPM æµç¨å®ä¹ Key |
| | | */ |
| | | private String processDefinitionKey; |
| | | /** |
| | | * ä¸»è®¾è®¡å¸ |
| | | * |
| | | * å
³è AdminUserDO#getId() |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.iocoder.yudao.module.mes.dal.mysql.dv.metering; |
| | | |
| | | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| | | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; |
| | | import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.dv.metering.vo.MesDvMeteringPageReqVO; |
| | | import cn.iocoder.yudao.module.mes.dal.dataobject.dv.metering.MesDvMeteringDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * MES 计éå¨å
· Mapper |
| | | * |
| | | * @author è¶
级管çå |
| | | */ |
| | | @Mapper |
| | | public interface MesDvMeteringMapper extends BaseMapperX<MesDvMeteringDO> { |
| | | |
| | | default PageResult<MesDvMeteringDO> selectPage(MesDvMeteringPageReqVO reqVO) { |
| | | return selectPage(reqVO, new LambdaQueryWrapperX<MesDvMeteringDO>() |
| | | .likeIfPresent(MesDvMeteringDO::getCode, reqVO.getCode()) |
| | | .likeIfPresent(MesDvMeteringDO::getName, reqVO.getName()) |
| | | .likeIfPresent(MesDvMeteringDO::getBrand, reqVO.getBrand()) |
| | | .eqIfPresent(MesDvMeteringDO::getCategory, reqVO.getCategory()) |
| | | .eqIfPresent(MesDvMeteringDO::getDeptId, reqVO.getDeptId()) |
| | | .eqIfPresent(MesDvMeteringDO::getChargeUserId, reqVO.getChargeUserId()) |
| | | .eqIfPresent(MesDvMeteringDO::getStatus, reqVO.getStatus()) |
| | | .geIfPresent(MesDvMeteringDO::getNextCheckDate, reqVO.getNextCheckDateBegin()) |
| | | .leIfPresent(MesDvMeteringDO::getNextCheckDate, reqVO.getNextCheckDateEnd()) |
| | | .orderByDesc(MesDvMeteringDO::getId)); |
| | | } |
| | | |
| | | default MesDvMeteringDO selectByCode(String code) { |
| | | return selectOne(MesDvMeteringDO::getCode, code); |
| | | } |
| | | |
| | | default List<MesDvMeteringDO> selectListByNextCheckDateBetween(LocalDate begin, LocalDate end) { |
| | | return selectList(new LambdaQueryWrapperX<MesDvMeteringDO>() |
| | | .ge(MesDvMeteringDO::getNextCheckDate, begin) |
| | | .le(MesDvMeteringDO::getNextCheckDate, end)); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.iocoder.yudao.module.mes.dal.mysql.dv.meteringcheck; |
| | | |
| | | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| | | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; |
| | | import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.dv.meteringcheck.vo.MesDvMeteringCheckPageReqVO; |
| | | import cn.iocoder.yudao.module.mes.dal.dataobject.dv.meteringcheck.MesDvMeteringCheckDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * MES è®¡éæ£æµè®°å½ Mapper |
| | | * |
| | | * @author è¶
级管çå |
| | | */ |
| | | @Mapper |
| | | public interface MesDvMeteringCheckMapper extends BaseMapperX<MesDvMeteringCheckDO> { |
| | | |
| | | default PageResult<MesDvMeteringCheckDO> selectPage(MesDvMeteringCheckPageReqVO reqVO) { |
| | | return selectPage(reqVO, new LambdaQueryWrapperX<MesDvMeteringCheckDO>() |
| | | .eqIfPresent(MesDvMeteringCheckDO::getMeteringId, reqVO.getMeteringId()) |
| | | .likeIfPresent(MesDvMeteringCheckDO::getCheckCode, reqVO.getCheckCode()) |
| | | .eqIfPresent(MesDvMeteringCheckDO::getCheckResult, reqVO.getCheckResult()) |
| | | .betweenIfPresent(MesDvMeteringCheckDO::getCheckDate, reqVO.getCheckDate()) |
| | | .orderByDesc(MesDvMeteringCheckDO::getId)); |
| | | } |
| | | |
| | | default MesDvMeteringCheckDO selectByCheckCode(String checkCode) { |
| | | return selectOne(MesDvMeteringCheckDO::getCheckCode, checkCode); |
| | | } |
| | | |
| | | default MesDvMeteringCheckDO selectLatestByMeteringId(Long meteringId) { |
| | | return selectOne(new LambdaQueryWrapperX<MesDvMeteringCheckDO>() |
| | | .eq(MesDvMeteringCheckDO::getMeteringId, meteringId) |
| | | .orderByDesc(MesDvMeteringCheckDO::getCheckDate) |
| | | .orderByDesc(MesDvMeteringCheckDO::getId) |
| | | .last("LIMIT 1")); |
| | | } |
| | | |
| | | default Long selectCountByMeteringId(Long meteringId) { |
| | | return selectCount(MesDvMeteringCheckDO::getMeteringId, meteringId); |
| | | } |
| | | |
| | | } |
| | |
| | | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; |
| | | import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.wm.batch.vo.MesWmBatchPageReqVO; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.wm.batch.vo.MesWmBatchProcessTraceRespVO; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.wm.batch.vo.MesWmBatchPurchaseSourceRespVO; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.wm.batch.vo.MesWmBatchSalesTargetRespVO; |
| | | import cn.iocoder.yudao.module.mes.dal.dataobject.wm.batch.MesWmBatchDO; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | |
| | | */ |
| | | List<MesWmBatchDO> selectListByBackward(String batchCode); |
| | | |
| | | /** |
| | | * æ¥è¯¢æ¹æ¬¡éè´æ¥æºï¼éè´å
¥åºå + IQCï¼ |
| | | * |
| | | * @param batchCode æ¹æ¬¡å· |
| | | * @return éè´æ¥æºå表 |
| | | */ |
| | | List<MesWmBatchPurchaseSourceRespVO> selectPurchaseSourceList(String batchCode); |
| | | |
| | | /** |
| | | * æ¥è¯¢æ¹æ¬¡éå®å»åï¼éå®åºåºå + OQCï¼ |
| | | * |
| | | * @param batchCode æ¹æ¬¡å· |
| | | * @return éå®å»åå表 |
| | | */ |
| | | List<MesWmBatchSalesTargetRespVO> selectSalesTargetList(String batchCode); |
| | | |
| | | /** |
| | | * æ¥è¯¢æ¹æ¬¡å·¥åºæµè½¬ï¼äº§åº/æå
¥äºä»¶ï¼ |
| | | * |
| | | * @param batchCode æ¹æ¬¡å· |
| | | * @return å·¥åºæµè½¬å表 |
| | | */ |
| | | List<MesWmBatchProcessTraceRespVO> selectProcessTraceList(String batchCode); |
| | | |
| | | } |
| | |
| | | */ |
| | | String AUTO_CODE = "mes:md:auto_code:"; |
| | | |
| | | /** |
| | | * 计éå¨å
·å°ææéå»é |
| | | * |
| | | * KEY æ ¼å¼ï¼mes:dv:metering:remind:{meteringId}:{nextCheckDate} |
| | | * VALUE æ°æ®æ ¼å¼ï¼1 |
| | | */ |
| | | String METERING_EXPIRE_REMIND = "mes:dv:metering:remind:"; |
| | | |
| | | /** |
| | | * 计éå¨å
·å°ææéæ«æé¨é© |
| | | * |
| | | * KEY æ ¼å¼ï¼mes:dv:metering:remind:scan:{today} |
| | | * VALUE æ°æ®æ ¼å¼ï¼1 |
| | | */ |
| | | String METERING_EXPIRE_REMIND_SCAN = "mes:dv:metering:remind:scan:"; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.iocoder.yudao.module.mes.dal.redis.dv.metering; |
| | | |
| | | import cn.iocoder.yudao.module.mes.dal.redis.RedisKeyConstants; |
| | | import jakarta.annotation.Resource; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.time.Duration; |
| | | import java.time.LocalDate; |
| | | |
| | | /** |
| | | * MES 计éå¨å
·å°ææé Redis DAO |
| | | * |
| | | * @author è¶
级管çå |
| | | */ |
| | | @Repository |
| | | public class MesDvMeteringRemindRedisDAO { |
| | | |
| | | /** |
| | | * æéå»é KEY çè¿ææ¶é´ï¼60 天ï¼ï¼åä¸å¨å
·åä¸å°ææ¥ 60 天å
åªæé䏿¬¡ |
| | | */ |
| | | private static final Duration REMIND_TIMEOUT = Duration.ofDays(60); |
| | | /** |
| | | * æ«æé¨é©çè¿ææ¶é´ï¼30 åéï¼ï¼é¿å
å¤å®ä¾/夿¬¡å¹¶åé夿«æ |
| | | */ |
| | | private static final Duration SCAN_LOCK_TIMEOUT = Duration.ofMinutes(30); |
| | | |
| | | @Resource |
| | | private StringRedisTemplate stringRedisTemplate; |
| | | |
| | | /** |
| | | * å°è¯æ è®°å·²æéï¼åä¸å¨å
·åä¸å°ææ¥ 60 天å
åªæé䏿¬¡ï¼ |
| | | * |
| | | * @param meteringId 计éå¨å
·ç¼å· |
| | | * @param nextCheckDate å°ææ¥ |
| | | * @return true è¡¨ç¤ºé¦æ¬¡æ è®°æåï¼éè¦åéæé |
| | | */ |
| | | public boolean tryMarkReminded(Long meteringId, LocalDate nextCheckDate) { |
| | | String key = RedisKeyConstants.METERING_EXPIRE_REMIND + meteringId + ":" + nextCheckDate; |
| | | return Boolean.TRUE.equals(stringRedisTemplate.opsForValue().setIfAbsent(key, "1", REMIND_TIMEOUT)); |
| | | } |
| | | |
| | | /** |
| | | * å°è¯è·åå½å¤©çæ«æé¨é©ï¼é¿å
å¤å®ä¾å¹¶åé夿«æ |
| | | * |
| | | * @param today å½å¤©æ¥æ |
| | | * @return true 表示è·åæåï¼å¯ä»¥æ§è¡æ«æï¼ |
| | | */ |
| | | public boolean tryAcquireScanLock(LocalDate today) { |
| | | String key = RedisKeyConstants.METERING_EXPIRE_REMIND_SCAN + today; |
| | | return Boolean.TRUE.equals(stringRedisTemplate.opsForValue().setIfAbsent(key, "1", SCAN_LOCK_TIMEOUT)); |
| | | } |
| | | |
| | | } |
| | |
| | | String MES_DV_CHECK_RESULT = "mes_dv_check_result"; // MES ç¹æ£ç»æ |
| | | String MES_DV_REPAIR_STATUS = "mes_dv_repair_status"; // MES 维修工åç¶æ |
| | | String MES_DV_REPAIR_RESULT = "mes_dv_repair_result"; // MES ç»´ä¿®ç»æ |
| | | String MES_DV_METERING_CATEGORY = "mes_dv_metering_category"; // MES 计éå¨å
·ç±»å« |
| | | String MES_DV_METERING_STATUS = "mes_dv_metering_status"; // MES 计éå¨å
·ç¶æ |
| | | String MES_DV_METERING_CHECK_RESULT = "mes_dv_metering_check_result"; // MES è®¡éæ£æµç»è®º |
| | | |
| | | // ========== æçæ¥å (CAL) ========== |
| | | String MES_CAL_HOLIDAY_TYPE = "mes_cal_holiday_type"; // MES åæç±»å |
| | |
| | | // ========== MES 设å¤ç®¡ç-ç¹æ£è®°å½æç»ï¼1-040-306-100ï¼ ========== |
| | | ErrorCode DV_CHECK_RECORD_LINE_NOT_EXISTS = new ErrorCode(1_040_306_100, "设å¤ç¹æ£è®°å½æç»ä¸åå¨"); |
| | | |
| | | // ========== MES 设å¤ç®¡ç-计éå¨å
·ï¼1-040-307-000ï¼ ========== |
| | | ErrorCode DV_METERING_NOT_EXISTS = new ErrorCode(1_040_307_000, "计éå¨å
·ä¸åå¨"); |
| | | ErrorCode DV_METERING_CODE_DUPLICATE = new ErrorCode(1_040_307_001, "计éå¨å
·ç¼ç å·²åå¨"); |
| | | ErrorCode DV_METERING_HAS_CHECK_RECORD = new ErrorCode(1_040_307_002, "计éå¨å
·å·²å
³èæ£æµè®°å½ï¼æ æ³å é¤"); |
| | | |
| | | // ========== MES 设å¤ç®¡ç-è®¡éæ£æµè®°å½ï¼1-040-307-100ï¼ ========== |
| | | ErrorCode DV_METERING_CHECK_NOT_EXISTS = new ErrorCode(1_040_307_100, "è®¡éæ£æµè®°å½ä¸åå¨"); |
| | | ErrorCode DV_METERING_CHECK_CODE_DUPLICATE = new ErrorCode(1_040_307_101, "è®¡éæ£æµç¼å·å·²åå¨"); |
| | | |
| | | // ========== MES å·¥å
·ç®¡ç-å·¥å
·ç±»åï¼1-040-400-000ï¼ ========== |
| | | ErrorCode TM_TOOL_TYPE_NOT_EXISTS = new ErrorCode(1_040_400_000, "å·¥å
·ç±»åä¸åå¨"); |
| | | ErrorCode TM_TOOL_TYPE_CODE_DUPLICATE = new ErrorCode(1_040_400_001, "å·¥å
·ç±»åç¼ç å·²åå¨"); |
| | |
| | | ErrorCode PD_PROJECT_NOT_UPLOAD_FOR_AUDIT = new ErrorCode(1_040_800_005, "åªæå¾
å®¡æ ¸ç¶æçè®¾è®¡é¡¹ç®æè½å®¡æ ¸"); |
| | | ErrorCode PD_PROJECT_NOT_AUDIT_FOR_ARCHIVE = new ErrorCode(1_040_800_006, "åªæå¾
彿¡£ç¶æçè®¾è®¡é¡¹ç®æè½å½æ¡£"); |
| | | ErrorCode PD_PROJECT_AUDIT_NOT_FINISHED = new ErrorCode(1_040_800_007, "该项ç®ä¸å卿ªå®¡æ ¸çèµæï¼è¯·å
宿ææèµæå®¡æ ¸"); |
| | | ErrorCode PD_PROJECT_NOT_UPLOAD_FOR_APPROVAL = new ErrorCode(1_040_800_008, "åªæå¾
å®¡æ ¸ç¶æçè®¾è®¡é¡¹ç®æè½æäº¤å®¡æ¹"); |
| | | ErrorCode PD_PROJECT_NOT_APPROVING = new ErrorCode(1_040_800_009, "设计项ç®ä¸å¤äºå®¡æ¹ä¸ç¶æ"); |
| | | ErrorCode PD_PROJECT_BPM_CATEGORY_NOT_EXISTS = new ErrorCode(1_040_800_010, "设计项ç®å®¡æ¹åç±»ä¸åå¨ï¼è¯·å
é
ç½® BPM å®¡æ¹æµç¨"); |
| | | |
| | | // ========== MES 产å设计-èµæå表ï¼1-040-801-000ï¼ ========== |
| | | ErrorCode PD_DOCUMENT_NOT_EXISTS = new ErrorCode(1_040_801_000, "è®¾è®¡èµæä¸åå¨"); |
| | |
| | | * 已彿¡£ |
| | | */ |
| | | public static final int ARCHIVE = 4; |
| | | /** |
| | | * 审æ¹ä¸ï¼BPM 审æ¹è¿è¡ä¸ï¼ |
| | | */ |
| | | public static final int APPROVING = 5; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.iocoder.yudao.module.mes.enums.dv; |
| | | |
| | | import cn.iocoder.yudao.framework.common.core.ArrayValuable; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | | * MES è®¡éæ£æµç»è®ºæä¸¾ |
| | | * |
| | | * @author è¶
级管çå |
| | | */ |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum MesDvMeteringCheckResultEnum implements ArrayValuable<Integer> { |
| | | |
| | | QUALIFIED(1, "åæ ¼"), |
| | | UNQUALIFIED(2, "ä¸åæ ¼"); |
| | | |
| | | public static final Integer[] ARRAYS = Arrays.stream(values()).map(MesDvMeteringCheckResultEnum::getResult).toArray(Integer[]::new); |
| | | |
| | | /** |
| | | * ç»è®ºå¼ |
| | | */ |
| | | private final Integer result; |
| | | /** |
| | | * ç»è®ºå |
| | | */ |
| | | private final String name; |
| | | |
| | | @Override |
| | | public Integer[] array() { |
| | | return ARRAYS; |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.iocoder.yudao.module.mes.enums.dv; |
| | | |
| | | import cn.iocoder.yudao.framework.common.core.ArrayValuable; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.temporal.ChronoUnit; |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | | * MES 计éå¨å
·å°æç¶ææä¸¾ |
| | | * |
| | | * @author è¶
级管çå |
| | | */ |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum MesDvMeteringExpireStatusEnum implements ArrayValuable<Integer> { |
| | | |
| | | OVERDUE(1, "å·²è¿æ"), |
| | | WITHIN(2, "å³å°å°æ"), |
| | | NORMAL(3, "æ£å¸¸"); |
| | | |
| | | public static final Integer[] ARRAYS = Arrays.stream(values()).map(MesDvMeteringExpireStatusEnum::getStatus).toArray(Integer[]::new); |
| | | |
| | | /** |
| | | * ç¶æå¼ |
| | | */ |
| | | private final Integer status; |
| | | /** |
| | | * ç¶æå |
| | | */ |
| | | private final String name; |
| | | |
| | | /** |
| | | * 计ç®å°æç¶æ |
| | | * |
| | | * @param nextCheckDate 䏿¬¡æ£æµæ¥æï¼å°ææ¥ï¼ |
| | | * @param remindDays æåæéå¤©æ° |
| | | * @return å°æç¶æ |
| | | */ |
| | | public static Integer compute(LocalDate nextCheckDate, int remindDays) { |
| | | if (nextCheckDate == null) { |
| | | return NORMAL.getStatus(); |
| | | } |
| | | long days = ChronoUnit.DAYS.between(LocalDate.now(), nextCheckDate); |
| | | if (days < 0) { |
| | | return OVERDUE.getStatus(); |
| | | } |
| | | if (days <= remindDays) { |
| | | return WITHIN.getStatus(); |
| | | } |
| | | return NORMAL.getStatus(); |
| | | } |
| | | |
| | | @Override |
| | | public Integer[] array() { |
| | | return ARRAYS; |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.iocoder.yudao.module.mes.enums.dv; |
| | | |
| | | import cn.iocoder.yudao.framework.common.core.ArrayValuable; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | | * MES 计éå¨å
·ç¶ææä¸¾ |
| | | * |
| | | * @author è¶
级管çå |
| | | */ |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum MesDvMeteringStatusEnum implements ArrayValuable<Integer> { |
| | | |
| | | IN_USE(1, "å¨ç¨"), |
| | | STOPPED(2, "åç¨"), |
| | | SCRAPPED(3, "æ¥åº"); |
| | | |
| | | public static final Integer[] ARRAYS = Arrays.stream(values()).map(MesDvMeteringStatusEnum::getStatus).toArray(Integer[]::new); |
| | | |
| | | /** |
| | | * ç¶æå¼ |
| | | */ |
| | | private final Integer status; |
| | | /** |
| | | * ç¶æå |
| | | */ |
| | | private final String name; |
| | | |
| | | @Override |
| | | public Integer[] array() { |
| | | return ARRAYS; |
| | | } |
| | | |
| | | } |
| | |
| | | /** |
| | | * å¾
彿¡£ |
| | | * |
| | | * å¯¹åº MesPdProjectService#auditProject æ¹æ³ |
| | | * å¯¹åº MesPdProjectService#updateProjectAuditStatus æ¹æ³ï¼BPM 审æ¹éè¿åï¼ |
| | | */ |
| | | AUDIT(MesPdStatusConstants.AUDIT, "å¾
彿¡£"), |
| | | /** |
| | |
| | | * |
| | | * å¯¹åº MesPdProjectService#archiveProject æ¹æ³ |
| | | */ |
| | | ARCHIVE(MesPdStatusConstants.ARCHIVE, "已彿¡£"); |
| | | ARCHIVE(MesPdStatusConstants.ARCHIVE, "已彿¡£"), |
| | | /** |
| | | * 审æ¹ä¸ |
| | | * |
| | | * å¯¹åº MesPdProjectService#submitProjectApproval æ¹æ³ |
| | | */ |
| | | APPROVING(MesPdStatusConstants.APPROVING, "审æ¹ä¸"); |
| | | |
| | | public static final Integer[] ARRAYS = Arrays.stream(values()).map(MesPdProjectStatusEnum::getStatus).toArray(Integer[]::new); |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.iocoder.yudao.module.mes.service.dv.metering; |
| | | |
| | | /** |
| | | * MES 计éå¨å
·å°ææé Service æ¥å£ |
| | | * |
| | | * @author è¶
级管çå |
| | | */ |
| | | public interface MesDvMeteringRemindService { |
| | | |
| | | /** |
| | | * åéå°ææéç«å
ä¿¡ï¼æè§¦åï¼å¹çï¼ |
| | | * |
| | | * å¨è®¡éå¨å
·å页æ¥è¯¢æ¶è§¦åï¼å
æ¢å½å¤©æ«æé¨é©ï¼åæ¥å°æå¨å
·ï¼æå¨å
·+å°ææ¥å»éåéå°åç«å
ä¿¡ã |
| | | */ |
| | | void sendExpireRemind(); |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.iocoder.yudao.module.mes.service.dv.metering; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.iocoder.yudao.module.infra.api.config.ConfigApi; |
| | | import cn.iocoder.yudao.module.mes.dal.dataobject.dv.metering.MesDvMeteringDO; |
| | | import cn.iocoder.yudao.module.mes.dal.mysql.dv.metering.MesDvMeteringMapper; |
| | | import cn.iocoder.yudao.module.mes.dal.redis.dv.metering.MesDvMeteringRemindRedisDAO; |
| | | import cn.iocoder.yudao.module.system.api.notify.NotifyMessageSendApi; |
| | | import cn.iocoder.yudao.module.system.api.notify.dto.NotifySendSingleToUserReqDTO; |
| | | import jakarta.annotation.Resource; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * MES 计éå¨å
·å°ææé Service å®ç°ç±» |
| | | * |
| | | * @author è¶
级管çå |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class MesDvMeteringRemindServiceImpl implements MesDvMeteringRemindService { |
| | | |
| | | /** |
| | | * æé天æ°é
ç½® KEYï¼infra_configï¼ |
| | | */ |
| | | private static final String REMIND_DAYS_CONFIG_KEY = "mes.dv-metering.remind-days"; |
| | | /** |
| | | * æé天æ°é»è®¤å¼ |
| | | */ |
| | | private static final int DEFAULT_REMIND_DAYS = 30; |
| | | /** |
| | | * å°ææéç«å
信模æ¿ç¼å· |
| | | */ |
| | | private static final String REMIND_TEMPLATE_CODE = "mes_metering_expire_remind"; |
| | | |
| | | @Resource |
| | | private MesDvMeteringMapper meteringMapper; |
| | | @Resource |
| | | private MesDvMeteringRemindRedisDAO meteringRemindRedisDAO; |
| | | @Resource |
| | | private ConfigApi configApi; |
| | | @Resource |
| | | private NotifyMessageSendApi notifyMessageSendApi; |
| | | |
| | | @Override |
| | | public void sendExpireRemind() { |
| | | try { |
| | | // 1. æ¢å½å¤©æ«æé¨é©ï¼é¿å
å¤å®ä¾/夿¬¡å¹¶åé夿«æ |
| | | LocalDate today = LocalDate.now(); |
| | | if (!meteringRemindRedisDAO.tryAcquireScanLock(today)) { |
| | | return; |
| | | } |
| | | // 2. 读åæé天æ°ï¼é»è®¤ 30ï¼ |
| | | int remindDays = getRemindDays(); |
| | | // 3. æ¥è¯¢ [today, today + remindDays] å°æçå¨å
· |
| | | List<MesDvMeteringDO> list = meteringMapper.selectListByNextCheckDateBetween( |
| | | today, today.plusDays(remindDays)); |
| | | // 4. éå°åéç«å
ä¿¡ï¼æå¨å
· + å°ææ¥å»éï¼ |
| | | for (MesDvMeteringDO metering : list) { |
| | | if (metering.getChargeUserId() == null || metering.getNextCheckDate() == null) { |
| | | continue; |
| | | } |
| | | if (!meteringRemindRedisDAO.tryMarkReminded(metering.getId(), metering.getNextCheckDate())) { |
| | | continue; |
| | | } |
| | | sendRemindMessage(metering); |
| | | } |
| | | } catch (Exception ex) { |
| | | // best-effortï¼æé失败ä¸å½±åå表æ¥è¯¢ |
| | | log.error("[sendExpireRemind][åé计éå¨å
·å°ææé失败]", ex); |
| | | } |
| | | } |
| | | |
| | | private int getRemindDays() { |
| | | String value = configApi.getConfigValueByKey(REMIND_DAYS_CONFIG_KEY); |
| | | if (StrUtil.isBlank(value)) { |
| | | return DEFAULT_REMIND_DAYS; |
| | | } |
| | | try { |
| | | return Integer.parseInt(value.trim()); |
| | | } catch (NumberFormatException ex) { |
| | | log.warn("[getRemindDays][é
ç½® {} çå¼ {} éæ³ï¼ä½¿ç¨é»è®¤å¼ {}]", REMIND_DAYS_CONFIG_KEY, value, DEFAULT_REMIND_DAYS); |
| | | return DEFAULT_REMIND_DAYS; |
| | | } |
| | | } |
| | | |
| | | private void sendRemindMessage(MesDvMeteringDO metering) { |
| | | Map<String, Object> params = new HashMap<>(); |
| | | params.put("meteringCode", metering.getCode()); |
| | | params.put("meteringName", metering.getName()); |
| | | params.put("nextCheckDate", metering.getNextCheckDate().toString()); |
| | | NotifySendSingleToUserReqDTO reqDTO = new NotifySendSingleToUserReqDTO() |
| | | .setUserId(metering.getChargeUserId()) |
| | | .setTemplateCode(REMIND_TEMPLATE_CODE) |
| | | .setTemplateParams(params); |
| | | notifyMessageSendApi.sendSingleMessageToAdmin(reqDTO); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.iocoder.yudao.module.mes.service.dv.metering; |
| | | |
| | | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.dv.metering.vo.MesDvMeteringPageReqVO; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.dv.metering.vo.MesDvMeteringSaveReqVO; |
| | | import cn.iocoder.yudao.module.mes.dal.dataobject.dv.metering.MesDvMeteringDO; |
| | | import jakarta.validation.Valid; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap; |
| | | |
| | | /** |
| | | * MES 计éå¨å
· Service æ¥å£ |
| | | * |
| | | * @author è¶
级管çå |
| | | */ |
| | | public interface MesDvMeteringService { |
| | | |
| | | /** |
| | | * å建计éå¨å
· |
| | | * |
| | | * @param createReqVO åå»ºä¿¡æ¯ |
| | | * @return ç¼å· |
| | | */ |
| | | Long createMetering(@Valid MesDvMeteringSaveReqVO createReqVO); |
| | | |
| | | /** |
| | | * æ´æ°è®¡éå¨å
· |
| | | * |
| | | * @param updateReqVO æ´æ°ä¿¡æ¯ |
| | | */ |
| | | void updateMetering(@Valid MesDvMeteringSaveReqVO updateReqVO); |
| | | |
| | | /** |
| | | * å é¤è®¡éå¨å
· |
| | | * |
| | | * @param id ç¼å· |
| | | */ |
| | | void deleteMetering(Long id); |
| | | |
| | | /** |
| | | * è·å¾è®¡éå¨å
· |
| | | * |
| | | * @param id ç¼å· |
| | | * @return 计éå¨å
· |
| | | */ |
| | | MesDvMeteringDO getMetering(Long id); |
| | | |
| | | /** |
| | | * è·å¾è®¡éå¨å
·å页 |
| | | * |
| | | * @param pageReqVO å页æ¥è¯¢ |
| | | * @return 计éå¨å
·å页 |
| | | */ |
| | | PageResult<MesDvMeteringDO> getMeteringPage(MesDvMeteringPageReqVO pageReqVO); |
| | | |
| | | /** |
| | | * è·å¾è®¡éå¨å
·å表 |
| | | * |
| | | * @return 计éå¨å
·å表 |
| | | */ |
| | | List<MesDvMeteringDO> getMeteringList(); |
| | | |
| | | /** |
| | | * è·å¾è®¡éå¨å
·å表 |
| | | * |
| | | * @param ids ç¼å·æ°ç» |
| | | * @return 计éå¨å
·å表 |
| | | */ |
| | | List<MesDvMeteringDO> getMeteringList(Collection<Long> ids); |
| | | |
| | | /** |
| | | * è·å¾è®¡éå¨å
· Map |
| | | * |
| | | * @param ids ç¼å·æ°ç» |
| | | * @return 计éå¨å
· Map |
| | | */ |
| | | default Map<Long, MesDvMeteringDO> getMeteringMap(Collection<Long> ids) { |
| | | return convertMap(getMeteringList(ids), MesDvMeteringDO::getId); |
| | | } |
| | | |
| | | /** |
| | | * æ ¡éªè®¡éå¨å
·åå¨ |
| | | * |
| | | * @param id ç¼å· |
| | | */ |
| | | void validateMeteringExists(Long id); |
| | | |
| | | /** |
| | | * è·å¾å°ææé天æ°ï¼é»è®¤ 30ï¼ |
| | | * |
| | | * @return æéå¤©æ° |
| | | */ |
| | | int getRemindDays(); |
| | | |
| | | /** |
| | | * åå计éå¨å
·çæè¿æ£æµä¿¡æ¯ï¼æ£æµè®°å½æ°å¢/ä¿®æ¹/å é¤åè°ç¨ï¼ |
| | | * |
| | | * @param meteringId 计éå¨å
·ç¼å· |
| | | * @param lastCheckDate æè¿æ£æµæ¥æï¼æ åç½®ç©ºï¼ |
| | | * @param nextCheckDate 䏿¬¡æ£æµæ¥æï¼æ åç½®ç©ºï¼ |
| | | */ |
| | | void updateMeteringCheckInfo(Long meteringId, LocalDate lastCheckDate, LocalDate nextCheckDate); |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.iocoder.yudao.module.mes.service.dv.metering; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.util.ObjUtil; |
| | | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| | | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| | | import cn.iocoder.yudao.module.infra.api.config.ConfigApi; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.dv.metering.vo.MesDvMeteringPageReqVO; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.dv.metering.vo.MesDvMeteringSaveReqVO; |
| | | import cn.iocoder.yudao.module.mes.dal.dataobject.dv.metering.MesDvMeteringDO; |
| | | import cn.iocoder.yudao.module.mes.dal.mysql.dv.metering.MesDvMeteringMapper; |
| | | import cn.iocoder.yudao.module.mes.service.dv.meteringcheck.MesDvMeteringCheckService; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import jakarta.annotation.Resource; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.validation.annotation.Validated; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; |
| | | import static cn.iocoder.yudao.module.mes.enums.ErrorCodeConstants.DV_METERING_CODE_DUPLICATE; |
| | | import static cn.iocoder.yudao.module.mes.enums.ErrorCodeConstants.DV_METERING_HAS_CHECK_RECORD; |
| | | import static cn.iocoder.yudao.module.mes.enums.ErrorCodeConstants.DV_METERING_NOT_EXISTS; |
| | | |
| | | /** |
| | | * MES 计éå¨å
· Service å®ç°ç±» |
| | | * |
| | | * @author è¶
级管çå |
| | | */ |
| | | @Service |
| | | @Validated |
| | | public class MesDvMeteringServiceImpl implements MesDvMeteringService { |
| | | |
| | | /** |
| | | * æé天æ°é
ç½® KEYï¼infra_configï¼ |
| | | */ |
| | | private static final String REMIND_DAYS_CONFIG_KEY = "mes.dv-metering.remind-days"; |
| | | /** |
| | | * æé天æ°é»è®¤å¼ |
| | | */ |
| | | private static final int DEFAULT_REMIND_DAYS = 30; |
| | | |
| | | @Resource |
| | | private MesDvMeteringMapper meteringMapper; |
| | | @Resource |
| | | @Lazy // å»¶è¿å è½½ï¼é¿å
ä¸è®¡éæ£æµè®°å½ Service 循ç¯ä¾èµ |
| | | private MesDvMeteringCheckService meteringCheckService; |
| | | @Resource |
| | | private MesDvMeteringRemindService meteringRemindService; |
| | | @Resource |
| | | private ConfigApi configApi; |
| | | |
| | | @Override |
| | | public Long createMetering(MesDvMeteringSaveReqVO createReqVO) { |
| | | // æ ¡éªç¼ç å¯ä¸ |
| | | validateMeteringCodeUnique(null, createReqVO.getCode()); |
| | | |
| | | // æå
¥ |
| | | MesDvMeteringDO metering = BeanUtils.toBean(createReqVO, MesDvMeteringDO.class); |
| | | meteringMapper.insert(metering); |
| | | return metering.getId(); |
| | | } |
| | | |
| | | @Override |
| | | public void updateMetering(MesDvMeteringSaveReqVO updateReqVO) { |
| | | // æ ¡éªåå¨ |
| | | validateMeteringExists(updateReqVO.getId()); |
| | | // æ ¡éªç¼ç å¯ä¸ |
| | | validateMeteringCodeUnique(updateReqVO.getId(), updateReqVO.getCode()); |
| | | |
| | | // æ´æ° |
| | | MesDvMeteringDO updateObj = BeanUtils.toBean(updateReqVO, MesDvMeteringDO.class); |
| | | meteringMapper.updateById(updateObj); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteMetering(Long id) { |
| | | // æ ¡éªåå¨ |
| | | validateMeteringExists(id); |
| | | // æ ¡éªæ å
³èæ£æµè®°å½ |
| | | if (meteringCheckService.getMeteringCheckCountByMeteringId(id) > 0) { |
| | | throw exception(DV_METERING_HAS_CHECK_RECORD); |
| | | } |
| | | |
| | | // å é¤ |
| | | meteringMapper.deleteById(id); |
| | | } |
| | | |
| | | @Override |
| | | public void validateMeteringExists(Long id) { |
| | | if (meteringMapper.selectById(id) == null) { |
| | | throw exception(DV_METERING_NOT_EXISTS); |
| | | } |
| | | } |
| | | |
| | | private void validateMeteringCodeUnique(Long id, String code) { |
| | | if (StrUtil.isBlank(code)) { |
| | | return; |
| | | } |
| | | MesDvMeteringDO metering = meteringMapper.selectByCode(code); |
| | | if (metering == null) { |
| | | return; |
| | | } |
| | | if (ObjUtil.notEqual(metering.getId(), id)) { |
| | | throw exception(DV_METERING_CODE_DUPLICATE); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public MesDvMeteringDO getMetering(Long id) { |
| | | return meteringMapper.selectById(id); |
| | | } |
| | | |
| | | @Override |
| | | public PageResult<MesDvMeteringDO> getMeteringPage(MesDvMeteringPageReqVO pageReqVO) { |
| | | // 1. å°æç¶æè½¬æ¢ä¸ºæ¥æèå´ï¼èµ° DB è¿æ»¤ |
| | | Integer expireStatus = pageReqVO.getExpireStatus(); |
| | | if (expireStatus != null) { |
| | | LocalDate today = LocalDate.now(); |
| | | int remindDays = getRemindDays(); |
| | | switch (expireStatus) { |
| | | case 1 -> { // å·²è¿æï¼å°ææ¥ < ä»å¤© |
| | | pageReqVO.setNextCheckDateEnd(today.minusDays(1)); |
| | | } |
| | | case 2 -> { // å³å°å°æï¼å°ææ¥å¨ [ä»å¤©, ä»å¤©+æé天æ°] |
| | | pageReqVO.setNextCheckDateBegin(today); |
| | | pageReqVO.setNextCheckDateEnd(today.plusDays(remindDays)); |
| | | } |
| | | case 3 -> { // æ£å¸¸ï¼å°ææ¥ > ä»å¤©+æéå¤©æ° |
| | | pageReqVO.setNextCheckDateBegin(today.plusDays(remindDays + 1)); |
| | | } |
| | | default -> { |
| | | } |
| | | } |
| | | } |
| | | // 2. æ¥è¯¢ |
| | | PageResult<MesDvMeteringDO> pageResult = meteringMapper.selectPage(pageReqVO); |
| | | // 3. æè§¦åå°ææéç«å
ä¿¡ï¼best-effortï¼ä¸å½±åæ¥è¯¢ï¼ |
| | | meteringRemindService.sendExpireRemind(); |
| | | return pageResult; |
| | | } |
| | | |
| | | @Override |
| | | public int getRemindDays() { |
| | | String value = configApi.getConfigValueByKey(REMIND_DAYS_CONFIG_KEY); |
| | | if (StrUtil.isBlank(value)) { |
| | | return DEFAULT_REMIND_DAYS; |
| | | } |
| | | try { |
| | | return Integer.parseInt(value.trim()); |
| | | } catch (NumberFormatException ex) { |
| | | return DEFAULT_REMIND_DAYS; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void updateMeteringCheckInfo(Long meteringId, LocalDate lastCheckDate, LocalDate nextCheckDate) { |
| | | meteringMapper.updateById(new MesDvMeteringDO() |
| | | .setId(meteringId) |
| | | .setLastCheckDate(lastCheckDate) |
| | | .setNextCheckDate(nextCheckDate)); |
| | | } |
| | | |
| | | @Override |
| | | public List<MesDvMeteringDO> getMeteringList() { |
| | | return meteringMapper.selectList(); |
| | | } |
| | | |
| | | @Override |
| | | public List<MesDvMeteringDO> getMeteringList(Collection<Long> ids) { |
| | | if (CollUtil.isEmpty(ids)) { |
| | | return Collections.emptyList(); |
| | | } |
| | | return meteringMapper.selectByIds(ids); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.iocoder.yudao.module.mes.service.dv.meteringcheck; |
| | | |
| | | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.dv.meteringcheck.vo.MesDvMeteringCheckPageReqVO; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.dv.meteringcheck.vo.MesDvMeteringCheckSaveReqVO; |
| | | import cn.iocoder.yudao.module.mes.dal.dataobject.dv.meteringcheck.MesDvMeteringCheckDO; |
| | | import jakarta.validation.Valid; |
| | | |
| | | /** |
| | | * MES è®¡éæ£æµè®°å½ Service æ¥å£ |
| | | * |
| | | * @author è¶
级管çå |
| | | */ |
| | | public interface MesDvMeteringCheckService { |
| | | |
| | | /** |
| | | * åå»ºè®¡éæ£æµè®°å½ |
| | | * |
| | | * @param createReqVO åå»ºä¿¡æ¯ |
| | | * @return ç¼å· |
| | | */ |
| | | Long createMeteringCheck(@Valid MesDvMeteringCheckSaveReqVO createReqVO); |
| | | |
| | | /** |
| | | * æ´æ°è®¡éæ£æµè®°å½ |
| | | * |
| | | * @param updateReqVO æ´æ°ä¿¡æ¯ |
| | | */ |
| | | void updateMeteringCheck(@Valid MesDvMeteringCheckSaveReqVO updateReqVO); |
| | | |
| | | /** |
| | | * å é¤è®¡éæ£æµè®°å½ |
| | | * |
| | | * @param id ç¼å· |
| | | */ |
| | | void deleteMeteringCheck(Long id); |
| | | |
| | | /** |
| | | * è·å¾è®¡éæ£æµè®°å½ |
| | | * |
| | | * @param id ç¼å· |
| | | * @return è®¡éæ£æµè®°å½ |
| | | */ |
| | | MesDvMeteringCheckDO getMeteringCheck(Long id); |
| | | |
| | | /** |
| | | * è·å¾è®¡éæ£æµè®°å½å页 |
| | | * |
| | | * @param pageReqVO å页æ¥è¯¢ |
| | | * @return è®¡éæ£æµè®°å½å页 |
| | | */ |
| | | PageResult<MesDvMeteringCheckDO> getMeteringCheckPage(MesDvMeteringCheckPageReqVO pageReqVO); |
| | | |
| | | /** |
| | | * è·å¾æå®è®¡éå¨å
·ä¸çæ£æµè®°å½æ°é |
| | | * |
| | | * @param meteringId 计éå¨å
·ç¼å· |
| | | * @return æ£æµè®°å½æ°é |
| | | */ |
| | | Long getMeteringCheckCountByMeteringId(Long meteringId); |
| | | |
| | | /** |
| | | * æ ¡éªè®¡éæ£æµè®°å½åå¨ |
| | | * |
| | | * @param id ç¼å· |
| | | */ |
| | | void validateMeteringCheckExists(Long id); |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.iocoder.yudao.module.mes.service.dv.meteringcheck; |
| | | |
| | | import cn.hutool.core.util.ObjUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| | | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.dv.meteringcheck.vo.MesDvMeteringCheckPageReqVO; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.dv.meteringcheck.vo.MesDvMeteringCheckSaveReqVO; |
| | | import cn.iocoder.yudao.module.mes.dal.dataobject.dv.metering.MesDvMeteringDO; |
| | | import cn.iocoder.yudao.module.mes.dal.dataobject.dv.meteringcheck.MesDvMeteringCheckDO; |
| | | import cn.iocoder.yudao.module.mes.dal.mysql.dv.meteringcheck.MesDvMeteringCheckMapper; |
| | | import cn.iocoder.yudao.module.mes.service.dv.metering.MesDvMeteringService; |
| | | import jakarta.annotation.Resource; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.validation.annotation.Validated; |
| | | |
| | | import java.time.LocalDate; |
| | | |
| | | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; |
| | | import static cn.iocoder.yudao.module.mes.enums.ErrorCodeConstants.DV_METERING_CHECK_CODE_DUPLICATE; |
| | | import static cn.iocoder.yudao.module.mes.enums.ErrorCodeConstants.DV_METERING_CHECK_NOT_EXISTS; |
| | | import static cn.iocoder.yudao.module.mes.enums.ErrorCodeConstants.DV_METERING_NOT_EXISTS; |
| | | |
| | | /** |
| | | * MES è®¡éæ£æµè®°å½ Service å®ç°ç±» |
| | | * |
| | | * @author è¶
级管çå |
| | | */ |
| | | @Service |
| | | @Validated |
| | | public class MesDvMeteringCheckServiceImpl implements MesDvMeteringCheckService { |
| | | |
| | | @Resource |
| | | private MesDvMeteringCheckMapper meteringCheckMapper; |
| | | @Resource |
| | | @Lazy // å»¶è¿å è½½ï¼é¿å
ä¸è®¡éå¨å
· Service 循ç¯ä¾èµ |
| | | private MesDvMeteringService meteringService; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Long createMeteringCheck(MesDvMeteringCheckSaveReqVO createReqVO) { |
| | | // æ ¡éªè®¡éå¨å
·åå¨ |
| | | MesDvMeteringDO metering = validateMeteringExists(createReqVO.getMeteringId()); |
| | | // æ ¡éªæ£æµç¼å·å¯ä¸ |
| | | validateMeteringCheckCodeUnique(null, createReqVO.getCheckCode()); |
| | | |
| | | // 计ç®ä¸æ¬¡æ£æµæ¥æï¼ä¸ºç©ºåææ ¡å卿èªå¨è®¡ç®ï¼ |
| | | LocalDate nextCheckDate = computeNextCheckDate(createReqVO.getCheckDate(), |
| | | createReqVO.getNextCheckDate(), metering); |
| | | MesDvMeteringCheckDO check = BeanUtils.toBean(createReqVO, MesDvMeteringCheckDO.class); |
| | | check.setNextCheckDate(nextCheckDate); |
| | | meteringCheckMapper.insert(check); |
| | | |
| | | // åå计éå¨å
·çæè¿æ£æµä¿¡æ¯ |
| | | refreshMeteringCheckInfo(createReqVO.getMeteringId()); |
| | | return check.getId(); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void updateMeteringCheck(MesDvMeteringCheckSaveReqVO updateReqVO) { |
| | | // æ ¡éªåå¨ |
| | | validateMeteringCheckExists(updateReqVO.getId()); |
| | | // æ ¡éªè®¡éå¨å
·åå¨ |
| | | MesDvMeteringDO metering = validateMeteringExists(updateReqVO.getMeteringId()); |
| | | // æ ¡éªæ£æµç¼å·å¯ä¸ |
| | | validateMeteringCheckCodeUnique(updateReqVO.getId(), updateReqVO.getCheckCode()); |
| | | |
| | | // 计ç®ä¸æ¬¡æ£æµæ¥æï¼ä¸ºç©ºåææ ¡å卿èªå¨è®¡ç®ï¼ |
| | | LocalDate nextCheckDate = computeNextCheckDate(updateReqVO.getCheckDate(), |
| | | updateReqVO.getNextCheckDate(), metering); |
| | | MesDvMeteringCheckDO updateObj = BeanUtils.toBean(updateReqVO, MesDvMeteringCheckDO.class); |
| | | updateObj.setNextCheckDate(nextCheckDate); |
| | | meteringCheckMapper.updateById(updateObj); |
| | | |
| | | // åå计éå¨å
·çæè¿æ£æµä¿¡æ¯ |
| | | refreshMeteringCheckInfo(updateReqVO.getMeteringId()); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void deleteMeteringCheck(Long id) { |
| | | // æ ¡éªåå¨ |
| | | validateMeteringCheckExists(id); |
| | | MesDvMeteringCheckDO check = meteringCheckMapper.selectById(id); |
| | | |
| | | // å é¤ |
| | | meteringCheckMapper.deleteById(id); |
| | | |
| | | // åå计éå¨å
·çæè¿æ£æµä¿¡æ¯ |
| | | refreshMeteringCheckInfo(check.getMeteringId()); |
| | | } |
| | | |
| | | @Override |
| | | public MesDvMeteringCheckDO getMeteringCheck(Long id) { |
| | | return meteringCheckMapper.selectById(id); |
| | | } |
| | | |
| | | @Override |
| | | public PageResult<MesDvMeteringCheckDO> getMeteringCheckPage(MesDvMeteringCheckPageReqVO pageReqVO) { |
| | | return meteringCheckMapper.selectPage(pageReqVO); |
| | | } |
| | | |
| | | @Override |
| | | public Long getMeteringCheckCountByMeteringId(Long meteringId) { |
| | | return meteringCheckMapper.selectCountByMeteringId(meteringId); |
| | | } |
| | | |
| | | @Override |
| | | public void validateMeteringCheckExists(Long id) { |
| | | if (meteringCheckMapper.selectById(id) == null) { |
| | | throw exception(DV_METERING_CHECK_NOT_EXISTS); |
| | | } |
| | | } |
| | | |
| | | private MesDvMeteringDO validateMeteringExists(Long meteringId) { |
| | | MesDvMeteringDO metering = meteringService.getMetering(meteringId); |
| | | if (metering == null) { |
| | | throw exception(DV_METERING_NOT_EXISTS); |
| | | } |
| | | return metering; |
| | | } |
| | | |
| | | private void validateMeteringCheckCodeUnique(Long id, String checkCode) { |
| | | if (StrUtil.isBlank(checkCode)) { |
| | | return; |
| | | } |
| | | MesDvMeteringCheckDO check = meteringCheckMapper.selectByCheckCode(checkCode); |
| | | if (check == null) { |
| | | return; |
| | | } |
| | | if (ObjUtil.notEqual(check.getId(), id)) { |
| | | throw exception(DV_METERING_CHECK_CODE_DUPLICATE); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 计ç®ä¸æ¬¡æ£æµæ¥æï¼æå¨æå®ä¼å
ï¼å¦åæ æ£æµæ¥æ + æ ¡åå¨æï¼æï¼èªå¨è®¡ç® |
| | | */ |
| | | private LocalDate computeNextCheckDate(LocalDate checkDate, LocalDate nextCheckDate, MesDvMeteringDO metering) { |
| | | if (nextCheckDate != null) { |
| | | return nextCheckDate; |
| | | } |
| | | if (checkDate != null && metering.getCheckCycleCount() != null) { |
| | | return checkDate.plusMonths(metering.getCheckCycleCount()); |
| | | } |
| | | return nextCheckDate; |
| | | } |
| | | |
| | | /** |
| | | * æ"ææ°ä¸æ¡æ£æµè®°å½"æ´ä½éç®åå计éå¨å
·ï¼æ£ç¡®è¦çç¼è¾éææ°è®°å½/å é¤ä¸é´è®°å½çè¾¹ç |
| | | */ |
| | | private void refreshMeteringCheckInfo(Long meteringId) { |
| | | MesDvMeteringCheckDO latest = meteringCheckMapper.selectLatestByMeteringId(meteringId); |
| | | if (latest == null) { |
| | | meteringService.updateMeteringCheckInfo(meteringId, null, null); |
| | | } else { |
| | | meteringService.updateMeteringCheckInfo(meteringId, |
| | | latest.getCheckDate(), latest.getNextCheckDate()); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | // æå
¥ |
| | | MesMdItemDO item = BeanUtils.toBean(createReqVO, MesMdItemDO.class); |
| | | item.setStatus(CommonStatusEnum.DISABLE.getStatus()); // é»è®¤ç¦ç¨ãä¿¡æ¯å®æåï¼åå¯ç¨ |
| | | // ç¶æåªè½ç±åºç¡æ°æ®ï¼MDMï¼æ§å¶ï¼MDM åæ¥æ¶æ²¿ç¨å
¶ç¶æï¼MES æ¬å°æ°å¢é»è®¤ç¦ç¨ |
| | | item.setStatus(createReqVO.getMdmItemId() != null && createReqVO.getStatus() != null |
| | | ? createReqVO.getStatus() : CommonStatusEnum.DISABLE.getStatus()); |
| | | clearStockIfNotSafe(item); // 妿æªå¯ç¨å®å
¨åºåï¼æ¸
é¶åºåä¸ä¸é |
| | | itemMapper.insert(item); |
| | | |
| | |
| | | // æ´æ° |
| | | MesMdItemDO updateObj = BeanUtils.toBean(updateReqVO, MesMdItemDO.class); |
| | | clearStockIfNotSafe(updateObj); // 妿æªå¯ç¨å®å
¨åºåï¼æ¸
é¶åºåä¸ä¸é |
| | | // ç¶æåªè½ç±åºç¡æ°æ®ï¼MDMï¼æ§å¶ï¼MES æ¬å°æ´æ°ä¸å
许修æ¹ç¶æ |
| | | if (updateReqVO.getMdmItemId() == null) { |
| | | updateObj.setStatus(null); |
| | | } |
| | | itemMapper.updateById(updateObj); |
| | | |
| | | // åæ¥å° MDMï¼å¾é syncMdm æ¶ï¼ |
| | |
| | | void uploadProject(Long id, Long userId); |
| | | |
| | | /** |
| | | * å®¡æ ¸è®¾è®¡é¡¹ç®ï¼å¾
å®¡æ ¸âå¾
彿¡£ï¼ |
| | | * æäº¤è®¾è®¡é¡¹ç®å®¡æ¹ï¼å¾
å®¡æ ¸â审æ¹ä¸ï¼ |
| | | * <p> |
| | | * å建 BPM æµç¨å®ä¾ï¼å®¡æ¹éè¿åç±çå¬å¨åè°æ´æ°ä¸ºå¾
彿¡£ |
| | | * |
| | | * @param id ç¼å· |
| | | * @param processDefinitionKey æµç¨å®ä¹ Key |
| | | */ |
| | | void auditProject(Long id); |
| | | void submitProjectApproval(Long id, String processDefinitionKey); |
| | | |
| | | /** |
| | | * è·å¾è®¾è®¡é¡¹ç®å®¡æ¹æµç¨å表 |
| | | * |
| | | * @return æµç¨å表ï¼id/name/version/keyï¼ |
| | | */ |
| | | List<Map<String, Object>> getProjectApproveProcessDefinitionList(); |
| | | |
| | | /** |
| | | * æ´æ°è®¾è®¡é¡¹ç®å®¡æ¹ç¶æï¼BPM çå¬å¨åè°ï¼ |
| | | * |
| | | * @param id ç¼å· |
| | | * @param bpmResult BPM 审æ¹ç»æ |
| | | */ |
| | | void updateProjectAuditStatus(Long id, Integer bpmResult); |
| | | |
| | | /** |
| | | * 彿¡£è®¾è®¡é¡¹ç®ï¼å¾
彿¡£â已彿¡£ï¼ |
| | |
| | | package cn.iocoder.yudao.module.mes.service.pd.project; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| | | import cn.iocoder.yudao.module.bpm.api.task.BpmProcessInstanceApi; |
| | | import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO; |
| | | import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmCategoryDO; |
| | | import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmProcessDefinitionInfoDO; |
| | | import cn.iocoder.yudao.module.bpm.enums.task.BpmTaskStatusEnum; |
| | | import cn.iocoder.yudao.module.bpm.service.definition.BpmCategoryService; |
| | | import cn.iocoder.yudao.module.bpm.service.definition.BpmProcessDefinitionService; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.pd.project.vo.MesPdProjectPageReqVO; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.pd.project.vo.MesPdProjectSaveReqVO; |
| | | import cn.iocoder.yudao.module.mes.dal.dataobject.pd.document.MesPdDocumentDO; |
| | |
| | | import cn.iocoder.yudao.module.mes.service.pd.document.MesPdDocumentService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import jakarta.annotation.Resource; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.flowable.engine.repository.ProcessDefinition; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.validation.annotation.Validated; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; |
| | | import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap; |
| | | import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; |
| | | import static cn.iocoder.yudao.module.mes.enums.ErrorCodeConstants.*; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Service |
| | | @Validated |
| | | @Slf4j |
| | | public class MesPdProjectServiceImpl implements MesPdProjectService { |
| | | |
| | | /** |
| | | * BPM 产å项ç®å®¡æ¹åç±»ç¼ç |
| | | */ |
| | | private static final String BPM_PROCESS_DEFINITION_CATEGORY_CODE = "mes_pd_project_approve"; |
| | | |
| | | @Resource |
| | | private MesPdProjectMapper projectMapper; |
| | |
| | | @Resource |
| | | @Lazy |
| | | private MesMdAutoCodeRecordService autoCodeRecordService; |
| | | |
| | | @Resource |
| | | private BpmProcessInstanceApi processInstanceApi; |
| | | |
| | | @Resource |
| | | private BpmCategoryService bpmCategoryService; |
| | | |
| | | @Resource |
| | | private BpmProcessDefinitionService bpmProcessDefinitionService; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void auditProject(Long id) { |
| | | // æ ¡éªåå¨ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void submitProjectApproval(Long id, String processDefinitionKey) { |
| | | // 1. æ ¡éªåå¨ + å¾
å®¡æ ¸ç¶æ |
| | | MesPdProjectDO project = validateProjectExists(id); |
| | | // æ ¡éªç¶æä¸ºå¾
å®¡æ ¸ |
| | | if (!MesPdProjectStatusEnum.UPLOAD.getStatus().equals(project.getStatus())) { |
| | | throw exception(PD_PROJECT_NOT_UPLOAD_FOR_AUDIT); |
| | | throw exception(PD_PROJECT_NOT_UPLOAD_FOR_APPROVAL); |
| | | } |
| | | // æ ¡éªè¯¥é¡¹ç®ä¸ææèµæå®¡æ ¸è®°å½åå·²å®¡æ ¸ï¼ä¸åå¨å¾
å®¡æ ¸çè®°å½ï¼ |
| | | // 2. æ ¡éªè¯¥é¡¹ç®ä¸ææèµæå®¡æ ¸è®°å½åå·²å®¡æ ¸ï¼ä¸åå¨å¾
å®¡æ ¸çè®°å½ï¼ |
| | | List<MesPdDocumentDO> documents = documentService.getDocumentListByProjectId(id); |
| | | List<Long> documentIds = documents.stream().map(MesPdDocumentDO::getId).toList(); |
| | | if (documentAuditMapper.existsPendingAuditByDocumentIds(documentIds)) { |
| | | throw exception(PD_PROJECT_AUDIT_NOT_FINISHED); |
| | | } |
| | | // æ´æ°ç¶æ |
| | | // 3. å建 BPM æµç¨å®ä¾ |
| | | String processInstanceId = processInstanceApi.createProcessInstance(getLoginUserId(), |
| | | new BpmProcessInstanceCreateReqDTO() |
| | | .setProcessDefinitionKey(processDefinitionKey) |
| | | .setBusinessKey(String.valueOf(id))); |
| | | // 4. æ´æ°é¡¹ç®ç¶æä¸ºå®¡æ¹ä¸ |
| | | projectMapper.updateById(MesPdProjectDO.builder() |
| | | .id(id) |
| | | .status(MesPdProjectStatusEnum.AUDIT.getStatus()) |
| | | .status(MesPdProjectStatusEnum.APPROVING.getStatus()) |
| | | .processInstanceId(processInstanceId) |
| | | .processDefinitionKey(processDefinitionKey) |
| | | .build()); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getProjectApproveProcessDefinitionList() { |
| | | // 1. æ ¡éªåç±»æ¯å¦åå¨ |
| | | List<BpmCategoryDO> categories = bpmCategoryService.getCategoryListByCode( |
| | | Collections.singletonList(BPM_PROCESS_DEFINITION_CATEGORY_CODE)); |
| | | if (CollUtil.isEmpty(categories)) { |
| | | throw exception(PD_PROJECT_BPM_CATEGORY_NOT_EXISTS); |
| | | } |
| | | // 2. è·ååç±»ä¸çæµç¨å®ä¹ä¿¡æ¯ |
| | | List<BpmProcessDefinitionInfoDO> definitionInfoList = bpmProcessDefinitionService |
| | | .getProcessDefinitionInfoListByCategory(BPM_PROCESS_DEFINITION_CATEGORY_CODE); |
| | | if (CollUtil.isEmpty(definitionInfoList)) { |
| | | return Collections.emptyList(); |
| | | } |
| | | // 3. è¿æ»¤æ¿æ´»ç¶æï¼ä¿çææ°çæ¬ |
| | | Map<String, ProcessDefinition> latestVersionMap = new HashMap<>(); |
| | | for (BpmProcessDefinitionInfoDO info : definitionInfoList) { |
| | | ProcessDefinition pd = bpmProcessDefinitionService.getProcessDefinition(info.getProcessDefinitionId()); |
| | | if (pd == null || pd.isSuspended()) { |
| | | continue; |
| | | } |
| | | ProcessDefinition existing = latestVersionMap.get(pd.getKey()); |
| | | if (existing == null || pd.getVersion() > existing.getVersion()) { |
| | | latestVersionMap.put(pd.getKey(), pd); |
| | | } |
| | | } |
| | | // 4. è¿åæµç¨å®ä¹å表 |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (ProcessDefinition pd : latestVersionMap.values()) { |
| | | Map<String, Object> item = new HashMap<>(); |
| | | item.put("id", pd.getId()); |
| | | item.put("key", pd.getKey()); |
| | | item.put("name", pd.getName()); |
| | | result.add(item); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void updateProjectAuditStatus(Long id, Integer bpmResult) { |
| | | // 1. æ ¡éªåå¨ |
| | | MesPdProjectDO project = validateProjectExists(id); |
| | | if (!MesPdProjectStatusEnum.APPROVING.getStatus().equals(project.getStatus())) { |
| | | log.warn("[updateProjectAuditStatus] 设计项ç®({}) ä¸å¤äºå®¡æ¹ä¸ç¶æï¼å½åç¶æï¼{}", id, project.getStatus()); |
| | | return; |
| | | } |
| | | // 2. æ ¹æ®å®¡æ¹ç»ææ´æ°ç¶æ |
| | | Integer newStatus = convertBpmResultToProjectStatus(bpmResult); |
| | | if (newStatus != null) { |
| | | projectMapper.updateById(MesPdProjectDO.builder() |
| | | .id(id) |
| | | .status(newStatus) |
| | | .build()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è½¬æ¢ BPM 审æ¹ç»æä¸ºè®¾è®¡é¡¹ç®ç¶æ |
| | | */ |
| | | private Integer convertBpmResultToProjectStatus(Integer bpmResult) { |
| | | if (BpmTaskStatusEnum.APPROVE.getStatus().equals(bpmResult)) { |
| | | return MesPdProjectStatusEnum.AUDIT.getStatus(); |
| | | } else if (BpmTaskStatusEnum.REJECT.getStatus().equals(bpmResult)) { |
| | | return MesPdProjectStatusEnum.UPLOAD.getStatus(); |
| | | } else if (BpmTaskStatusEnum.CANCEL.getStatus().equals(bpmResult)) { |
| | | return MesPdProjectStatusEnum.UPLOAD.getStatus(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void archiveProject(Long id, Long userId) { |
| | | // æ ¡éªåå¨ |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.iocoder.yudao.module.mes.service.pd.project.listener; |
| | | |
| | | import cn.iocoder.yudao.module.bpm.api.event.BpmProcessInstanceStatusEvent; |
| | | import cn.iocoder.yudao.module.bpm.api.event.BpmProcessInstanceStatusEventListener; |
| | | import cn.iocoder.yudao.module.mes.service.pd.project.MesPdProjectService; |
| | | import jakarta.annotation.Resource; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * 设计项ç®å®¡æ¹ç¶æçå¬å¨ |
| | | * |
| | | * çå¬ BPM æµç¨å®ä¾ç¶æåæ´äºä»¶ï¼æ´æ°è®¾è®¡é¡¹ç®ç审æ¹ç¶æ |
| | | * |
| | | * @author è¶
级管çå |
| | | */ |
| | | @Component |
| | | @Slf4j |
| | | public class MesPdProjectStatusListener extends BpmProcessInstanceStatusEventListener { |
| | | |
| | | /** |
| | | * BPM 设计项ç®å®¡æ¹æµç¨å®ä¹ key |
| | | */ |
| | | private static final String BPM_PROCESS_DEFINITION_KEY = "mes-pd-project-audit"; |
| | | |
| | | @Resource |
| | | private MesPdProjectService projectService; |
| | | |
| | | @Override |
| | | protected String getProcessDefinitionKey() { |
| | | return BPM_PROCESS_DEFINITION_KEY; |
| | | } |
| | | |
| | | @Override |
| | | protected void onEvent(BpmProcessInstanceStatusEvent event) { |
| | | Long projectId; |
| | | try { |
| | | projectId = Long.parseLong(event.getBusinessKey()); |
| | | } catch (NumberFormatException e) { |
| | | log.warn("[onEvent] businessKey({}) 䏿¯ææç设计项ç®ç¼å·", event.getBusinessKey()); |
| | | return; |
| | | } |
| | | log.info("[onEvent] æ¶å°BPM审æ¹äºä»¶ï¼projectId={}, status={}", projectId, event.getStatus()); |
| | | projectService.updateProjectAuditStatus(projectId, event.getStatus()); |
| | | } |
| | | |
| | | } |
| | |
| | | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.wm.batch.vo.MesWmBatchGenerateReqVO; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.wm.batch.vo.MesWmBatchPageReqVO; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.wm.batch.vo.MesWmBatchProcessTraceRespVO; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.wm.batch.vo.MesWmBatchPurchaseSourceRespVO; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.wm.batch.vo.MesWmBatchSalesTargetRespVO; |
| | | import cn.iocoder.yudao.module.mes.dal.dataobject.wm.batch.MesWmBatchDO; |
| | | |
| | | import java.util.List; |
| | |
| | | */ |
| | | Long getBatchCountByToolId(Long toolId); |
| | | |
| | | /** |
| | | * è·å¾æ¹æ¬¡éè´æ¥æºï¼éè´å
¥åºå + IQCï¼ |
| | | * |
| | | * @param code æ¹æ¬¡å· |
| | | * @return éè´æ¥æºå表 |
| | | */ |
| | | List<MesWmBatchPurchaseSourceRespVO> getPurchaseSourceList(String code); |
| | | |
| | | /** |
| | | * è·å¾æ¹æ¬¡éå®å»åï¼éå®åºåºå + OQCï¼ |
| | | * |
| | | * @param code æ¹æ¬¡å· |
| | | * @return éå®å»åå表 |
| | | */ |
| | | List<MesWmBatchSalesTargetRespVO> getSalesTargetList(String code); |
| | | |
| | | /** |
| | | * è·å¾æ¹æ¬¡å·¥åºæµè½¬ï¼äº§åº/æå
¥äºä»¶ï¼ |
| | | * |
| | | * @param code æ¹æ¬¡å· |
| | | * @return å·¥åºæµè½¬å表 |
| | | */ |
| | | List<MesWmBatchProcessTraceRespVO> getProcessTraceList(String code); |
| | | |
| | | /** |
| | | * æ ¹æ® SN ç è·å¾æ¹æ¬¡ |
| | | * |
| | | * @param sn SN ç |
| | | * @return æ¹æ¬¡è®°å½ï¼æªå½ä¸è¿å nullï¼ |
| | | */ |
| | | MesWmBatchDO getBatchBySn(String sn); |
| | | |
| | | } |
| | |
| | | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.wm.batch.vo.MesWmBatchGenerateReqVO; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.wm.batch.vo.MesWmBatchPageReqVO; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.wm.batch.vo.MesWmBatchProcessTraceRespVO; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.wm.batch.vo.MesWmBatchPurchaseSourceRespVO; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.wm.batch.vo.MesWmBatchSalesTargetRespVO; |
| | | import cn.iocoder.yudao.module.mes.dal.dataobject.mdm.MesMdmItemDO; |
| | | import cn.iocoder.yudao.module.mes.dal.dataobject.wm.batch.MesWmBatchDO; |
| | | import cn.iocoder.yudao.module.mes.dal.dataobject.wm.sn.MesWmSnDO; |
| | | import cn.iocoder.yudao.module.mes.dal.mysql.wm.batch.MesWmBatchMapper; |
| | | import cn.iocoder.yudao.module.mes.dal.mysql.wm.sn.MesWmSnMapper; |
| | | import cn.iocoder.yudao.module.mes.enums.MesBizTypeConstants; |
| | | import cn.iocoder.yudao.module.mes.enums.md.autocode.MesMdAutoCodeRuleCodeEnum; |
| | | import cn.iocoder.yudao.module.mes.service.md.autocode.MesMdAutoCodeRecordService; |
| | |
| | | import org.springframework.validation.annotation.Validated; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Comparator; |
| | | import java.util.HashSet; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | |
| | | |
| | | @Resource |
| | | private MesMdmItemService mdmItemService; |
| | | @Resource |
| | | private MesWmSnMapper snMapper; |
| | | @Resource |
| | | private MdmItemBatchConfigApi itemBatchConfigApi; |
| | | @Resource |
| | |
| | | return batchMapper.selectCountByToolId(toolId); |
| | | } |
| | | |
| | | @Override |
| | | public List<MesWmBatchPurchaseSourceRespVO> getPurchaseSourceList(String code) { |
| | | return batchMapper.selectPurchaseSourceList(code); |
| | | } |
| | | |
| | | @Override |
| | | public List<MesWmBatchSalesTargetRespVO> getSalesTargetList(String code) { |
| | | return batchMapper.selectSalesTargetList(code); |
| | | } |
| | | |
| | | @Override |
| | | public List<MesWmBatchProcessTraceRespVO> getProcessTraceList(String code) { |
| | | List<MesWmBatchProcessTraceRespVO> list = batchMapper.selectProcessTraceList(code); |
| | | if (CollUtil.isEmpty(list)) { |
| | | return list; |
| | | } |
| | | // æå·¥åãå·¥åºåºå·ãäºä»¶æ¶é´æåºï¼sort å¯è½ä¸ºç©ºï¼ç©ºå¼å
åºï¼ |
| | | list.sort(Comparator.comparing(MesWmBatchProcessTraceRespVO::getWorkOrderId, |
| | | Comparator.nullsLast(Comparator.naturalOrder())) |
| | | .thenComparing(MesWmBatchProcessTraceRespVO::getProcessSort, |
| | | Comparator.nullsLast(Comparator.naturalOrder())) |
| | | .thenComparing(MesWmBatchProcessTraceRespVO::getEventTime, |
| | | Comparator.nullsLast(Comparator.naturalOrder()))); |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public MesWmBatchDO getBatchBySn(String sn) { |
| | | MesWmSnDO snDO = snMapper.selectOne(MesWmSnDO::getCode, sn); |
| | | if (snDO == null || StrUtil.isBlank(snDO.getBatchCode())) { |
| | | return null; |
| | | } |
| | | return batchMapper.selectByCode(snDO.getBatchCode()); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | <!-- |
| | | åå追溯ï¼ä»æä¸ªåæææ¹æ¬¡åºåï¼æ¥æ¾å®è¢«åªäºå·¥åæ¶èåï¼äº§åºäºåªäºæåæ¹æ¬¡ |
| | | SQL è·¯å¾ï¼åºåäºå¡(æ¶è OUT) â æ¶èå â æ¥å·¥è®°å½ â åºåäºå¡(äº§åº IN) â æ¹æ¬¡ |
| | | é¾è·¯ï¼åºåäºå¡(æ¶è OUT, biz=123, biz_id=æ¶èåid) â æ¶èå â æ¥å·¥ â 产åºå(feedback_id) â åºåäºå¡(äº§åº IN, biz=124, biz_id=产åºåid) â æ¹æ¬¡ |
| | | --> |
| | | <select id="selectListByForward" parameterType="String" resultMap="BatchTraceResult"> |
| | | SELECT DISTINCT pf.work_order_id, pf.item_id, tx_produce.batch_id, tx_produce.batch_code |
| | | FROM mes_wm_transaction tx_consume |
| | | LEFT JOIN mes_wm_item_consume ic ON tx_consume.biz_id = ic.id AND tx_consume.biz_type = 123 AND ic.deleted = 0 |
| | | LEFT JOIN mes_pro_feedback pf ON pf.id = ic.feedback_id AND pf.deleted = 0 |
| | | LEFT JOIN mes_wm_transaction tx_produce ON tx_produce.biz_id = pf.id AND tx_produce.biz_type = 124 AND tx_produce.deleted = 0 |
| | | JOIN mes_wm_item_consume ic ON tx_consume.biz_id = ic.id AND tx_consume.biz_type = 123 AND ic.deleted = 0 |
| | | JOIN mes_pro_feedback pf ON pf.id = ic.feedback_id AND pf.deleted = 0 |
| | | JOIN mes_wm_product_produce pp ON pp.feedback_id = pf.id AND pp.deleted = 0 |
| | | JOIN mes_wm_transaction tx_produce ON tx_produce.biz_id = pp.id AND tx_produce.biz_type = 124 AND tx_produce.deleted = 0 |
| | | WHERE tx_consume.batch_code = #{batchCode} |
| | | AND tx_consume.biz_type = 123 |
| | | AND tx_consume.deleted = 0 |
| | |
| | | |
| | | <!-- |
| | | åå追溯ï¼ä»æä¸ªæåæ¹æ¬¡åºåï¼æ¥æ¾çäº§å®æ¶æ¶èäºåªäºåæææ¹æ¬¡ |
| | | SQL è·¯å¾ï¼åºåäºå¡(äº§åº IN) â 产åºå â æ¥å·¥è®°å½ â åºåäºå¡(æ¶è OUT) â æ¹æ¬¡ |
| | | é¾è·¯ï¼åºåäºå¡(äº§åº IN, biz=124, biz_id=产åºåid) â 产åºå â æ¥å·¥ â æ¶èå(feedback_id) â åºåäºå¡(æ¶è OUT, biz=123, biz_id=æ¶èåid) â æ¹æ¬¡ |
| | | --> |
| | | <select id="selectListByBackward" parameterType="String" resultMap="BatchTraceResult"> |
| | | SELECT DISTINCT ic.work_order_id, tx_consume.item_id, tx_consume.batch_id, tx_consume.batch_code |
| | | FROM mes_wm_transaction tx_produce |
| | | LEFT JOIN mes_wm_product_produce pp ON tx_produce.biz_id = pp.id AND tx_produce.biz_type = 124 AND pp.deleted = 0 |
| | | LEFT JOIN mes_pro_feedback pf ON pf.id = pp.feedback_id AND pf.deleted = 0 |
| | | LEFT JOIN mes_wm_transaction tx_consume ON tx_consume.biz_id = pf.id AND tx_consume.biz_type = 123 AND tx_consume.deleted = 0 |
| | | LEFT JOIN mes_wm_item_consume ic ON ic.id = tx_consume.biz_id AND ic.deleted = 0 |
| | | JOIN mes_wm_product_produce pp ON tx_produce.biz_id = pp.id AND tx_produce.biz_type = 124 AND pp.deleted = 0 |
| | | JOIN mes_pro_feedback pf ON pf.id = pp.feedback_id AND pf.deleted = 0 |
| | | JOIN mes_wm_item_consume ic ON ic.feedback_id = pf.id AND ic.deleted = 0 |
| | | JOIN mes_wm_transaction tx_consume ON tx_consume.biz_id = ic.id AND tx_consume.biz_type = 123 AND tx_consume.deleted = 0 |
| | | WHERE tx_produce.batch_code = #{batchCode} |
| | | AND tx_produce.biz_type = 124 |
| | | AND tx_produce.deleted = 0 |
| | | AND tx_consume.batch_id IS NOT NULL |
| | | </select> |
| | | |
| | | <!-- æ¹æ¬¡éè´æ¥æºï¼æ¹æ¬¡ â éè´å
¥åºè¡ â éè´å
¥åºå â IQC --> |
| | | <select id="selectPurchaseSourceList" parameterType="String" |
| | | resultType="cn.iocoder.yudao.module.mes.controller.admin.wm.batch.vo.MesWmBatchPurchaseSourceRespVO"> |
| | | SELECT r.code AS receipt_code, r.receipt_date, r.purchase_order_code, r.vendor_id, |
| | | iqc.code AS iqc_code, iqc.check_result AS check_result, |
| | | rl.batch_code, rl.item_id, rl.received_quantity |
| | | FROM mes_wm_item_receipt_line rl |
| | | JOIN mes_wm_item_receipt r ON r.id = rl.receipt_id AND r.deleted = 0 |
| | | LEFT JOIN mes_qc_iqc iqc ON iqc.id = r.iqc_id AND iqc.deleted = 0 |
| | | WHERE rl.batch_code = #{batchCode} AND rl.deleted = 0 |
| | | </select> |
| | | |
| | | <!-- æ¹æ¬¡éå®å»åï¼æ¹æ¬¡ â éå®åºåºè¡ â éå®åºåºå â OQC --> |
| | | <select id="selectSalesTargetList" parameterType="String" |
| | | resultType="cn.iocoder.yudao.module.mes.controller.admin.wm.batch.vo.MesWmBatchSalesTargetRespVO"> |
| | | SELECT s.code AS sales_code, s.sales_date, s.sales_order_code, s.client_id, |
| | | oqc.code AS oqc_code, oqc.check_result AS check_result, |
| | | sl.batch_code, sl.item_id, sl.quantity, sl.quality_status |
| | | FROM mes_wm_product_sales_line sl |
| | | JOIN mes_wm_product_sales s ON s.id = sl.sales_id AND s.deleted = 0 |
| | | LEFT JOIN mes_qc_oqc oqc ON oqc.id = sl.oqc_id AND oqc.deleted = 0 |
| | | WHERE sl.batch_code = #{batchCode} AND sl.deleted = 0 |
| | | </select> |
| | | |
| | | <!-- æ¹æ¬¡å·¥åºæµè½¬ï¼äº§åº(OUT)/æå
¥(IN) äºä»¶èåï¼æ é建表 --> |
| | | <select id="selectProcessTraceList" parameterType="String" |
| | | resultType="cn.iocoder.yudao.module.mes.controller.admin.wm.batch.vo.MesWmBatchProcessTraceRespVO"> |
| | | SELECT 'OUT' AS event_type, pp.work_order_id, pp.process_id, |
| | | ppl.batch_code, ppl.quantity, ppl.quality_status, pp.produce_date AS event_time, |
| | | wop.sort AS process_sort |
| | | FROM mes_wm_product_produce_line ppl |
| | | JOIN mes_wm_product_produce pp ON pp.id = ppl.produce_id AND pp.deleted = 0 |
| | | LEFT JOIN mes_pro_work_order_process wop |
| | | ON wop.work_order_id = pp.work_order_id AND wop.process_id = pp.process_id AND wop.deleted = 0 |
| | | WHERE ppl.batch_code = #{batchCode} AND ppl.deleted = 0 |
| | | UNION ALL |
| | | SELECT 'IN' AS event_type, ic.work_order_id, ic.process_id, |
| | | icd.batch_code, icd.quantity, NULL AS quality_status, ic.consume_date AS event_time, |
| | | wop.sort AS process_sort |
| | | FROM mes_wm_item_consume_detail icd |
| | | JOIN mes_wm_item_consume ic ON ic.id = icd.consume_id AND ic.deleted = 0 |
| | | LEFT JOIN mes_pro_work_order_process wop |
| | | ON wop.work_order_id = ic.work_order_id AND wop.process_id = ic.process_id AND wop.deleted = 0 |
| | | WHERE icd.batch_code = #{batchCode} AND icd.deleted = 0 |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | @Schema(description = "å
¬å¸å°å", example = "䏿µ·å¸æµ¦ä¸æ°åºXXè·¯XXå·") |
| | | private String address; |
| | | |
| | | @Schema(description = "弿·é¶è¡", example = "ä¸å½å·¥åé¶è¡ä¸æµ·åè¡") |
| | | private String bankName; |
| | | |
| | | @Schema(description = "é¶è¡è´¦å·", example = "622202xxxxxxxxxxxx") |
| | | private String bankAccount; |
| | | |
| | | @Schema(description = "è系人", example = "å¼ ä¸") |
| | | private String contactName; |
| | | |
| | |
| | | @Schema(description = "é®ç®±", example = "zhangsan@example.com") |
| | | private String contactEmail; |
| | | |
| | | @Schema(description = "夿³¨", example = "ä¼å
ä¾è´§") |
| | | private String remark; |
| | | |
| | | @Schema(description = "ç³è¯·äººID", example = "1") |
| | | private Long applyUserId; |
| | | |
| | |
| | | @Schema(description = "å
¬å¸å°å", example = "䏿µ·å¸æµ¦ä¸æ°åºXXè·¯XXå·") |
| | | private String address; |
| | | |
| | | @Schema(description = "弿·é¶è¡", example = "ä¸å½å·¥åé¶è¡ä¸æµ·åè¡") |
| | | private String bankName; |
| | | |
| | | @Schema(description = "é¶è¡è´¦å·", example = "622202xxxxxxxxxxxx") |
| | | private String bankAccount; |
| | | |
| | | @Schema(description = "è系人", example = "å¼ ä¸") |
| | | private String contactName; |
| | | |
| | |
| | | @Schema(description = "é®ç®±", example = "zhangsan@example.com") |
| | | private String contactEmail; |
| | | |
| | | @Schema(description = "夿³¨", example = "ä¼å
ä¾è´§") |
| | | private String remark; |
| | | |
| | | } |
| | |
| | | import cn.iocoder.yudao.module.srm.controller.admin.certificate.vo.*; |
| | | import cn.iocoder.yudao.module.srm.dal.dataobject.SrmSupplierDO; |
| | | import cn.iocoder.yudao.module.srm.service.certificate.SrmSupplierCertificateService; |
| | | import cn.iocoder.yudao.module.srm.service.certificate.SrmSupplierCertificateServiceImpl; |
| | | import cn.iocoder.yudao.module.srm.service.supplier.SrmSupplierService; |
| | | import cn.iocoder.yudao.module.system.api.storage.StorageAttachmentApi; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | |
| | | |
| | | @Resource |
| | | private SrmSupplierService supplierService; |
| | | |
| | | @Resource |
| | | private StorageAttachmentApi storageAttachmentApi; |
| | | |
| | | @PostMapping("/create") |
| | | @Operation(summary = "å建èµè´¨è¯ä¹¦") |
| | |
| | | var pageResult = certificateService.getCertificatePage(pageReqVO); |
| | | var respList = BeanUtils.toBean(pageResult.getList(), SrmSupplierCertificateRespVO.class); |
| | | enrichSupplierNames(respList); |
| | | enrichAttachments(respList); |
| | | return success(new PageResult<>(respList, pageResult.getTotal())); |
| | | } |
| | | |
| | |
| | | public CommonResult<List<SrmSupplierCertificateRespVO>> getListBySupplier(@RequestParam("supplierId") Long supplierId) { |
| | | var list = BeanUtils.toBean(certificateService.getCertificateListBySupplierId(supplierId), SrmSupplierCertificateRespVO.class); |
| | | enrichSupplierNames(list); |
| | | enrichAttachments(list); |
| | | return success(list); |
| | | } |
| | | |
| | |
| | | public CommonResult<SrmSupplierCertificateRespVO> getCertificate(@RequestParam("id") Long id) { |
| | | var resp = BeanUtils.toBean(certificateService.getCertificate(id), SrmSupplierCertificateRespVO.class); |
| | | enrichSupplierName(resp); |
| | | enrichAttachments(List.of(resp)); |
| | | return success(resp); |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | private void enrichAttachments(List<SrmSupplierCertificateRespVO> list) { |
| | | if (list == null || list.isEmpty()) return; |
| | | list.forEach(vo -> vo.setAttachmentList(storageAttachmentApi.listAttachments( |
| | | SrmSupplierCertificateServiceImpl.CERTIFICATE_RECORD_TYPE, vo.getId()))); |
| | | } |
| | | |
| | | } |
| | |
| | | package cn.iocoder.yudao.module.srm.controller.admin.certificate.vo; |
| | | |
| | | import cn.iocoder.yudao.module.system.api.storage.dto.StorageBlobRespDTO; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | @Schema(description = "管çåå° - SRM ä¾åºåèµè´¨è¯ä¹¦ Response VO") |
| | | @Data |
| | |
| | | @Schema(description = "å建æ¶é´") |
| | | private LocalDateTime createTime; |
| | | |
| | | @Schema(description = "è¯ä¹¦éä»¶å表") |
| | | private List<StorageBlobRespDTO> attachmentList; |
| | | |
| | | } |
| | |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.util.List; |
| | | |
| | | @Schema(description = "管çåå° - SRM ä¾åºåèµè´¨è¯ä¹¦å建/æ´æ° Request VO") |
| | | @Data |
| | |
| | | @Schema(description = "夿³¨", example = "年度èµè´¨å®¡æ ¸") |
| | | private String remark; |
| | | |
| | | @Schema(description = "è¯ä¹¦éä»¶æä»¶IDå表") |
| | | private List<Long> blobIds; |
| | | |
| | | } |
| | |
| | | return success(BeanUtils.toBean(list, SrmSupplierRespVO.class)); |
| | | } |
| | | |
| | | @GetMapping("/list") |
| | | @Operation(summary = "è·åä¾åºåæ¡£æ¡å表ï¼ä¸è¿æ»¤åå
¥ç¶æï¼") |
| | | public CommonResult<List<SrmSupplierRespVO>> getSupplierAllList() { |
| | | List<SrmSupplierDO> list = supplierService.getSupplierAllList(); |
| | | return success(BeanUtils.toBean(list, SrmSupplierRespVO.class)); |
| | | } |
| | | |
| | | @GetMapping("/export-excel") |
| | | @Operation(summary = "导åºä¾åºå Excel") |
| | | @PreAuthorize("@ss.hasPermission('srm:supplier:export')") |
| | |
| | | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| | | import cn.iocoder.yudao.module.srm.controller.admin.tender.vo.*; |
| | | import cn.iocoder.yudao.module.srm.service.tender.SrmTenderProjectService; |
| | | import cn.iocoder.yudao.module.srm.service.tender.SrmTenderProjectServiceImpl; |
| | | import cn.iocoder.yudao.module.system.api.storage.StorageAttachmentApi; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | |
| | | |
| | | @Resource |
| | | private SrmTenderProjectService tenderProjectService; |
| | | |
| | | @Resource |
| | | private StorageAttachmentApi storageAttachmentApi; |
| | | |
| | | @PostMapping("/create") |
| | | @Operation(summary = "åå»ºææ é¡¹ç®") |
| | |
| | | @Operation(summary = "è·åææ é¡¹ç®è¯¦æ
") |
| | | @PreAuthorize("@ss.hasPermission('srm:tender-project:query')") |
| | | public CommonResult<SrmTenderProjectRespVO> getTenderProject(@RequestParam("id") Long id) { |
| | | return success(BeanUtils.toBean(tenderProjectService.getTenderProject(id), SrmTenderProjectRespVO.class)); |
| | | var resp = BeanUtils.toBean(tenderProjectService.getTenderProject(id), SrmTenderProjectRespVO.class); |
| | | enrichAttachments(List.of(resp)); |
| | | return success(resp); |
| | | } |
| | | |
| | | @GetMapping("/page") |
| | | @Operation(summary = "è·åææ é¡¹ç®å页") |
| | | @PreAuthorize("@ss.hasPermission('srm:tender-project:query')") |
| | | public CommonResult<PageResult<SrmTenderProjectRespVO>> getTenderProjectPage(@Valid SrmTenderProjectPageReqVO pageReqVO) { |
| | | return success(BeanUtils.toBean(tenderProjectService.getTenderProjectPage(pageReqVO), SrmTenderProjectRespVO.class)); |
| | | var pageResult = tenderProjectService.getTenderProjectPage(pageReqVO); |
| | | var respList = BeanUtils.toBean(pageResult.getList(), SrmTenderProjectRespVO.class); |
| | | enrichAttachments(respList); |
| | | return success(new PageResult<>(respList, pageResult.getTotal())); |
| | | } |
| | | |
| | | // ========== å
³èæ°æ®å¡«å
========== |
| | | |
| | | private void enrichAttachments(List<SrmTenderProjectRespVO> list) { |
| | | if (list == null || list.isEmpty()) return; |
| | | list.forEach(vo -> vo.setAttachmentList(storageAttachmentApi.listAttachments( |
| | | SrmTenderProjectServiceImpl.TENDER_PROJECT_RECORD_TYPE, vo.getId()))); |
| | | } |
| | | |
| | | @PutMapping("/publish") |
| | |
| | | import jakarta.validation.constraints.NotNull; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Schema(description = "管çåå° - SRM ææ é¡¹ç®é¨åæ´æ° Request VOï¼åå¸ä¸/ææ ä¸é¶æ®µï¼") |
| | | @Data |
| | | public class SrmTenderProjectPartialUpdateReqVO { |
| | |
| | | @Schema(description = "èµè´¨è¦æ±", example = "éå
·å¤ISO9001认è¯") |
| | | private String qualificationRequirements; |
| | | |
| | | @Schema(description = "èµè´¨è¦æ±éä»¶æä»¶IDå表") |
| | | private List<Long> blobIds; |
| | | |
| | | } |
| | |
| | | package cn.iocoder.yudao.module.srm.controller.admin.tender.vo; |
| | | |
| | | import cn.iocoder.yudao.module.system.api.storage.dto.StorageBlobRespDTO; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | @Schema(description = "管çåå° - SRM ææ é¡¹ç® Response VO") |
| | | @Data |
| | |
| | | @Schema(description = "èµè´¨è¦æ±", example = "éå
·å¤ISO9001认è¯") |
| | | private String qualificationRequirements; |
| | | |
| | | @Schema(description = "èµè´¨è¦æ±éä»¶å表") |
| | | private List<StorageBlobRespDTO> attachmentList; |
| | | |
| | | @Schema(description = "éè´ç³è¯·ID", example = "1") |
| | | private Long purchaseRequestId; |
| | | |
| | |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | @Schema(description = "管çåå° - SRM ææ é¡¹ç®å建/æ´æ° Request VO") |
| | | @Data |
| | |
| | | @Schema(description = "èµè´¨è¦æ±", example = "éå
·å¤ISO9001认è¯") |
| | | private String qualificationRequirements; |
| | | |
| | | @Schema(description = "èµè´¨è¦æ±éä»¶æä»¶IDå表") |
| | | private List<Long> blobIds; |
| | | |
| | | @Schema(description = "éè´ç³è¯·ID", example = "1") |
| | | private Long purchaseRequestId; |
| | | |
| | |
| | | import com.baomidou.mybatisplus.annotation.KeySequence; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import lombok.*; |
| | | |
| | | import java.math.BigDecimal; |
| | |
| | | private String businessLicenseNo; |
| | | private String taxNo; |
| | | private String address; |
| | | private String bankName; |
| | | private String bankAccount; |
| | | private String contactName; |
| | | private String contactMobile; |
| | | private String contactEmail; |
| | |
| | | private Long financeReviewerId; |
| | | private LocalDateTime financeReviewTime; |
| | | private String financeReviewOpinion; |
| | | private String remark; |
| | | |
| | | } |
| | |
| | | return DRAFT.getCode().equals(status); |
| | | } |
| | | |
| | | /** PUBLISHED æ BIDDINGï¼å®æ´çï¼ï¼æ PRICE_COMPARINGï¼ç®æçï¼å
许ä¾åºåææ */ |
| | | /** BIDDINGï¼å®æ´çï¼ï¼æ PRICE_COMPARINGï¼ç®æçï¼å
许ä¾åºåææ */ |
| | | public static boolean canCreateBid(Integer status) { |
| | | return PUBLISHED.getCode().equals(status) || BIDDING.getCode().equals(status) |
| | | return BIDDING.getCode().equals(status) |
| | | || PRICE_COMPARING.getCode().equals(status); |
| | | } |
| | | |
| | |
| | | */ |
| | | void approve(Long id); |
| | | |
| | | /** |
| | | * ç¡®ä¿ä¾åºåå·²åå
¥ï¼æªåå
¥åèªå¨å建åå
¥ç³è¯·å¹¶ç½®ä¸ºå·²éè¿ |
| | | * |
| | | * @param supplierId ä¾åºåç¼å· |
| | | */ |
| | | void ensureSupplierApproved(Long supplierId); |
| | | |
| | | } |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void ensureSupplierApproved(Long supplierId) { |
| | | if (supplierId == null) { |
| | | return; |
| | | } |
| | | // æ ¡éªä¾åºååå¨ |
| | | SrmSupplierDO supplier = supplierMapper.selectById(supplierId); |
| | | if (supplier == null) { |
| | | throw ServiceExceptionUtil.exception(ErrorCodeConstants.SUPPLIER_NOT_EXISTS); |
| | | } |
| | | // å·²åå
¥åæ éå¤ç |
| | | if (supplierApplyMapper.existsApprovedBySupplierId(supplierId)) { |
| | | return; |
| | | } |
| | | // èªå¨å建åå
¥ç³è¯·å¹¶ç´æ¥ç½®ä¸ºå·²éè¿ |
| | | SrmSupplierApplyDO apply = new SrmSupplierApplyDO(); |
| | | apply.setApplyNo(generateApplyNo()); |
| | | apply.setSupplierId(supplierId); |
| | | apply.setSupplierName(supplier.getName()); |
| | | apply.setSupplierType(supplier.getType()); |
| | | apply.setCompanyNature(supplier.getCompanyNature()); |
| | | apply.setRegisteredCapital(supplier.getRegisteredCapital()); |
| | | apply.setBusinessLicenseNo(supplier.getBusinessLicenseNo()); |
| | | apply.setTaxNo(supplier.getTaxNo()); |
| | | apply.setAddress(supplier.getAddress()); |
| | | apply.setBankName(supplier.getBankName()); |
| | | apply.setBankAccount(supplier.getBankAccount()); |
| | | apply.setContactName(supplier.getContactName()); |
| | | apply.setContactMobile(supplier.getContactMobile()); |
| | | apply.setContactEmail(supplier.getContactEmail()); |
| | | apply.setRemark("䏿 çæéè´è®¢åæ¶èªå¨åå
¥å¹¶éè¿"); |
| | | apply.setApplyStatus(SupplierApplyStatusEnum.APPROVED.getCode()); |
| | | apply.setApplyTime(LocalDateTime.now()); |
| | | supplierApplyMapper.insert(apply); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void approve(Long id) { |
| | | SrmSupplierApplyDO apply = validateApplyExists(id); |
| | | if (!SupplierApplyStatusEnum.APPROVED.getCode().equals(apply.getApplyStatus())) { |
| | |
| | | supplier.setBusinessLicenseNo(apply.getBusinessLicenseNo()); |
| | | supplier.setTaxNo(apply.getTaxNo()); |
| | | supplier.setAddress(apply.getAddress()); |
| | | supplier.setBankName(apply.getBankName()); |
| | | supplier.setBankAccount(apply.getBankAccount()); |
| | | supplier.setContactName(apply.getContactName()); |
| | | supplier.setContactMobile(apply.getContactMobile()); |
| | | supplier.setContactEmail(apply.getContactEmail()); |
| | | supplier.setRemark(apply.getRemark()); |
| | | supplier.setStatus(0); |
| | | supplierMapper.insert(supplier); |
| | | |
| | |
| | | package cn.iocoder.yudao.module.srm.service.certificate; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| | | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| | | import cn.iocoder.yudao.module.srm.controller.admin.certificate.vo.SrmSupplierCertificatePageReqVO; |
| | |
| | | import cn.iocoder.yudao.module.srm.dal.mysql.SrmSupplierCertificateMapper; |
| | | import cn.iocoder.yudao.module.srm.enums.ErrorCodeConstants; |
| | | import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil; |
| | | import cn.iocoder.yudao.module.system.api.storage.StorageAttachmentApi; |
| | | import jakarta.annotation.Resource; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.validation.annotation.Validated; |
| | | |
| | | import java.time.LocalDate; |
| | |
| | | @Validated |
| | | public class SrmSupplierCertificateServiceImpl implements SrmSupplierCertificateService { |
| | | |
| | | /** |
| | | * èµè´¨è¯ä¹¦éä»¶çä¸å¡è®°å½ç±»åï¼å¯¹åº {@link cn.iocoder.yudao.module.system.enums.storage.StorageRecordTypeEnum#SRM_SUPPLIER_CERTIFICATE} |
| | | */ |
| | | public static final String CERTIFICATE_RECORD_TYPE = "srm_supplier_certificate"; |
| | | |
| | | @Resource |
| | | private SrmSupplierCertificateMapper certificateMapper; |
| | | |
| | | @Resource |
| | | private StorageAttachmentApi storageAttachmentApi; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Long createCertificate(SrmSupplierCertificateSaveReqVO createReqVO) { |
| | | SrmSupplierCertificateDO certificate = BeanUtils.toBean(createReqVO, SrmSupplierCertificateDO.class); |
| | | updateStatus(certificate); |
| | | certificateMapper.insert(certificate); |
| | | // ç»å®è¯ä¹¦éä»¶ |
| | | if (CollUtil.isNotEmpty(createReqVO.getBlobIds())) { |
| | | storageAttachmentApi.bindAttachments("file", CERTIFICATE_RECORD_TYPE, certificate.getId(), createReqVO.getBlobIds()); |
| | | } |
| | | return certificate.getId(); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void updateCertificate(SrmSupplierCertificateSaveReqVO updateReqVO) { |
| | | validateCertificateExists(updateReqVO.getId()); |
| | | SrmSupplierCertificateDO updateObj = BeanUtils.toBean(updateReqVO, SrmSupplierCertificateDO.class); |
| | | updateStatus(updateObj); |
| | | certificateMapper.updateById(updateObj); |
| | | // å¢éæ´æ°è¯ä¹¦éä»¶ |
| | | storageAttachmentApi.updateAttachments("file", CERTIFICATE_RECORD_TYPE, updateReqVO.getId(), updateReqVO.getBlobIds()); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void deleteCertificate(Long id) { |
| | | validateCertificateExists(id); |
| | | // å é¤è¯ä¹¦éä»¶ |
| | | storageAttachmentApi.deleteAttachmentsByRecord(CERTIFICATE_RECORD_TYPE, id); |
| | | certificateMapper.deleteById(id); |
| | | } |
| | | |
| | |
| | | List<SrmSupplierDO> getSupplierSimpleList(); |
| | | |
| | | /** |
| | | * è·åå
¨é¨ä¾åºåæ¡£æ¡å表ï¼ä¸è¿æ»¤åå
¥ç¶æï¼ç¨äºææ éæ©ä¾åºåï¼ |
| | | */ |
| | | List<SrmSupplierDO> getSupplierAllList(); |
| | | |
| | | /** |
| | | * è·åä¾åºåå表 |
| | | */ |
| | | List<SrmSupplierDO> getSupplierList(Collection<Long> ids); |
| | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| | | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| | | import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; |
| | | import cn.iocoder.yudao.module.srm.controller.admin.supplier.vo.SrmSupplierPageReqVO; |
| | | import cn.iocoder.yudao.module.srm.controller.admin.supplier.vo.SrmSupplierSaveReqVO; |
| | | import cn.iocoder.yudao.module.srm.dal.dataobject.SrmSupplierDO; |
| | | import cn.iocoder.yudao.module.srm.dal.dataobject.*; |
| | | import cn.iocoder.yudao.module.srm.dal.mysql.SrmBidAwardMapper; |
| | | import cn.iocoder.yudao.module.srm.dal.mysql.SrmBidEvaluationMapper; |
| | | import cn.iocoder.yudao.module.srm.dal.mysql.SrmSupplierApplyMapper; |
| | | import cn.iocoder.yudao.module.srm.dal.mysql.SrmSupplierCategoryMapper; |
| | | import cn.iocoder.yudao.module.srm.dal.mysql.SrmSupplierContactMapper; |
| | | import cn.iocoder.yudao.module.srm.dal.mysql.SrmSupplierCertificateMapper; |
| | | import cn.iocoder.yudao.module.srm.dal.mysql.SrmSupplierMapper; |
| | | import cn.iocoder.yudao.module.srm.dal.mysql.SrmTenderBidMapper; |
| | | import cn.iocoder.yudao.module.srm.enums.ErrorCodeConstants; |
| | | import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil; |
| | | import jakarta.annotation.Resource; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; |
| | | |
| | |
| | | |
| | | @Resource |
| | | private SrmSupplierCategoryMapper supplierCategoryMapper; |
| | | |
| | | @Resource |
| | | private SrmSupplierApplyMapper supplierApplyMapper; |
| | | |
| | | @Resource |
| | | private SrmSupplierCertificateMapper supplierCertificateMapper; |
| | | |
| | | @Resource |
| | | private SrmTenderBidMapper tenderBidMapper; |
| | | |
| | | @Resource |
| | | private SrmBidEvaluationMapper bidEvaluationMapper; |
| | | |
| | | @Resource |
| | | private SrmBidAwardMapper bidAwardMapper; |
| | | |
| | | @Override |
| | | public Long createSupplier(SrmSupplierSaveReqVO createReqVO) { |
| | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void deleteSupplier(Long id) { |
| | | // æ ¡éªå卿§ |
| | | validateSupplierExists(id); |
| | | // å é¤å
³èæ°æ® |
| | | // å
³èæ°æ®å卿¶ï¼ä¸å
许å é¤ |
| | | validateNoReference(id); |
| | | // å¯ç´æ¥æ¸
ççå
³èæ°æ® |
| | | supplierContactMapper.deleteBySupplierId(id); |
| | | supplierCategoryMapper.deleteBySupplierId(id); |
| | | // é»è¾å é¤ |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<SrmSupplierDO> getSupplierAllList() { |
| | | return supplierMapper.selectList(new LambdaQueryWrapperX<SrmSupplierDO>() |
| | | .orderByAsc(SrmSupplierDO::getId)); |
| | | } |
| | | |
| | | @Override |
| | | public List<SrmSupplierDO> getSupplierList(Collection<Long> ids) { |
| | | if (CollUtil.isEmpty(ids)) { |
| | | return Collections.emptyList(); |
| | |
| | | } |
| | | } |
| | | |
| | | private void validateNoReference(Long id) { |
| | | boolean hasReference = supplierApplyMapper.existsApprovedBySupplierId(id) |
| | | || supplierCertificateMapper.selectCount(SrmSupplierCertificateDO::getSupplierId, id) > 0 |
| | | || tenderBidMapper.selectCount(SrmTenderBidDO::getSupplierId, id) > 0 |
| | | || bidEvaluationMapper.selectCount(SrmBidEvaluationDO::getSupplierId, id) > 0 |
| | | || bidAwardMapper.selectCount(SrmBidAwardDO::getSupplierId, id) > 0; |
| | | if (hasReference) { |
| | | throw ServiceExceptionUtil.exception(ErrorCodeConstants.SUPPLIER_EXISTS_REFERENCE); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | import cn.iocoder.yudao.module.srm.enums.BidStatusEnum; |
| | | import cn.iocoder.yudao.module.srm.enums.ErrorCodeConstants; |
| | | import cn.iocoder.yudao.module.srm.enums.TenderStatusEnum; |
| | | import cn.iocoder.yudao.module.srm.service.apply.SrmSupplierApplyService; |
| | | import com.mzt.logapi.starter.annotation.LogRecord; |
| | | import jakarta.annotation.Resource; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | |
| | | @Resource |
| | | private ErpPurchaseOrderApi erpPurchaseOrderApi; |
| | | |
| | | @Resource |
| | | private SrmSupplierApplyService supplierApplyService; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | throw ServiceExceptionUtil.exception(ErrorCodeConstants.AWARD_SUPPLIER_NOT_SYNCED); |
| | | } |
| | | |
| | | // ä¾åºåæªåå
¥åèªå¨åå
¥å¹¶éè¿ï¼ä¿è¯éè´è®¢åæµç¨å¯ç¨ |
| | | supplierApplyService.ensureSupplierApproved(srmSupplier.getId()); |
| | | |
| | | // 3. æ¥ææ ç©æå表 |
| | | List<SrmTenderMaterialDO> materials = tenderMaterialMapper |
| | | .selectListByTenderProjectId(award.getTenderProjectId()); |
| | |
| | | import cn.iocoder.yudao.module.erp.api.purchase.dto.ErpPurchaseOrderCreateReqDTO; |
| | | import cn.iocoder.yudao.module.mdm.api.item.MdmItemApi; |
| | | import cn.iocoder.yudao.module.mdm.api.item.dto.MdmItemRespDTO; |
| | | import cn.iocoder.yudao.module.system.api.storage.StorageAttachmentApi; |
| | | import cn.iocoder.yudao.module.srm.controller.admin.tender.vo.SrmTenderMaterialSaveReqVO; |
| | | import cn.iocoder.yudao.module.srm.controller.admin.tender.vo.SrmTenderProjectPageReqVO; |
| | | import cn.iocoder.yudao.module.srm.controller.admin.tender.vo.SrmTenderProjectPartialUpdateReqVO; |
| | |
| | | import cn.iocoder.yudao.module.srm.enums.BidStatusEnum; |
| | | import cn.iocoder.yudao.module.srm.enums.ErrorCodeConstants; |
| | | import cn.iocoder.yudao.module.srm.enums.TenderStatusEnum; |
| | | import cn.iocoder.yudao.module.srm.service.apply.SrmSupplierApplyService; |
| | | import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil; |
| | | import com.mzt.logapi.context.LogRecordContext; |
| | | import com.mzt.logapi.starter.annotation.LogRecord; |
| | |
| | | @Slf4j |
| | | public class SrmTenderProjectServiceImpl implements SrmTenderProjectService { |
| | | |
| | | /** |
| | | * ææ é¡¹ç®èµè´¨è¦æ±éä»¶çä¸å¡è®°å½ç±»åï¼å¯¹åº {@link cn.iocoder.yudao.module.system.enums.storage.StorageRecordTypeEnum#SRM_TENDER_PROJECT} |
| | | */ |
| | | public static final String TENDER_PROJECT_RECORD_TYPE = "srm_tender_project"; |
| | | |
| | | @Resource |
| | | private SrmTenderProjectMapper tenderProjectMapper; |
| | | @Resource |
| | |
| | | private MdmItemApi mdmItemApi; |
| | | @Resource |
| | | private ErpPurchaseOrderApi erpPurchaseOrderApi; |
| | | @Resource |
| | | private SrmSupplierApplyService supplierApplyService; |
| | | @Resource |
| | | private StorageAttachmentApi storageAttachmentApi; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Long createTenderProject(SrmTenderProjectSaveReqVO createReqVO) { |
| | | SrmTenderProjectDO project = BeanUtils.toBean(createReqVO, SrmTenderProjectDO.class); |
| | | project.setTenderStatus(TenderStatusEnum.DRAFT.getCode()); |
| | |
| | | project.setBiddingMode(tenderConfigService.getConfig().getDefaultBiddingMode()); |
| | | } |
| | | tenderProjectMapper.insert(project); |
| | | // ç»å®èµè´¨è¦æ±éä»¶ |
| | | if (CollUtil.isNotEmpty(createReqVO.getBlobIds())) { |
| | | storageAttachmentApi.bindAttachments("file", TENDER_PROJECT_RECORD_TYPE, project.getId(), createReqVO.getBlobIds()); |
| | | } |
| | | return project.getId(); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @LogRecord(type = LOG_TENDER_TYPE, subType = LOG_TENDER_UPDATE_SUB_TYPE, |
| | | bizNo = "{{#updateReqVO.id}}", success = LOG_TENDER_UPDATE_SUCCESS) |
| | | public void updateTenderProject(SrmTenderProjectSaveReqVO updateReqVO) { |
| | |
| | | SrmTenderProjectDO updateObj = BeanUtils.toBean(updateReqVO, SrmTenderProjectDO.class); |
| | | updateObj.setTenderStatus(status); // ç¶æä¸å
许åç«¯ä¼ å
¥è¦ç |
| | | tenderProjectMapper.updateById(updateObj); |
| | | // å¢éæ´æ°èµè´¨è¦æ±éä»¶ |
| | | storageAttachmentApi.updateAttachments("file", TENDER_PROJECT_RECORD_TYPE, updateReqVO.getId(), updateReqVO.getBlobIds()); |
| | | LogRecordContext.putVariable("tenderName", project.getTenderName()); |
| | | LogRecordContext.putVariable("oldTenderDesc", project.getTenderDesc()); |
| | | LogRecordContext.putVariable("newTenderDesc", updateReqVO.getTenderDesc()); |
| | |
| | | updateObj.setTenderDesc(updateReqVO.getTenderDesc()); |
| | | updateObj.setQualificationRequirements(updateReqVO.getQualificationRequirements()); |
| | | tenderProjectMapper.updateById(updateObj); |
| | | // å¢éæ´æ°èµè´¨è¦æ±éä»¶ |
| | | storageAttachmentApi.updateAttachments("file", TENDER_PROJECT_RECORD_TYPE, updateReqVO.getId(), updateReqVO.getBlobIds()); |
| | | LogRecordContext.putVariable("tenderName", project.getTenderName()); |
| | | LogRecordContext.putVariable("oldTenderDesc", project.getTenderDesc()); |
| | | LogRecordContext.putVariable("newTenderDesc", updateReqVO.getTenderDesc()); |
| | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void deleteTenderProject(Long id) { |
| | | SrmTenderProjectDO project = validateTenderExists(id); |
| | | if (!TenderStatusEnum.DRAFT.getCode().equals(project.getTenderStatus())) { |
| | |
| | | if (tenderBidMapper.countByTenderProjectId(id) > 0) { |
| | | throw ServiceExceptionUtil.exception(ErrorCodeConstants.TENDER_HAS_BIDS_CANNOT_DELETE); |
| | | } |
| | | // å é¤èµè´¨è¦æ±éä»¶ |
| | | storageAttachmentApi.deleteAttachmentsByRecord(TENDER_PROJECT_RECORD_TYPE, id); |
| | | tenderMaterialMapper.deleteByTenderProjectId(id); |
| | | tenderProjectMapper.deleteById(id); |
| | | } |
| | |
| | | throw ServiceExceptionUtil.exception(ErrorCodeConstants.AWARD_SUPPLIER_NOT_SYNCED); |
| | | } |
| | | |
| | | // ä¾åºåæªåå
¥åèªå¨åå
¥å¹¶éè¿ï¼ä¿è¯éè´è®¢åæµç¨å¯ç¨ |
| | | supplierApplyService.ensureSupplierApproved(supplier.getId()); |
| | | |
| | | // æ¥ææ ç©æ |
| | | List<SrmTenderMaterialDO> materials = tenderMaterialMapper |
| | | .selectListByTenderProjectId(award.getTenderProjectId()); |
| | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @LogRecord(type = LOG_TENDER_TYPE, subType = LOG_TENDER_UPDATE_SUB_TYPE, |
| | | bizNo = "{{#updateReqVO.id}}", success = LOG_TENDER_UPDATE_SUCCESS) |
| | | public void updateTenderProjectPartial(SrmTenderProjectPartialUpdateReqVO updateReqVO) { |
| | |
| | | updateObj.setTenderDesc(updateReqVO.getTenderDesc()); |
| | | updateObj.setQualificationRequirements(updateReqVO.getQualificationRequirements()); |
| | | tenderProjectMapper.updateById(updateObj); |
| | | // å¢éæ´æ°èµè´¨è¦æ±éä»¶ |
| | | storageAttachmentApi.updateAttachments("file", TENDER_PROJECT_RECORD_TYPE, updateReqVO.getId(), updateReqVO.getBlobIds()); |
| | | LogRecordContext.putVariable("tenderName", project.getTenderName()); |
| | | LogRecordContext.putVariable("oldTenderDesc", project.getTenderDesc()); |
| | | LogRecordContext.putVariable("newTenderDesc", updateReqVO.getTenderDesc()); |
| | |
| | | business_license_no VARCHAR(100) DEFAULT NULL COMMENT 'è¥ä¸æ§ç
§ç¼å·', |
| | | tax_no VARCHAR(100) DEFAULT NULL COMMENT 'ç¨å·', |
| | | address VARCHAR(500) DEFAULT NULL COMMENT 'å
¬å¸å°å', |
| | | bank_name VARCHAR(255) DEFAULT NULL COMMENT '弿·é¶è¡', |
| | | bank_account VARCHAR(100) DEFAULT NULL COMMENT 'é¶è¡è´¦å·', |
| | | contact_name VARCHAR(50) DEFAULT NULL COMMENT 'è系人', |
| | | contact_mobile VARCHAR(20) DEFAULT NULL COMMENT 'èç³»çµè¯', |
| | | contact_email VARCHAR(100) DEFAULT NULL COMMENT 'é®ç®±', |
| | |
| | | finance_reviewer_id BIGINT DEFAULT NULL COMMENT 'è´¢å¡å®¡æ ¸äººID', |
| | | finance_review_time DATETIME DEFAULT NULL COMMENT 'è´¢å¡å®¡æ ¸æ¶é´', |
| | | finance_review_opinion VARCHAR(500) DEFAULT NULL COMMENT 'è´¢å¡å®¡æ ¸æè§', |
| | | remark VARCHAR(500) DEFAULT NULL COMMENT '夿³¨', |
| | | creator VARCHAR(64) DEFAULT '' COMMENT 'å建è
', |
| | | create_time DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'å建æ¶é´', |
| | | updater VARCHAR(64) DEFAULT '' COMMENT 'æ´æ°è
', |
| | |
| | | KEY idx_supplier_id (supplier_id), |
| | | KEY idx_purchase_order_id (purchase_order_id) |
| | | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='宿 è®°å½è¡¨'; |
| | | |
| | |
| | | AFTER_SALE_RETURN("aftersales_after_sale_return", "å®åéè´§ç³è¯·"), |
| | | |
| | | // ===== MES ===== |
| | | MES_PD_DOCUMENT("mes_pd_document", "MES è®¾è®¡èµæ"); |
| | | MES_PD_DOCUMENT("mes_pd_document", "MES è®¾è®¡èµæ"), |
| | | |
| | | // ===== SRM ===== |
| | | SRM_SUPPLIER_CERTIFICATE("srm_supplier_certificate", "SRM ä¾åºåèµè´¨è¯ä¹¦"), |
| | | SRM_TENDER_PROJECT("srm_tender_project", "SRM ææ é¡¹ç®"); |
| | | |
| | | private final String type; |
| | | private final String description; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | server: |
| | | port: 48080 |
| | | |
| | | --- #################### æ°æ®åºç¸å
³é
ç½® #################### |
| | | spring: |
| | | autoconfigure: |
| | | # noinspection SpringBootApplicationYaml |
| | | exclude: |
| | | - org.springframework.boot.autoconfigure.quartz.QuartzAutoConfiguration # é»è®¤ local ç¯å¢ï¼ä¸å¼å¯ Quartz çèªå¨é
ç½® |
| | | - org.springframework.ai.vectorstore.qdrant.autoconfigure.QdrantVectorStoreAutoConfiguration # ç¦ç¨ AI 模åç Qdrantï¼æå¨å建 |
| | | - org.springframework.ai.vectorstore.redis.autoconfigure.RedisVectorStoreAutoConfiguration # ç¦ç¨ AI 模åç Redisï¼æå¨å建 |
| | | - org.springframework.ai.vectorstore.milvus.autoconfigure.MilvusVectorStoreAutoConfiguration # ç¦ç¨ AI 模åç Milvusï¼æå¨å建 |
| | | - org.dromara.trans.config.TransServiceConfig # TODO èè¿ï¼easy-trans å
¼å®¹ Spring Boot 4 åç§»é¤ï¼TransServiceConfig å¼ç¨äºå·²ç§»é¤ç RestTemplateBuilderï¼ |
| | | # ç¦ç¨æªé
ç½® API Key çæ¨¡åèªå¨é
ç½®ï¼åªä¿çéä¹åé® Embedding çæå¨é
ç½®ï¼ |
| | | - org.springframework.ai.model.openai.autoconfigure.OpenAiChatAutoConfiguration |
| | | - org.springframework.ai.model.openai.autoconfigure.OpenAiEmbeddingAutoConfiguration |
| | | - org.springframework.ai.model.openai.autoconfigure.OpenAiImageAutoConfiguration |
| | | - org.springframework.ai.model.openai.autoconfigure.OpenAiAudioSpeechAutoConfiguration |
| | | - org.springframework.ai.model.openai.autoconfigure.OpenAiAudioTranscriptionAutoConfiguration |
| | | - org.springframework.ai.model.openai.autoconfigure.OpenAiModerationAutoConfiguration |
| | | - org.springframework.ai.model.deepseek.autoconfigure.DeepSeekChatAutoConfiguration |
| | | - org.springframework.ai.model.anthropic.autoconfigure.AnthropicChatAutoConfiguration |
| | | - org.springframework.ai.model.google.genai.autoconfigure.chat.GoogleGenAiChatAutoConfiguration |
| | | - org.springframework.ai.model.google.genai.autoconfigure.embedding.GoogleGenAiEmbeddingConnectionAutoConfiguration |
| | | - org.springframework.ai.model.google.genai.autoconfigure.embedding.GoogleGenAiTextEmbeddingAutoConfiguration |
| | | - org.springframework.ai.model.ollama.autoconfigure.OllamaApiAutoConfiguration |
| | | - org.springframework.ai.model.ollama.autoconfigure.OllamaChatAutoConfiguration |
| | | - org.springframework.ai.model.ollama.autoconfigure.OllamaEmbeddingAutoConfiguration |
| | | - org.springframework.ai.model.stabilityai.autoconfigure.StabilityAiImageAutoConfiguration |
| | | # æ°æ®æºé
置项 |
| | | datasource: |
| | | druid: # Druid ãçæ§ãç¸å
³çå
¨å±é
ç½® |
| | | web-stat-filter: |
| | | enabled: true |
| | | stat-view-servlet: |
| | | enabled: true |
| | | allow: # 设置ç½ååï¼ä¸å¡«åå
许ææè®¿é® |
| | | url-pattern: /druid/* |
| | | login-username: # æ§å¶å°ç®¡çç¨æ·ååå¯ç |
| | | login-password: |
| | | filter: |
| | | stat: |
| | | enabled: true |
| | | log-slow-sql: true # æ
¢ SQL è®°å½ |
| | | slow-sql-millis: 100 |
| | | merge-sql: true |
| | | wall: |
| | | config: |
| | | multi-statement-allow: true |
| | | dynamic: # 夿°æ®æºé
ç½® |
| | | druid: # Druid ãè¿æ¥æ± ãç¸å
³çå
¨å±é
ç½® |
| | | initial-size: 1 # åå§è¿æ¥æ° |
| | | min-idle: 1 # æå°è¿æ¥æ± æ°é |
| | | max-active: 20 # æå¤§è¿æ¥æ± æ°é |
| | | max-wait: 60000 # é
ç½®è·åè¿æ¥çå¾
è¶
æ¶çæ¶é´ï¼åä½ï¼æ¯«ç§ï¼1 åéï¼ |
| | | time-between-eviction-runs-millis: 60000 # é
ç½®é´éå¤ä¹
æè¿è¡ä¸æ¬¡æ£æµï¼æ£æµéè¦å
³éç空é²è¿æ¥ï¼åä½ï¼æ¯«ç§ï¼1 åéï¼ |
| | | min-evictable-idle-time-millis: 600000 # é
ç½®ä¸ä¸ªè¿æ¥å¨æ± 䏿å°çåçæ¶é´ï¼åä½ï¼æ¯«ç§ï¼10 åéï¼ |
| | | max-evictable-idle-time-millis: 1800000 # é
ç½®ä¸ä¸ªè¿æ¥å¨æ± 䏿大çåçæ¶é´ï¼åä½ï¼æ¯«ç§ï¼30 åéï¼ |
| | | validation-query: SELECT 1 FROM DUAL # é
ç½®æ£æµè¿æ¥æ¯å¦ææ |
| | | test-while-idle: true |
| | | test-on-borrow: false |
| | | test-on-return: false |
| | | pool-prepared-statements: true # æ¯å¦å¼å¯ PreparedStatement ç¼å |
| | | max-pool-prepared-statement-per-connection-size: 20 # æ¯ä¸ªè¿æ¥ç¼åç PreparedStatement æ°é |
| | | primary: master |
| | | datasource: |
| | | master: |
| | | url: jdbc:mysql://172.17.0.1:9002/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X è¿æ¥çç¤ºä¾ |
| | | # url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=true&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true # MySQL Connector/J 5.X è¿æ¥çç¤ºä¾ |
| | | # url: jdbc:postgresql://127.0.0.1:5432/ruoyi-vue-pro # PostgreSQL è¿æ¥çç¤ºä¾ |
| | | # url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle è¿æ¥çç¤ºä¾ |
| | | # url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=ruoyi-vue-pro;SelectMethod=cursor;encrypt=false;rewriteBatchedStatements=true;useUnicode=true;characterEncoding=utf-8 # SQLServer è¿æ¥çç¤ºä¾ |
| | | # url: jdbc:dm://127.0.0.1:5236?schema=RUOYI_VUE_PRO # DM è¿æ¥çç¤ºä¾ |
| | | # url: jdbc:kingbase8://127.0.0.1:54321/test # 人大éä» KingbaseES è¿æ¥çç¤ºä¾ |
| | | # url: jdbc:postgresql://127.0.0.1:5432/postgres # OpenGauss è¿æ¥çç¤ºä¾ |
| | | # url: jdbc:postgresql://127.0.0.1:5866/ruoyi-vue-pro # çé« HighGo è¿æ¥çç¤ºä¾ |
| | | username: root |
| | | password: yzfx@123456.. |
| | | # username: sa # SQL Server è¿æ¥çç¤ºä¾ |
| | | # password: Yudao@2024 # SQL Server è¿æ¥çç¤ºä¾ |
| | | # username: SYSDBA # DM è¿æ¥çç¤ºä¾ |
| | | # password: SYSDBA001 # DM è¿æ¥çç¤ºä¾ |
| | | # username: root # OpenGauss è¿æ¥çç¤ºä¾ |
| | | # password: Yudao@2024 # OpenGauss è¿æ¥çç¤ºä¾ |
| | | # username: root # çé« HighGo è¿æ¥çç¤ºä¾ |
| | | # password: 123456 # çé« HighGo è¿æ¥çç¤ºä¾ |
| | | slave: # 模æä»åºï¼å¯æ ¹æ®èªå·±éè¦ä¿®æ¹ |
| | | lazy: true # å¼å¯æå è½½ï¼ä¿è¯å¯å¨é度 |
| | | url: jdbc:mysql://172.17.0.1:9002/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&rewriteBatchedStatements=true&nullCatalogMeansCurrent=true |
| | | username: root |
| | | password: yzfx@123456 |
| | | # tdengine: # IoT æ°æ®åºï¼éè¦ IoT ç©èç½åå¼å¯å¢ï¼ï¼ |
| | | # lazy: true # å¼å¯æå è½½ï¼ä¿è¯å¯å¨é度 |
| | | # url: jdbc:TAOS-WS://127.0.0.1:6041/ruoyi_vue_pro?varcharAsString=true&enableAutoReconnect=true # åè§ï¼https://t.zsxq.com/qaX9cï¼å¼å¯ TDengine WebSocket èªå¨éè¿ |
| | | # driver-class-name: com.taosdata.jdbc.ws.WebSocketDriver |
| | | # username: root |
| | | # password: taosdata |
| | | # druid: |
| | | # validation-query: SELECT SERVER_STATUS() # TDengine æ°æ®æºçæææ§æ£æ¥ SQL |
| | | |
| | | # Redis é
ç½®ãRedisson é»è®¤çé
置足å¤ä½¿ç¨ï¼ä¸è¬ä¸éè¦è¿è¡è°ä¼ |
| | | data: |
| | | redis: |
| | | host: 172.17.0.1 # å°å |
| | | port: 6379 # ç«¯å£ |
| | | database: 1 # æ°æ®åºç´¢å¼ |
| | | # password: dev # å¯ç ï¼å»ºè®®ç产ç¯å¢å¼å¯ |
| | | |
| | | --- #################### 宿¶ä»»å¡ç¸å
³é
ç½® #################### |
| | | |
| | | # Quartz é
置项ï¼å¯¹åº QuartzProperties é
置类 |
| | | spring: |
| | | quartz: |
| | | auto-startup: true # æ¬å°å¼åç¯å¢ï¼å°½éä¸è¦å¼å¯ Job |
| | | scheduler-name: schedulerName # Scheduler ååãé»è®¤ä¸º schedulerName |
| | | job-store-type: jdbc # Job åå¨å¨ç±»åãé»è®¤ä¸º memory 表示å
åï¼å¯é jdbc ä½¿ç¨æ°æ®åºã |
| | | wait-for-jobs-to-complete-on-shutdown: true # åºç¨å
³éæ¶ï¼æ¯å¦çå¾
宿¶ä»»å¡æ§è¡å®æãé»è®¤ä¸º false ï¼å»ºè®®è®¾ç½®ä¸º true |
| | | properties: # æ·»å Quartz Scheduler éå 屿§ï¼æ´å¤å¯ä»¥ç http://www.quartz-scheduler.org/documentation/2.4.0-SNAPSHOT/configuration.html ææ¡£ |
| | | org: |
| | | quartz: |
| | | # Scheduler ç¸å
³é
ç½® |
| | | scheduler: |
| | | instanceName: schedulerName |
| | | instanceId: AUTO # èªå¨çæ instance ID |
| | | # JobStore ç¸å
³é
ç½® |
| | | jobStore: |
| | | # JobStore å®ç°ç±»ãå¯è§å客ï¼https://blog.csdn.net/weixin_42458219/article/details/122247162 |
| | | class: org.springframework.scheduling.quartz.LocalDataSourceJobStore |
| | | isClustered: true # æ¯éç¾¤æ¨¡å¼ |
| | | clusterCheckinInterval: 15000 # éç¾¤æ£æ¥é¢çï¼åä½ï¼æ¯«ç§ãé»è®¤ä¸º 15000ï¼å³ 15 ç§ |
| | | misfireThreshold: 60000 # misfire éå¼ï¼åä½ï¼æ¯«ç§ã |
| | | # çº¿ç¨æ± ç¸å
³é
ç½® |
| | | threadPool: |
| | | threadCount: 25 # çº¿ç¨æ± 大å°ãé»è®¤ä¸º 10 ã |
| | | threadPriority: 5 # 线ç¨ä¼å
级 |
| | | class: org.quartz.simpl.SimpleThreadPool # çº¿ç¨æ± ç±»å |
| | | jdbc: # ä½¿ç¨ JDBC ç JobStore çæ¶åï¼JDBC çé
ç½® |
| | | initialize-schema: NEVER # æ¯å¦èªå¨ä½¿ç¨ SQL åå§å Quartz è¡¨ç»æãè¿é设置æ never ï¼æä»¬æå¨åå»ºè¡¨ç»æã |
| | | |
| | | --- #################### æ¶æ¯éåç¸å
³ #################### |
| | | |
| | | # rocketmq é
置项ï¼å¯¹åº RocketMQProperties é
置类 |
| | | rocketmq: |
| | | name-server: 127.0.0.1:9876 # RocketMQ Namesrv |
| | | |
| | | spring: |
| | | # RabbitMQ é
置项ï¼å¯¹åº RabbitProperties é
置类 |
| | | rabbitmq: |
| | | host: 127.0.0.1 # RabbitMQ æå¡çå°å |
| | | port: 5672 # RabbitMQ æå¡çç«¯å£ |
| | | username: rabbit # RabbitMQ æå¡çè´¦å· |
| | | password: rabbit # RabbitMQ æå¡çå¯ç |
| | | # Kafka é
置项ï¼å¯¹åº KafkaProperties é
置类 |
| | | kafka: |
| | | bootstrap-servers: 127.0.0.1:9092 # æå® Kafka Broker å°åï¼å¯ä»¥è®¾ç½®å¤ä¸ªï¼ä»¥éå·åé |
| | | |
| | | --- #################### æå¡ä¿éç¸å
³é
ç½® #################### |
| | | |
| | | # Lock4j é
置项 |
| | | lock4j: |
| | | acquire-timeout: 3000 # è·ååå¸å¼éè¶
æ¶æ¶é´ï¼é»è®¤ä¸º 3000 æ¯«ç§ |
| | | expire: 30000 # åå¸å¼éçè¶
æ¶æ¶é´ï¼é»è®¤ä¸º 30000 æ¯«ç§ |
| | | |
| | | --- #################### çæ§ç¸å
³é
ç½® #################### |
| | | |
| | | # Actuator çæ§ç«¯ç¹çé
置项 |
| | | management: |
| | | endpoints: |
| | | web: |
| | | base-path: /actuator # Actuator æä¾ç API æ¥å£çæ ¹ç®å½ãé»è®¤ä¸º /actuator |
| | | exposure: |
| | | include: '*' # éè¦å¼æ¾ç端ç¹ãé»è®¤å¼åªæå¼ health å info 两个端ç¹ãéè¿è®¾ç½® * ï¼å¯ä»¥å¼æ¾ææç«¯ç¹ã |
| | | |
| | | # Spring Boot Admin é
置项 |
| | | spring: |
| | | boot: |
| | | admin: |
| | | # Spring Boot Admin Client 客æ·ç«¯çç¸å
³é
ç½® |
| | | client: |
| | | url: http://127.0.0.1:${server.port}/${spring.boot.admin.context-path} # 设置 Spring Boot Admin Server å°å |
| | | instance: |
| | | service-host-type: IP # 注åå®ä¾æ¶ï¼ä¼å
ä½¿ç¨ IP [IP, HOST_NAME, CANONICAL_HOST_NAME] |
| | | username: admin |
| | | password: admin |
| | | # Spring Boot Admin Server æå¡ç«¯çç¸å
³é
ç½® |
| | | context-path: /admin # é
ç½® Spring |
| | | # å
许åµå
¥ iframe çååï¼æ¯æéé
符ï¼ï¼å®é
é¨ç½²æ¶ï¼å¯ä»¥æ¹ä¸º "'self' [ä½ çå
¬ç½åå]" |
| | | frame-ancestors: "'self' localhost localhost:48080 127.0.0.1 127.0.0.1:48080" |
| | | |
| | | # æ¥å¿æä»¶é
ç½® |
| | | logging: |
| | | file: |
| | | name: logs/${spring.application.name}.log # æ¥å¿æä»¶åï¼ç¸å¯¹äºé¡¹ç®æ ¹ç®å½ |
| | | level: |
| | | # é
ç½®èªå·±åç MyBatis Mapper æå°æ¥å¿ |
| | | cn.iocoder.yudao.module.bpm.dal.mysql: debug |
| | | cn.iocoder.yudao.module.infra.dal.mysql: debug |
| | | cn.iocoder.yudao.module.infra.dal.mysql.logger.ApiErrorLogMapper: INFO # é
ç½® ApiErrorLogMapper çæ¥å¿çº§å«ä¸º infoï¼é¿å
å GlobalExceptionHandler éå¤æå° |
| | | cn.iocoder.yudao.module.infra.dal.mysql.job.JobLogMapper: INFO # é
ç½® JobLogMapper çæ¥å¿çº§å«ä¸º info |
| | | cn.iocoder.yudao.module.infra.dal.mysql.file.FileConfigMapper: INFO # é
ç½® FileConfigMapper çæ¥å¿çº§å«ä¸º info |
| | | cn.iocoder.yudao.module.pay.dal.mysql: debug |
| | | cn.iocoder.yudao.module.pay.dal.mysql.notify.PayNotifyTaskMapper: INFO # é
ç½® PayNotifyTaskMapper çæ¥å¿çº§å«ä¸º info |
| | | cn.iocoder.yudao.module.system.dal.mysql: debug |
| | | cn.iocoder.yudao.module.system.dal.mysql.sms.SmsChannelMapper: INFO # é
ç½® SmsChannelMapper çæ¥å¿çº§å«ä¸º info |
| | | cn.iocoder.yudao.module.tool.dal.mysql: debug |
| | | cn.iocoder.yudao.module.member.dal.mysql: debug |
| | | cn.iocoder.yudao.module.trade.dal.mysql: debug |
| | | cn.iocoder.yudao.module.promotion.dal.mysql: debug |
| | | cn.iocoder.yudao.module.statistics.dal.mysql: debug |
| | | cn.iocoder.yudao.module.crm.dal.mysql: debug |
| | | cn.iocoder.yudao.module.erp.dal.mysql: debug |
| | | cn.iocoder.yudao.module.mes.dal.mysql: debug |
| | | cn.iocoder.yudao.module.wms.dal.mysql: debug |
| | | cn.iocoder.yudao.module.iot.dal.mysql: debug |
| | | cn.iocoder.yudao.module.iot.dal.tdengine: DEBUG |
| | | cn.iocoder.yudao.module.iot.service.rule: debug |
| | | cn.iocoder.yudao.module.ai.dal.mysql: debug |
| | | cn.iocoder.yudao.module.im.dal.mysql: debug |
| | | org.springframework.context.support.PostProcessorRegistrationDelegate: ERROR # TODO èè¿ï¼å
ç¦ç¨ï¼Spring Boot 3.X åå¨é¨åé误ç WARN æç¤º |
| | | |
| | | debug: false |
| | | |
| | | yudao: |
| | | ai: |
| | | vector-store: |
| | | type: milvus # åéåºç±»åï¼milvus |
| | | milvus: |
| | | initialize-schema: true |
| | | database-name: test |
| | | collection-name: knowledge_segment_yzfx |
| | | host: 36.213.180.217 |
| | | port: 19530 |
| | | |
| | | --- #################### 微信å
¬ä¼å·ãå°ç¨åºç¸å
³é
ç½® #################### |
| | | wx: |
| | | mp: # å
¬ä¼å·é
ç½®ï¼å¿
å¡«ï¼ï¼åè§ https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-mp-spring-boot-starter/README.md ææ¡£ |
| | | # app-id: wx041349c6f39b268b # æµè¯å·ï¼çå¸å°§æä¾çï¼ |
| | | # secret: 5abee519483bc9f8cb37ce280e814bd0 |
| | | # app-id: wx5b23ba7a5589ecbb # æµè¯å·ï¼èªå·±çï¼ |
| | | # secret: 2a7b3b20c537e52e74afd395eb85f61f |
| | | app-id: wxf56b1542b9e85f8a # æµè¯å·ï¼Kongdy æä¾çï¼ |
| | | secret: 496379dcef1ba869e9234de8d598cfd3 |
| | | # åå¨é
ç½®ï¼è§£å³ AccessToken çè·¨èç¹çå
񄧮 |
| | | config-storage: |
| | | type: RedisTemplate # éç¨ RedisTemplate æä½ Redisï¼ä¼èªå¨ä» Spring ä¸è·å |
| | | key-prefix: wx # Redis Key çåç¼ |
| | | http-client-type: HttpComponents # éç¨ HttpComponentsï¼HttpClient 5ï¼è¯·æ±å¾®ä¿¡å
¬ä¼å·å¹³å° |
| | | miniapp: # å°ç¨åºé
ç½®ï¼å¿
å¡«ï¼ï¼åè§ https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-miniapp-spring-boot-starter/README.md ææ¡£ |
| | | # appid: wx62056c0d5e8db250 # æµè¯å·ï¼çå¸å°§æä¾çï¼ |
| | | # secret: 333ae72f41552af1e998fe1f54e1584a |
| | | # appid: wx63c280fe3248a3e7 # wenhualiançæ¥å£æµè¯å· |
| | | # secret: 6f270509224a7ae1296bbf1c8cb97aed |
| | | appid: wxc4598c446f8a9cb3 # æµè¯å·ï¼Kongdy æä¾çï¼ |
| | | secret: 4a1a04e07f6a4a0751b39c3064a92c8b |
| | | # appid: wx66186af0759f47c9 # æµè¯å·ï¼puhui æä¾çï¼ |
| | | # secret: 3218bcbd112cbc614c7264ceb20144ac |
| | | config-storage: |
| | | type: RedisTemplate # éç¨ RedisTemplate æä½ Redisï¼ä¼èªå¨ä» Spring ä¸è·å |
| | | key-prefix: wa # Redis Key çåç¼ |
| | | http-client-type: HttpComponents # éç¨ HttpComponentsï¼HttpClient 5ï¼è¯·æ±å¾®ä¿¡å°ç¨åºå¹³å° |
| | | |
| | | --- #################### è¶
级管çåç¸å
³é
ç½® #################### |
| | | |
| | | # è¶
级管çåé
置项ï¼è®¾ç½®å½åé¡¹ç®ææèªå®ä¹çé
ç½® |
| | | yudao: |
| | | captcha: |
| | | enable: false # æ¬å°ç¯å¢ï¼ææ¶å
³éå¾çéªè¯ç ï¼æ¹ä¾¿ç»å½çæ¥å£çæµè¯ï¼ |
| | | security: |
| | | mock-enable: true |
| | | pay: |
| | | order-notify-url: https://yutou.mynatapp.cc/admin-api/pay/notify/order # æ¯ä»æ¸ éçãæ¯ä»ãåè°å°å |
| | | refund-notify-url: https://yutou.mynatapp.cc/admin-api/pay/notify/refund # æ¯ä»æ¸ éçã鿬¾ãåè°å°å |
| | | transfer-notify-url: https://yutou.mynatapp.cc/admin-api/pay/notify/transfer # æ¯ä»æ¸ éçã转账ãåè°å°å |
| | | access-log: # è®¿é®æ¥å¿çé
置项 |
| | | enable: false |
| | | demo: false # å
³éæ¼ç¤ºæ¨¡å¼ |
| | | wxa-code: |
| | | env-version: develop # å°ç¨åºçæ¬: æ£å¼ç为 "release"ï¼ä½éªç为 "trial"ï¼å¼åç为 "develop" |
| | | wxa-subscribe-message: |
| | | miniprogram-state: developer # 跳转å°ç¨åºç±»åï¼å¼åç为 âdeveloperâï¼ä½éªç为 âtrialâä¸ºï¼æ£å¼ç为 âformalâ |
| | | tencent-lbs-key: TVDBZ-TDILD-4ON4B-PFDZA-RNLKH-VVF6E # QQ å°å¾çå¯é¥ https://lbs.qq.com/service/staticV2/staticGuide/staticDoc |
| | | storage: # æä»¶ä¸ä¼ é
ç½® |
| | | path: /data/javaWork/mom/file # æä»¶å卿 ¹ç®å½ |
| | | url-prefix: /admin-api/system/storage-blob # URLè·¯å¾åç¼ |
| | | domain: http://42.63.70.231:9001 # åååç¼ï¼æå®é
ååé
ç½®ï¼ï¼å端é
置好åä¸å¤ªå¯¹ç°å¨æ¯ç´è¿åç«¯ï¼ææè¦åç«¯ç«¯å£ |
| | | expired: 120 # tokenè¿ææ¶é´ï¼åéï¼ |
| | | use-limit: 10 # tokenä½¿ç¨æ¬¡æ°ä¸é |
| | | jwt-secret: abcdefghijklmnopqrstuvwxyz0123456789ABCDEFG # JWTå¯é¥ |
| | | compress: true # æ¯å¦å缩å¾ç |
| | | need-compress-size: 10MB # 触åå缩çæä»¶å¤§å°éå¼ |
| | | compress-quality: 0.5 # å缩质é(0.0-1.0) |
| | | |
| | | justauth: |
| | | enabled: true |
| | | type: |
| | | DINGTALK: # éé |
| | | client-id: dingvrnreaje3yqvzhxg |
| | | client-secret: i8E6iZyDvZj51JIb0tYsYfVQYOks9Cq1lgryEjFRqC79P3iJcrxEwT6Qk2QvLrLI |
| | | ignore-check-redirect-uri: true |
| | | WECHAT_ENTERPRISE: # ä¼ä¸å¾®ä¿¡ |
| | | client-id: wwd411c69a39ad2e54 |
| | | client-secret: 1wTb7hYxnpT2TUbIeHGXGo7T0odav1ic10mLdyyATOw |
| | | agent-id: 1000004 |
| | | ignore-check-redirect-uri: true |
| | | # noinspection SpringBootApplicationYaml |
| | | WECHAT_MINI_PROGRAM: # 微信å°ç¨åº |
| | | client-id: ${wx.miniapp.appid} |
| | | client-secret: ${wx.miniapp.secret} |
| | | ignore-check-redirect-uri: true |
| | | ignore-check-state: true # 微信å°ç¨åºï¼ä¸ä¼ä½¿ç¨å° stateï¼æä»¥ä¸è¿è¡æ ¡éª |
| | | WECHAT_MP: # 微信å
¬ä¼å· |
| | | client-id: ${wx.mp.app-id} |
| | | client-secret: ${wx.mp.secret} |
| | | ignore-check-redirect-uri: true |
| | | ALIPAY: # æ¯ä»å®å°ç¨åº |
| | | client-id: xx |
| | | client-secret: xx |
| | | alipay-public-key: xx |
| | | ignore-check-redirect-uri: true |
| | | ignore-check-state: true |
| | | cache: |
| | | type: REDIS |
| | | prefix: 'social_auth_state:' # ç¼ååç¼ï¼ç®ååªå¯¹ Redis ç¼åçæï¼é»è®¤ JUSTAUTH::STATE:: |
| | | timeout: 24h # è¶
æ¶æ¶é¿ï¼ç®ååªå¯¹ Redis ç¼åçæï¼é»è®¤ 3 åé |