退料申请表数据问题修改

This commit is contained in:
liang.chao 2024-04-03 14:08:22 +08:00
parent 5ed70b45b1
commit c96a108d89
5 changed files with 89 additions and 32 deletions

View File

@ -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<BackApplyInfo> list = backReceiveService.getbackReceiveList(record);
return success(list);
if (record.getFlag() == 0) {
List<BackApplyInfo> list = backReceiveService.getbackReceiveList(record);
return success(list);
} else {
startPage();
List<BackApplyInfo> list = backReceiveService.getbackReceiveList(record);
return success(getDataTable(list));
}
} catch (Exception e) {
throw new RuntimeException(e);
}

View File

@ -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;
}

View File

@ -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 )
<if test="keyWord != null and keyWord != ''">
and (bai.code like concat('%', #{keyWord}, '%') or
bagi.agreement_code like concat('%', #{keyWord}, '%'))
</if>
<if test="unitId != null and unitId != ''">
and bui.unit_id = #{unitId}
</if>
<if test="lotId != null and lotId != ''">
and bpl.lot_id = #{lotId}
</if>
<if test="agreementCode != null and agreementCode != ''">
and bagi.agreement_code like concat('%', #{agreementCode}, '%')
</if>
<if test="taskStatus != null and taskStatus != ''">
and tt.task_status = #{taskStatus}
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND bai.back_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59')
</if>
GROUP BY
bai.id,
us.user_name,
bai.phone,
bpl.lot_name,
bui.unit_name,
bagi.plan_start_time
<if test="typeId != null and typeId != ''">
HAVING
FIND_IN_SET(#{typeId}, GROUP_CONCAT(DISTINCT bad.type_id))
</if>
ORDER BY
tt.task_status ASC,
bai.create_time DESC
</select>
<select id="receiveView" resultType="com.bonus.sgzb.app.domain.BackApplyInfo">
@ -620,7 +654,8 @@
bai.task_id as taskId,
tta.agreement_id as agreementId,
mt.type_id as typeId,
mt.type_name typeCode,
mt.type_name as typeCode,
mt.unit_name as unitName,
mt2.type_name AS typeName,
IFNULL(bad.audit_num,0)-(IFNULL(aa.back_num,0)) as num,
mt.manage_type as manageType,

View File

@ -84,11 +84,17 @@ public class BackApplyController extends BaseController {
*/
@ApiOperation(value = "退料申请(查看)")
@GetMapping("/getViewByApply")
public TableDataInfo getViewByApply(BackApplyInfo bean) {
startPage();
bean.setFlag(0);
List<BackApplyInfo> list = backApplyService.getViewByApply(bean);
return getDataTable(list);
public AjaxResult getViewByApply(BackApplyInfo bean) {
if (bean.getViewWeb() == 1) {
bean.setFlag(0);
List<BackApplyInfo> list = backApplyService.getViewByApply(bean);
return AjaxResult.success(list);
} else {
startPage();
bean.setFlag(0);
List<BackApplyInfo> list = backApplyService.getViewByApply(bean);
return AjaxResult.success(getDataTable(list));
}
}
/**

View File

@ -245,4 +245,6 @@ public class BackApplyInfo extends BaseEntity {
/** 前端条件查询所传退料时间 */
private String time;
private int viewWeb;
}