清理和礼品卡相关的代码

This commit is contained in:
季圣华
2019-02-22 23:27:46 +08:00
parent 6bffcd8f28
commit 086b7d486f
8 changed files with 10 additions and 242 deletions

View File

@@ -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 = "采购退货";

View File

@@ -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;
}
}

View File

@@ -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

View File

@@ -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;
}
}

View File

@@ -87,7 +87,7 @@
case when type='入库' then di.BasicNumber when type='出库' then 0-di.BasicNumber else 0 end as b_num,
date_format(dh.OperTime,'%Y-%m-%d %H:%i:%S') as oTime
from jsh_depothead dh INNER JOIN jsh_depotitem di on dh.id=di.HeaderId where type!='其它'
and SubType!='调拨' and SubType!='礼品充值'
and SubType!='调拨'
and MaterialId =${mId} ORDER BY oTime desc
<if test="offset != null and rows != null">
limit #{offset},#{rows}
@@ -96,7 +96,7 @@
<select id="findDetailByTypeAndMaterialIdCounts" resultType="java.lang.Integer">
select count(1)
from jsh_depothead dh INNER JOIN jsh_depotitem di on dh.id=di.HeaderId where type!='其它'
and SubType!='调拨' and SubType!='礼品充值'
and SubType!='调拨'
and MaterialId =${mId}
</select>
@@ -124,7 +124,7 @@
<select id="findByTypeAndMaterialIdOut" resultType="java.lang.Integer">
select ifnull(sum(BasicNumber),0) as BasicNumber from jsh_depothead dh INNER JOIN jsh_depotitem di on dh.id=di.HeaderId where type='出库'
and SubType!='调拨' and SubType!='礼品充值' and MaterialId = ${mId}
and SubType!='调拨' and MaterialId = ${mId}
</select>
<select id="getDetailList" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultWithInfoExMap">
@@ -177,7 +177,7 @@
or
(SubType='调拨' and AnotherDepotId=${ProjectId})
or
(SubType='礼品充值' and AnotherDepotId=${ProjectId}))
(AnotherDepotId=${ProjectId}))
and MaterialId = ${MId} and dh.OperTime &lt; '${MonthTime}-01 00:00:00'
</select>
@@ -188,7 +188,7 @@
or
(SubType='调拨' and AnotherDepotId=${ProjectId})
or
(SubType='礼品充值' and AnotherDepotId=${ProjectId}))
(AnotherDepotId=${ProjectId}))
and MaterialId = ${MId} and dh.OperTime &gt;= '${MonthTime}-01 00:00:00'
and dh.OperTime &lt;= '${MonthTime}-31 23:59:59'
</select>
@@ -216,7 +216,7 @@
or
(SubType='调拨' and AnotherDepotId=${ProjectId})
or
(SubType='礼品充值' and AnotherDepotId=${ProjectId}))
(AnotherDepotId=${ProjectId}))
and MaterialId = ${MId} and dh.OperTime &lt; '${MonthTime}-01 00:00:00'
</select>
@@ -227,7 +227,7 @@
or
(SubType='调拨' and AnotherDepotId=${ProjectId})
or
(SubType='礼品充值' and AnotherDepotId=${ProjectId}))
(AnotherDepotId=${ProjectId}))
and MaterialId = ${MId} and dh.OperTime &gt;= '${MonthTime}-01 00:00:00'
and dh.OperTime &lt;= '${MonthTime}-31 23:59:59'
</select>