Browse Source

托书,成本分配列表

zengtx 1 year ago
parent
commit
12d5e780ca

+ 2 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/costLossReview/controller/SyCostLossReviewController.java

@@ -242,8 +242,8 @@ public class SyCostLossReviewController extends JeecgController<SyOrderData, ISy
        return Result.OK(pageList);
    }
 
-    @AutoLog(value = "成本损失列表-分页成本列表查询")
-    @ApiOperation(value="成本损失列表-分页成本列表查询", notes="成本损失列表-分页成本列表查询")
+    @AutoLog(value = "成本分配列表-分页成本列表查询")
+    @ApiOperation(value="成本分配列表-分页成本列表查询", notes="成本分配列表-分页成本列表查询")
     @GetMapping(value = "/queryCostAllocationPage")
     public Result<?> queryCostAllocationPage(CostAllocationReview sy,
                                          @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,

+ 24 - 20
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/costLossReview/mapper/xml/SyCostLossReviewMapper.xml

@@ -255,7 +255,7 @@
     </select>
 
     <select id="queryCostAllocation" resultType="org.jeecg.modules.documents.costLossReview.entity.CostAllocationReview">
-        select plan_num as planNum,first_approve_date as approvalDate,first_approve_by as approvalMan,create_time as createTime,
+        select a.plan_num as planNum,a.first_approve_date as approvalDate,b.assigned_by as approvalMan,a.create_time as createTime,
         cost_info ->> '$.poStyleNum'  AS poStyleNum,
         cost_info ->> '$.exportSales'  AS exportSales,
         cost_info ->> '$.garmentContractno'  AS garmentContractno,
@@ -284,62 +284,66 @@
         cost_info ->> '$.accidentcnyAmount'  AS accidentcnyAmount,
         cost_info ->> '$.accidentUsdamount'  AS accidentUsdamount,
         cost_info ->> '$.remarks'  AS remarks
-        from sy_cost_json
+        from sy_cost_json a
+        left join sy_cost_approval_history b on a.plan_num = b.plan_no
         where 1=1
         <if test="sy.createTime != null and sy.createTime !=''">
-            AND date_format( create_time, '%Y-%m-%d' )= date_format(#{sy.createTime},'%Y-%m-%d');
+            AND date_format( a.create_time, '%Y-%m-%d' )= date_format(#{sy.createTime},'%Y-%m-%d');
         </if>
         <if test="sy.approvalMan != null and sy.approvalMan !=''">
-            AND first_approve_by LIKE CONCAT('%',#{sy.approvalMan},'%')
+            AND b.assigned_by LIKE CONCAT('%',#{sy.approvalMan},'%')
         </if>
         <if test="sy.approvalDate != null and sy.approvalDate !=''">
-            AND first_approve_date LIKE CONCAT('%',#{sy.approvalDate},'%')
+            AND a.first_approve_date LIKE CONCAT('%',#{sy.approvalDate},'%')
         </if>
         <if test="sy.planNum != null and sy.planNum !=''">
-            AND plan_num LIKE CONCAT('%',#{sy.planNum},'%')
+            AND a.plan_num LIKE CONCAT('%',#{sy.planNum},'%')
         </if>
         <if test="sy.poStyleNum != null and sy.poStyleNum !=''">
-            AND JSON_EXTRACT( cost_info, '$.poStyleNum' ) = #{sy.poStyleNum}
+            AND JSON_EXTRACT( a.cost_info, '$.poStyleNum' ) like CONCAT('%',#{sy.poStyleNum},'%')
         </if>
         <if test="sy.exportSales != null and sy.exportSales !=''">
-            AND JSON_EXTRACT( cost_info, '$.exportSales' ) LIKE CONCAT('%',#{sy.exportSales},'%')
+            AND JSON_EXTRACT( a.cost_info, '$.exportSales' ) LIKE CONCAT('%',#{sy.exportSales},'%')
         </if>
         <if test="sy.garmentContractno != null and sy.garmentContractno !=''">
-            AND JSON_EXTRACT( cost_info, '$.garmentContractno' ) LIKE CONCAT('%',#{sy.garmentContractno},'%')
+            AND JSON_EXTRACT( a.cost_info, '$.garmentContractno' ) LIKE CONCAT('%',#{sy.garmentContractno},'%')
         </if>
         <if test="sy.department != null and sy.department !=''">
-            AND JSON_EXTRACT( cost_info, '$.department' ) = #{sy.department}
+            AND JSON_EXTRACT( a.cost_info, '$.department' ) = #{sy.department}
         </if>
         <if test="sy.customerShortame != null and sy.customerShortame !=''">
-            AND JSON_EXTRACT( cost_info, '$.customerShortame' ) = #{sy.customerShortame}
+            AND JSON_EXTRACT( a.cost_info, '$.customerShortame' ) like CONCAT('%',#{sy.customerShortame},'%')
         </if>
         <if test="sy.processUnit != null and sy.processUnit !=''">
-            AND JSON_EXTRACT( cost_info, '$.processUnit') = #{sy.processUnit}
+            AND JSON_EXTRACT( a.cost_info, '$.processUnit') like CONCAT('%',#{sy.processUnit},'%')
         </if>
         <if test="sy.outdata != null and sy.outdata !=''">
-            AND JSON_EXTRACT( cost_info, '$.outdata' ) = CONVERT(#{sy.outdata},UNSIGNED)
+            AND JSON_EXTRACT( a.cost_info, '$.outdata' ) = CONVERT(#{sy.outdata},UNSIGNED)
         </if>
 
         <if test="sy.planQuantity != null and sy.planQuantity !=''">
-            AND JSON_EXTRACT( cost_info, '$.planQuantity' ) = #{sy.planQuantity}
+            AND JSON_EXTRACT( a.cost_info, '$.planQuantity' ) = #{sy.planQuantity}
         </if>
         <if test="sy.actualShipquantity != null and sy.actualShipquantity !=''">
-            AND JSON_EXTRACT( cost_info, '$.actualShipquantity' ) = #{sy.actualShipquantity}
+            AND JSON_EXTRACT( a.cost_info, '$.actualShipquantity' ) = #{sy.actualShipquantity}
         </if>
         <if test="sy.shortseveral != null and sy.shortseveral !=''">
-            AND JSON_EXTRACT( cost_info, '$.shortseveral' ) = #{sy.shortseveral}
+            AND JSON_EXTRACT( a.cost_info, '$.shortseveral' ) = #{sy.shortseveral}
         </if>
         <if test="sy.shortvalue != null and sy.shortvalue !=''">
-            AND JSON_EXTRACT( cost_info, '$.shortvalue') = #{sy.shortvalue}
+            AND JSON_EXTRACT( a.cost_info, '$.shortvalue') = #{sy.shortvalue}
         </if>
         <if test="sy.fabricshortcost != null and sy.fabricshortcost !=''">
-            AND JSON_EXTRACT( cost_info, '$.fabricshortcost' ) = #{sy.fabricshortcost}
+            AND JSON_EXTRACT( a.cost_info, '$.fabricshortcost' ) = #{sy.fabricshortcost}
         </if>
         <if test="sy.preparedBy != null and sy.preparedBy !=''">
-            AND JSON_EXTRACT( cost_info, '$.preparedBy' ) LIKE CONCAT('%',#{sy.preparedBy},'%')
+            AND JSON_EXTRACT( a.cost_info, '$.preparedBy' ) LIKE CONCAT('%',#{sy.preparedBy},'%')
         </if>
         <if test='sy.rejectDate != null and sy.rejectDate !="" and sy.rejectDate == "1"'>
-            AND JSON_EXTRACT( cost_info, '$.rejectDate' ) is not null
+            AND b.stuta = '驳回'
+        </if>
+        <if test="sy.status != null and sy.status !=''">
+            AND a.status = #{sy.status}
         </if>
 
     </select>

+ 32 - 11
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/syShippingOrder/mapper/xml/SyShippingOrderMapper.xml

@@ -101,21 +101,40 @@ d.terms_of_deliveryvalue as termsOfDeliveryvalue
 
 <!--    成衣详情-->
     <select id="queryItem" resultType="org.jeecg.modules.documents.syShippingOrder.entity.SyShippingOrderItem">
-SELECT GROUP_CONCAT(a.id) as id, a.sy_shipping_order_item_id as syShippingOrderItemId, a.english_name as englishName, a.style_number as styleNumber, a.smail_po as smailPo,a.create_by as createBy,
-sum(a.number) as number,
-case when a.ready_fabric != '成衣' then sum(a.box_number) else a.box_number end as boxNumber,a.pk_org as pkOrg,
-case when a.ready_fabric != '成衣' then sum(a.gross_weight) else a.gross_weight end as grossWeight,
-case when a.ready_fabric != '成衣' then sum(a.net_weight) else a.net_weight end as netWeight,
-case when a.ready_fabric != '成衣' then a.volume else a.volume end as volume,round(sum(a.total_price),2) as totalPrice,
-a.distribution_point as distributionPoint, a.container_code as containerCode, a.container_number as containerNumber, a.unit_price as unitPrice, a.pre_shipment_date as preShipmentDate,
-a.salesman, a.operating_department as operatingDepartment, a.purchase_outsourcing_order_no as purOrSubOrder, a.outsourcing_factory_for_procurement as outsourcingFactoryForProcurement,
- a.memo, a.sort, a.ready_fabric as readyFabric, GROUP_CONCAT(DISTINCT a.tailoring_fabric_id) as tailoringFabricId, GROUP_CONCAT(a.tailoring_fabric_item_id) as tailoringFabricItemId,a.client_abbreviation as clientAbbreviation
- FROM sy_shipping_order_item a
+        select t.id, t.syShippingOrderItemId, t.englishName, t.styleNumber, t.smailPo,t.createBy,
+        sum(t.number) as number,
+        sum(t.boxNumber) as boxNumber,t.pkOrg,
+        sum(t.grossWeight) as grossWeight,
+        sum(t.netWeight) as netWeight,
+        sum(t.totalPrice) as totalPrice,
+        sum(t.volume) as volume,
+        t.distributionPoint, t.containerCode, t.containerNumber, t.unitPrice, t.preShipmentDate,
+        t.salesman, t.operatingDepartment, t.purOrSubOrder,
+        t.outsourcingFactoryForProcurement,
+        t.memo, t.sort, t.readyFabric, t.tailoringFabricId, t.tailoringFabricItemId,t.clientAbbreviation,
+        t.supplier
+        from (
+        SELECT GROUP_CONCAT(a.id) as id, a.sy_shipping_order_item_id as syShippingOrderItemId, a.english_name as
+        englishName, a.style_number as styleNumber, a.smail_po as smailPo,a.create_by as createBy,
+        sum(a.number) as number,a.supplier,
+        case when a.ready_fabric != '成衣' then sum(a.box_number) else a.box_number end as boxNumber,a.pk_org as pkOrg,
+        case when a.ready_fabric != '成衣' then sum(a.gross_weight) else a.gross_weight end as grossWeight,
+        case when a.ready_fabric != '成衣' then sum(a.net_weight) else a.net_weight end as netWeight,
+        case when a.ready_fabric != '成衣' then a.volume else a.volume end as volume,round(sum(a.total_price),2) as
+        totalPrice,
+        a.distribution_point as distributionPoint, a.container_code as containerCode, a.container_number as
+        containerNumber, a.unit_price as unitPrice, a.pre_shipment_date as preShipmentDate,
+        a.salesman, a.operating_department as operatingDepartment, a.purchase_outsourcing_order_no as purOrSubOrder,
+        a.outsourcing_factory_for_procurement as outsourcingFactoryForProcurement,
+        a.memo, a.sort, a.ready_fabric as readyFabric, GROUP_CONCAT(DISTINCT a.tailoring_fabric_id) as
+        tailoringFabricId, GROUP_CONCAT(a.tailoring_fabric_item_id) as tailoringFabricItemId,a.client_abbreviation as
+        clientAbbreviation
+        FROM sy_shipping_order_item a
         <if test='type == "成衣"'>
             left join sy_packing_list_tailoring_item c
             on a.tailoring_fabric_item_id = c.id
             where a.del_flag = 0 and sy_shipping_order_item_id = #{id}
-            group by a.tailoring_fabric_id order by a.supplier,a.salesman,a.style_number,a.smail_po,a.unit_price
+            group by c.group_id) t group by t.styleNumber,t.smailPo,t.unitPrice order by t.supplier,t.salesman,t.styleNumber,t.smailPo,t.unitPrice
         </if>
         <if test='type == "面辅料"'>
             left join sy_packing_list_fabric_item c
@@ -124,8 +143,10 @@ a.salesman, a.operating_department as operatingDepartment, a.purchase_outsourcin
             on a.elements_Id = b.id
             where a.del_flag = 0 and sy_shipping_order_item_id = #{id}
             group by b.hs_code,b.declaration_name,b.declaration_unit order by style_number,smail_po desc
+            ) t
         </if>
 
+
     </select>