|
@@ -158,7 +158,7 @@ public class ProductNewController extends BaseController {
|
|
product.setProductCategory("1");
|
|
product.setProductCategory("1");
|
|
}
|
|
}
|
|
Page<Product> searchPage = new Page<>(request, response);
|
|
Page<Product> searchPage = new Page<>(request, response);
|
|
- searchPage.setOrderBy("2".equals(product.getSearchProductCategory())?"cshd.submitDate desc":"");
|
|
|
|
|
|
+ searchPage.setOrderBy("2".equals(product.getSearchProductCategory()) ? "cshd.submitDate desc" : "");
|
|
Page<Product> page = productNewService.findPage(searchPage, product);
|
|
Page<Product> page = productNewService.findPage(searchPage, product);
|
|
List<Product> list = page.getList();
|
|
List<Product> list = page.getList();
|
|
if (CollectionUtils.isNotEmpty(list)) {
|
|
if (CollectionUtils.isNotEmpty(list)) {
|
|
@@ -195,7 +195,8 @@ public class ProductNewController extends BaseController {
|
|
Calendar calendar = Calendar.getInstance();
|
|
Calendar calendar = Calendar.getInstance();
|
|
if (p.getOnLineDate() != null) {
|
|
if (p.getOnLineDate() != null) {
|
|
calendar.setTime(fmt.parse(p.getOnLineDate()));
|
|
calendar.setTime(fmt.parse(p.getOnLineDate()));
|
|
- calendar.add(Calendar.DATE,180);
|
|
|
|
|
|
+ //设置为day月前
|
|
|
|
+ calendar.add(Calendar.MONTH, 3);
|
|
p.setOnLineDate(fmt.format(calendar.getTime()));
|
|
p.setOnLineDate(fmt.format(calendar.getTime()));
|
|
}
|
|
}
|
|
} catch (ParseException e) {
|
|
} catch (ParseException e) {
|
|
@@ -246,7 +247,7 @@ public class ProductNewController extends BaseController {
|
|
}
|
|
}
|
|
product.setLadderPriceList(ladderPriceList);
|
|
product.setLadderPriceList(ladderPriceList);
|
|
}
|
|
}
|
|
- product.setCommodityType(StringUtils.isEmpty(product.getCommodityType())?"0":product.getCommodityType());
|
|
|
|
|
|
+ product.setCommodityType(StringUtils.isEmpty(product.getCommodityType()) ? "0" : product.getCommodityType());
|
|
List<CmBrand> brandList = productService.findBrandList();
|
|
List<CmBrand> brandList = productService.findBrandList();
|
|
Map<String, Object> classify = productService.findClassify();
|
|
Map<String, Object> classify = productService.findClassify();
|
|
List<Province> provinceList = areaService.loadProvince();
|
|
List<Province> provinceList = areaService.loadProvince();
|
|
@@ -398,14 +399,16 @@ public class ProductNewController extends BaseController {
|
|
if (null == product.getProductID()) {
|
|
if (null == product.getProductID()) {
|
|
return "redirect:" + Global.getAdminPath() + "/product/new/list/";
|
|
return "redirect:" + Global.getAdminPath() + "/product/new/list/";
|
|
}
|
|
}
|
|
- product.setCommodityType(StringUtils.isEmpty(product.getCommodityType())?"0":product.getCommodityType());
|
|
|
|
|
|
+ product.setCommodityType(StringUtils.isEmpty(product.getCommodityType()) ? "0" : product.getCommodityType());
|
|
Map<String, Object> classify = productService.findClassify();
|
|
Map<String, Object> classify = productService.findClassify();
|
|
model.addAttribute("classify", classify);
|
|
model.addAttribute("classify", classify);
|
|
model.addAttribute("product", product);
|
|
model.addAttribute("product", product);
|
|
return "modules/product-new/fastEdit";
|
|
return "modules/product-new/fastEdit";
|
|
}
|
|
}
|
|
|
|
|
|
- /**已废弃*/
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 已废弃
|
|
|
|
+ */
|
|
@RequiresPermissions("product:product:view")
|
|
@RequiresPermissions("product:product:view")
|
|
@RequestMapping(value = "setCategory")
|
|
@RequestMapping(value = "setCategory")
|
|
public String setCategory(Product product, Model model) {
|
|
public String setCategory(Product product, Model model) {
|
|
@@ -726,10 +729,11 @@ public class ProductNewController extends BaseController {
|
|
//上架时间
|
|
//上架时间
|
|
Date onLineDate = cmSecondHandDetail.getOnLineDate();
|
|
Date onLineDate = cmSecondHandDetail.getOnLineDate();
|
|
if (null != onLineDate) {
|
|
if (null != onLineDate) {
|
|
- // 计算是否还在180天内有效
|
|
|
|
|
|
+ // 计算是否还在3个月内有效
|
|
Calendar ca = Calendar.getInstance();
|
|
Calendar ca = Calendar.getInstance();
|
|
ca.setTime(onLineDate);
|
|
ca.setTime(onLineDate);
|
|
- ca.add(Calendar.DATE, 180);
|
|
|
|
|
|
+ //设置为day月前
|
|
|
|
+ ca.add(Calendar.MONTH, 3);
|
|
onLineDate = ca.getTime();
|
|
onLineDate = ca.getTime();
|
|
|
|
|
|
if (StringUtils.equals("3", validFlag)) {
|
|
if (StringUtils.equals("3", validFlag)) {
|
|
@@ -738,7 +742,7 @@ public class ProductNewController extends BaseController {
|
|
} else if (StringUtils.equals("2", validFlag)) {
|
|
} else if (StringUtils.equals("2", validFlag)) {
|
|
// 上架
|
|
// 上架
|
|
if (date.after(onLineDate)) {
|
|
if (date.after(onLineDate)) {
|
|
- // 已过期,重新计算180天
|
|
|
|
|
|
+ // 已过期,重新计算3个月
|
|
cmSecondHandDetailService.updateOnLineDate(date, productId);
|
|
cmSecondHandDetailService.updateOnLineDate(date, productId);
|
|
}
|
|
}
|
|
map.put("msg", "上架成功");
|
|
map.put("msg", "上架成功");
|