工程领退台账数据穿透
This commit is contained in:
parent
e002d90778
commit
e198b4d002
|
|
@ -3,12 +3,14 @@ package com.bonus.aqgqj.business.backstage.controller.inventory;
|
|||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import com.bonus.aqgqj.business.backstage.entity.OutPlanVo;
|
||||
import com.bonus.aqgqj.business.backstage.entity.ProjectMaterialLedger;
|
||||
import com.bonus.aqgqj.business.backstage.entity.inventory.InventoryCountVo;
|
||||
import com.bonus.aqgqj.business.backstage.entity.inventory.ProjectMaterialLedgers;
|
||||
import com.bonus.aqgqj.business.backstage.service.inventory.InventoryCountService;
|
||||
import com.bonus.aqgqj.manager.annotation.DecryptAndVerify;
|
||||
import com.bonus.aqgqj.manager.core.entity.EncryptedReq;
|
||||
import com.bonus.aqgqj.manager.webResult.AjaxResult;
|
||||
import com.bonus.aqgqj.manager.webResult.ServerResponse;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
|
@ -51,6 +53,32 @@ public class InventoryCountController {
|
|||
return new PageInfo<>(projectMaterialLedgers);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取工程利库详情
|
||||
* @param dto query参数
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("getLkDetailsByProAndModel")
|
||||
@DecryptAndVerify(decryptedClass = ProjectMaterialLedger.class)
|
||||
public PageInfo<ProjectMaterialLedger> getLkDetailsByProAndModel(EncryptedReq<ProjectMaterialLedger> dto) {
|
||||
PageHelper.startPage(dto.getPageNum(), dto.getPageSize());
|
||||
List<ProjectMaterialLedger> list = service.getLkDetailsByProAndModel(dto.getData());
|
||||
return new PageInfo<>(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取工程退料详情
|
||||
* @param dto query参数
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("getBackDetailsByProAndModel")
|
||||
@DecryptAndVerify(decryptedClass = ProjectMaterialLedger.class)
|
||||
public PageInfo<ProjectMaterialLedger> getBackDetailsByProAndModel(EncryptedReq<ProjectMaterialLedger> dto) {
|
||||
PageHelper.startPage(dto.getPageNum(), dto.getPageSize());
|
||||
List<ProjectMaterialLedger> list = service.getBackDetailsByProAndModel(dto.getData());
|
||||
return new PageInfo<>(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询安全工器具台账
|
||||
* @param dto query参数
|
||||
|
|
|
|||
|
|
@ -111,4 +111,13 @@ public class ProjectMaterialLedger {
|
|||
* 计划数量
|
||||
*/
|
||||
private String applyNum;
|
||||
|
||||
/**
|
||||
* 计划编码
|
||||
*/
|
||||
private String planCode;
|
||||
|
||||
private Integer queryType;
|
||||
|
||||
private String backTime;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,4 +50,18 @@ public interface InventoryCountMapper {
|
|||
* @return List<ProjectMaterialLedgers>
|
||||
*/
|
||||
List<ProjectMaterialLedgers> getSafetyToolsLedger(ProjectMaterialLedgers data);
|
||||
|
||||
/**
|
||||
* 利库详情
|
||||
* @param data
|
||||
* @return List<ProjectMaterialLedger>
|
||||
*/
|
||||
List<ProjectMaterialLedger> getLkDetailsByProAndModel(ProjectMaterialLedger data);
|
||||
|
||||
/**
|
||||
* 退料详情
|
||||
* @param data
|
||||
* @return List<ProjectMaterialLedger>
|
||||
*/
|
||||
List<ProjectMaterialLedger> getBackDetailsByProAndModel(ProjectMaterialLedger data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.bonus.aqgqj.business.backstage.entity.ProjectMaterialLedger;
|
|||
import com.bonus.aqgqj.business.backstage.entity.inventory.InventoryApplyVo;
|
||||
import com.bonus.aqgqj.business.backstage.entity.inventory.InventoryCountVo;
|
||||
import com.bonus.aqgqj.business.backstage.entity.inventory.ProjectMaterialLedgers;
|
||||
import com.bonus.aqgqj.manager.webResult.AjaxResult;
|
||||
import com.bonus.aqgqj.manager.webResult.ServerResponse;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -46,4 +47,18 @@ public interface InventoryCountService {
|
|||
* @return List<ProjectMaterialLedger>
|
||||
*/
|
||||
List<ProjectMaterialLedgers> getSafetyToolsLedger(ProjectMaterialLedgers data);
|
||||
|
||||
/**
|
||||
* 获取工程利库详情
|
||||
* @param data
|
||||
* @return AjaxResult
|
||||
*/
|
||||
List<ProjectMaterialLedger> getLkDetailsByProAndModel(ProjectMaterialLedger data);
|
||||
|
||||
/**
|
||||
* 获取工程退货详情
|
||||
* @param data
|
||||
* @return AjaxResult
|
||||
*/
|
||||
List<ProjectMaterialLedger> getBackDetailsByProAndModel(ProjectMaterialLedger data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.bonus.aqgqj.business.backstage.entity.ProjectMaterialLedger;
|
|||
import com.bonus.aqgqj.business.backstage.entity.inventory.InventoryCountVo;
|
||||
import com.bonus.aqgqj.business.backstage.entity.inventory.ProjectMaterialLedgers;
|
||||
import com.bonus.aqgqj.business.backstage.mapper.inventory.InventoryCountMapper;
|
||||
import com.bonus.aqgqj.manager.webResult.AjaxResult;
|
||||
import com.bonus.aqgqj.manager.webResult.ServerResponse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -96,6 +97,26 @@ public class InventoryCountServiceImpl implements InventoryCountService{
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProjectMaterialLedger> getLkDetailsByProAndModel(ProjectMaterialLedger data) {
|
||||
try {
|
||||
return mapper.getLkDetailsByProAndModel(data);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(),e);
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProjectMaterialLedger> getBackDetailsByProAndModel(ProjectMaterialLedger data) {
|
||||
try {
|
||||
return mapper.getBackDetailsByProAndModel(data);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(),e);
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算差缺量
|
||||
* @param outRecord 出库数量
|
||||
|
|
|
|||
|
|
@ -208,4 +208,68 @@
|
|||
)
|
||||
</if>
|
||||
</select>
|
||||
<select id="getLkDetailsByProAndModel"
|
||||
resultType="com.bonus.aqgqj.business.backstage.entity.ProjectMaterialLedger">
|
||||
SELECT
|
||||
spa.id,
|
||||
p.ID AS proId,
|
||||
o.model_id AS modelId,
|
||||
spa.`code` as planCode,
|
||||
p.`NAME` AS proName,
|
||||
o.type,
|
||||
o.`name`,
|
||||
o.model,
|
||||
o.unit,
|
||||
IFNULL(o.cg_num,0) AS totalCg,
|
||||
IFNULL(o.lk_num,0) AS totalLk,
|
||||
IFNULL(o.cg_num,0)+IFNULL(o.lk_num,0) as totalCk
|
||||
FROM st_plan_out_details o
|
||||
JOIN st_plan_out spo ON o.out_id = spo.id
|
||||
LEFT JOIN st_plan_apply spa on spa.id = spo.apply_id
|
||||
JOIN bm_project p ON spo.pro_id = p.ID
|
||||
WHERE p.ID = #{proId}
|
||||
AND o.model_id = #{modelId}
|
||||
<if test="queryType != null">
|
||||
<if test="queryType == 1">
|
||||
and IFNULL(o.lk_num,0)>0
|
||||
</if>
|
||||
<if test="queryType == 2">
|
||||
and(
|
||||
IFNULL(o.lk_num,0)>0 or IFNULL(o.cg_num,0)>0
|
||||
)
|
||||
</if>
|
||||
</if>
|
||||
<if test="planCode != null and planCode != ''">
|
||||
and spa.`code` LIKE CONCAT('%',#{planCode},'%')
|
||||
</if>
|
||||
</select>
|
||||
<select id="getBackDetailsByProAndModel"
|
||||
resultType="com.bonus.aqgqj.business.backstage.entity.ProjectMaterialLedger">
|
||||
SELECT
|
||||
p.ID AS proId,
|
||||
p.`NAME` AS proName,
|
||||
smt3.`name` AS type,
|
||||
smt2.`name` AS `name`,
|
||||
smt.`name` AS model,
|
||||
smt.unit_name as unit,
|
||||
b.model_id AS modelId,
|
||||
LEFT(sba.back_time,10) as backTime,
|
||||
sba.`code` as planCode,
|
||||
b.num AS totalBack
|
||||
FROM
|
||||
st_back_details b
|
||||
LEFT JOIN st_ma_type smt ON smt.id = b.model_id
|
||||
AND smt.`level` = '3'
|
||||
LEFT JOIN st_ma_type smt2 ON smt2.id = smt.parent_id
|
||||
LEFT JOIN st_ma_type smt3 ON smt3.id = smt2.parent_id
|
||||
JOIN st_back_apply sba ON b.apply_id = sba.id
|
||||
JOIN bm_project p ON sba.project_id = p.ID
|
||||
WHERE
|
||||
p.ID = #{proId}
|
||||
AND b.model_id = #{modelId}
|
||||
and sba.`status`='1'
|
||||
<if test="planCode != null and planCode != ''">
|
||||
and sba.`code` LIKE CONCAT('%',#{planCode},'%')
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue