|
@@ -6,6 +6,10 @@ import com.xingxi.common.core.domain.AjaxResult;
|
|
|
import com.xingxi.common.core.page.TableDataInfo;
|
|
import com.xingxi.common.core.page.TableDataInfo;
|
|
|
import com.xingxi.common.core.text.Convert;
|
|
import com.xingxi.common.core.text.Convert;
|
|
|
import com.xingxi.common.enums.BusinessType;
|
|
import com.xingxi.common.enums.BusinessType;
|
|
|
|
|
+import com.xingxi.common.utils.DateUtils;
|
|
|
|
|
+import com.xingxi.common.utils.ShiroUtils;
|
|
|
|
|
+import com.xingxi.master.merchant.domain.MerchantProd;
|
|
|
|
|
+import com.xingxi.master.merchant.service.IMerchantProdService;
|
|
|
import com.xingxi.web.controller.master.merchant.domain.MerchantProdVo;
|
|
import com.xingxi.web.controller.master.merchant.domain.MerchantProdVo;
|
|
|
import com.xingxi.web.controller.master.merchant.service.IMerchantProdVoService;
|
|
import com.xingxi.web.controller.master.merchant.service.IMerchantProdVoService;
|
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
@@ -14,6 +18,7 @@ import org.springframework.ui.ModelMap;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
|
|
+import java.util.Date;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -28,6 +33,8 @@ public class MerchantProdController extends BaseController {
|
|
|
private final String prefix = "master/merchant/prod";
|
|
private final String prefix = "master/merchant/prod";
|
|
|
|
|
|
|
|
@Resource
|
|
@Resource
|
|
|
|
|
+ private IMerchantProdService merchantProdService;
|
|
|
|
|
+ @Resource
|
|
|
private IMerchantProdVoService merchantProdVoService;
|
|
private IMerchantProdVoService merchantProdVoService;
|
|
|
|
|
|
|
|
@RequiresPermissions("master:merchant:prod:view")
|
|
@RequiresPermissions("master:merchant:prod:view")
|
|
@@ -81,12 +88,30 @@ public class MerchantProdController extends BaseController {
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
public AjaxResult remove(String ids) {
|
|
public AjaxResult remove(String ids) {
|
|
|
if (ids.indexOf(",") > 0) {
|
|
if (ids.indexOf(",") > 0) {
|
|
|
- return toAjax(merchantProdVoService.logicDeleteMerchantProdByMercProdIds(Convert.toStrArray(ids)));
|
|
|
|
|
|
|
+ return toAjax(merchantProdService.logicDeleteMerchantProdByMercProdIds(Convert.toStrArray(ids)));
|
|
|
} else {
|
|
} else {
|
|
|
- return toAjax(merchantProdVoService.logicDeleteMerchantProdByMercProdId(Long.parseLong(ids)));
|
|
|
|
|
|
|
+ return toAjax(merchantProdService.logicDeleteMerchantProdByMercProdId(Long.parseLong(ids)));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 上架店铺商品
|
|
|
|
|
+ */
|
|
|
|
|
+ @RequiresPermissions("master:merchant:prod:shelf")
|
|
|
|
|
+ @Log(title = "店铺商品", businessType = BusinessType.UPDATE)
|
|
|
|
|
+ @PostMapping("/shelf")
|
|
|
|
|
+ @ResponseBody
|
|
|
|
|
+ public AjaxResult shelf(Long mercProdId, String shelfFlag) {
|
|
|
|
|
+ Date nowDate = DateUtils.getNowDate();
|
|
|
|
|
+ MerchantProd merchantProd = new MerchantProd();
|
|
|
|
|
+ merchantProd.setMercProdId(mercProdId);
|
|
|
|
|
+ merchantProd.setShelfFlag(shelfFlag);
|
|
|
|
|
+ merchantProd.setShelfTime(nowDate);
|
|
|
|
|
+ merchantProd.setUpdateUser(ShiroUtils.getLoginName());
|
|
|
|
|
+ merchantProd.setUpdateTime(nowDate);
|
|
|
|
|
+ return toAjax(merchantProdService.updateMerchantProd(merchantProd));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@RequiresPermissions("master:merchant:prod:view")
|
|
@RequiresPermissions("master:merchant:prod:view")
|
|
|
@GetMapping("/checkMercProd")
|
|
@GetMapping("/checkMercProd")
|
|
|
@ResponseBody
|
|
@ResponseBody
|