...
|
...
|
@@ -124,15 +124,15 @@ func (d *PrdMoK3cloudDao) SyncDataProductPlan(version int64) error { |
|
|
)
|
|
|
SELECT prd_mo_k3cloud."join_product_plan_id",prd_mo_k3cloud."bill_no",
|
|
|
prd_mo_k3cloud."plan_start_date",
|
|
|
json_build_object('workshopId',"workshop"."workshop_id",'workshopName',prd_mo_k3cloud."work_shop_name"),
|
|
|
json_build_object('workshopId',COALESCE("workshop"."workshop_id",0),'workshopName',prd_mo_k3cloud."work_shop_name"),
|
|
|
prd_mo_k3cloud."material_name", json_build_object('unit',prd_mo_k3cloud."unit_name",'quantity',prd_mo_k3cloud."qty"),
|
|
|
2,prd_mo_k3cloud."description",
|
|
|
json_build_object('productPlanExt',json_build_object('productId',prd_mo_k3cloud."join_product_plan_id",'productCode',prd_mo_k3cloud."material_number",'productName',prd_mo_k3cloud."material_name")),
|
|
|
now(),now()
|
|
|
FROM "manufacture"."prd_mo_k3cloud"
|
|
|
LEFT JOIN "material_k3cloud" ON "prd_mo_k3cloud"."material_number"="material_k3cloud"."number"
|
|
|
LEFT JOIN "workshop" ON "workshop"."workshop_name" = "prd_mo_k3cloud"."work_shop_name"
|
|
|
WHERE prd_mo_k3cloud."data_version"=?
|
|
|
LEFT JOIN "manufacture"."material_k3cloud" ON "prd_mo_k3cloud"."material_id"="material_k3cloud"."material_id"
|
|
|
LEFT JOIN "manufacture"."workshop" ON "workshop"."workshop_name" = "prd_mo_k3cloud"."work_shop_name"
|
|
|
WHERE prd_mo_k3cloud."data_version">=?
|
|
|
ON conflict ("product_plan_id") DO
|
|
|
UPDATE
|
|
|
SET (
|
...
|
...
|
|