清理和礼品卡相关的代码
This commit is contained in:
@@ -49,7 +49,7 @@ public class BusinessConstants {
|
||||
public static final String ENABLE_SERIAL_NUMBER_NOT_ENABLED = "0";
|
||||
/**
|
||||
* 出入库分类
|
||||
*采购、采购退货、其它、零售、销售、调拨、礼品充值
|
||||
*采购、采购退货、其它、零售、销售、调拨
|
||||
* */
|
||||
public static final String SUB_TYPE_PURCHASE = "采购";
|
||||
public static final String SUB_TYPE_PURCHASE_TETURNS = "采购退货";
|
||||
|
||||
@@ -121,32 +121,4 @@ public class DepotController {
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查找礼品卡-虚拟仓库
|
||||
* @param type
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/findGiftByType")
|
||||
public JSONArray findGiftByType(@RequestParam("type") Integer type,
|
||||
HttpServletRequest request) {
|
||||
JSONArray arr = new JSONArray();
|
||||
try {
|
||||
List<Depot> dataList = depotService.findGiftByType(type);
|
||||
//存放数据json数组
|
||||
if (null != dataList) {
|
||||
for (Depot depot : dataList) {
|
||||
JSONObject item = new JSONObject();
|
||||
item.put("id", depot.getId());
|
||||
//仓库名称
|
||||
item.put("name", depot.getName());
|
||||
arr.add(item);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error(">>>>>>>>>查找仓库信息异常", e);
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,45 +145,6 @@ public class DepotHeadController {
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查找统计信息_根据礼品卡(报表)
|
||||
* @param projectId
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/findGiftReport")
|
||||
public BaseResponseInfo findGiftReport(@RequestParam("projectId") String projectId,
|
||||
HttpServletRequest request) {
|
||||
BaseResponseInfo res = new BaseResponseInfo();
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
try {
|
||||
List<DepotHead> dataList_in = depotHeadService.getDepotHead();
|
||||
String headId = "";
|
||||
if (null != dataList_in) {
|
||||
for (DepotHead depotHead : dataList_in) {
|
||||
headId = headId + depotHead.getId() + ",";
|
||||
}
|
||||
List<DepotHead> dataList_out = depotHeadService.getDepotHeadGiftOut(projectId);
|
||||
if (null != dataList_out) {
|
||||
for (DepotHead depotHead : dataList_out) {
|
||||
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
|
||||
|
||||
@@ -634,61 +634,6 @@ public class DepotItemController {
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查找礼品卡信息
|
||||
* @param currentPage
|
||||
* @param pageSize
|
||||
* @param projectId
|
||||
* @param headIds
|
||||
* @param materialIds
|
||||
* @param mpList
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/findGiftByAll")
|
||||
public BaseResponseInfo findGiftByAll(@RequestParam("currentPage") Integer currentPage,
|
||||
@RequestParam("pageSize") Integer pageSize,
|
||||
@RequestParam("projectId") Integer projectId,
|
||||
@RequestParam("headIds") String headIds,
|
||||
@RequestParam("materialIds") String materialIds,
|
||||
@RequestParam("mpList") String mpList,
|
||||
HttpServletRequest request) {
|
||||
BaseResponseInfo res = new BaseResponseInfo();
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
try {
|
||||
List<DepotItemVo4WithInfoEx> dataList = depotItemService.findByAll(headIds, materialIds, currentPage, pageSize);
|
||||
String[] mpArr = mpList.split(",");
|
||||
int total = depotItemService.findByAllCount(headIds, materialIds);
|
||||
map.put("total", total);
|
||||
Integer pid = projectId;
|
||||
JSONArray dataArray = new JSONArray();
|
||||
if (null != dataList) {
|
||||
for (DepotItemVo4WithInfoEx diEx : dataList) {
|
||||
JSONObject item = new JSONObject();
|
||||
BigDecimal InSum = sumNumberGift("礼品充值", pid, diEx.getMId(), "in");
|
||||
BigDecimal OutSum = sumNumberGift("礼品销售", pid, diEx.getMId(), "out");
|
||||
item.put("MaterialName", diEx.getMName());
|
||||
item.put("MaterialModel", diEx.getMModel());
|
||||
//扩展信息
|
||||
String materialOther = getOtherInfo(mpArr, diEx);
|
||||
item.put("MaterialOther", materialOther);
|
||||
item.put("MaterialColor", diEx.getMColor());
|
||||
item.put("MaterialUnit", diEx.getMaterialUnit());
|
||||
item.put("thisSum", InSum.subtract(OutSum));
|
||||
dataArray.add(item);
|
||||
}
|
||||
}
|
||||
map.put("rows", dataArray);
|
||||
res.code = 200;
|
||||
res.data = map;
|
||||
} catch(Exception e){
|
||||
e.printStackTrace();
|
||||
res.code = 500;
|
||||
res.data = "获取数据失败";
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel表格
|
||||
* @param currentPage
|
||||
@@ -836,28 +781,4 @@ public class DepotItemController {
|
||||
}
|
||||
return sumPrice;
|
||||
}
|
||||
|
||||
/**
|
||||
* 数量合计-礼品卡
|
||||
* @param subType
|
||||
* @param ProjectId
|
||||
* @param MId
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
public BigDecimal sumNumberGift(String subType, Integer ProjectId, Long MId, String type) {
|
||||
BigDecimal sumNumber = BigDecimal.ZERO;
|
||||
String allNumber = "";
|
||||
try {
|
||||
if (ProjectId != null) {
|
||||
BigDecimal sum = depotItemService.findGiftByType(subType, ProjectId, MId, type);
|
||||
if(sum != null) {
|
||||
sumNumber = sum;
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return sumNumber;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user