Explorar el Código

重构日志记录

sun-pc hace 7 meses
padre
commit
dbe3f77408

+ 750 - 3
boxcost/api/aadiffupdatetest.http

@@ -9,9 +9,756 @@ POST http://{{host}}/boxcost/diffUpdatePlanTest HTTP/1.1
 Content-Type: application/json
 Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MjI4MjU4OTIsImlkIjoiNjQyYTUyNGY1ZjUwYmM5MDNmOTg2Mzk0Iiwia2V5IjoiYm94Y29zdCIsIm5hbWUiOiLlrZnog5wiLCJvcmlnX2lhdCI6MTcyMjIyMTA5MiwicGFyZW50IjoiNjQyYTUyNGY1ZjUwYmM5MDNmOTg2Mzk0IiwicGhvbmUiOiIxMzQwODU0NzgyMyIsInJvbGUiOiIiLCJzdGF0ZSI6MSwidXNlclR5cGUiOjJ9.Cz7qI3-Vah0io5ZLIFDyVOf8qsqdmbT8WHdprrjbdXw
 
- {
-  "_id": "64780c8de1c4729d48677847"
- }
+
+{
+    "_id": "64a6afe55cca777202101854",
+    "createTime": "2023-07-06T20:13:25.551+08:00",
+    "createUser": "B-CG-N2023-01-034",
+    "name": "福满堂礼盒",
+    "pack": {
+        "_id": "64a6aebd5cca77720210184f",
+        "compCounts": 5,
+        "components": [
+            {
+                "count": 1,
+                "id": "1688873384413",
+                "name": "盖",
+                "stages": [
+                    {
+                        "batchCount": 2,
+                        "batchSizeHeight": 960,
+                        "batchSizeWidth": 640,
+                        "billId": "64aa68025cca777202101890",
+                        "billType": 1,
+                        "category": "纸张",
+                        "deliveryTime": "2023-07-11T12:18:55.618+08:00",
+                        "id": "16888733969996474a69fe1c4729d48677818",
+                        "name": "凤锦PET光银",
+                        "norm": "275g",
+                        "orderCount": 44000,
+                        "orderPrice": 0.903,
+                        "price": 1.47,
+                        "remark": "960幅宽",
+                        "size": "840*640",
+                        "supplierInfo": {
+                            "_id": "6479b10a097738f60ad6d74b",
+                            "address": "四川省德阳市广汉市向阳镇顺江南路8号",
+                            "categorys": [
+                                "纸张"
+                            ],
+                            "createTime": "2023-06-02T17:06:18.818+08:00",
+                            "name": "033 四川华侨凤凰纸业有限公司",
+                            "phone": "13183833987",
+                            "updateTime": "2023-06-02T17:06:18.818+08:00"
+                        },
+                        "type": 1,
+                        "typeId": "6474a69fe1c4729d48677818",
+                        "unit": "平方米"
+                    },
+                    {
+                        "batchCount": 1,
+                        "batchSizeHeight": 480,
+                        "batchSizeWidth": 640,
+                        "billId": "64aa68375cca777202101891",
+                        "billType": 2,
+                        "category": "外协加工",
+                        "deliveryTime": "2023-07-12T12:18:58.286+08:00",
+                        "group": "168887345197263ef03301031634bc6eeb841",
+                        "id": "168887345197264254a55b89f15098e2730cf",
+                        "name": "UV印刷",
+                        "norm": "5C+专",
+                        "orderCount": 87300,
+                        "orderPrice": 0.42,
+                        "price": 0.42,
+                        "remark": "480幅宽 4C+白+专PT2028C",
+                        "size": "420*640",
+                        "supplierInfo": {
+                            "_id": "6375e17b3913c1b5774bad73",
+                            "address": "崇州金鸡路556 印刷部",
+                            "category": "UV印刷",
+                            "categorys": [
+                                "外协加工"
+                            ],
+                            "createTime": "2022-11-17T15:23:39.49+08:00",
+                            "name": "017-泓瑞包装-印刷部",
+                            "phone": "13666221118",
+                            "updateTime": "2023-04-20T14:20:48.459+08:00"
+                        },
+                        "type": 2,
+                        "typeId": "64254a55b89f15098e2730cf",
+                        "unit": "张"
+                    },
+                    {
+                        "batchCount": 1,
+                        "batchSizeHeight": 480,
+                        "batchSizeWidth": 640,
+                        "billId": "64aa68375cca777202101891",
+                        "billType": 2,
+                        "category": "外协加工",
+                        "deliveryTime": "2023-07-12T12:18:58.286+08:00",
+                        "group": "168887345197263ef03301031634bc6eeb841",
+                        "id": "168887345197263ef03301031634bc6eeb841",
+                        "name": "UV印刷",
+                        "norm": "逆向油",
+                        "orderCount": 87300,
+                        "orderPrice": 0.2,
+                        "price": 0.65,
+                        "remark": " 420幅宽",
+                        "size": "420*640",
+                        "supplierInfo": {
+                            "_id": "6375e17b3913c1b5774bad73",
+                            "address": "崇州金鸡路556 印刷部",
+                            "category": "UV印刷",
+                            "categorys": [
+                                "外协加工"
+                            ],
+                            "createTime": "2022-11-17T15:23:39.49+08:00",
+                            "name": "017-泓瑞包装-印刷部",
+                            "phone": "13666221118",
+                            "updateTime": "2023-04-20T14:20:48.459+08:00"
+                        },
+                        "type": 2,
+                        "typeId": "63ef03301031634bc6eeb841",
+                        "unit": "平方米"
+                    },
+                    {
+                        "batchCount": 1,
+                        "batchSizeHeight": 635,
+                        "batchSizeWidth": 465,
+                        "billId": "64aa6af55cca777202101892",
+                        "billType": 1,
+                        "category": "纸张",
+                        "deliveryTime": "2023-07-12T12:19:00.438+08:00",
+                        "id": "16888735966346474a8d2e1c4729d4867782d",
+                        "name": "灰底白凤玺",
+                        "norm": "290g",
+                        "orderCount": 87300,
+                        "orderPrice": 0.274,
+                        "price": 3200,
+                        "remark": "635幅宽",
+                        "size": "635*410",
+                        "supplierInfo": {
+                            "_id": "6479b10a097738f60ad6d74b",
+                            "address": "四川省德阳市广汉市向阳镇顺江南路8号",
+                            "categorys": [
+                                "纸张"
+                            ],
+                            "createTime": "2023-06-02T17:06:18.818+08:00",
+                            "name": "033 四川华侨凤凰纸业有限公司",
+                            "phone": "13183833987",
+                            "updateTime": "2023-06-02T17:06:18.818+08:00"
+                        },
+                        "type": 1,
+                        "typeId": "6474a8d2e1c4729d4867782d",
+                        "unit": "吨"
+                    },
+                    {
+                        "batchCount": 1,
+                        "batchSizeHeight": 635,
+                        "batchSizeWidth": 465,
+                        "billId": "64aa64005cca77720210188d",
+                        "billType": 2,
+                        "category": "外协加工",
+                        "deliveryTime": "2023-07-13T12:19:04.973+08:00",
+                        "id": "16888736431906474aa07e1c4729d4867782e",
+                        "name": "对裱",
+                        "norm": "照样",
+                        "orderCount": 87200,
+                        "orderPrice": 0.1,
+                        "price": 0.1,
+                        "remark": "635幅宽",
+                        "size": "635*410",
+                        "supplierInfo": {
+                            "_id": "63e9b057201413726b012291",
+                            "address": "崇州市宏业大道559号",
+                            "category": "对裱",
+                            "categorys": [
+                                "外协加工"
+                            ],
+                            "createTime": "2023-02-13T11:36:55.969+08:00",
+                            "name": "009-成都卉嘉包装材料(对裱杨玄)",
+                            "phone": "15902817321",
+                            "updateTime": "2023-04-26T11:53:25.596+08:00"
+                        },
+                        "type": 2,
+                        "typeId": "6474aa07e1c4729d4867782e",
+                        "unit": "张"
+                    },
+                    {
+                        "batchCount": 1,
+                        "billId": "64aa35aa5cca777202101872",
+                        "billType": 2,
+                        "category": "外协加工",
+                        "deliveryTime": "2023-07-14T12:19:07.245+08:00",
+                        "id": "16888736431906474ad94e1c4729d48677830",
+                        "name": "压纹(对裱)",
+                        "norm": "照样",
+                        "orderCount": 87150,
+                        "orderPrice": 0.09,
+                        "price": 0.09,
+                        "size": "0",
+                        "supplierInfo": {
+                            "_id": "63edbe951bd7c47e69698533",
+                            "address": "金鸡路556号-压纹 吴宗祥",
+                            "category": "压纹",
+                            "categorys": [
+                                "外协加工"
+                            ],
+                            "createTime": "2023-02-16T13:26:45.004+08:00",
+                            "name": "019-压纹 吴宗祥",
+                            "phone": "18280165844",
+                            "updateTime": "2023-04-19T17:36:07.663+08:00"
+                        },
+                        "type": 2,
+                        "typeId": "6474ad94e1c4729d48677830",
+                        "unit": "张"
+                    },
+                    {
+                        "batchCount": 1,
+                        "billId": "64aa35ae5cca777202101873",
+                        "billType": 2,
+                        "category": "外协加工",
+                        "deliveryTime": "2023-07-15T12:19:09.397+08:00",
+                        "id": "1688873643190643e16f6b00654e2a4d35ed8",
+                        "name": "模切+打包",
+                        "norm": "照样",
+                        "orderCount": 87050,
+                        "orderPrice": 0.05,
+                        "price": 0.05,
+                        "remark": " ",
+                        "size": "0",
+                        "supplierInfo": {
+                            "_id": "642fe64f26be7db05898efd4",
+                            "address": "成都崇州经济开发区力兴之家二期B区1号",
+                            "categorys": [
+                                "外协加工",
+                                "成品采购",
+                                "手工组装"
+                            ],
+                            "createTime": "2023-04-07T17:45:51.117+08:00",
+                            "name": "004-四川宝汇包装印务",
+                            "phone": "18981731822",
+                            "updateTime": "2023-04-26T11:54:58.13+08:00"
+                        },
+                        "type": 2,
+                        "typeId": "643e16f6b00654e2a4d35ed8",
+                        "unit": "张"
+                    }
+                ],
+                "totalPrice": 147948,
+                "uvSize": "0"
+            },
+            {
+                "count": 1,
+                "id": "1688873678549",
+                "name": "底",
+                "stages": [
+                    {
+                        "batchCount": 1,
+                        "batchSizeHeight": 570,
+                        "batchSizeWidth": 710,
+                        "billId": "64aa36765cca777202101874",
+                        "billType": 1,
+                        "category": "纸张",
+                        "deliveryTime": "2023-07-11T12:23:45.358+08:00",
+                        "id": "16888737545906474a8a3e1c4729d4867782b",
+                        "name": "灰底白凤玺",
+                        "norm": "240g",
+                        "orderCount": 88000,
+                        "orderPrice": 0.321,
+                        "price": 3300,
+                        "remark": "570幅宽",
+                        "size": "570*710",
+                        "supplierInfo": {
+                            "_id": "6479b10a097738f60ad6d74b",
+                            "address": "四川省德阳市广汉市向阳镇顺江南路8号",
+                            "categorys": [
+                                "纸张"
+                            ],
+                            "createTime": "2023-06-02T17:06:18.818+08:00",
+                            "name": "033 四川华侨凤凰纸业有限公司",
+                            "phone": "13183833987",
+                            "updateTime": "2023-06-02T17:06:18.818+08:00"
+                        },
+                        "type": 1,
+                        "typeId": "6474a8a3e1c4729d4867782b",
+                        "unit": "吨"
+                    },
+                    {
+                        "batchCount": 1,
+                        "batchSizeHeight": 570,
+                        "batchSizeWidth": 710,
+                        "billId": "64aa36805cca777202101875",
+                        "billType": 2,
+                        "category": "外协加工",
+                        "deliveryTime": "2023-07-12T12:23:48.198+08:00",
+                        "id": "168887379601564094d169299235046049c96",
+                        "name": "普通印刷",
+                        "norm": "4C",
+                        "orderCount": 87300,
+                        "orderPrice": 0.072,
+                        "price": 0.072,
+                        "remark": " 570幅宽",
+                        "size": "570*710",
+                        "supplierInfo": {
+                            "_id": "63846b744d585ba68be6cba1",
+                            "address": "成都崇州经济开发区泗维路333号",
+                            "category": "普通印刷",
+                            "categorys": [
+                                "外协加工"
+                            ],
+                            "createTime": "2022-11-28T16:04:04.791+08:00",
+                            "name": "008-成都宏川印务",
+                            "phone": "13689052627",
+                            "updateTime": "2023-04-26T11:52:56.541+08:00"
+                        },
+                        "type": 2,
+                        "typeId": "64094d169299235046049c96",
+                        "unit": "张"
+                    },
+                    {
+                        "batchCount": 1,
+                        "batchSizeHeight": 570,
+                        "batchSizeWidth": 710,
+                        "billId": "64aa36875cca777202101876",
+                        "billType": 2,
+                        "category": "外协加 工",
+                        "deliveryTime": "2023-07-13T12:23:49.797+08:00",
+                        "id": "168887379601563ef066d1031634bc6eeb844",
+                        "name": "覆膜",
+                        "norm": "哑膜",
+                        "orderCount": 87250,
+                        "orderPrice": 0.198,
+                        "price": 0.49,
+                        "remark": " ",
+                        "size": "570*710",
+                        "supplierInfo": {
+                            "_id": "6388441551ba5b3307f8ab61",
+                            "address": "金鸡路556号 覆膜 熊明军",
+                            "category": "覆膜",
+                            "categorys": [
+                                "外协加工"
+                            ],
+                            "createTime": "2022-12-01T14:05:09.079+08:00",
+                            "name": "018-覆膜 熊明军",
+                            "phone": "13980871668",
+                            "updateTime": "2023-04-19T17:35:50.467+08:00"
+                        },
+                        "type": 2,
+                        "typeId": "63ef066d1031634bc6eeb844",
+                        "unit": "平方米"
+                    },
+                    {
+                        "batchCount": 1,
+                        "batchSizeHeight": 707,
+                        "batchSizeWidth": 559,
+                        "billId": "64aa368d5cca777202101877",
+                        "billType": 1,
+                        "category": "瓦纸",
+                        "deliveryTime": "2023-07-14T12:23:52.149+08:00",
+                        "group": "168887386759164744b674fd5c73264889076",
+                        "id": "168887380765463f325bd1031634bc6eeb8dd",
+                        "name": "E瓦",
+                        "norm": "110+130",
+                        "orderCount": 87250,
+                        "orderPrice": 0.423,
+                        "price": 1.07,
+                        "size": "707*559",
+                        "supplierInfo": {
+                            "_id": "638844d151ba5b3307f8ab68",
+                            "address": "成都市崇州工业区宏业大道北段559号",
+                            "category": "打包",
+                            "categorys": [
+                                "外协加工",
+                                "瓦纸"
+                            ],
+                            "createTime": "2022-12-01T14:08:17.095+08:00",
+                            "name": "015-中印正隆包装材料成都",
+                            "phone": "13699069388",
+                            "updateTime": "2023-04-26T11:53:08.767+08:00"
+                        },
+                        "type": 1,
+                        "typeId": "63f325bd1031634bc6eeb8dd",
+                        "unit": "平方米"
+                    },
+                    {
+                        "batchCount": 1,
+                        "billId": "64aa368d5cca777202101877",
+                        "billType": 1,
+                        "category": "外协加工",
+                        "deliveryTime": "2023-07-14T12:23:52.149+08:00",
+                        "group": "168887386759164744b674fd5c73264889076",
+                        "id": "168887386759164744b674fd5c73264889076",
+                        "name": "裱瓦+模切+打包",
+                        "norm": "照样",
+                        "orderCount": 87150,
+                        "orderPrice": 0.13,
+                        "price": 0.13,
+                        "size": "0",
+                        "supplierInfo": {
+                            "_id": "638844d151ba5b3307f8ab68",
+                            "address": "成都市崇州工业区宏业大道北段559号",
+                            "category": "打包",
+                            "categorys": [
+                                "外协加工",
+                                "瓦纸"
+                            ],
+                            "createTime": "2022-12-01T14:08:17.095+08:00",
+                            "name": "015-中印正隆包装材料成都",
+                            "phone": "13699069388",
+                            "updateTime": "2023-04-26T11:53:08.767+08:00"
+                        },
+                        "type": 2,
+                        "typeId": "64744b674fd5c73264889076",
+                        "unit": "张"
+                    }
+                ],
+                "totalPrice": 100045.35,
+                "uvSize": "0"
+            },
+            {
+                "count": 1,
+                "id": "1688873895080",
+                "name": "内盒",
+                "stages": [
+                    {
+                        "batchCount": 1,
+                        "batchSizeHeight": 810,
+                        "batchSizeWidth": 660,
+                        "billId": "64aa64205cca77720210188e",
+                        "billType": 1,
+                        "category": "纸张",
+                        "deliveryTime": "2023-07-11T12:32:56.641+08:00",
+                        "id": "16888739250706474a7bbe1c4729d48677822",
+                        "name": "凤 玺PET光银",
+                        "norm": "315g",
+                        "orderCount": 88000,
+                        "orderPrice": 0.802,
+                        "price": 1.5,
+                        "size": "810*650",
+                        "supplierInfo": {
+                            "_id": "6479b10a097738f60ad6d74b",
+                            "address": "四川省德阳市广汉市向阳镇顺江南路8号",
+                            "categorys": [
+                                "纸张"
+                            ],
+                            "createTime": "2023-06-02T17:06:18.818+08:00",
+                            "name": "033 四川华侨凤凰纸业有限公司",
+                            "phone": "13183833987",
+                            "updateTime": "2023-06-02T17:06:18.818+08:00"
+                        },
+                        "type": 1,
+                        "typeId": "6474a7bbe1c4729d48677822",
+                        "unit": "平方米"
+                    },
+                    {
+                        "batchCount": 1,
+                        "batchSizeHeight": 810,
+                        "batchSizeWidth": 650,
+                        "billId": "64aa64245cca77720210188f",
+                        "billType": 2,
+                        "category": "外协加工",
+                        "deliveryTime": "2023-07-12T12:32:59.34+08:00",
+                        "group": "168887403401763ef03301031634bc6eeb841",
+                        "id": "168887403401764254a55b89f15098e2730cf",
+                        "name": "UV印刷",
+                        "norm": "5C+专",
+                        "orderCount": 87300,
+                        "orderPrice": 0.42,
+                        "price": 0.42,
+                        "remark": "4C+白+专PT199C ",
+                        "size": "810*650",
+                        "supplierInfo": {
+                            "_id": "6375e17b3913c1b5774bad73",
+                            "address": "崇州金鸡路556 印刷部",
+                            "category": "UV印刷",
+                            "categorys": [
+                                "外协加工"
+                            ],
+                            "createTime": "2022-11-17T15:23:39.49+08:00",
+                            "name": "017-泓瑞包装-印刷部",
+                            "phone": "13666221118",
+                            "updateTime": "2023-04-20T14:20:48.459+08:00"
+                        },
+                        "type": 2,
+                        "typeId": "64254a55b89f15098e2730cf",
+                        "unit": "张"
+                    },
+                    {
+                        "batchCount": 1,
+                        "batchSizeHeight": 810,
+                        "batchSizeWidth": 650,
+                        "billId": "64aa64245cca77720210188f",
+                        "billType": 2,
+                        "category": "外协加工",
+                        "deliveryTime": "2023-07-12T12:32:59.34+08:00",
+                        "group": "168887403401763ef03301031634bc6eeb841",
+                        "id": "168887403401763ef03301031634bc6eeb841",
+                        "name": "UV印刷",
+                        "norm": "逆向油",
+                        "orderCount": 87300,
+                        "orderPrice": 0.342,
+                        "price": 0.65,
+                        "remark": " ",
+                        "size": "810*650",
+                        "supplierInfo": {
+                            "_id": "6375e17b3913c1b5774bad73",
+                            "address": "崇州金鸡路556 印刷部",
+                            "category": "UV印刷",
+                            "categorys": [
+                                "外协加工"
+                            ],
+                            "createTime": "2022-11-17T15:23:39.49+08:00",
+                            "name": "017-泓瑞包装-印刷部",
+                            "phone": "13666221118",
+                            "updateTime": "2023-04-20T14:20:48.459+08:00"
+                        },
+                        "type": 2,
+                        "typeId": "63ef03301031634bc6eeb841",
+                        "unit": "平方米"
+                    },
+                    {
+                        "batchCount": 1,
+                        "billId": "64aa38b45cca77720210187a",
+                        "billType": 2,
+                        "category": "外协加工",
+                        "deliveryTime": "2023-07-13T12:33:01.172+08:00",
+                        "id": "168887403401763ef10f91031634bc6eeb849",
+                        "name": "压纹",
+                        "norm": "按文件要求",
+                        "orderCount": 87250,
+                        "orderPrice": 0.08,
+                        "price": 0.08,
+                        "remark": " ",
+                        "size": "0",
+                        "supplierInfo": {
+                            "_id": "63edbe951bd7c47e69698533",
+                            "address": "金鸡路556号-压纹 吴宗祥",
+                            "category": "压纹",
+                            "categorys": [
+                                "外协加工"
+                            ],
+                            "createTime": "2023-02-16T13:26:45.004+08:00",
+                            "name": "019-压纹 吴宗祥",
+                            "phone": "18280165844",
+                            "updateTime": "2023-04-19T17:36:07.663+08:00"
+                        },
+                        "type": 2,
+                        "typeId": "63ef10f91031634bc6eeb849",
+                        "unit": "张"
+                    },
+                    {
+                        "batchCount": 1,
+                        "billId": "64aa38bb5cca77720210187b",
+                        "billType": 2,
+                        "category": "外协加工",
+                        "deliveryTime": "2023-07-14T12:33:03.101+08:00",
+                        "id": "1688874034017642bd94d26be7db05898efad",
+                        "name": "模切+粘盒+打包",
+                        "norm": "照样",
+                        "orderCount": 87100,
+                        "orderPrice": 0.128,
+                        "price": 0.128,
+                        "size": "0",
+                        "supplierInfo": {
+                            "_id": "642fe64f26be7db05898efd4",
+                            "address": "成都崇州经济开发区力兴之家二期B区1号",
+                            "categorys": [
+                                "外协加工",
+                                "成品采购",
+                                "手工组装"
+                            ],
+                            "createTime": "2023-04-07T17:45:51.117+08:00",
+                            "name": "004-四川宝汇包装印务",
+                            "phone": "18981731822",
+                            "updateTime": "2023-04-26T11:54:58.13+08:00"
+                        },
+                        "type": 2,
+                        "typeId": "642bd94d26be7db05898efad",
+                        "unit": "张"
+                    }
+                ],
+                "totalPrice": 155227.4,
+                "uvSize": "0"
+            },
+            {
+                "count": 1,
+                "id": "1688645537711",
+                "name": "手提袋",
+                "stages": [
+                    {
+                        "batchCount": 1,
+                        "batchSizeHeight": 1050,
+                        "batchSizeWidth": 787,
+                        "billId": "64aa41025cca77720210187e",
+                        "billType": 1,
+                        "category": "纸张",
+                        "deliveryTime": "2023-07-08T20:17:58.652+08:00",
+                        "id": "168864555937763eee85b1031634bc6eeb817",
+                        "name": "太阳白卡",
+                        "norm": "210g",
+                        "orderCount": 88000,
+                        "orderPrice": 0.798,
+                        "price": 4600,
+                        "size": "1050*787",
+                        "supplierInfo": {
+                            "_id": "6384668e4d585ba68be6cb9f",
+                            "address": "成都市温江区公平镇分水村七组",
+                            "category": "纸张类",
+                            "categorys": [
+                                "纸张"
+                            ],
+                            "createTime": "2022-11-28T15:43:10.638+08:00",
+                            "name": "003-成都正大文博纸业",
+                            "phone": "13853360367",
+                            "updateTime": "2023-04-26T11:52:49.268+08:00"
+                        },
+                        "type": 1,
+                        "typeId": "63eee85b1031634bc6eeb817",
+                        "unit": "吨"
+                    },
+                    {
+                        "batchCount": 1,
+                        "batchSizeHeight": 1050,
+                        "batchSizeWidth": 393,
+                        "billId": "64aa410a5cca77720210187f",
+                        "billType": 2,
+                        "category": "外协加工",
+                        "deliveryTime": "2023-07-09T12:39:10+08:00",
+                        "id": "16888775503276419364ffc8951b4c2992195",
+                        "name": "普通印刷",
+                        "norm": "4C+专",
+                        "orderCount": 87343400,
+                        "orderPrice": 0.108,
+                        "price": 0.108,
+                        "size": "0",
+                        "supplierInfo": {
+                            "_id": "63846b744d585ba68be6cba1",
+                            "address": "成都崇州经济开发区泗维路333号",
+                            "category": "普通印刷",
+                            "categorys": [
+                                "外协加工"
+                            ],
+                            "createTime": "2022-11-28T16:04:04.791+08:00",
+                            "name": "008-成都宏川印务",
+                            "phone": "13689052627",
+                            "updateTime": "2023-04-26T11:52:56.541+08:00"
+                        },
+                        "type": 2,
+                        "typeId": "6419364ffc8951b4c2992195",
+                        "unit": "张"
+                    },
+                    {
+                        "batchCount": 1,
+                        "batchSizeHeight": 1050,
+                        "batchSizeWidth": 393,
+                        "billId": "64aa41175cca777202101880",
+                        "billType": 2,
+                        "category": "外协加工",
+                        "deliveryTime": "2023-07-09T12:39:10+08:00",
+                        "id": "168887755032763ef066d1031634bc6eeb844",
+                        "name": "覆膜",
+                        "norm": "哑膜",
+                        "orderCount": 87250,
+                        "orderPrice": 0.202,
+                        "price": 0.49,
+                        "remark": " ",
+                        "size": "0",
+                        "supplierInfo": {
+                            "_id": "6388441551ba5b3307f8ab61",
+                            "address": "金鸡路556号 覆膜 熊明军",
+                            "category": "覆膜",
+                            "categorys": [
+                                "外协加工"
+                            ],
+                            "createTime": "2022-12-01T14:05:09.079+08:00",
+                            "name": "018-覆膜 熊明军",
+                            "phone": "13980871668",
+                            "updateTime": "2023-04-19T17:35:50.467+08:00"
+                        },
+                        "type": 2,
+                        "typeId": "63ef066d1031634bc6eeb844",
+                        "unit": "平方米"
+                    },
+                    {
+                        "batchCount": 1,
+                        "billId": "64aa411a5cca777202101881",
+                        "billType": 2,
+                        "category": "外协加工",
+                        "deliveryTime": "2023-07-09T12:39:24+08:00",
+                        "id": "168887756492364812b4d7306b5a7cef71cdf",
+                        "name": "烫金",
+                        "norm": "照样",
+                        "orderCount": 87200,
+                        "orderPrice": 0.15,
+                        "price": 0.15,
+                        "size": "0",
+                        "supplierInfo": {
+                            "_id": "638eecd4f9039e0980fe5650",
+                            "address": "崇州金鸡路556号 烫金 温学刚",
+                            "category": "烫金",
+                            "categorys": [
+                                "外协加工"
+                            ],
+                            "createTime": "2022-12-06T15:18:44.322+08:00",
+                            "name": "020-烫金 温学刚",
+                            "phone": "13028138020",
+                            "updateTime": "2023-04-19T17:36:26.912+08:00"
+                        },
+                        "type": 2,
+                        "typeId": "64812b4d7306b5a7cef71cdf",
+                        "unit": "张"
+                    },
+                    {
+                        "batchCount": 1,
+                        "billId": "64aa411d5cca777202101882",
+                        "billType": 234354,
+                        "category": "外协加工",
+                        "deliveryTime": "2023-07-09T12:39:34+08:00",
+                        "id": "1688877574862645f013fbfd3ba5057afd488",
+                        "name": "模切+成型+手提绳+打包",
+                        "norm": "照样",
+                        "orderCount": 87100,
+                        "orderPrice": 0.33,
+                        "price": 0.33,
+                        "remark": " ",
+                        "size": "0",
+                        "supplierInfo": {
+                            "_id": "6489aed623be8cc264b06836",
+                            "address": "四川广汉市小汉镇工业园区",
+                            "categorys": [
+                                "外协加工"
+                            ],
+                            "createTime": "2023-06-14T20:13:10.848+08:00",
+                            "name": "039四川广汉龙华印业有限公司",
+                            "phone": "18608380866",
+                            "updateTime": "2023-06-14T20:13:10.848+08:00"
+                        },
+                        "type": 2,
+                        "typeId": "645f013fbfd3ba5057afd488",
+                        "unit": "个"
+                    }
+                ],
+                "totalPrice": 139099.9,
+                "uvSize": "0"
+            },
+            {
+                "count": 1,
+                "id": "1688874105677",
+                "name": "外箱",
+                "uvSize": "0"
+            }
+        ],
+        "createTime": "2023-07-06T20:08:29.093+08:00",
+        "designer": "YHGD-0007",
+        "name": "福满堂礼盒",
+        "updateTime": "2023-07-09T11:41:44.322+08:00"
+    },
+    "status": "process",
+    "total": 87000,
+    "totalPrice": 542320.65,
+    "updteTime": "2024-07-30T15:556:2844.58675+08:00"
+}
 
 ###
 # 工艺单日志记录测试

+ 7 - 0
boxcost/api/bill-produce.go

@@ -81,11 +81,13 @@ func ProduceReview(c *gin.Context, apictx *ApiSession) (interface{}, error) {
 		UpdateTime: time.Now(),
 		SignUsers:  signs,
 	}
+	desc := fmt.Sprintf("【%s】审核了订单", user.Name)
 	// return repo.RepoUpdateSetDoc(apictx.CreateRepoCtx(), repo.CollectionBillProduce, _id, &produce)
 	return repo.RepoUpdateSetDoc1(apictx.CreateRepoCtx(), repo.CollectionBillProduce, _id, &produce, &repo.RecordLogReq{
 		Path:     c.Request.URL.Path,
 		UserId:   apictx.User.ID,
 		TargetId: _id,
+		Desc:     desc,
 	})
 
 }
@@ -201,9 +203,13 @@ func UpdateProduceBill(c *gin.Context, apictx *ApiSession) (interface{}, error)
 
 		}
 	}
+	userId, _ := primitive.ObjectIDFromHex(apictx.User.ID)
+	user, _ := getUserById(apictx, userId)
+	desc := fmt.Sprintf("【%s】更新了订单", user.Name)
 	// 计算结算价格
 	if bill.Status == "complete" {
 		bill.CompleteTime = time.Now()
+		desc = fmt.Sprintf("【%s】完成了订单", user.Name)
 	}
 	if bill.Remark == "" {
 		bill.Remark = " "
@@ -236,6 +242,7 @@ func UpdateProduceBill(c *gin.Context, apictx *ApiSession) (interface{}, error)
 		Path:     c.Request.URL.Path,
 		UserId:   apictx.User.ID,
 		TargetId: bill.Id.Hex(),
+		Desc:     desc,
 	})
 }
 

+ 8 - 0
boxcost/api/bill-product.go

@@ -81,11 +81,14 @@ func ProductReview(c *gin.Context, apictx *ApiSession) (interface{}, error) {
 		UpdateTime: time.Now(),
 		SignUsers:  signs,
 	}
+
+	desc := fmt.Sprintf("【%s】审核了订单", user.Name)
 	// return repo.RepoUpdateSetDoc(apictx.CreateRepoCtx(), repo.CollectionBillProduct, _id, &product)
 	return repo.RepoUpdateSetDoc1(apictx.CreateRepoCtx(), repo.CollectionBillProduct, _id, &product, &repo.RecordLogReq{
 		Path:     c.Request.URL.Path,
 		UserId:   apictx.User.ID,
 		TargetId: _id,
+		Desc:     desc,
 	})
 
 }
@@ -202,8 +205,12 @@ func UpdateProductBill(c *gin.Context, apictx *ApiSession) (interface{}, error)
 		}
 	}
 	// 计算结算价格
+	userId, _ := primitive.ObjectIDFromHex(apictx.User.ID)
+	user, _ := getUserById(apictx, userId)
+	desc := fmt.Sprintf("【%s】更新了订单", user.Name)
 	if bill.Status == "complete" {
 		bill.CompleteTime = time.Now()
+		desc = fmt.Sprintf("【%s】完成了订单", user.Name)
 	}
 
 	if bill.Remark == "" {
@@ -237,6 +244,7 @@ func UpdateProductBill(c *gin.Context, apictx *ApiSession) (interface{}, error)
 		Path:     c.Request.URL.Path,
 		UserId:   apictx.User.ID,
 		TargetId: bill.Id.Hex(),
+		Desc:     desc,
 	})
 
 }

+ 11 - 0
boxcost/api/bill.go

@@ -69,11 +69,15 @@ func BillRecord(c *gin.Context, apictx *ApiSession) (interface{}, error) {
 		return nil, errors.New("订单类型错误!")
 	}
 	update := bson.M{"isRecord": req.Record}
+	userId, _ := primitive.ObjectIDFromHex(apictx.User.ID)
+	user, _ := getUserById(apictx, userId)
+	desc := fmt.Sprintf("【%s】对订单进行了对账", user.Name)
 	// return repo.RepoUpdateSetDoc(apictx.CreateRepoCtx(), collection, req.Id.Hex(), &update)
 	return repo.RepoUpdateSetDoc1(apictx.CreateRepoCtx(), collection, req.Id.Hex(), &update, &repo.RecordLogReq{
 		Path:     c.Request.URL.Path,
 		UserId:   apictx.User.ID,
 		TargetId: req.Id.Hex(),
+		Desc:     desc,
 	})
 
 }
@@ -121,11 +125,13 @@ func PurchaseReview(c *gin.Context, apictx *ApiSession) (interface{}, error) {
 		SignUsers:  signs,
 	}
 
+	desc := fmt.Sprintf("【%s】审核了订单", user.Name)
 	// return repo.RepoUpdateSetDoc(apictx.CreateRepoCtx(), repo.CollectionBillPurchase, _id, &purchase)
 	return repo.RepoUpdateSetDoc1(apictx.CreateRepoCtx(), repo.CollectionBillPurchase, _id, &purchase, &repo.RecordLogReq{
 		Path:     c.Request.URL.Path,
 		UserId:   apictx.User.ID,
 		TargetId: _id,
+		Desc:     desc,
 	})
 
 }
@@ -336,8 +342,12 @@ func UpdateBill(c *gin.Context, apictx *ApiSession) (interface{}, error) {
 
 		}
 	}
+	userId, _ := primitive.ObjectIDFromHex(apictx.User.ID)
+	user, _ := getUserById(apictx, userId)
+	desc := fmt.Sprintf("【%s】更新了订单", user.Name)
 	if bill.Status == "complete" {
 		bill.CompleteTime = time.Now()
+		desc = fmt.Sprintf("【%s】完成了订单", user.Name)
 	}
 	if bill.Remark == "" {
 		bill.Remark = " "
@@ -369,6 +379,7 @@ func UpdateBill(c *gin.Context, apictx *ApiSession) (interface{}, error) {
 		Path:     c.Request.URL.Path,
 		UserId:   apictx.User.ID,
 		TargetId: bill.Id.Hex(),
+		Desc:     desc,
 	})
 }
 

+ 2 - 2
boxcost/api/diff-logs.go

@@ -8,7 +8,7 @@ import (
 	"go.mongodb.org/mongo-driver/bson"
 )
 
-func PrintDiff(c *gin.Context, apictx *ApiSession) (interface{}, error) {
+func BillHistoryList(c *gin.Context, apictx *ApiSession) (interface{}, error) {
 	// id := c.Query("id")
 	// CollectionMaterial      = "material"
 	// CollectionCraft         = "craft"
@@ -41,7 +41,7 @@ func PrintDiff(c *gin.Context, apictx *ApiSession) (interface{}, error) {
 		return errors.New("目标类型不能为空"), nil
 	}
 	return repo.RepoPageSearch(apictx.CreateRepoCtx(), &repo.PageSearchOptions{
-		CollectName: repo.CollectionLogs,
+		CollectName: repo.CollectionBillHistory,
 		Query:       query,
 		Page:        page,
 		Size:        size,

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 8
boxcost/api/index.html


+ 4 - 0
boxcost/api/plan.go

@@ -105,6 +105,7 @@ func PlanAllocBatch(c *gin.Context, apictx *ApiSession) (interface{}, error) {
 	if len(typeBillIds) < 1 {
 		return nil, errors.New("未找到单据信息")
 	}
+	desc := fmt.Sprintf("【%s】发送了订单", user.Name)
 
 	var wg sync.WaitGroup
 	for _, tId := range typeBillIds {
@@ -120,6 +121,7 @@ func PlanAllocBatch(c *gin.Context, apictx *ApiSession) (interface{}, error) {
 				Path:     c.Request.URL.Path,
 				UserId:   apictx.User.ID,
 				TargetId: billId.Hex(),
+				Desc:     desc,
 			})
 		}
 		// 工艺
@@ -130,6 +132,7 @@ func PlanAllocBatch(c *gin.Context, apictx *ApiSession) (interface{}, error) {
 				Path:     c.Request.URL.Path,
 				UserId:   apictx.User.ID,
 				TargetId: billId.Hex(),
+				Desc:     desc,
 			})
 		}
 		// 成品采购
@@ -140,6 +143,7 @@ func PlanAllocBatch(c *gin.Context, apictx *ApiSession) (interface{}, error) {
 				Path:     c.Request.URL.Path,
 				UserId:   apictx.User.ID,
 				TargetId: billId.Hex(),
+				Desc:     desc,
 			})
 		}
 

+ 2 - 2
boxcost/api/router.go

@@ -20,8 +20,8 @@ func RegRouters(svc *Service) {
 	boxcost.GET("/callback", callback)
 	boxcost.POSTJWT("/diffUpdatePlanTest", DiffUpdatePlanTest)
 	boxcost.POSTJWT("/diffUpdateProduceTest", DiffUpdateProduceTest)
-	boxcost.GET("/printDiff", PrintDiff)
-	boxcost.GETJWT("/logs/list", PrintDiff)
+	// boxcost.GET("/printDiff", PrintDiff)
+	boxcost.GETJWT("/bill/history/list", BillHistoryList)
 	boxcost.POSTJWT("/download/plan/track", DownloadPlanTrack)
 
 	PlanTrack(boxcost)

+ 9 - 0
boxcost/api/supplier.go

@@ -167,6 +167,7 @@ func SupplierBillAlloc(c *gin.Context, apictx *ApiSession) (interface{}, error)
 		return nil, errors.New("订单类型错误")
 	}
 
+	desc := fmt.Sprintf("【%s】发送了订单", user.Name)
 	result := &mongo.UpdateResult{}
 	var err error
 	switch billType {
@@ -176,6 +177,7 @@ func SupplierBillAlloc(c *gin.Context, apictx *ApiSession) (interface{}, error)
 			Path:     c.Request.URL.Path,
 			UserId:   apictx.User.ID,
 			TargetId: billId.Hex(),
+			Desc:     desc,
 		})
 	case PRODUCE_BILL_TYPE:
 		// result, err = repo.RepoUpdateSetDoc(apictx.CreateRepoCtx(), repo.CollectionBillProduce, billId.Hex(), &model.ProduceBill{IsSend: true, SendTime: time.Now()})
@@ -183,6 +185,7 @@ func SupplierBillAlloc(c *gin.Context, apictx *ApiSession) (interface{}, error)
 			Path:     c.Request.URL.Path,
 			UserId:   apictx.User.ID,
 			TargetId: billId.Hex(),
+			Desc:     desc,
 		})
 	case PRODUCT_BILL_TYPE:
 		// result, err = repo.RepoUpdateSetDoc(apictx.CreateRepoCtx(), repo.CollectionBillProduct, billId.Hex(), &model.ProductBill{IsSend: true, SendTime: time.Now()})
@@ -190,6 +193,7 @@ func SupplierBillAlloc(c *gin.Context, apictx *ApiSession) (interface{}, error)
 			Path:     c.Request.URL.Path,
 			UserId:   apictx.User.ID,
 			TargetId: billId.Hex(),
+			Desc:     desc,
 		})
 	default:
 		return result, nil
@@ -247,6 +251,8 @@ func SupplierBillAck(c *gin.Context, apictx *ApiSession) (interface{}, error) {
 	if !flagType {
 		return nil, errors.New("订单类型错误")
 	}
+	user, _ := getUserById(apictx, userId)
+	desc := fmt.Sprintf("【%s】接收了订单", user.Name)
 	isAck := true
 	switch billType {
 	case "purchase":
@@ -255,6 +261,7 @@ func SupplierBillAck(c *gin.Context, apictx *ApiSession) (interface{}, error) {
 			Path:     c.Request.URL.Path,
 			UserId:   apictx.User.ID,
 			TargetId: _id,
+			Desc:     desc,
 		})
 	case "produce":
 		// return repo.RepoUpdateSetDoc(apictx.CreateRepoCtx(), repo.CollectionBillProduce, _id, &model.ProduceBill{IsAck: &isAck, AckTime: time.Now()})
@@ -262,6 +269,7 @@ func SupplierBillAck(c *gin.Context, apictx *ApiSession) (interface{}, error) {
 			Path:     c.Request.URL.Path,
 			UserId:   apictx.User.ID,
 			TargetId: _id,
+			Desc:     desc,
 		})
 	case "product":
 		// return repo.RepoUpdateSetDoc(apictx.CreateRepoCtx(), repo.CollectionBillProduct, _id, &model.ProductBill{IsAck: &isAck, AckTime: time.Now()})
@@ -269,6 +277,7 @@ func SupplierBillAck(c *gin.Context, apictx *ApiSession) (interface{}, error) {
 			Path:     c.Request.URL.Path,
 			UserId:   apictx.User.ID,
 			TargetId: _id,
+			Desc:     desc,
 		})
 	default:
 		return nil, errors.New("更新类型错误")

+ 19 - 0
boxcost/db/model/bill-history.go

@@ -0,0 +1,19 @@
+package model
+
+import (
+	"time"
+
+	"go.mongodb.org/mongo-driver/bson/primitive"
+)
+
+type BillHistory struct {
+	Id         primitive.ObjectID `bson:"_id,omitempty" json:"_id"`
+	UserId     string             `bson:"userId,omitempty" json:"userId"`
+	TargetId   string             `bson:"targetId,omitempty" json:"targetId"`
+	Path       string             `bson:"path,omitempty" json:"path"`
+	Collection string             `bson:"collection,omitempty" json:"collection"`
+	// 谁更新了该订单
+	Desc       string    `bson:"desc,omitempty" json:"desc"`
+	Content    string    `bson:"content,omitempty" json:"content"`
+	CreateTime time.Time `bson:"createTime,omitempty" json:"createTime"`
+}

+ 0 - 21
boxcost/db/model/logs.go

@@ -1,21 +0,0 @@
-package model
-
-import (
-	"time"
-
-	"go.mongodb.org/mongo-driver/bson/primitive"
-)
-
-type Logs struct {
-	Id       primitive.ObjectID `bson:"_id,omitempty" json:"_id"`
-	Path     string             `bson:"path,omitempty" json:"path"`
-	UserId   string             `bson:"userId,omitempty" json:"userId"`
-	TargetId string             `bson:"targetId,omitempty" json:"targetId"`
-	// 哪个数据表
-	Collection string      `bson:"collection,omitempty" json:"collection"`
-	Diff       string      `bson:"diff,omitempty" json:"diff"`
-	Changes    []string    `bson:"changes,omitempty" json:"changes"`
-	UserInfo   *UserSmaple `bson:"userInfo,omitempty" json:"userInfo"`
-	CreateTime time.Time   `bson:"createTime,omitempty" json:"createTime"`
-	UpdateTime time.Time   `bson:"updateTime,omitempty" json:"updateTime"`
-}

+ 28 - 178
boxcost/db/repo/repo.go

@@ -2,7 +2,6 @@ package repo
 
 import (
 	"box-cost/db"
-	"box-cost/db/model"
 	dm "box-cost/db/model"
 	"box-cost/log"
 	"context"
@@ -10,7 +9,6 @@ import (
 	"fmt"
 	"time"
 
-	"github.com/sergi/go-diff/diffmatchpatch"
 	"go.mongodb.org/mongo-driver/bson"
 	"go.mongodb.org/mongo-driver/bson/primitive"
 	"go.mongodb.org/mongo-driver/mongo"
@@ -44,6 +42,7 @@ const (
 	CollectionLogs        = "logs"
 	CollectionRequestLogs = "request-logs"
 	CollectionPlanTrack   = "plan-track"
+	CollectionBillHistory = "bill-history"
 )
 
 type Map map[string]interface{}
@@ -141,198 +140,49 @@ type RecordLogReq struct {
 	Path     string
 	UserId   string
 	TargetId string
+	Desc     string
 }
 
 func RepoUpdateSetDoc1(ctx *RepoSession, collectName string, idstr string, model interface{}, recordLogReq *RecordLogReq) (*mongo.UpdateResult, error) {
 
 	colls := ctx.Client.GetCollection(collectName)
 	update := bson.M{"$set": model}
-
-	// 获取模型对应的数据表
-	collection := getModel2Collection(model)
-	fmt.Println(collection)
-
 	uid, _ := primitive.ObjectIDFromHex(idstr)
 
-	// ========================记录更新日志 查询更新前数据============================
-	var oldData Map
+	result, err := colls.UpdateByID(ctx.Ctx, uid, update)
 
-	err := colls.FindOne(ctx.Ctx, bson.M{"_id": uid}).Decode(&oldData)
-	fmt.Println(err)
-
-	// ============================================================================
-	result, err1 := colls.UpdateByID(ctx.Ctx, uid, update)
+	// 更新出错或者没有更新就不进行更新日志记录
+	if err != nil || result.ModifiedCount == 0 {
+		return result, err
+	}
 
-	// ========================记录更新日志 查询更新后数据============================
+	// 计划和订单日志
 	var newData Map
 	colls.FindOne(ctx.Ctx, bson.M{"_id": uid}).Decode(&newData)
-	// ============================================================================
-
-	// ============================记录更新前后差异================================
-	diff, err := diffUpdateData(oldData, newData)
-	if err != nil {
-		fmt.Println(err)
-	}
-	// fmt.Println(diff.Diff)
-	userInfo, err := getUserById(ctx, recordLogReq.UserId)
-	if err != nil {
-		fmt.Println(err)
-	}
-
-	// 记录到数据库中
-	changeLogs := &dm.Logs{
-		Path:       recordLogReq.Path,
-		UserId:     recordLogReq.UserId,
-		TargetId:   recordLogReq.TargetId,
-		Collection: collection,
-		UserInfo:   userInfo,
-		Diff:       diff.Diff,
-		Changes:    diff.Changes,
-		CreateTime: time.Now(),
-		UpdateTime: time.Now(),
-	}
-	RepoAddDoc(ctx, CollectionLogs, changeLogs)
-	// ==========================================================================
-	return result, err1
-
-}
-
-func getUserById(ctx *RepoSession, id string) (*model.UserSmaple, error) {
-	user := &model.UserSmaple{}
-	_, err := RepoSeachDoc(ctx, &DocSearchOptions{
-		Db:          "box-user",
-		CollectName: CollectionUsers,
-		Query:       Map{"_id": id},
-		Project:     []string{"name", "avatar", "city", "loginName", "roles", "phone"},
-	}, user)
-	return user, err
-}
-
-func getModel2Collection(omodel interface{}) string {
-	// 订单
-	if _, ok := omodel.(*dm.PurchaseBill); ok {
-		return CollectionBillPurchase
-	}
-	if _, ok := omodel.(*dm.ProduceBill); ok {
-		return CollectionBillProduce
-	}
-
-	// test
-	// if _, ok := omodel.(*dm.ProduceBill); ok {
-	// 	return "bill-produce_copy1"
-	// }
-
-	if _, ok := omodel.(*dm.ProductBill); ok {
-		return CollectionBillProduct
-	}
-
-	// 计划
-	if _, ok := omodel.(*dm.ProductPlan); ok {
-		return CollectionProductPlan
-	}
-
-	// test
-	// if _, ok := omodel.(*dm.ProductPlan); ok {
-	// 	return "product-plan_copy1"
-	// }
-
-	if _, ok := omodel.(*dm.Product); ok {
-		return CollectionProduct
-	}
-
-	// craft
-	if _, ok := omodel.(*dm.Craft); ok {
-		return CollectionCraft
-	}
-
-	// material
-	if _, ok := omodel.(*dm.Material); ok {
-		return CollectionMaterial
-	}
-
-	// pack
-	if _, ok := omodel.(*dm.Pack); ok {
-		return CollectionPack
-	}
-
-	if _, ok := omodel.(*dm.PlanTrack); ok {
-		return CollectionPlanTrack
-	}
-
-	if _, ok := omodel.(*dm.Signature); ok {
-		return CollectionSignature
-	}
-
-	if _, ok := omodel.(*dm.Supplier); ok {
-		return CollectionSupplier
-	}
-
-	if _, ok := omodel.(*dm.Setting); ok {
-		return "infos"
-	}
-
-	if _, ok := omodel.(*dm.Unit); ok {
-		return "units"
-	}
-
-	if _, ok := omodel.(*dm.Category); ok {
-		return "cates"
-	}
-
-	return ""
-}
-
-type DiffUpdateData struct {
-	Diff    string
-	Changes []string
-}
-
-// 比较差异字符
-func diffUpdateData(oldObj any, newObj any) (*DiffUpdateData, error) {
-	oldObjByte, err := json.Marshal(oldObj)
-	if err != nil {
-		return &DiffUpdateData{}, err
-	}
-	newObjByte, err := json.Marshal(newObj)
+	newObjByte, err := json.Marshal(newData)
 	if err != nil {
-		return &DiffUpdateData{}, err
-	}
-
-	dmp := diffmatchpatch.New()
-	diffs := dmp.DiffMain(string(oldObjByte), string(newObjByte), false)
-	fmt.Println(diffs)
-	if len(diffs) < 1 {
-		return &DiffUpdateData{}, nil
-	}
-
-	diffData := &DiffUpdateData{}
-	for _, diff := range diffs {
-		switch diff.Type {
-		case diffmatchpatch.DiffInsert:
-			diffData.Diff += fmt.Sprintf("<ins>%s</ins>", diff.Text)
-		case diffmatchpatch.DiffDelete:
-			diffData.Diff += fmt.Sprintf("<del>%s</del>", diff.Text)
-		case diffmatchpatch.DiffEqual:
-			diffData.Diff += diff.Text
+		fmt.Println("记录历史失败:", err)
+		return result, err
+	}
+	// 单据历史记录
+	if collectName == CollectionBillPurchase || collectName == CollectionBillProduce || collectName == CollectionBillProduct {
+		history := &dm.BillHistory{
+			UserId:     recordLogReq.UserId,
+			TargetId:   recordLogReq.TargetId,
+			Path:       recordLogReq.Path,
+			Collection: collectName,
+			Desc:       recordLogReq.Desc,
+			Content:    string(newObjByte),
+			CreateTime: time.Now(),
 		}
-	}
-	diffData.Changes = []string{}
-	// dmp.diff
-
-	// 返回差异数据用于日志记录
-	// diff := &DiffUpdateData{}
-	// if len(diffs) > 0 {
-	// 	// return dmp.DiffPrettyText(diffs), nil
-	// 	htmlString := html.UnescapeString(dmp.DiffPrettyHtml(diffs))
-	// 	delInsRegex := regexp.MustCompile(`"([^"]+)":\s*"([^"]*(<del[^>]*>.*?</del>|<ins[^>]*>.*?</ins>)+[^"]*)",`)
-	// 	delInsMatches := delInsRegex.FindAllString(htmlString, -1)
-	// 	diff.Diff = htmlString
-	// 	diff.Changes = delInsMatches
-	// 	return diff, nil
+		RepoAddDoc(ctx, CollectionBillHistory, history)
 
-	// }
+	} else if collectName == CollectionProductPlan {
+		// TODO 计划历史
+		fmt.Println(collectName)
+	}
 
-	return diffData, nil
+	return result, err
 }
 
 func RepoUpdateSeDbDoc(ctx *RepoSession, db string, collectName string, idstr string, model interface{}) (*mongo.UpdateResult, error) {

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio