给零售、销售、采购统计接口增加仓库查询条件
This commit is contained in:
@@ -469,6 +469,7 @@ public class DepotItemController {
|
|||||||
@RequestParam("pageSize") Integer pageSize,
|
@RequestParam("pageSize") Integer pageSize,
|
||||||
@RequestParam("beginTime") String beginTime,
|
@RequestParam("beginTime") String beginTime,
|
||||||
@RequestParam("endTime") String endTime,
|
@RequestParam("endTime") String endTime,
|
||||||
|
@RequestParam(value = "depotId", required = false) Long depotId,
|
||||||
@RequestParam("materialParam") String materialParam,
|
@RequestParam("materialParam") String materialParam,
|
||||||
@RequestParam("mpList") String mpList,
|
@RequestParam("mpList") String mpList,
|
||||||
@RequestParam(value = "roleType", required = false) String roleType,
|
@RequestParam(value = "roleType", required = false) String roleType,
|
||||||
@@ -480,7 +481,7 @@ public class DepotItemController {
|
|||||||
try {
|
try {
|
||||||
String [] creatorArray = depotHeadService.getCreatorArray(roleType);
|
String [] creatorArray = depotHeadService.getCreatorArray(roleType);
|
||||||
String [] organArray = null;
|
String [] organArray = null;
|
||||||
List<Long> depotList = depotService.parseDepotList(null);
|
List<Long> depotList = depotService.parseDepotList(depotId);
|
||||||
Boolean forceFlag = systemConfigService.getForceApprovalFlag();
|
Boolean forceFlag = systemConfigService.getForceApprovalFlag();
|
||||||
List<DepotItemVo4WithInfoEx> dataList = depotItemService.getListWithBugOrSale(StringUtil.toNull(materialParam),
|
List<DepotItemVo4WithInfoEx> dataList = depotItemService.getListWithBugOrSale(StringUtil.toNull(materialParam),
|
||||||
"buy", beginTime, endTime, creatorArray, organArray, depotList, forceFlag, (currentPage-1)*pageSize, pageSize);
|
"buy", beginTime, endTime, creatorArray, organArray, depotList, forceFlag, (currentPage-1)*pageSize, pageSize);
|
||||||
@@ -516,7 +517,11 @@ public class DepotItemController {
|
|||||||
dataArray.add(item);
|
dataArray.add(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
BigDecimal inSumPriceTotal = depotItemService.buyOrSale("入库", "采购", null, beginTime, endTime, creatorArray, organArray, depotList, forceFlag, "price");
|
||||||
|
BigDecimal outSumPriceTotal = depotItemService.buyOrSale("出库", "采购退货", null, beginTime, endTime, creatorArray, organArray, depotList, forceFlag, "price");
|
||||||
|
BigDecimal realityPriceTotal = inSumPriceTotal.subtract(outSumPriceTotal);
|
||||||
map.put("rows", dataArray);
|
map.put("rows", dataArray);
|
||||||
|
map.put("realityPriceTotal", realityPriceTotal);
|
||||||
res.code = 200;
|
res.code = 200;
|
||||||
res.data = map;
|
res.data = map;
|
||||||
} catch(Exception e){
|
} catch(Exception e){
|
||||||
@@ -544,6 +549,7 @@ public class DepotItemController {
|
|||||||
@RequestParam("pageSize") Integer pageSize,
|
@RequestParam("pageSize") Integer pageSize,
|
||||||
@RequestParam("beginTime") String beginTime,
|
@RequestParam("beginTime") String beginTime,
|
||||||
@RequestParam("endTime") String endTime,
|
@RequestParam("endTime") String endTime,
|
||||||
|
@RequestParam(value = "depotId", required = false) Long depotId,
|
||||||
@RequestParam("materialParam") String materialParam,
|
@RequestParam("materialParam") String materialParam,
|
||||||
@RequestParam("mpList") String mpList,
|
@RequestParam("mpList") String mpList,
|
||||||
@RequestParam(value = "roleType", required = false) String roleType,
|
@RequestParam(value = "roleType", required = false) String roleType,
|
||||||
@@ -555,7 +561,7 @@ public class DepotItemController {
|
|||||||
try {
|
try {
|
||||||
String [] creatorArray = depotHeadService.getCreatorArray(roleType);
|
String [] creatorArray = depotHeadService.getCreatorArray(roleType);
|
||||||
String [] organArray = null;
|
String [] organArray = null;
|
||||||
List<Long> depotList = depotService.parseDepotList(null);
|
List<Long> depotList = depotService.parseDepotList(depotId);
|
||||||
Boolean forceFlag = systemConfigService.getForceApprovalFlag();
|
Boolean forceFlag = systemConfigService.getForceApprovalFlag();
|
||||||
List<DepotItemVo4WithInfoEx> dataList = depotItemService.getListWithBugOrSale(StringUtil.toNull(materialParam),
|
List<DepotItemVo4WithInfoEx> dataList = depotItemService.getListWithBugOrSale(StringUtil.toNull(materialParam),
|
||||||
"sale", beginTime, endTime, creatorArray, organArray, depotList, forceFlag, (currentPage-1)*pageSize, pageSize);
|
"sale", beginTime, endTime, creatorArray, organArray, depotList, forceFlag, (currentPage-1)*pageSize, pageSize);
|
||||||
@@ -591,7 +597,11 @@ public class DepotItemController {
|
|||||||
dataArray.add(item);
|
dataArray.add(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
BigDecimal outSumPriceTotal = depotItemService.buyOrSale("出库", "零售", null, beginTime, endTime, creatorArray, organArray, depotList, forceFlag, "price");
|
||||||
|
BigDecimal inSumPriceTotal = depotItemService.buyOrSale("入库", "零售退货", null, beginTime, endTime, creatorArray, organArray, depotList, forceFlag, "price");
|
||||||
|
BigDecimal realityPriceTotal = outSumPriceTotal.subtract(inSumPriceTotal);
|
||||||
map.put("rows", dataArray);
|
map.put("rows", dataArray);
|
||||||
|
map.put("realityPriceTotal", realityPriceTotal);
|
||||||
res.code = 200;
|
res.code = 200;
|
||||||
res.data = map;
|
res.data = map;
|
||||||
} catch(Exception e){
|
} catch(Exception e){
|
||||||
@@ -620,6 +630,7 @@ public class DepotItemController {
|
|||||||
@RequestParam("pageSize") Integer pageSize,
|
@RequestParam("pageSize") Integer pageSize,
|
||||||
@RequestParam("beginTime") String beginTime,
|
@RequestParam("beginTime") String beginTime,
|
||||||
@RequestParam("endTime") String endTime,
|
@RequestParam("endTime") String endTime,
|
||||||
|
@RequestParam(value = "depotId", required = false) Long depotId,
|
||||||
@RequestParam("materialParam") String materialParam,
|
@RequestParam("materialParam") String materialParam,
|
||||||
@RequestParam("mpList") String mpList,
|
@RequestParam("mpList") String mpList,
|
||||||
@RequestParam(value = "roleType", required = false) String roleType,
|
@RequestParam(value = "roleType", required = false) String roleType,
|
||||||
@@ -631,7 +642,7 @@ public class DepotItemController {
|
|||||||
try {
|
try {
|
||||||
String [] creatorArray = depotHeadService.getCreatorArray(roleType);
|
String [] creatorArray = depotHeadService.getCreatorArray(roleType);
|
||||||
String [] organArray = depotHeadService.getOrganArray("销售", "");
|
String [] organArray = depotHeadService.getOrganArray("销售", "");
|
||||||
List<Long> depotList = depotService.parseDepotList(null);
|
List<Long> depotList = depotService.parseDepotList(depotId);
|
||||||
Boolean forceFlag = systemConfigService.getForceApprovalFlag();
|
Boolean forceFlag = systemConfigService.getForceApprovalFlag();
|
||||||
List<DepotItemVo4WithInfoEx> dataList = depotItemService.getListWithBugOrSale(StringUtil.toNull(materialParam),
|
List<DepotItemVo4WithInfoEx> dataList = depotItemService.getListWithBugOrSale(StringUtil.toNull(materialParam),
|
||||||
"sale", beginTime, endTime, creatorArray, organArray, depotList, forceFlag, (currentPage-1)*pageSize, pageSize);
|
"sale", beginTime, endTime, creatorArray, organArray, depotList, forceFlag, (currentPage-1)*pageSize, pageSize);
|
||||||
@@ -667,7 +678,11 @@ public class DepotItemController {
|
|||||||
dataArray.add(item);
|
dataArray.add(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
BigDecimal outSumPriceTotal = depotItemService.buyOrSale("出库", "销售", null, beginTime, endTime, creatorArray, organArray, depotList, forceFlag, "price");
|
||||||
|
BigDecimal inSumPriceTotal = depotItemService.buyOrSale("入库", "销售退货", null, beginTime, endTime, creatorArray, organArray, depotList, forceFlag, "price");
|
||||||
|
BigDecimal realityPriceTotal = outSumPriceTotal.subtract(inSumPriceTotal);
|
||||||
map.put("rows", dataArray);
|
map.put("rows", dataArray);
|
||||||
|
map.put("realityPriceTotal", realityPriceTotal);
|
||||||
res.code = 200;
|
res.code = 200;
|
||||||
res.data = map;
|
res.data = map;
|
||||||
} catch(Exception e){
|
} catch(Exception e){
|
||||||
|
|||||||
@@ -466,9 +466,9 @@
|
|||||||
select ifnull(sum(basic_number),0) as BasicNumber from jsh_depot_item di,jsh_depot_head dh
|
select ifnull(sum(basic_number),0) as BasicNumber from jsh_depot_item di,jsh_depot_head dh
|
||||||
where di.header_id = dh.id
|
where di.header_id = dh.id
|
||||||
and dh.type=#{type} and dh.sub_type=#{subType}
|
and dh.type=#{type} and dh.sub_type=#{subType}
|
||||||
and di.material_id =#{MId}
|
|
||||||
and dh.oper_time >= #{beginTime}
|
and dh.oper_time >= #{beginTime}
|
||||||
and dh.oper_time <= #{endTime}
|
and dh.oper_time <= #{endTime}
|
||||||
|
and di.material_id =#{MId}
|
||||||
<if test="creatorArray != null">
|
<if test="creatorArray != null">
|
||||||
and dh.creator in (
|
and dh.creator in (
|
||||||
<foreach collection="creatorArray" item="creator" separator=",">
|
<foreach collection="creatorArray" item="creator" separator=",">
|
||||||
@@ -500,9 +500,11 @@
|
|||||||
select ifnull(sum(all_price),0) as AllPrice from jsh_depot_item di,jsh_depot_head dh
|
select ifnull(sum(all_price),0) as AllPrice from jsh_depot_item di,jsh_depot_head dh
|
||||||
where di.header_id = dh.id
|
where di.header_id = dh.id
|
||||||
and dh.type=#{type} and dh.sub_type=#{subType}
|
and dh.type=#{type} and dh.sub_type=#{subType}
|
||||||
and di.material_id =#{MId}
|
|
||||||
and dh.oper_time >= #{beginTime}
|
and dh.oper_time >= #{beginTime}
|
||||||
and dh.oper_time <= #{endTime}
|
and dh.oper_time <= #{endTime}
|
||||||
|
<if test="MId != null">
|
||||||
|
and di.material_id =#{MId}
|
||||||
|
</if>
|
||||||
<if test="creatorArray != null">
|
<if test="creatorArray != null">
|
||||||
and dh.creator in (
|
and dh.creator in (
|
||||||
<foreach collection="creatorArray" item="creator" separator=",">
|
<foreach collection="creatorArray" item="creator" separator=",">
|
||||||
|
|||||||
Reference in New Issue
Block a user