add:库存查询增加合计功能
This commit is contained in:
@@ -54,6 +54,13 @@ public interface MdPbStoragevehicleextMapper extends BaseMapper<MdPbStoragevehic
|
|||||||
*/
|
*/
|
||||||
IPage<JSONObject> queryAllByPage(Page<JSONObject> page, @Param("param") Map whereJson);
|
IPage<JSONObject> queryAllByPage(Page<JSONObject> page, @Param("param") Map whereJson);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计算总计
|
||||||
|
* @param whereJson 入参
|
||||||
|
* @return List<JSONObject>
|
||||||
|
*/
|
||||||
|
JSONObject queryAllSumQty(@Param("param") Map whereJson);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* erp查询库存
|
* erp查询库存
|
||||||
* @param whereJson {
|
* @param whereJson {
|
||||||
|
|||||||
@@ -178,6 +178,46 @@
|
|||||||
ORDER BY ext.insert_time Desc
|
ORDER BY ext.insert_time Desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="queryAllSumQty" resultType="com.alibaba.fastjson.JSONObject">
|
||||||
|
SELECT
|
||||||
|
SUM(ext.canuse_qty) AS canuse_qty,
|
||||||
|
SUM(ext.frozen_qty) AS frozen_qty
|
||||||
|
FROM
|
||||||
|
md_pb_storagevehicleext ext
|
||||||
|
INNER JOIN st_ivt_structattr attr ON ext.storagevehicle_code = attr.storagevehicle_code
|
||||||
|
INNER JOIN md_me_materialbase mater ON mater.material_id = ext.material_id
|
||||||
|
LEFT JOIN md_pb_groupplate late ON late.material_id = ext.material_id and late.pcsn = ext.pcsn and late.storagevehicle_code = ext.storagevehicle_code
|
||||||
|
<where>
|
||||||
|
1 = 1
|
||||||
|
<if test="param.stor_id != null and param.stor_id != ''">
|
||||||
|
AND
|
||||||
|
attr.stor_id = #{param.stor_id}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="param.sect_id != null and param.sect_id != ''">
|
||||||
|
AND
|
||||||
|
attr.sect_id = #{param.sect_id}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="param.struct_code != null and param.struct_code != ''">
|
||||||
|
AND
|
||||||
|
(attr.struct_code LIKE #{param.struct_code} or
|
||||||
|
attr.struct_name LIKE #{param.struct_code} )
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="param.material_code != null and param.material_code != ''">
|
||||||
|
AND
|
||||||
|
(mater.material_code LIKE #{param.material_code} or
|
||||||
|
mater.material_name LIKE #{param.material_code} )
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<if test="param.pcsn != null and param.pcsn != ''">
|
||||||
|
AND
|
||||||
|
ext.pcsn LIKE #{param.pcsn}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="queryCanuseSum" resultType="java.math.BigDecimal">
|
<select id="queryCanuseSum" resultType="java.math.BigDecimal">
|
||||||
SELECT
|
SELECT
|
||||||
SUM(canuse_qty)
|
SUM(canuse_qty)
|
||||||
|
|||||||
@@ -77,8 +77,23 @@ public class MdPbStoragevehicleextServiceImpl extends ServiceImpl<MdPbStorageveh
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPage<JSONObject> queryAll(Map whereJson, PageQuery page) {
|
public IPage<JSONObject> queryAll(Map whereJson, PageQuery page) {
|
||||||
return this.baseMapper.queryAllByPage(new Page<>(page.getPage() + 1, page.getSize()),
|
IPage<JSONObject> jsonObjectIPage = this.baseMapper.queryAllByPage(new Page<>(page.getPage() + 1, page.getSize()),
|
||||||
whereJson);
|
whereJson);
|
||||||
|
List<JSONObject> records = jsonObjectIPage.getRecords();
|
||||||
|
JSONObject jsonSum = this.baseMapper.queryAllSumQty(whereJson);
|
||||||
|
|
||||||
|
if (ObjectUtil.isNotEmpty(jsonSum)) {
|
||||||
|
jsonSum.put("sect_name", "合计");
|
||||||
|
records.add(jsonSum);
|
||||||
|
} else {
|
||||||
|
if (ObjectUtil.isNotEmpty(records)) {
|
||||||
|
JSONObject json = new JSONObject();
|
||||||
|
json.put("sect_name","合计");
|
||||||
|
records.add(json);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
jsonObjectIPage.setRecords(records);
|
||||||
|
return jsonObjectIPage;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ export default {
|
|||||||
},
|
},
|
||||||
toView(vehicle) {
|
toView(vehicle) {
|
||||||
this.showModal = true
|
this.showModal = true
|
||||||
crudStructivt.imageLoad('vehicle').then(response => {
|
crudStructivt.imageLoad(vehicle).then(response => {
|
||||||
const blob = new Blob([response]) // 尽可能根据响应头确定类型
|
const blob = new Blob([response]) // 尽可能根据响应头确定类型
|
||||||
this.imageUrl = URL.createObjectURL(blob)
|
this.imageUrl = URL.createObjectURL(blob)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user