From c96a108d89d9a8be9e88e3ee574deacf3acbcba9 Mon Sep 17 00:00:00 2001 From: "liang.chao" Date: Wed, 3 Apr 2024 14:08:22 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=80=E6=96=99=E7=94=B3=E8=AF=B7=E8=A1=A8?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/controller/BackReceiveController.java | 11 ++- .../bonus/sgzb/app/domain/BackApplyInfo.java | 7 ++ .../mapper/app/BackReceiveMapper.xml | 85 +++++++++++++------ .../controller/BackApplyController.java | 16 ++-- .../sgzb/material/domain/BackApplyInfo.java | 2 + 5 files changed, 89 insertions(+), 32 deletions(-) diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/controller/BackReceiveController.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/controller/BackReceiveController.java index 3b0e47f1..75bb60b3 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/controller/BackReceiveController.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/controller/BackReceiveController.java @@ -13,6 +13,7 @@ import java.util.List; /** * 退料接收-app + * * @author bns_han */ @RestController @@ -32,8 +33,14 @@ public class BackReceiveController extends BaseController { @GetMapping("getbackReceiveList") public AjaxResult getbackReceiveList(BackApplyInfo record) { try { - List list = backReceiveService.getbackReceiveList(record); - return success(list); + if (record.getFlag() == 0) { + List list = backReceiveService.getbackReceiveList(record); + return success(list); + } else { + startPage(); + List list = backReceiveService.getbackReceiveList(record); + return success(getDataTable(list)); + } } catch (Exception e) { throw new RuntimeException(e); } diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/domain/BackApplyInfo.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/domain/BackApplyInfo.java index 092a459d..bd12c738 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/domain/BackApplyInfo.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/domain/BackApplyInfo.java @@ -51,6 +51,10 @@ public class BackApplyInfo { * 类型名称 */ private String typeName; + /** + * 协议号 + */ + private String agreementCode; /** * 规格编号 */ @@ -159,4 +163,7 @@ public class BackApplyInfo { * 退料数量 */ private String preNum; + private String startTime; + private String endTime; + private Integer flag; } diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/app/BackReceiveMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/app/BackReceiveMapper.xml index a9eb290b..dc5f40af 100644 --- a/sgzb-modules/sgzb-base/src/main/resources/mapper/app/BackReceiveMapper.xml +++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/app/BackReceiveMapper.xml @@ -583,35 +583,69 @@ SELECT bai.id, bai.`code`, - bai.task_id as taskId, - bai.back_person as backPerson, + bai.task_id AS taskId, + bai.back_person AS backPerson, bai.phone, bpl.lot_id, - bpl.lot_name as lotName, - bui.unit_id as unitId, - bui.unit_name as unitName, - bai.back_time as backTime, - tt.task_status as taskStatus, - tta.agreement_id as agreementId, - GROUP_CONCAT(DISTINCT bad.type_id) as typeId, - GROUP_CONCAT(mt2.type_name, '') AS typeName + bpl.lot_name AS lotName, + bui.unit_id AS unitId, + bui.unit_name AS unitName, + bai.back_time AS backTime, + bagi.agreement_code AS agreementCode, + tt.task_status AS taskStatus, + sd.`name` AS taskName, + tta.agreement_id AS agreementId, + GROUP_CONCAT( DISTINCT bad.type_id ) AS typeId, + GROUP_CONCAT( mt2.type_name, '' ) AS typeName FROM back_apply_info bai - LEFT JOIN back_apply_details bad on bad.parent_id=bai.id - LEFT JOIN tm_task tt on tt.task_id=bai.task_id - LEFT JOIN tm_task_agreement tta on tta.task_id=tt.task_id - LEFT JOIN bm_agreement_info bagi on bagi.agreement_id=tta.agreement_id - LEFT JOIN bm_project_lot bpl on bpl.lot_id=bagi.project_id - LEFT JOIN bm_unit_info bui on bui.unit_id=bagi.unit_id - LEFT JOIN sys_user us on us.user_id=bai.create_by - LEFT JOIN ma_type mt1 ON mt1.type_id=bad.type_id - LEFT JOIN ma_type mt2 ON mt2.type_id=mt1.parent_id - LEFT JOIN ma_type mt3 ON mt3.type_id=mt2.parent_id - LEFT JOIN ma_type mt4 ON mt4.type_id=mt3.parent_id + LEFT JOIN back_apply_details bad ON bad.parent_id = bai.id + LEFT JOIN tm_task tt ON tt.task_id = bai.task_id + LEFT JOIN tm_task_agreement tta ON tta.task_id = tt.task_id + LEFT JOIN bm_agreement_info bagi ON bagi.agreement_id = tta.agreement_id + LEFT JOIN bm_project_lot bpl ON bpl.lot_id = bagi.project_id + LEFT JOIN bm_unit_info bui ON bui.unit_id = bagi.unit_id + LEFT JOIN sys_user us ON us.user_id = bai.create_by + LEFT JOIN ma_type mt1 ON mt1.type_id = bad.type_id + LEFT JOIN ma_type mt2 ON mt2.type_id = mt1.parent_id + LEFT JOIN ma_type mt3 ON mt3.type_id = mt2.parent_id + LEFT JOIN ma_type mt4 ON mt4.type_id = mt3.parent_id + LEFT JOIN sys_dic sd ON sd.id = tt.task_status WHERE - tt.task_status in (38,39,40) - GROUP BY bai.id, us.user_name, bai.phone, bpl.lot_name, bui.unit_name, bagi.plan_start_time - ORDER BY tt.task_status asc ,bai.create_time desc + tt.task_status IN ( 37, 38, 39, 40 ) + + and (bai.code like concat('%', #{keyWord}, '%') or + bagi.agreement_code like concat('%', #{keyWord}, '%')) + + + and bui.unit_id = #{unitId} + + + and bpl.lot_id = #{lotId} + + + and bagi.agreement_code like concat('%', #{agreementCode}, '%') + + + and tt.task_status = #{taskStatus} + + + AND bai.back_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59') + + GROUP BY + bai.id, + us.user_name, + bai.phone, + bpl.lot_name, + bui.unit_name, + bagi.plan_start_time + + HAVING + FIND_IN_SET(#{typeId}, GROUP_CONCAT(DISTINCT bad.type_id)) + + ORDER BY + tt.task_status ASC, + bai.create_time DESC