优化商品库存流水接口
This commit is contained in:
@@ -77,7 +77,9 @@ public class DepotItemController {
|
|||||||
if (list != null) {
|
if (list != null) {
|
||||||
for (DepotItemVo4DetailByTypeAndMId d: list) {
|
for (DepotItemVo4DetailByTypeAndMId d: list) {
|
||||||
JSONObject item = new JSONObject();
|
JSONObject item = new JSONObject();
|
||||||
item.put("number", d.getNumber()); //商品编号
|
item.put("number", d.getNumber()); //编号
|
||||||
|
item.put("barCode", d.getBarCode()); //条码
|
||||||
|
item.put("materialName", d.getMaterialName()); //名称
|
||||||
String type = d.getType();
|
String type = d.getType();
|
||||||
String subType = d.getSubType();
|
String subType = d.getSubType();
|
||||||
if(("其它").equals(type)) {
|
if(("其它").equals(type)) {
|
||||||
|
|||||||
@@ -7,6 +7,10 @@ public class DepotItemVo4DetailByTypeAndMId {
|
|||||||
|
|
||||||
private String number;
|
private String number;
|
||||||
|
|
||||||
|
private String barCode;
|
||||||
|
|
||||||
|
private String materialName;
|
||||||
|
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
private String subType;
|
private String subType;
|
||||||
@@ -25,6 +29,22 @@ public class DepotItemVo4DetailByTypeAndMId {
|
|||||||
this.number = number;
|
this.number = number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getBarCode() {
|
||||||
|
return barCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBarCode(String barCode) {
|
||||||
|
this.barCode = barCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMaterialName() {
|
||||||
|
return materialName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaterialName(String materialName) {
|
||||||
|
this.materialName = materialName;
|
||||||
|
}
|
||||||
|
|
||||||
public String getType() {
|
public String getType() {
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
|
|
||||||
<resultMap id="DetailByTypeAndMIdResultMap" type="com.jsh.erp.datasource.entities.DepotItemVo4DetailByTypeAndMId">
|
<resultMap id="DetailByTypeAndMIdResultMap" type="com.jsh.erp.datasource.entities.DepotItemVo4DetailByTypeAndMId">
|
||||||
<result column="number" jdbcType="VARCHAR" property="number" />
|
<result column="number" jdbcType="VARCHAR" property="number" />
|
||||||
|
<result column="bar_code" jdbcType="VARCHAR" property="barCode" />
|
||||||
|
<result column="material_name" jdbcType="VARCHAR" property="materialName" />
|
||||||
<result column="type" jdbcType="VARCHAR" property="type" />
|
<result column="type" jdbcType="VARCHAR" property="type" />
|
||||||
<result column="sub_type" jdbcType="VARCHAR" property="subType" />
|
<result column="sub_type" jdbcType="VARCHAR" property="subType" />
|
||||||
<result column="b_num" jdbcType="BIGINT" property="bnum" />
|
<result column="b_num" jdbcType="BIGINT" property="bnum" />
|
||||||
@@ -120,7 +122,7 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="findDetailByTypeAndMaterialIdList" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="DetailByTypeAndMIdResultMap">
|
<select id="findDetailByTypeAndMaterialIdList" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="DetailByTypeAndMIdResultMap">
|
||||||
select dh.number,dh.type,dh.sub_type,
|
select dh.number,me.bar_code,m.name material_name,dh.type,dh.sub_type,
|
||||||
case
|
case
|
||||||
when type='入库' then ifnull(di.basic_number,0)
|
when type='入库' then ifnull(di.basic_number,0)
|
||||||
when type='出库' then 0-di.basic_number
|
when type='出库' then 0-di.basic_number
|
||||||
@@ -135,7 +137,9 @@
|
|||||||
(select name from jsh_depot d where d.id=di.depot_id and ifnull(d.delete_flag,'0') !='1') as depotName,
|
(select name from jsh_depot d where d.id=di.depot_id and ifnull(d.delete_flag,'0') !='1') as depotName,
|
||||||
date_format(dh.oper_time,'%Y-%m-%d %H:%i:%S') as oTime
|
date_format(dh.oper_time,'%Y-%m-%d %H:%i:%S') as oTime
|
||||||
from jsh_depot_head dh
|
from jsh_depot_head dh
|
||||||
INNER JOIN jsh_depot_item di on dh.id=di.header_id and ifnull(di.delete_flag,'0') !='1'
|
left join jsh_depot_item di on dh.id=di.header_id and ifnull(di.delete_flag,'0') !='1'
|
||||||
|
left join jsh_material m on di.material_id=m.id and ifnull(m.delete_flag,'0') !='1'
|
||||||
|
left join jsh_material_extend me on me.id=di.material_extend_id and ifnull(me.delete_Flag,'0') !='1'
|
||||||
where ((dh.type!='其它' and dh.sub_type!='调拨')
|
where ((dh.type!='其它' and dh.sub_type!='调拨')
|
||||||
or (dh.type='其它' and dh.sub_type='组装单')
|
or (dh.type='其它' and dh.sub_type='组装单')
|
||||||
or (dh.type='其它' and dh.sub_type='拆卸单')
|
or (dh.type='其它' and dh.sub_type='拆卸单')
|
||||||
|
|||||||
Reference in New Issue
Block a user