Authored by caoyan

发售日历

... ... @@ -24,6 +24,7 @@ public interface ProductMapper {
@Param("shelveStatus") Integer shelveStatus,
@Param("storageId") Integer storageId,
@Param("productCode") String productCode,
@Param("isSynCalender") Integer isSynCalender,
@Param("start") Integer start,
@Param("rows") Integer rows);
... ... @@ -34,7 +35,8 @@ public interface ProductMapper {
@Param("brandId") Integer brandId,
@Param("shelveStatus") Integer shelveStatus,
@Param("storageId") Integer storageId,
@Param("productCode") String productCode);
@Param("productCode") String productCode,
@Param("isSynCalender") Integer isSynCalender);
List<Product> selectSkuPage(@Param("productCode") String productCode,
@Param("productName") String productName,
... ...
... ... @@ -112,7 +112,9 @@
<if test="storageId != null and storageId > 0">
and id in (select product_id from storage where id = #{storageId})
</if>
<if test="isSynCalender != null and isSynCalender > -1">
and is_syn_calender = #{isSynCalender}
</if>
</sql>
<select id="selectSkuPage" resultMap="BaseResultMap">
... ...
... ... @@ -483,7 +483,8 @@ public class ProductServiceImpl implements IProductService, ApplicationContextAw
bo.getBrandId(),
bo.getShelveStatus(),
bo.getStorageId(),
bo.getProductCode());
bo.getProductCode(),
bo.getIsSynCalender());
List<ProductResponceBo> boList = new ArrayList<>();
if (count > 0) {
List<Product> productList = productMapper.selectPage(bo.getId(),
... ... @@ -494,11 +495,15 @@ public class ProductServiceImpl implements IProductService, ApplicationContextAw
bo.getShelveStatus(),
bo.getStorageId(),
bo.getProductCode(),
bo.getIsSynCalender(),
bo.getStartIndex(),
bo.getRows());
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
productList.forEach(p -> {
ProductResponceBo b = new ProductResponceBo();
BeanUtils.copyProperties(p, b);
b.setOfferPrice(p.getOfferPrice().compareTo(BigDecimal.valueOf(0.00)) == 0 ? "" : "¥"+String.format("%d", p.getOfferPrice().intValue()));
b.setSaleTime((p.getSaleTime() == null || p.getSaleTime() == 0) ? "" : sdf.format(p.getSaleTime() * 1000L));
boList.add(b);
});
List<Integer> productIdList = CollectionUtil.distinct(productList, Product::getId);
... ... @@ -535,6 +540,7 @@ public class ProductServiceImpl implements IProductService, ApplicationContextAw
if (brand != null) {
respBo.setBrandName(brand.getBrandName());
}
});
}
PageResponseBO<ProductResponceBo> pageBo = new PageResponseBO<>(count, boList, bo.getPage(), bo.getRows());
... ... @@ -1138,7 +1144,8 @@ public class ProductServiceImpl implements IProductService, ApplicationContextAw
null,
null,
null,
bo.getProductCode());
bo.getProductCode(),
null);
List<ProductResponceBo> boList = new ArrayList<>();
if (count > 0) {
List<Product> productList = productMapper.selectPage(bo.getId(),
... ... @@ -1149,6 +1156,7 @@ public class ProductServiceImpl implements IProductService, ApplicationContextAw
null,
null,
bo.getProductCode(),
null,
bo.getStartIndex(),
bo.getRows());
List<ProductSales> salesList = productSalesMapper
... ...
... ... @@ -185,7 +185,7 @@
</div>
</li>
<li>
<div class="label">发售价:</div>
<div class="label">发售价</div>
<div class="base-info-item">
<input id="editOfferPrice" type="text" name="offerPrice"/>
</div>
... ...
... ... @@ -23,6 +23,7 @@
<input id="productCode" type="text"/>
<input id="storageId" type="text"/>
<input id="shelveStatus" type="text"/>
<input id="isSynCalender" type="text"/>
</div>
<div style="margin: 10px 0 0 30px;" class="div_search">
<a id="searchLinkButton" class="easyui-linkbutton btn-info" data-options="iconCls:'icon-search'">筛选</a>
... ... @@ -110,6 +111,16 @@
{"text" : "已下架", "value" : 2}
]
});
$("#isSynCalender").combobox({
prompt: "是否发售日历",
width: 150,
editable : false,
data: [
{"text" : "是否发售日历", "value" : "-1", "selected": true},
{"text" : "否", "value" : 0},
{"text" : "是", "value" : 1}
]
});
$("#productTable").myDatagrid({
fit: true,
fitColumns: true,
... ... @@ -155,6 +166,26 @@
width: 100,
align: "center",
}, {
title: "发售价格",
field: "offerPrice",
width: 100,
align: "center",
}, {
title: "发售日期",
field: "saleTime",
width: 100,
align: "center",
},{
title: "是否发售日历",
field: "isSynCalender",
width: 100,
align: "center",
formatter: function (value) {
if(value == "0" ) return "否";
if(value == "1" ) return "是";
return "";
}
},{
title: "商品状态",
field: "shelveStatus",
width: 170,
... ... @@ -227,6 +258,7 @@
param.shelveStatus = $('#shelveStatus').combobox('getValue');
param.productCode = $('#productCode').textbox('getText');
param.storageId = $('#storageId').textbox('getText');
param.isSynCalender = $('#isSynCalender').combobox('getValue');
$("#productTable").myDatagrid("load", param);
}
});
... ...