diff --git a/erp_web/pages/reports/buy_in_report.html b/erp_web/pages/reports/buy_in_report.html
index 1a076d25..fe695f39 100644
--- a/erp_web/pages/reports/buy_in_report.html
+++ b/erp_web/pages/reports/buy_in_report.html
@@ -29,6 +29,18 @@
class="txt Wdate width-160" style="height: 30px;border: 1px solid #95B8E7;border-radius:5px;"/>
+
查询
打印
@@ -43,6 +55,7 @@
$(function () {
var thisDate = getNowFormatMonth(); //当前月份
$("#searchMonth").val(thisDate);
+ initMaterialNameList();
initMProperty(); //初始化商品属性
initTableData();
ininPager();
@@ -50,6 +63,21 @@
print();
});
+ //初始化商品名称模糊匹配
+ function initMaterialNameList() {
+ $('#mName').combobox({
+ method:"get",
+ url: "/material/getMaterialNameList",
+ valueField: 'value',
+ textField: 'text',
+ hasDownArrow: false,
+ filter: function(q, row){
+ var opts = $(this).combobox('options');
+ return row[opts.textField].indexOf(q) >-1;
+ }
+ });
+ }
+
//初始化商品属性
function initMProperty() {
$.ajax({
@@ -184,64 +212,20 @@
function showDetails(pageNo, pageSize) {
$.ajax({
- type: "get",
- url: "/depotHead/findByMonth",
+ type: "post",
+ url: "/depotItem/buyIn",
dataType: "json",
data: ({
- monthTime: $("#searchMonth").val()
+ currentPage: pageNo,
+ pageSize: pageSize,
+ monthTime: $("#searchMonth").val(),
+ name: $("#mName").combobox("getValue"),
+ model: $("#mModel").textbox("getValue"),
+ mpList: mPropertyList
}),
success: function (res) {
- if(res && res.code === 200 && res.data) {
- var HeadIds = res.data.HeadIds;
- if (HeadIds) {
- //获取排序后的产品ID
- $.ajax({
- type: "get",
- url: "/material/findByOrder",
- dataType: "json",
- success: function (res) {
- if(res && res.code === 200 && res.data) {
- var mIds = res.data.mIds;
- if (mIds) {
- $.ajax({
- type: "post",
- url: "/depotItem/buyIn",
- dataType: "json",
- data: ({
- currentPage: pageNo,
- pageSize: pageSize,
- monthTime: $("#searchMonth").val(),
- headIds: HeadIds,
- materialIds: mIds,
- mpList: mPropertyList
- }),
- success: function (res) {
- if (res && res.code === 200 && res.data) {
- $("#tableData").datagrid('loadData', res.data);
- }
- },
- //此处添加错误处理
- error: function () {
- $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
- return;
- }
- });
- }
- else {
- $.messager.alert('查询提示', '本月无数据!', 'error');
- }
- }
- },
- //此处添加错误处理
- error: function () {
- $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
- return;
- }
- });
- }
- else {
- $.messager.alert('查询提示', '本月无数据!', 'error');
- }
+ if (res && res.code === 200 && res.data) {
+ $("#tableData").datagrid('loadData', res.data);
}
},
//此处添加错误处理
diff --git a/erp_web/pages/reports/in_out_stock_report.html b/erp_web/pages/reports/in_out_stock_report.html
index 468e2e31..e0f925e2 100644
--- a/erp_web/pages/reports/in_out_stock_report.html
+++ b/erp_web/pages/reports/in_out_stock_report.html
@@ -316,112 +316,69 @@
});
function showEachDetails(pageNo, pageSize) {
- $.ajax({
- type: "get",
- url: "/depotHead/findByMonth",
- dataType: "json",
- data: ({
- monthTime: $("#searchMonth").val()
- }),
- success: function (res) {
- if(res && res.code === 200 && res.data) {
- var HeadIds = res.data.HeadIds;
- if (HeadIds) {
- //获取排序后的产品ID
- $.ajax({
- type: "get",
- url: "/material/findByOrder",
- dataType: "json",
- data: ({
- name: $("#mName").combobox("getValue"),
- model: $("#mModel").textbox("getValue")
- }),
- success: function (res) {
- if(res && res.code === 200 && res.data) {
- var mIds = res.data.mIds;
- if (mIds) {
- if (pageSize === 3000) {
- window.location.href = "/depotItem/exportExcel?browserType=" + getOs() + "¤tPage=" + pageNo + "&pageSize=" + pageSize + "&depotId=" + $.trim($("#searchProjectId").val()) + "&monthTime=" + $("#searchMonth").val() + "&headIds=" + HeadIds + "&materialIds=" + mIds;
- }
- else {
- $.ajax({
- type: "post",
- url: "/depotItem/findByAll",
- dataType: "json",
- data: ({
- currentPage: pageNo,
- pageSize: pageSize,
- depotId: $.trim($("#searchProjectId").val()),
- monthTime: $("#searchMonth").val(),
- headIds: HeadIds,
- materialIds: mIds,
- mpList: mPropertyList
- }),
- success: function (res) {
- if(res && res.code === 200) {
- $("#tableData").datagrid('loadData', res.data);
- }
- },
- //此处添加错误处理
- error: function () {
- $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
- return;
- }
- });
-
- //总金额
- $.ajax({
- type: "post",
- url: "/depotItem/totalCountMoney",
- dataType: "json",
- data: ({
- depotId: $.trim($("#searchProjectId").val()),
- monthTime: $("#searchMonth").val(),
- headIds: HeadIds,
- materialIds: mIds
- }),
- success: function (res) {
- if(res && res.code === 200) {
- if(res.data && res.data.totalCount) {
- var count = res.data.totalCount.toString();
- if (count.lastIndexOf('.') > -1) {
- count = count.substring(0, count.lastIndexOf('.') + 3);
- }
- $("#tablePanel .total-count").text("本月合计金额:" + count + "元");//本月合计金额
- }
- }
- },
- //此处添加错误处理
- error: function () {
- $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
- return;
- }
- });
- }
- }
- else {
- $.messager.alert('查询提示', '本月无数据!', 'error');
- }
- }
- },
- //此处添加错误处理
- error: function () {
- $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
- return;
- }
- });
- }
- else {
- $.messager.alert('查询提示', '本月无数据!', 'error');
+ if (pageSize === 3000) {
+ window.location.href = "/depotItem/exportExcel?browserType=" + getOs()
+ + "¤tPage=" + pageNo + "&pageSize=" + pageSize
+ + "&depotId=" + $.trim($("#searchProjectId").val())
+ + "&monthTime=" + $("#searchMonth").val()
+ + "&name=" + $("#mName").combobox("getValue")
+ + "&model=" + $("#mModel").textbox("getValue");
+ }
+ else {
+ $.ajax({
+ type: "post",
+ url: "/depotItem/findByAll",
+ dataType: "json",
+ data: ({
+ currentPage: pageNo,
+ pageSize: pageSize,
+ depotId: $.trim($("#searchProjectId").val()),
+ monthTime: $("#searchMonth").val(),
+ name: $("#mName").combobox("getValue"),
+ model: $("#mModel").textbox("getValue"),
+ mpList: mPropertyList
+ }),
+ success: function (res) {
+ if(res && res.code === 200) {
+ $("#tableData").datagrid('loadData', res.data);
}
+ },
+ //此处添加错误处理
+ error: function () {
+ $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
+ return;
}
- },
- //此处添加错误处理
- error: function () {
- $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
- return;
- }
- });
+ });
+
+ //总金额
+ $.ajax({
+ type: "post",
+ url: "/depotItem/totalCountMoney",
+ dataType: "json",
+ data: ({
+ depotId: $.trim($("#searchProjectId").val()),
+ monthTime: $("#searchMonth").val(),
+ name: $("#mName").combobox("getValue"),
+ model: $("#mModel").textbox("getValue")
+ }),
+ success: function (res) {
+ if(res && res.code === 200) {
+ if(res.data && res.data.totalCount) {
+ var count = res.data.totalCount.toString();
+ if (count.lastIndexOf('.') > -1) {
+ count = count.substring(0, count.lastIndexOf('.') + 3);
+ }
+ $("#tablePanel .total-count").text("本月合计金额:" + count + "元");//本月合计金额
+ }
+ }
+ },
+ //此处添加错误处理
+ error: function () {
+ $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
+ return;
+ }
+ });
+ }
}
//报表打印
diff --git a/erp_web/pages/reports/sale_out_report.html b/erp_web/pages/reports/sale_out_report.html
index d21e4d1e..8e93b707 100644
--- a/erp_web/pages/reports/sale_out_report.html
+++ b/erp_web/pages/reports/sale_out_report.html
@@ -29,6 +29,18 @@
class="txt Wdate width-160" style="height: 30px;border: 1px solid #95B8E7;border-radius:5px;"/>
+
查询
打印
@@ -47,6 +59,7 @@
$("#searchTable .tip").css("padding-left", "15px").css("color", "red");
var thisDate = getNowFormatMonth(); //当前月份
$("#searchMonth").val(thisDate);
+ initMaterialNameList();
initMProperty(); //初始化商品属性
initTableData();
ininPager();
@@ -54,6 +67,21 @@
print();
});
+ //初始化商品名称模糊匹配
+ function initMaterialNameList() {
+ $('#mName').combobox({
+ method:"get",
+ url: "/material/getMaterialNameList",
+ valueField: 'value',
+ textField: 'text',
+ hasDownArrow: false,
+ filter: function(q, row){
+ var opts = $(this).combobox('options');
+ return row[opts.textField].indexOf(q) >-1;
+ }
+ });
+ }
+
//初始化商品属性
function initMProperty() {
$.ajax({
@@ -191,72 +219,28 @@
function showDetails(pageNo, pageSize) {
$.ajax({
- type: "get",
- url: "/depotHead/findByMonth",
+ type: "post",
+ url: "/depotItem/saleOut",
dataType: "json",
data: ({
- monthTime: $("#searchMonth").val()
+ currentPage: pageNo,
+ pageSize: pageSize,
+ monthTime: $("#searchMonth").val(),
+ name: $("#mName").combobox("getValue"),
+ model: $("#mModel").textbox("getValue"),
+ mpList: mPropertyList
}),
success: function (res) {
- if(res && res.code === 200 && res.data) {
- var HeadIds = res.data.HeadIds;
- if (HeadIds) {
- //获取排序后的产品ID
- $.ajax({
- type: "get",
- url: "/material/findByOrder",
- dataType: "json",
- success: function (res) {
- if (res && res.code === 200 && res.data) {
- var mIds = res.data.mIds;
- if (mIds) {
- $.ajax({
- type: "post",
- url: "/depotItem/saleOut",
- dataType: "json",
- data: ({
- currentPage: pageNo,
- pageSize: pageSize,
- monthTime: $("#searchMonth").val(),
- headIds: HeadIds,
- materialIds: mIds,
- mpList: mPropertyList
- }),
- success: function (res) {
- if (res && res.code === 200) {
- $("#tableData").datagrid('loadData', res.data);
- }
- var total = 0;
- res.data.rows.forEach(function(value, index, array){
- //执行某些操作
- total += value.OutInSumPrice;
- })
-
- $(".first-total").text(total); //当前总余额
- },
- //此处添加错误处理
- error: function () {
- $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
- return;
- }
- });
- }
- else {
- $.messager.alert('查询提示', '本月无数据!', 'error');
- }
- }
- },
- //此处添加错误处理
- error: function () {
- $.messager.alert('查询提示', '查询数据后台异常,请稍后再试!', 'error');
- return;
- }
- });
- }
- else {
- $.messager.alert('查询提示', '本月无数据!', 'error');
- }
+ if (res && res.code === 200) {
+ $("#tableData").datagrid('loadData', res.data);
}
+ var total = 0;
+ res.data.rows.forEach(function(value, index, array){
+ //执行某些操作
+ total += value.OutInSumPrice;
+ })
+
+ $(".first-total").text(total); //当前总余额
},
//此处添加错误处理
error: function () {
diff --git a/src/main/java/com/jsh/erp/controller/DepotHeadController.java b/src/main/java/com/jsh/erp/controller/DepotHeadController.java
index 4f4e04e5..1430b3cd 100644
--- a/src/main/java/com/jsh/erp/controller/DepotHeadController.java
+++ b/src/main/java/com/jsh/erp/controller/DepotHeadController.java
@@ -109,39 +109,6 @@ public class DepotHeadController {
return res;
}
- /**
- * 查找单据_根据月份(报表)
- * @param monthTime
- * @param request
- * @return
- */
- @GetMapping(value = "/findByMonth")
- public BaseResponseInfo findByMonth(@RequestParam("monthTime") String monthTime,
- HttpServletRequest request)throws Exception {
- BaseResponseInfo res = new BaseResponseInfo();
- Map
map = new HashMap();
- try {
- List dataList = depotHeadService.findByMonth(monthTime);
- String headId = "";
- if (null != dataList) {
- for (DepotHead depotHead : dataList) {
- headId = headId + depotHead.getId() + ",";
- }
- }
- if (headId != "") {
- headId = headId.substring(0, headId.lastIndexOf(","));
- }
- map.put("HeadIds", headId);
- res.code = 200;
- res.data = map;
- } catch(Exception e){
- e.printStackTrace();
- res.code = 500;
- res.data = "获取数据失败";
- }
- return res;
- }
-
/**
* 入库出库明细接口
* @param currentPage
diff --git a/src/main/java/com/jsh/erp/controller/DepotItemController.java b/src/main/java/com/jsh/erp/controller/DepotItemController.java
index 412280b5..cf0328aa 100644
--- a/src/main/java/com/jsh/erp/controller/DepotItemController.java
+++ b/src/main/java/com/jsh/erp/controller/DepotItemController.java
@@ -22,6 +22,7 @@ import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.math.BigDecimal;
import java.text.DecimalFormat;
+import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
@@ -258,17 +259,20 @@ public class DepotItemController {
@RequestParam("pageSize") Integer pageSize,
@RequestParam("depotId") Long depotId,
@RequestParam("monthTime") String monthTime,
- @RequestParam("headIds") String headIds,
- @RequestParam("materialIds") String materialIds,
+ @RequestParam("name") String name,
+ @RequestParam("model") String model,
@RequestParam("mpList") String mpList,
HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
Map map = new HashMap();
Long tenantId = Long.parseLong(request.getSession().getAttribute("tenantId").toString());
+ String timeA = monthTime+"-01 00:00:00";
+ String timeB = Tools.lastDayOfMonth(monthTime)+" 23:59:59";
try {
- List dataList = depotItemService.findByAll(headIds, materialIds, (currentPage-1)*pageSize, pageSize);
+ List dataList = depotItemService.findByAll(StringUtil.toNull(name), StringUtil.toNull(model),
+ timeB,(currentPage-1)*pageSize, pageSize);
String[] mpArr = mpList.split(",");
- int total = depotItemService.findByAllCount(headIds, materialIds);
+ int total = depotItemService.findByAllCount(StringUtil.toNull(name), timeB, StringUtil.toNull(model));
map.put("total", total);
//存放数据json数组
JSONArray dataArray = new JSONArray();
@@ -281,8 +285,6 @@ public class DepotItemController {
for (DepotItemVo4WithInfoEx diEx : dataList) {
JSONObject item = new JSONObject();
Long mId = diEx.getMId();
- String timeA = monthTime+"-01 00:00:00";
- String timeB = monthTime+"-31 23:59:59";
item.put("MaterialName", diEx.getMName());
item.put("MaterialModel", diEx.getMModel());
//扩展信息
@@ -294,7 +296,7 @@ public class DepotItemController {
item.put("prevSum", depotItemService.getStockByParam(depotId,mId,null,timeA,tenantId));
item.put("InSum", depotItemService.getInNumByParam(depotId,mId,timeA,timeB,tenantId));
item.put("OutSum", depotItemService.getOutNumByParam(depotId,mId,timeA,timeB,tenantId));
- BigDecimal thisSum = depotItemService.getStockByParam(depotId,mId,null,null,tenantId);
+ BigDecimal thisSum = depotItemService.getStockByParam(depotId,mId,null,timeB,tenantId);
item.put("thisSum", thisSum);
for(MaterialExtend me:meList) {
if(me.getMaterialId().longValue() == diEx.getMId().longValue()) {
@@ -336,12 +338,15 @@ public class DepotItemController {
@RequestParam("pageSize") Integer pageSize,
@RequestParam("depotId") Long depotId,
@RequestParam("monthTime") String monthTime,
- @RequestParam("headIds") String headIds,
- @RequestParam("materialIds") String materialIds,
- HttpServletRequest request, HttpServletResponse response) {
+ @RequestParam("name") String name,
+ @RequestParam("model") String model,
+ HttpServletRequest request, HttpServletResponse response) throws Exception {
Long tenantId = Long.parseLong(request.getSession().getAttribute("tenantId").toString());
+ String timeA = monthTime+"-01 00:00:00";
+ String timeB = Tools.lastDayOfMonth(monthTime)+" 23:59:59";
try {
- List dataList = depotItemService.findByAll(headIds, materialIds, (currentPage-1)*pageSize, pageSize);
+ List dataList = depotItemService.findByAll(StringUtil.toNull(name), StringUtil.toNull(model),
+ timeB, (currentPage-1)*pageSize, pageSize);
//存放数据json数组
String[] names = {"名称", "型号", "单位", "单价", "上月结存数量", "入库数量", "出库数量", "本月结存数量", "结存金额"};
String title = "库存报表";
@@ -349,8 +354,6 @@ public class DepotItemController {
if (null != dataList) {
for (DepotItemVo4WithInfoEx diEx : dataList) {
Long mId = diEx.getMId();
- String timeA = monthTime+"-01 00:00:00";
- String timeB = monthTime+"-31 23:59:59";
String[] objs = new String[9];
objs[0] = diEx.getMName().toString();
objs[1] = diEx.getMModel().toString();
@@ -359,7 +362,7 @@ public class DepotItemController {
objs[4] = depotItemService.getStockByParam(depotId,mId,null,timeA,tenantId).toString();
objs[5] = depotItemService.getInNumByParam(depotId,mId,timeA,timeB,tenantId).toString();
objs[6] = depotItemService.getOutNumByParam(depotId,mId,timeA,timeB,tenantId).toString();
- BigDecimal thisSum = depotItemService.getStockByParam(depotId,mId,null,null,tenantId);
+ BigDecimal thisSum = depotItemService.getStockByParam(depotId,mId,null,timeB,tenantId);
objs[7] = thisSum.toString();
objs[8] = thisSum.multiply(getUnitPrice(diEx.getPresetPriceOne(), diEx.getPriceStrategy())).toString();
objects.add(objs);
@@ -384,20 +387,22 @@ public class DepotItemController {
@PostMapping(value = "/totalCountMoney")
public BaseResponseInfo totalCountMoney(@RequestParam("depotId") Long depotId,
@RequestParam("monthTime") String monthTime,
- @RequestParam("headIds") String headIds,
- @RequestParam("materialIds") String materialIds,
+ @RequestParam("name") String name,
+ @RequestParam("model") String model,
HttpServletRequest request) throws Exception{
BaseResponseInfo res = new BaseResponseInfo();
Map map = new HashMap();
Long tenantId = Long.parseLong(request.getSession().getAttribute("tenantId").toString());
+ String endTime = Tools.lastDayOfMonth(monthTime)+" 23:59:59";
try {
- List dataList = depotItemService.findByAll(headIds, materialIds, null, null);
+ List dataList = depotItemService.findByAll(StringUtil.toNull(name), StringUtil.toNull(model),
+ endTime, null, null);
BigDecimal thisAllPrice = BigDecimal.ZERO;
if (null != dataList) {
for (DepotItemVo4WithInfoEx diEx : dataList) {
Long mId = diEx.getMId();
- BigDecimal thisSum = depotItemService.getStockByParam(depotId,mId,null,null,tenantId);
- BigDecimal unitPrice = getUnitPrice(diEx.getPresetPriceOne(), diEx.getPriceStrategy());
+ BigDecimal thisSum = depotItemService.getStockByParam(depotId,mId,null,endTime,tenantId);
+ BigDecimal unitPrice = diEx.getPurchaseDecimal();
thisAllPrice = thisAllPrice.add(thisSum.multiply(unitPrice));
}
}
@@ -427,16 +432,18 @@ public class DepotItemController {
public BaseResponseInfo buyIn(@RequestParam("currentPage") Integer currentPage,
@RequestParam("pageSize") Integer pageSize,
@RequestParam("monthTime") String monthTime,
- @RequestParam("headIds") String headIds,
- @RequestParam("materialIds") String materialIds,
+ @RequestParam("name") String name,
+ @RequestParam("model") String model,
@RequestParam("mpList") String mpList,
HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
Map map = new HashMap();
+ String endTime = Tools.lastDayOfMonth(monthTime)+" 23:59:59";
try {
- List dataList = depotItemService.findByAll(headIds, materialIds, (currentPage-1)*pageSize, pageSize);
+ List dataList = depotItemService.findByAll(StringUtil.toNull(name), StringUtil.toNull(model),
+ endTime, (currentPage-1)*pageSize, pageSize);
String[] mpArr = mpList.split(",");
- int total = depotItemService.findByAllCount(headIds, materialIds);
+ int total = depotItemService.findByAllCount(StringUtil.toNull(name), StringUtil.toNull(model), endTime);
map.put("total", total);
//存放数据json数组
JSONArray dataArray = new JSONArray();
@@ -488,16 +495,18 @@ public class DepotItemController {
public BaseResponseInfo saleOut(@RequestParam("currentPage") Integer currentPage,
@RequestParam("pageSize") Integer pageSize,
@RequestParam("monthTime") String monthTime,
- @RequestParam("headIds") String headIds,
- @RequestParam("materialIds") String materialIds,
+ @RequestParam("name") String name,
+ @RequestParam("model") String model,
@RequestParam("mpList") String mpList,
HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
Map map = new HashMap();
+ String endTime = Tools.lastDayOfMonth(monthTime)+" 23:59:59";
try {
- List dataList = depotItemService.findByAll(headIds, materialIds, (currentPage-1)*pageSize, pageSize);
+ List dataList = depotItemService.findByAll(StringUtil.toNull(name), StringUtil.toNull(model),
+ endTime,(currentPage-1)*pageSize, pageSize);
String[] mpArr = mpList.split(",");
- int total = depotItemService.findByAllCount(headIds, materialIds);
+ int total = depotItemService.findByAllCount(StringUtil.toNull(name), StringUtil.toNull(model), endTime);
map.put("total", total);
//存放数据json数组
JSONArray dataArray = new JSONArray();
diff --git a/src/main/java/com/jsh/erp/controller/MaterialController.java b/src/main/java/com/jsh/erp/controller/MaterialController.java
index 3c4964b5..094bb0a8 100644
--- a/src/main/java/com/jsh/erp/controller/MaterialController.java
+++ b/src/main/java/com/jsh/erp/controller/MaterialController.java
@@ -208,40 +208,6 @@ public class MaterialController {
return object;
}
-
- /**
- * 查找商品信息-统计排序
- * @param request
- * @return
- */
- @GetMapping(value = "/findByOrder")
- public BaseResponseInfo findByOrder(@RequestParam("name") String name,
- @RequestParam("model") String model,
- HttpServletRequest request)throws Exception {
- BaseResponseInfo res = new BaseResponseInfo();
- Map map = new HashMap();
- try {
- List dataList = materialService.findByOrder(StringUtil.toNull(name), StringUtil.toNull(model));
- String mId = "";
- if (null != dataList) {
- for (Material material : dataList) {
- mId = mId + material.getId() + ",";
- }
- }
- if (mId != "") {
- mId = mId.substring(0, mId.lastIndexOf(","));
- }
- map.put("mIds", mId);
- res.code = 200;
- res.data = map;
- } catch(Exception e){
- e.printStackTrace();
- res.code = 500;
- res.data = "获取数据失败";
- }
- return res;
- }
-
/**
* 根据商品id查找商品信息
* @param meId
diff --git a/src/main/java/com/jsh/erp/datasource/mappers/DepotItemMapperEx.java b/src/main/java/com/jsh/erp/datasource/mappers/DepotItemMapperEx.java
index 06137ee4..fd77249b 100644
--- a/src/main/java/com/jsh/erp/datasource/mappers/DepotItemMapperEx.java
+++ b/src/main/java/com/jsh/erp/datasource/mappers/DepotItemMapperEx.java
@@ -40,14 +40,16 @@ public interface DepotItemMapperEx {
@Param("headerId") Long headerId);
List findByAll(
- @Param("headIds") String headIds,
- @Param("materialIds") String materialIds,
+ @Param("name") String name,
+ @Param("model") String model,
+ @Param("endTime") String endTime,
@Param("offset") Integer offset,
@Param("rows") Integer rows);
int findByAllCount(
- @Param("headIds") String headIds,
- @Param("materialIds") String materialIds);
+ @Param("name") String name,
+ @Param("model") String model,
+ @Param("endTime") String endTime);
BigDecimal buyOrSaleNumber(
@Param("type") String type,
diff --git a/src/main/java/com/jsh/erp/datasource/mappers/MaterialMapperEx.java b/src/main/java/com/jsh/erp/datasource/mappers/MaterialMapperEx.java
index e874183d..80150857 100644
--- a/src/main/java/com/jsh/erp/datasource/mappers/MaterialMapperEx.java
+++ b/src/main/java/com/jsh/erp/datasource/mappers/MaterialMapperEx.java
@@ -41,8 +41,6 @@ public interface MaterialMapperEx {
List findByIdWithBarCode(@Param("meId") Long meId);
- List findBySelect();
-
List findBySelectWithBarCode(@Param("q") String q,
@Param("offset") Integer offset,
@Param("rows") Integer rows);
@@ -76,7 +74,4 @@ public interface MaterialMapperEx {
@Param("meId") Long meId);
List getMaterialNameList();
-
- List findByOrder(@Param("name") String name,
- @Param("model") String model);
}
diff --git a/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java b/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java
index 9b6e46d4..34f5d35c 100644
--- a/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java
+++ b/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java
@@ -285,20 +285,6 @@ public class DepotHeadService {
return result;
}
- public List findByMonth(String monthTime)throws Exception {
- DepotHeadExample example = new DepotHeadExample();
- monthTime = monthTime + "-31 23:59:59";
- Date month = StringUtil.getDateByString(monthTime, null);
- example.createCriteria().andOpertimeLessThanOrEqualTo(month).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
- List list = null;
- try{
- list = depotHeadMapper.selectByExample(example);
- }catch(Exception e){
- JshException.readFail(logger, e);
- }
- return list;
- }
-
public List findByAll(String beginTime, String endTime, String type, Integer pid, String dids, Integer oId, Integer offset, Integer rows) throws Exception{
List list = null;
try{
diff --git a/src/main/java/com/jsh/erp/service/depotItem/DepotItemService.java b/src/main/java/com/jsh/erp/service/depotItem/DepotItemService.java
index 23001c89..ffd2269f 100644
--- a/src/main/java/com/jsh/erp/service/depotItem/DepotItemService.java
+++ b/src/main/java/com/jsh/erp/service/depotItem/DepotItemService.java
@@ -234,20 +234,20 @@ public class DepotItemService {
return list;
}
- public List findByAll(String headIds, String materialIds, Integer offset, Integer rows)throws Exception {
+ public List findByAll(String name, String model, String endTime, Integer offset, Integer rows)throws Exception {
List list =null;
try{
- list = depotItemMapperEx.findByAll(headIds, materialIds, offset, rows);
+ list = depotItemMapperEx.findByAll(name, model, endTime, offset, rows);
}catch(Exception e){
JshException.readFail(logger, e);
}
return list;
}
- public int findByAllCount(String headIds, String materialIds)throws Exception {
+ public int findByAllCount(String name, String model, String endTime)throws Exception {
int result=0;
try{
- result = depotItemMapperEx.findByAllCount(headIds, materialIds);
+ result = depotItemMapperEx.findByAllCount(name, model, endTime);
}catch(Exception e){
JshException.readFail(logger, e);
}
diff --git a/src/main/java/com/jsh/erp/service/material/MaterialService.java b/src/main/java/com/jsh/erp/service/material/MaterialService.java
index df98fcb8..c2d85f1c 100644
--- a/src/main/java/com/jsh/erp/service/material/MaterialService.java
+++ b/src/main/java/com/jsh/erp/service/material/MaterialService.java
@@ -317,26 +317,6 @@ public class MaterialService {
return list;
}
- public List findBySelect()throws Exception{
- List list =null;
- try{
- list= materialMapperEx.findBySelect();
- }catch(Exception e){
- JshException.readFail(logger, e);
- }
- return list;
- }
-
- public List findByOrder(String name, String model)throws Exception{
- List list =null;
- try{
- list= materialMapperEx.findByOrder(name, model);
- }catch(Exception e){
- JshException.readFail(logger, e);
- }
- return list;
- }
-
public List findBySelectWithBarCode(String q,Integer offset, Integer rows)throws Exception{
List list =null;
try{
diff --git a/src/main/java/com/jsh/erp/utils/Tools.java b/src/main/java/com/jsh/erp/utils/Tools.java
index bee5825e..fa297852 100644
--- a/src/main/java/com/jsh/erp/utils/Tools.java
+++ b/src/main/java/com/jsh/erp/utils/Tools.java
@@ -459,6 +459,20 @@ public class Tools {
return new SimpleDateFormat("yyyy-MM").format(c.getTime());
}
+ /**
+ * 根据月份获取当月最后一天
+ * @param monthTime
+ * @return
+ * @throws ParseException
+ */
+ public static String lastDayOfMonth(String monthTime) throws ParseException {
+ Date date = new SimpleDateFormat("yyyy-MM").parse(monthTime);
+ Calendar cal = Calendar.getInstance();
+ cal.setTime(date);
+ cal.set(Calendar.DAY_OF_MONTH, 1);
+ cal.roll(Calendar.DAY_OF_MONTH, -1);
+ return new SimpleDateFormat("yyyy-MM-dd").format(cal.getTime());
+ }
/**
* 获取email用户姓名
diff --git a/src/main/resources/mapper_xml/DepotItemMapperEx.xml b/src/main/resources/mapper_xml/DepotItemMapperEx.xml
index af8104c3..927adde2 100644
--- a/src/main/resources/mapper_xml/DepotItemMapperEx.xml
+++ b/src/main/resources/mapper_xml/DepotItemMapperEx.xml
@@ -149,20 +149,25 @@