Commit d9d7cab3 by XiaHou

权星相关接口修复

parent 62a03742
...@@ -43,7 +43,7 @@ public class PmsProductController { ...@@ -43,7 +43,7 @@ public class PmsProductController {
@RequestMapping(value = "/getProductInfo", method = RequestMethod.GET) @RequestMapping(value = "/getProductInfo", method = RequestMethod.GET)
@ResponseBody @ResponseBody
//@PreAuthorize("hasAuthority('pms:product:read')") //@PreAuthorize("hasAuthority('pms:product:read')")
public CommonResult<PmsProductRequestParam> getUpdateInfo( @ApiParam("商品Id") @RequestParam(value="id") Long id) { public CommonResult<PmsProductRequestParam> getProductInfo( @ApiParam("商品Id") @RequestParam(value="id") Long id) {
PmsProductRequestParam pmsProductRequestParam = productService.getProductById(id); PmsProductRequestParam pmsProductRequestParam = productService.getProductById(id);
return CommonResult.success(pmsProductRequestParam); return CommonResult.success(pmsProductRequestParam);
} }
......
...@@ -23,15 +23,6 @@ public class UmsMchtHomeController { ...@@ -23,15 +23,6 @@ public class UmsMchtHomeController {
@Resource @Resource
private UmsMchtHomeService umsMchtHomeService; private UmsMchtHomeService umsMchtHomeService;
@ApiOperation(value = "获取供应商首页数据")
@RequestMapping(value = "/data",method = RequestMethod.GET)
public CommonResult<UmsMchtHomeResult> getMchtHomeData(){
UmsMchtHomeResult result = umsMchtHomeService.getMchtHomeData();
return CommonResult.success(result);
}
@ApiOperation(value = "获取店铺商品排行") @ApiOperation(value = "获取店铺商品排行")
@RequestMapping(value = "/sort",method = RequestMethod.GET) @RequestMapping(value = "/sort",method = RequestMethod.GET)
public CommonResult<List<PmsProductInfoResult>> getProductInfoList(){ public CommonResult<List<PmsProductInfoResult>> getProductInfoList(){
......
...@@ -46,53 +46,6 @@ public class UmsMchtHomeServiceImpl implements UmsMchtHomeService { ...@@ -46,53 +46,6 @@ public class UmsMchtHomeServiceImpl implements UmsMchtHomeService {
@Override @Override
public UmsMchtHomeResult getMchtHomeData() {
//供应商主页数据返回类
UmsMchtHomeResult mchtHomeResult = new UmsMchtHomeResult();
UmsAdmin umsAdmin = DgbSecurityUserHelper.getCurrentUser();
//获取用户权限角色
UmsRole umsRole = getRole(umsAdmin);
if (umsAdmin.getParentId() != null) {
umsAdmin = umsAdminMapper.selectByPrimaryKey(umsAdmin.getParentId());
}
//获取店铺信息
PmsMchtShopInfo shopInfo = getShopInfo(umsAdmin);
//获取公司信息
PmsMchtAptitudeInfo aptitudeInfo = getAptitudeInfo(umsAdmin);
//供应商信息返回类
UmsMchtInfoResult mchtInfoResult = new UmsMchtInfoResult();
BeanUtils.copyProperties(umsAdmin, mchtInfoResult);
//用户角色
if (null != umsRole) {
mchtInfoResult.setPermissions(umsRole.getName());
}
if (shopInfo != null) {
//店铺名称
ShopSuffixEnum shopSuffix = ShopSuffixEnum.getEnum(shopInfo.getShopSuffix());
mchtInfoResult.setShopName(shopInfo.getExpectShopName() + (shopSuffix == null ? "" : shopSuffix.getName()));
}
if (aptitudeInfo != null) {
//公司名称
mchtInfoResult.setCompanyName(aptitudeInfo.getCompanyName());
mchtHomeResult.setUmsMchtInfoResult(mchtInfoResult);
}
//获取订单信息
OmsOrderCountResult orderCountResult = getOrderCount(umsAdmin);
mchtHomeResult.setOmsOrderCountResult(orderCountResult);
//获取商品信息
PmsProductCountResult productCountResult = getProductCount(umsAdmin);
mchtHomeResult.setPmsProductCountResult(productCountResult);
//店铺评分
PmsMchtCommentResult result = getAvg(umsAdmin);
mchtHomeResult.setPmsMchtCommentResult(result);
//交易数据
UmsMchtTradingData mchtTradingData = getTradingData(umsAdmin);
mchtHomeResult.setMchtTradingData(mchtTradingData);
return mchtHomeResult;
}
@Override
public List<PmsProductInfoResult> getProductInfoList() { public List<PmsProductInfoResult> getProductInfoList() {
PageHelper.startPage(1, 7); PageHelper.startPage(1, 7);
UmsAdmin umsAdmin = DgbSecurityUserHelper.getCurrentUser(); UmsAdmin umsAdmin = DgbSecurityUserHelper.getCurrentUser();
...@@ -178,27 +131,6 @@ public class UmsMchtHomeServiceImpl implements UmsMchtHomeService { ...@@ -178,27 +131,6 @@ public class UmsMchtHomeServiceImpl implements UmsMchtHomeService {
return result; return result;
} }
private PmsProductCountResult getProductCount(UmsAdmin umsAdmin) {
PmsProductCountResult productCountResult = new PmsProductCountResult();
//上架商品
Integer aPublish = pmsProductDao.getProductCount(umsAdmin.getId(), 1, null, null);
productCountResult.setAPublish(aPublish);
//预警商品
Integer warnProduct = pmsProductDao.getWarnProduct(umsAdmin.getId());
productCountResult.setWarnProduct(warnProduct);
//促销商品
Integer promotionProduct = pmsProductDao.getProductCount(umsAdmin.getId(), 1, 1, null);
productCountResult.setPromotionProduct(promotionProduct);
//下架商品
Integer outProduct = pmsProductDao.getProductCount(umsAdmin.getId(), 0, null, null);
productCountResult.setOutProduct(outProduct);
//新品商品
Integer newProduct = pmsProductDao.getProductCount(umsAdmin.getId(), 1, null, 1);
productCountResult.setNewProduct(newProduct);
//被辅商品
return productCountResult;
}
private OmsOrderCountResult getOrderCount(UmsAdmin umsAdmin) { private OmsOrderCountResult getOrderCount(UmsAdmin umsAdmin) {
OmsOrderCountResult orderCountResult = new OmsOrderCountResult(); OmsOrderCountResult orderCountResult = new OmsOrderCountResult();
//待付款 //待付款
......
...@@ -14,8 +14,6 @@ import java.util.List; ...@@ -14,8 +14,6 @@ import java.util.List;
public interface UmsMchtHomeService { public interface UmsMchtHomeService {
UmsMchtHomeResult getMchtHomeData();
List<PmsProductInfoResult> getProductInfoList(); List<PmsProductInfoResult> getProductInfoList();
UmsRole getRole(UmsAdmin umsAdmin); UmsRole getRole(UmsAdmin umsAdmin);
......
...@@ -169,6 +169,9 @@ public class PmsProduct implements Serializable { ...@@ -169,6 +169,9 @@ public class PmsProduct implements Serializable {
@ApiModelProperty(value = "分销佣金") @ApiModelProperty(value = "分销佣金")
private BigDecimal commission; private BigDecimal commission;
@ApiModelProperty(value = "商品参考库存")
private Integer stock;
@ApiModelProperty(value = "商品描述") @ApiModelProperty(value = "商品描述")
private String description; private String description;
...@@ -593,6 +596,14 @@ public class PmsProduct implements Serializable { ...@@ -593,6 +596,14 @@ public class PmsProduct implements Serializable {
this.commission = commission; this.commission = commission;
} }
public Integer getStock() {
return stock;
}
public void setStock(Integer stock) {
this.stock = stock;
}
public String getDescription() { public String getDescription() {
return description; return description;
} }
...@@ -667,6 +678,7 @@ public class PmsProduct implements Serializable { ...@@ -667,6 +678,7 @@ public class PmsProduct implements Serializable {
sb.append(", deliveryType=").append(deliveryType); sb.append(", deliveryType=").append(deliveryType);
sb.append(", contSign=").append(contSign); sb.append(", contSign=").append(contSign);
sb.append(", commission=").append(commission); sb.append(", commission=").append(commission);
sb.append(", stock=").append(stock);
sb.append(", description=").append(description); sb.append(", description=").append(description);
sb.append(", detailHtml=").append(detailHtml); sb.append(", detailHtml=").append(detailHtml);
sb.append(", serialVersionUID=").append(serialVersionUID); sb.append(", serialVersionUID=").append(serialVersionUID);
......
...@@ -3375,6 +3375,66 @@ public class PmsProductExample { ...@@ -3375,6 +3375,66 @@ public class PmsProductExample {
addCriterion("commission not between", value1, value2, "commission"); addCriterion("commission not between", value1, value2, "commission");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andStockIsNull() {
addCriterion("stock is null");
return (Criteria) this;
}
public Criteria andStockIsNotNull() {
addCriterion("stock is not null");
return (Criteria) this;
}
public Criteria andStockEqualTo(Integer value) {
addCriterion("stock =", value, "stock");
return (Criteria) this;
}
public Criteria andStockNotEqualTo(Integer value) {
addCriterion("stock <>", value, "stock");
return (Criteria) this;
}
public Criteria andStockGreaterThan(Integer value) {
addCriterion("stock >", value, "stock");
return (Criteria) this;
}
public Criteria andStockGreaterThanOrEqualTo(Integer value) {
addCriterion("stock >=", value, "stock");
return (Criteria) this;
}
public Criteria andStockLessThan(Integer value) {
addCriterion("stock <", value, "stock");
return (Criteria) this;
}
public Criteria andStockLessThanOrEqualTo(Integer value) {
addCriterion("stock <=", value, "stock");
return (Criteria) this;
}
public Criteria andStockIn(List<Integer> values) {
addCriterion("stock in", values, "stock");
return (Criteria) this;
}
public Criteria andStockNotIn(List<Integer> values) {
addCriterion("stock not in", values, "stock");
return (Criteria) this;
}
public Criteria andStockBetween(Integer value1, Integer value2) {
addCriterion("stock between", value1, value2, "stock");
return (Criteria) this;
}
public Criteria andStockNotBetween(Integer value1, Integer value2) {
addCriterion("stock not between", value1, value2, "stock");
return (Criteria) this;
}
} }
public static class Criteria extends GeneratedCriteria { public static class Criteria extends GeneratedCriteria {
......
package com.macro.mall.model.dto.quanxing;
import com.macro.mall.model.OmsChoseProduct;
import com.macro.mall.model.PmsProduct;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class OmsChoseProductDto extends OmsChoseProduct {
@ApiModelProperty("库存")
private Integer stock;
@ApiModelProperty("商品名称")
private String name;
@ApiModelProperty("商品价格")
private BigDecimal price;
@ApiModelProperty("商品主图")
private String productPic;
@ApiModelProperty("已选商品id集合")
private String ids;
}
package com.macro.mall.model.dto.quanxing;
import com.macro.mall.model.PmsProductSkuValue;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
public class PmsProductSkuValueDto extends PmsProductSkuValue implements Serializable {
@ApiModelProperty("规格分类名称")
private String typeName;
}
...@@ -54,6 +54,7 @@ ...@@ -54,6 +54,7 @@
<result column="delivery_type" jdbcType="INTEGER" property="deliveryType" /> <result column="delivery_type" jdbcType="INTEGER" property="deliveryType" />
<result column="cont_sign" jdbcType="VARCHAR" property="contSign" /> <result column="cont_sign" jdbcType="VARCHAR" property="contSign" />
<result column="commission" jdbcType="DECIMAL" property="commission" /> <result column="commission" jdbcType="DECIMAL" property="commission" />
<result column="stock" jdbcType="INTEGER" property="stock" />
</resultMap> </resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.macro.mall.model.PmsProduct"> <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.macro.mall.model.PmsProduct">
<result column="description" jdbcType="LONGVARCHAR" property="description" /> <result column="description" jdbcType="LONGVARCHAR" property="description" />
...@@ -125,7 +126,7 @@ ...@@ -125,7 +126,7 @@
delivery_area, is_time_up, timer_date, market_date, product_origin, cost_price, bar_code, delivery_area, is_time_up, timer_date, market_date, product_origin, cost_price, bar_code,
virtual_sales, product_pic, pic_type, product_video, note, promotion_type, gift_growth, virtual_sales, product_pic, pic_type, product_video, note, promotion_type, gift_growth,
gift_point, use_point_limit, spu_id, third_flag, create_date, create_by, update_date, gift_point, use_point_limit, spu_id, third_flag, create_date, create_by, update_date,
update_by, del_flag, delete_status, delivery_type, cont_sign, commission update_by, del_flag, delete_status, delivery_type, cont_sign, commission, stock
</sql> </sql>
<sql id="Blob_Column_List"> <sql id="Blob_Column_List">
description, detail_html description, detail_html
...@@ -199,8 +200,8 @@ ...@@ -199,8 +200,8 @@
spu_id, third_flag, create_date, spu_id, third_flag, create_date,
create_by, update_date, update_by, create_by, update_date, update_by,
del_flag, delete_status, delivery_type, del_flag, delete_status, delivery_type,
cont_sign, commission, description, cont_sign, commission, stock,
detail_html) description, detail_html)
values (#{name,jdbcType=VARCHAR}, #{mchtId,jdbcType=BIGINT}, #{publishStatus,jdbcType=INTEGER}, values (#{name,jdbcType=VARCHAR}, #{mchtId,jdbcType=BIGINT}, #{publishStatus,jdbcType=INTEGER},
#{publishDate,jdbcType=TIMESTAMP}, #{verifyStatus,jdbcType=INTEGER}, #{newStatus,jdbcType=INTEGER}, #{publishDate,jdbcType=TIMESTAMP}, #{verifyStatus,jdbcType=INTEGER}, #{newStatus,jdbcType=INTEGER},
#{brandId,jdbcType=BIGINT}, #{brandName,jdbcType=VARCHAR}, #{productCategoryId,jdbcType=BIGINT}, #{brandId,jdbcType=BIGINT}, #{brandName,jdbcType=VARCHAR}, #{productCategoryId,jdbcType=BIGINT},
...@@ -218,8 +219,8 @@ ...@@ -218,8 +219,8 @@
#{spuId,jdbcType=VARCHAR}, #{thirdFlag,jdbcType=INTEGER}, #{createDate,jdbcType=TIMESTAMP}, #{spuId,jdbcType=VARCHAR}, #{thirdFlag,jdbcType=INTEGER}, #{createDate,jdbcType=TIMESTAMP},
#{createBy,jdbcType=BIGINT}, #{updateDate,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=BIGINT}, #{createBy,jdbcType=BIGINT}, #{updateDate,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=BIGINT},
#{delFlag,jdbcType=INTEGER}, #{deleteStatus,jdbcType=INTEGER}, #{deliveryType,jdbcType=INTEGER}, #{delFlag,jdbcType=INTEGER}, #{deleteStatus,jdbcType=INTEGER}, #{deliveryType,jdbcType=INTEGER},
#{contSign,jdbcType=VARCHAR}, #{commission,jdbcType=DECIMAL}, #{description,jdbcType=LONGVARCHAR}, #{contSign,jdbcType=VARCHAR}, #{commission,jdbcType=DECIMAL}, #{stock,jdbcType=INTEGER},
#{detailHtml,jdbcType=LONGVARCHAR}) #{description,jdbcType=LONGVARCHAR}, #{detailHtml,jdbcType=LONGVARCHAR})
</insert> </insert>
<insert id="insertSelective" parameterType="com.macro.mall.model.PmsProduct"> <insert id="insertSelective" parameterType="com.macro.mall.model.PmsProduct">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long"> <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
...@@ -380,6 +381,9 @@ ...@@ -380,6 +381,9 @@
<if test="commission != null"> <if test="commission != null">
commission, commission,
</if> </if>
<if test="stock != null">
stock,
</if>
<if test="description != null"> <if test="description != null">
description, description,
</if> </if>
...@@ -541,6 +545,9 @@ ...@@ -541,6 +545,9 @@
<if test="commission != null"> <if test="commission != null">
#{commission,jdbcType=DECIMAL}, #{commission,jdbcType=DECIMAL},
</if> </if>
<if test="stock != null">
#{stock,jdbcType=INTEGER},
</if>
<if test="description != null"> <if test="description != null">
#{description,jdbcType=LONGVARCHAR}, #{description,jdbcType=LONGVARCHAR},
</if> </if>
...@@ -714,6 +721,9 @@ ...@@ -714,6 +721,9 @@
<if test="record.commission != null"> <if test="record.commission != null">
commission = #{record.commission,jdbcType=DECIMAL}, commission = #{record.commission,jdbcType=DECIMAL},
</if> </if>
<if test="record.stock != null">
stock = #{record.stock,jdbcType=INTEGER},
</if>
<if test="record.description != null"> <if test="record.description != null">
description = #{record.description,jdbcType=LONGVARCHAR}, description = #{record.description,jdbcType=LONGVARCHAR},
</if> </if>
...@@ -779,6 +789,7 @@ ...@@ -779,6 +789,7 @@
delivery_type = #{record.deliveryType,jdbcType=INTEGER}, delivery_type = #{record.deliveryType,jdbcType=INTEGER},
cont_sign = #{record.contSign,jdbcType=VARCHAR}, cont_sign = #{record.contSign,jdbcType=VARCHAR},
commission = #{record.commission,jdbcType=DECIMAL}, commission = #{record.commission,jdbcType=DECIMAL},
stock = #{record.stock,jdbcType=INTEGER},
description = #{record.description,jdbcType=LONGVARCHAR}, description = #{record.description,jdbcType=LONGVARCHAR},
detail_html = #{record.detailHtml,jdbcType=LONGVARCHAR} detail_html = #{record.detailHtml,jdbcType=LONGVARCHAR}
<if test="_parameter != null"> <if test="_parameter != null">
...@@ -838,7 +849,8 @@ ...@@ -838,7 +849,8 @@
delete_status = #{record.deleteStatus,jdbcType=INTEGER}, delete_status = #{record.deleteStatus,jdbcType=INTEGER},
delivery_type = #{record.deliveryType,jdbcType=INTEGER}, delivery_type = #{record.deliveryType,jdbcType=INTEGER},
cont_sign = #{record.contSign,jdbcType=VARCHAR}, cont_sign = #{record.contSign,jdbcType=VARCHAR},
commission = #{record.commission,jdbcType=DECIMAL} commission = #{record.commission,jdbcType=DECIMAL},
stock = #{record.stock,jdbcType=INTEGER}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
...@@ -999,6 +1011,9 @@ ...@@ -999,6 +1011,9 @@
<if test="commission != null"> <if test="commission != null">
commission = #{commission,jdbcType=DECIMAL}, commission = #{commission,jdbcType=DECIMAL},
</if> </if>
<if test="stock != null">
stock = #{stock,jdbcType=INTEGER},
</if>
<if test="description != null"> <if test="description != null">
description = #{description,jdbcType=LONGVARCHAR}, description = #{description,jdbcType=LONGVARCHAR},
</if> </if>
...@@ -1061,6 +1076,7 @@ ...@@ -1061,6 +1076,7 @@
delivery_type = #{deliveryType,jdbcType=INTEGER}, delivery_type = #{deliveryType,jdbcType=INTEGER},
cont_sign = #{contSign,jdbcType=VARCHAR}, cont_sign = #{contSign,jdbcType=VARCHAR},
commission = #{commission,jdbcType=DECIMAL}, commission = #{commission,jdbcType=DECIMAL},
stock = #{stock,jdbcType=INTEGER},
description = #{description,jdbcType=LONGVARCHAR}, description = #{description,jdbcType=LONGVARCHAR},
detail_html = #{detailHtml,jdbcType=LONGVARCHAR} detail_html = #{detailHtml,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
...@@ -1117,7 +1133,8 @@ ...@@ -1117,7 +1133,8 @@
delete_status = #{deleteStatus,jdbcType=INTEGER}, delete_status = #{deleteStatus,jdbcType=INTEGER},
delivery_type = #{deliveryType,jdbcType=INTEGER}, delivery_type = #{deliveryType,jdbcType=INTEGER},
cont_sign = #{contSign,jdbcType=VARCHAR}, cont_sign = #{contSign,jdbcType=VARCHAR},
commission = #{commission,jdbcType=DECIMAL} commission = #{commission,jdbcType=DECIMAL},
stock = #{stock,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
</mapper> </mapper>
\ No newline at end of file
package com.macro.mall.portal.controller.quanxing;
import com.macro.mall.common.api.CommonPage;
import com.macro.mall.common.api.CommonResult;
import com.macro.mall.model.OmsChoseProduct;
import com.macro.mall.model.common.ResultMsg;
import com.macro.mall.model.dto.PmsSupplierAuditDto;
import com.macro.mall.model.dto.quanxing.OmsChoseProductDto;
import com.macro.mall.service.quanxing.IOmsChoseProductService;
import com.macro.mall.service.quanxing.IPmsSupplierAuditService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@Controller
@RequestMapping("/omsChoseProduct")
@Api(tags = "权星小程序_选择商品相关接口", description = "选择商品控制器")
public class OmsChoseProductController {
@Autowired
private IOmsChoseProductService omsChoseProductService;
@ApiOperation("权星小程序_选择商品分页查询")
@ResponseBody
@RequestMapping(value = "/getPageList", method = RequestMethod.GET)
public CommonResult<CommonPage<OmsChoseProductDto>> getListPage(@ApiParam("页数") @RequestParam("pageNum")Integer pageNum, @ApiParam("每页大小")@RequestParam("pageSize")Integer pageSize,
@ApiParam("会员id")@RequestParam("memberId")Long memberId){
return CommonResult.success(CommonPage.restPage(this.omsChoseProductService.getListPage(pageNum,pageSize,memberId)));
}
@ApiOperation("权星小程序_选择商品插入一条数据")
@ResponseBody
@RequestMapping(value = "/insertChoseProduct", method = RequestMethod.POST)
public CommonResult insertChoseProduct(@RequestBody OmsChoseProduct omsChoseProduct){
ResultMsg res =this.omsChoseProductService.insertChoseProduct(omsChoseProduct);
if(res.isFlag()){
return CommonResult.success(null,res.getMsg());
}
return CommonResult.failed(res.getMsg());
}
@ApiOperation("权星小程序_选择商品删除一条数据")
@ResponseBody
@RequestMapping(value = "/deleteChoseProduct", method = RequestMethod.POST)
public CommonResult deleteChoseProduct(@RequestBody OmsChoseProductDto omsChoseProductDto){
ResultMsg res =this.omsChoseProductService.deleteChoseProduct(omsChoseProductDto);
if(res.isFlag()){
return CommonResult.success(null,res.getMsg());
}
return CommonResult.failed(res.getMsg());
}
}
...@@ -3,7 +3,9 @@ package com.macro.mall.portal.controller.quanxing; ...@@ -3,7 +3,9 @@ package com.macro.mall.portal.controller.quanxing;
import com.macro.mall.common.api.CommonPage; import com.macro.mall.common.api.CommonPage;
import com.macro.mall.common.api.CommonResult; import com.macro.mall.common.api.CommonResult;
import com.macro.mall.domain.dto.PmsProductRequestParam;
import com.macro.mall.model.PmsProduct; import com.macro.mall.model.PmsProduct;
import com.macro.mall.model.common.ResultMsg;
import com.macro.mall.service.product.PmsProductService; import com.macro.mall.service.product.PmsProductService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -31,8 +33,32 @@ public class PmsProductController { ...@@ -31,8 +33,32 @@ public class PmsProductController {
@ApiParam("模糊查询商品名称 ")@RequestParam("name") String name, @ApiParam("模糊查询商品名称 ")@RequestParam("name") String name,
@ApiParam("是否新品 新品状态:0->不是新品;1->新品 ")@RequestParam("newStatus") Integer newStatus, @ApiParam("是否新品 新品状态:0->不是新品;1->新品 ")@RequestParam("newStatus") Integer newStatus,
@ApiParam("供应商id")@RequestParam("mchtId") Long mchtId, @ApiParam("供应商id")@RequestParam("mchtId") Long mchtId,
@ApiParam("审核状态:0->未审核;1->审核通过 2->驳回")@RequestParam("verifyStatus") Integer verifyStatus,
@ApiParam("上架状态:0->下架;1->上架")@RequestParam("publishStatus") Integer publishStatus,
@ApiParam("排序:(例如根据价格降序 传入price DESC 根据价格升序传入price ASC) ")@RequestParam("orderBy") String orderBy){ @ApiParam("排序:(例如根据价格降序 传入price DESC 根据价格升序传入price ASC) ")@RequestParam("orderBy") String orderBy){
return CommonResult.success(CommonPage.restPage(this.pmsProductService.getAppPageList(page,size,name,newStatus,mchtId,orderBy))); return CommonResult.success(CommonPage.restPage(this.pmsProductService.getAppPageList(page,size,name,newStatus,mchtId,verifyStatus,publishStatus,orderBy)));
} }
@ApiOperation("权星小程序_获取商品信息根据商品id")
@RequestMapping(value = "/getProductInfo", method = RequestMethod.GET)
@ResponseBody
public CommonResult<PmsProductRequestParam> getProductInfo(@ApiParam("商品Id") @RequestParam(value="id") Long id) {
return CommonResult.success(pmsProductService.getProductById(id));
}
@ApiOperation("权星小程序_获取供应商商品状态数量")
@RequestMapping(value = "/getSupplierProductStatus", method = RequestMethod.GET)
@ResponseBody
public CommonResult getSupplierProductStatus() {
ResultMsg res = this.pmsProductService.getSupplierProductStatus();
return CommonResult.success(res.getContext());
}
@ApiOperation("权星小程序_获取管理员商品状态数量")
@RequestMapping(value = "/getAdminProductStatus", method = RequestMethod.GET)
@ResponseBody
public CommonResult getAdminProductStatus() {
ResultMsg res = this.pmsProductService.getAdminProductStatus();
return CommonResult.success(res.getContext());
}
} }
...@@ -2,9 +2,12 @@ package com.macro.mall.dao.platform; ...@@ -2,9 +2,12 @@ package com.macro.mall.dao.platform;
import com.macro.mall.domain.dto.platform.SearchRecordParam; import com.macro.mall.domain.dto.platform.SearchRecordParam;
import com.macro.mall.domain.vo.platform.PmsSearchWordVo; import com.macro.mall.domain.vo.platform.PmsSearchWordVo;
import com.macro.mall.model.PmsSearchWord;
import java.util.List; import java.util.List;
public interface PmsSearchWordDao { public interface PmsSearchWordDao {
List<PmsSearchWordVo> queryList(SearchRecordParam param); List<PmsSearchWordVo> queryList(SearchRecordParam param);
PmsSearchWord selectOneByName(String word);
} }
...@@ -7,6 +7,7 @@ import com.macro.mall.domain.vo.product.PmsProductListResult; ...@@ -7,6 +7,7 @@ import com.macro.mall.domain.vo.product.PmsProductListResult;
import com.macro.mall.domain.vo.product.PmsProductResult; import com.macro.mall.domain.vo.product.PmsProductResult;
import com.macro.mall.domain.vo.product.RecommendProductVo; import com.macro.mall.domain.vo.product.RecommendProductVo;
import com.macro.mall.domain.vo.product.SimpleProductResult; import com.macro.mall.domain.vo.product.SimpleProductResult;
import com.macro.mall.model.PmsProduct;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.ModelAttribute;
...@@ -100,12 +101,10 @@ public interface PmsProductDao { ...@@ -100,12 +101,10 @@ public interface PmsProductDao {
/** /**
* 获取个类型商品数量 * 获取个类型商品数量
*/ */
Integer getProductCount(@Param("mchtId")Long mchtId, Integer getProductCount(PmsProduct pmsProduct);
@Param("publishStatus")Integer publishStatus,
@Param("promotionType")Integer promotionType,
@Param("newStatus")Integer newStatus);
Integer getWarnProduct(@Param("mchtId")Long mchtId); Integer getWarnProduct(@Param("mchtId")Long mchtId);
List<RecommendProductVo> getRecommendProduct(@Param("brandId")Long brandId); List<RecommendProductVo> getRecommendProduct(@Param("brandId")Long brandId);
} }
package com.macro.mall.dao.quanxing;
import com.macro.mall.model.dto.quanxing.OmsChoseProductDto;
import java.util.List;
public interface OmsChoseProductDao {
List<OmsChoseProductDto> selectListByMemberId(Long memberId);
}
package com.macro.mall.dao.quanxing; package com.macro.mall.dao.quanxing;
import com.macro.mall.model.PmsProductSkuValue; import com.macro.mall.model.PmsProductSkuValue;
import com.macro.mall.model.dto.quanxing.PmsProductSkuValueDto;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import javax.transaction.Transactional; import javax.transaction.Transactional;
...@@ -19,7 +20,7 @@ public interface PmsProductSkuValueDao { ...@@ -19,7 +20,7 @@ public interface PmsProductSkuValueDao {
* @param productId * @param productId
* @return * @return
*/ */
List<PmsProductSkuValue> selectListByProductId(Long productId); List<PmsProductSkuValueDto> selectListByProductId(Long productId);
/** /**
* 根据商品id 修改删除状态 * 根据商品id 修改删除状态
......
...@@ -7,4 +7,11 @@ import java.util.List; ...@@ -7,4 +7,11 @@ import java.util.List;
public interface PmsSupplierAuditDao { public interface PmsSupplierAuditDao {
PmsSupplierAudit selectOneByMemberId(Long memberId); PmsSupplierAudit selectOneByMemberId(Long memberId);
/**
* 返回数量
* @param pmsSupplierAudit
* @return
*/
Integer selectCount(PmsSupplierAudit pmsSupplierAudit);
} }
...@@ -3,6 +3,8 @@ package com.macro.mall.domain.dto; ...@@ -3,6 +3,8 @@ package com.macro.mall.domain.dto;
import com.macro.mall.model.PmsProduct; import com.macro.mall.model.PmsProduct;
import com.macro.mall.model.PmsProductSkuValue; import com.macro.mall.model.PmsProductSkuValue;
import com.macro.mall.model.PmsSkuStock; import com.macro.mall.model.PmsSkuStock;
import com.macro.mall.model.UmsMember;
import com.macro.mall.model.dto.quanxing.PmsProductSkuValueDto;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -13,10 +15,11 @@ import java.util.List; ...@@ -13,10 +15,11 @@ import java.util.List;
public class PmsProductRequestParam implements Serializable { public class PmsProductRequestParam implements Serializable {
@ApiModelProperty(value="商品对象") @ApiModelProperty(value="商品对象")
PmsProduct pmsProduct; private PmsProduct pmsProduct;
@ApiModelProperty(value="商品规格值集合") @ApiModelProperty(value="商品规格值集合")
List<PmsProductSkuValue> pmsProductSkuValueList; private List<PmsProductSkuValueDto> pmsProductSkuValueList;
@ApiModelProperty(value="商品sku集合") @ApiModelProperty(value="商品sku集合")
List<PmsSkuStock> pmsSkuStockList; private List<PmsSkuStock> pmsSkuStockList;
@ApiModelProperty(value="商家相关会员信息")
private UmsMember member;
} }
...@@ -205,5 +205,17 @@ public interface PmsProductService { ...@@ -205,5 +205,17 @@ public interface PmsProductService {
* @param newStatus * @param newStatus
* @return * @return
*/ */
List<PmsProduct> getAppPageList(Integer pageNum,Integer pageSize,String name,Integer newStatus,Long mchtId,String orderBy); List<PmsProduct> getAppPageList(Integer pageNum,Integer pageSize,String name,Integer newStatus,Long mchtId,Integer verifyStatus,Integer publishStatus,String orderBy);
/**
* 获取供应商个人中心商品状态
* @return
*/
ResultMsg getSupplierProductStatus();
/**
* 获取管理员个人中心商品状态
* @return
*/
ResultMsg getAdminProductStatus();
} }
...@@ -6,6 +6,7 @@ import com.macro.mall.common.api.StringUtils; ...@@ -6,6 +6,7 @@ import com.macro.mall.common.api.StringUtils;
import com.macro.mall.dao.platform.PmsSearchWordDao; import com.macro.mall.dao.platform.PmsSearchWordDao;
import com.macro.mall.dao.product.*; import com.macro.mall.dao.product.*;
import com.macro.mall.dao.quanxing.PmsProductSkuValueDao; import com.macro.mall.dao.quanxing.PmsProductSkuValueDao;
import com.macro.mall.dao.quanxing.PmsSupplierAuditDao;
import com.macro.mall.domain.dto.MchtProductQueryParam; import com.macro.mall.domain.dto.MchtProductQueryParam;
import com.macro.mall.domain.dto.PmsProductPicSearchParam; import com.macro.mall.domain.dto.PmsProductPicSearchParam;
import com.macro.mall.domain.dto.PmsProductRequestParam; import com.macro.mall.domain.dto.PmsProductRequestParam;
...@@ -55,8 +56,6 @@ public class PmsProductServiceImpl implements PmsProductService { ...@@ -55,8 +56,6 @@ public class PmsProductServiceImpl implements PmsProductService {
@Resource @Resource
private PmsProductDao pmsProductDao; private PmsProductDao pmsProductDao;
@Resource @Resource
private PmsCommentRepository pmsCommentRepository;
@Resource
private PmsProductWholesalePriceRepository pmsProductWholesalePriceRepository; private PmsProductWholesalePriceRepository pmsProductWholesalePriceRepository;
@Resource @Resource
private UmsMemberReceiveAddressRepository umsMemberReceiveAddressRepository; private UmsMemberReceiveAddressRepository umsMemberReceiveAddressRepository;
...@@ -71,36 +70,18 @@ public class PmsProductServiceImpl implements PmsProductService { ...@@ -71,36 +70,18 @@ public class PmsProductServiceImpl implements PmsProductService {
@Resource @Resource
private PmsProductMapper productMapper; private PmsProductMapper productMapper;
@Resource @Resource
private PmsSkuStockDao skuStockDao;
@Resource
private PmsSkuStockMapper skuStockMapper;
@Resource
private PmsProductAttributeValueDao productAttributeValueDao;
@Resource
private PmsProductAttributeValueMapper productAttributeValueMapper;
@Resource
private PmsProductDao productDao; private PmsProductDao productDao;
@Resource @Resource
private PmsProductVertifyRecordDao productVertifyRecordDao; private PmsProductVertifyRecordDao productVertifyRecordDao;
@Resource @Resource
private PmsProductCategoryHistoryMapper pmsProductCategoryHistoryMapper;
@Resource
private PmsProductRecommendDao pmsProductRecommendDao;
@Resource
private PmsProductRecommendMapper pmsProductRecommendMapper; private PmsProductRecommendMapper pmsProductRecommendMapper;
@Resource @Resource
private PmsProductWholesalePriceDao pmsProductWholesalePriceDao;
@Resource
private PmsProductWholesalePriceMapper pmsProductWholesalePriceMapper; private PmsProductWholesalePriceMapper pmsProductWholesalePriceMapper;
@Resource @Resource
private PmsProductCustomAttributeDao pmsProductCustomAttributeDao;
@Resource
private PmsProductCustomAttributeMapper pmsProductCustomAttributeMapper; private PmsProductCustomAttributeMapper pmsProductCustomAttributeMapper;
@Resource @Resource
private PmsProductLabelRelationMapper pmsProductLabelRelationMapper; private PmsProductLabelRelationMapper pmsProductLabelRelationMapper;
@Resource @Resource
private PmsProductLabelRelationDao pmsProductLabelRelationDao;
@Resource
private PmsProductAttributeValueMapper pmsProductAttributeValueMapper; private PmsProductAttributeValueMapper pmsProductAttributeValueMapper;
@Resource @Resource
private PmsSkuStockMapper pmsSkuStockMapper; private PmsSkuStockMapper pmsSkuStockMapper;
...@@ -124,7 +105,12 @@ public class PmsProductServiceImpl implements PmsProductService { ...@@ -124,7 +105,12 @@ public class PmsProductServiceImpl implements PmsProductService {
private UmsMemberService umsMemberService; private UmsMemberService umsMemberService;
@Resource @Resource
private PmsSearchWordMapper pmsSearchWordMapper; private PmsSearchWordMapper pmsSearchWordMapper;
@Resource
private PmsSupplierAuditDao pmsSupplierAuditDao;
@Resource
private UmsMemberMapper umsMemberMapper;
@Resource
private PmsSearchWordDao pmsSearchWordDao;
/** /**
* 权星添加商品 * 权星添加商品
* @param pmsProductRequestParam * @param pmsProductRequestParam
...@@ -493,6 +479,10 @@ public class PmsProductServiceImpl implements PmsProductService { ...@@ -493,6 +479,10 @@ public class PmsProductServiceImpl implements PmsProductService {
pmsProductRequestParam.setPmsProductSkuValueList(this.pmsProductSkuValueDao.selectListByProductId(id)); pmsProductRequestParam.setPmsProductSkuValueList(this.pmsProductSkuValueDao.selectListByProductId(id));
//根据商品id查询相关sku //根据商品id查询相关sku
pmsProductRequestParam.setPmsSkuStockList(this.pmsSkuStockDao.selectListByProductId(id)); pmsProductRequestParam.setPmsSkuStockList(this.pmsSkuStockDao.selectListByProductId(id));
//查询商品相关商家
if(pmsProductRequestParam.getPmsProduct() != null && pmsProductRequestParam.getPmsProduct().getMchtId() != null){
pmsProductRequestParam.setMember(this.umsMemberMapper.selectByPrimaryKey(pmsProductRequestParam.getPmsProduct().getMchtId()));
}
return pmsProductRequestParam; return pmsProductRequestParam;
} }
...@@ -888,7 +878,7 @@ public class PmsProductServiceImpl implements PmsProductService { ...@@ -888,7 +878,7 @@ public class PmsProductServiceImpl implements PmsProductService {
* @return * @return
*/ */
@Override @Override
public List<PmsProduct> getAppPageList(Integer pageNum,Integer pageSize,String name,Integer newStatus,Long mchtId,String orderBy){ public List<PmsProduct> getAppPageList(Integer pageNum,Integer pageSize,String name,Integer newStatus,Long mchtId,Integer verifyStatus,Integer publishStatus,String orderBy){
PageHelper.startPage(pageNum, pageSize); PageHelper.startPage(pageNum, pageSize);
PmsProductExample example = new PmsProductExample(); PmsProductExample example = new PmsProductExample();
PmsProductExample.Criteria criteria = example.createCriteria(); PmsProductExample.Criteria criteria = example.createCriteria();
...@@ -898,6 +888,8 @@ public class PmsProductServiceImpl implements PmsProductService { ...@@ -898,6 +888,8 @@ public class PmsProductServiceImpl implements PmsProductService {
//获取当前操作会员的id //获取当前操作会员的id
Long memberId = umsMemberService.getCurrentMemberId(); Long memberId = umsMemberService.getCurrentMemberId();
//添加记录 //添加记录
PmsSearchWord psw = this.pmsSearchWordDao.selectOneByName(name);
if(psw == null){
PmsSearchWord pmsSearchWord = new PmsSearchWord(); PmsSearchWord pmsSearchWord = new PmsSearchWord();
pmsSearchWord.setWord(name); pmsSearchWord.setWord(name);
pmsSearchWord.setCreateBy(memberId); pmsSearchWord.setCreateBy(memberId);
...@@ -905,17 +897,100 @@ public class PmsProductServiceImpl implements PmsProductService { ...@@ -905,17 +897,100 @@ public class PmsProductServiceImpl implements PmsProductService {
pmsSearchWord.setUpdateDate(new Date()); pmsSearchWord.setUpdateDate(new Date());
pmsSearchWordMapper.insertSelective(pmsSearchWord); pmsSearchWordMapper.insertSelective(pmsSearchWord);
} }
}
if(newStatus != null){ if(newStatus != null){
criteria.andNewStatusEqualTo(newStatus); criteria.andNewStatusEqualTo(newStatus);
} }
if(mchtId != null){ if(mchtId != null){
criteria.andCreateByEqualTo(mchtId); criteria.andMchtIdEqualTo(mchtId);
} }
if(verifyStatus != null){
criteria.andVerifyStatusEqualTo(verifyStatus);
}else{
criteria.andVerifyStatusEqualTo(1);//审核状态:0->未审核;1->审核通过 2->驳回 3->审核失败 criteria.andVerifyStatusEqualTo(1);//审核状态:0->未审核;1->审核通过 2->驳回 3->审核失败
criteria.andDeleteStatusEqualTo(0);//删除标识0 未删除 1已删除(彻底删除) }
if(publishStatus != null){
criteria.andPublishStatusEqualTo(publishStatus);
}else{
criteria.andPublishStatusEqualTo(1);//上架状态:0->下架;1->上架 criteria.andPublishStatusEqualTo(1);//上架状态:0->下架;1->上架
}
criteria.andDeleteStatusEqualTo(0);//删除标识0 未删除 1已删除(彻底删除)
//注意:排序使用的是列名 //注意:排序使用的是列名
example.setOrderByClause(orderBy); example.setOrderByClause(orderBy);
return this.pmsProductMapper.selectByExample(example); return this.pmsProductMapper.selectByExample(example);
} }
/**
* 获取供应商个人中心商品状态
* @return
*/
@Override
public ResultMsg getSupplierProductStatus(){
//获取当前操作会员的id
Long memberId = umsMemberService.getCurrentMemberId();
//数据Map
Map<String,Object> dataMap =new HashMap<>();
//获取待审核
PmsProduct pmsProduct = new PmsProduct();
pmsProduct.setVerifyStatus(0);//审核状态:0->未审核;1->审核通过 2->驳回 3->审核失败
pmsProduct.setMchtId(memberId);
dataMap.put("待审核",this.productDao.getProductCount(pmsProduct));
//获取已审核的
pmsProduct = new PmsProduct();
pmsProduct.setMchtId(memberId);
pmsProduct.setVerifyStatus(1);//审核状态:0->未审核;1->审核通过 2->驳回 3->审核失败
dataMap.put("已审核",this.productDao.getProductCount(pmsProduct));
//获取未通过
pmsProduct = new PmsProduct();
pmsProduct.setMchtId(memberId);
pmsProduct.setVerifyStatus(2);//审核状态:0->未审核;1->审核通过 2->驳回 3->审核失败
dataMap.put("未通过",this.productDao.getProductCount(pmsProduct));
//获取已下架
pmsProduct = new PmsProduct();
pmsProduct.setMchtId(memberId);
pmsProduct.setVerifyStatus(1);//审核状态:0->未审核;1->审核通过 2->驳回 3->审核失败
pmsProduct.setPublishStatus(0);//上架状态:0->下架;1->上架
dataMap.put("已下架",this.productDao.getProductCount(pmsProduct));
return new ResultMsg(true,"获取数据成功",dataMap);
}
/**
* 获取管理员个人中心商品状态
* @return
*/
@Override
public ResultMsg getAdminProductStatus(){
//数据Map
Map<String,Object> dataMap =new HashMap<>();
//获取待审核
PmsProduct pmsProduct = new PmsProduct();
pmsProduct.setVerifyStatus(0);//审核状态:0->未审核;1->审核通过 2->驳回 3->审核失败
dataMap.put("待审核商品",this.productDao.getProductCount(pmsProduct));
//获取已审核的
pmsProduct = new PmsProduct();
pmsProduct.setVerifyStatus(1);//审核状态:0->未审核;1->审核通过 2->驳回 3->审核失败
dataMap.put("已审核商品",this.productDao.getProductCount(pmsProduct));
//获取未通过
pmsProduct = new PmsProduct();
pmsProduct.setVerifyStatus(2);//审核状态:0->未审核;1->审核通过 2->驳回 3->审核失败
dataMap.put("未通过商品",this.productDao.getProductCount(pmsProduct));
//获取待审核供应商
PmsSupplierAudit pmsSupplierAudit = new PmsSupplierAudit();
pmsSupplierAudit.setStatus(0);//审核状态 0待审核 1审核通过 2审核不通过
dataMap.put("待审核供应商",this.pmsSupplierAuditDao.selectCount(pmsSupplierAudit));
//获取待审核供应商
pmsSupplierAudit = new PmsSupplierAudit();
pmsSupplierAudit.setStatus(1);//审核状态 0待审核 1审核通过 2审核不通过
dataMap.put("已审核供应商",this.pmsSupplierAuditDao.selectCount(pmsSupplierAudit));
//获取待审核供应商
pmsSupplierAudit = new PmsSupplierAudit();
pmsSupplierAudit.setStatus(2);//审核状态 0待审核 1审核通过 2审核不通过
dataMap.put("未通过供应商",this.pmsSupplierAuditDao.selectCount(pmsSupplierAudit));
return new ResultMsg(true,"查询成功",dataMap);
}
} }
package com.macro.mall.service.quanxing;
import com.macro.mall.model.OmsChoseProduct;
import com.macro.mall.model.common.ResultMsg;
import com.macro.mall.model.dto.quanxing.OmsChoseProductDto;
import java.util.List;
public interface IOmsChoseProductService {
/**
* 获取选择商品分页数据
* @param pageNum
* @param pageSize
* @param memberId
* @return
*/
List<OmsChoseProductDto> getListPage(Integer pageNum,Integer pageSize,Long memberId);
/**
* 插入一条选择商品
* @param omsChoseProduct
* @return
*/
ResultMsg insertChoseProduct(OmsChoseProduct omsChoseProduct);
/**
* 删除选择商品
* @param omsChoseProductDto
* @return
*/
ResultMsg deleteChoseProduct(OmsChoseProductDto omsChoseProductDto);
}
package com.macro.mall.service.quanxing.impl;
import com.github.pagehelper.PageHelper;
import com.macro.mall.dao.quanxing.OmsChoseProductDao;
import com.macro.mall.mapper.OmsChoseProductMapper;
import com.macro.mall.model.OmsChoseProduct;
import com.macro.mall.model.common.ResultMsg;
import com.macro.mall.model.dto.quanxing.OmsChoseProductDto;
import com.macro.mall.service.member.UmsMemberService;
import com.macro.mall.service.quanxing.IOmsChoseProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List;
@Service
public class OmsChoseProductServiceImpl implements IOmsChoseProductService {
@Resource
private OmsChoseProductMapper omsChoseProductMapper;
@Resource
private OmsChoseProductDao omsChoseProductDao;
@Autowired
private UmsMemberService umsMemberService;
/**
* 获取选择商品分页数据
* @param pageNum
* @param pageSize
* @param memberId
* @return
*/
@Override
public List<OmsChoseProductDto> getListPage(Integer pageNum, Integer pageSize, Long memberId){
PageHelper.startPage(pageNum, pageSize);
OmsChoseProductDto omsChoseProductDto = new OmsChoseProductDto();
omsChoseProductDto.setMemberId(memberId);
return this.omsChoseProductDao.selectListByMemberId(memberId);
}
/**
* 插入一条选择商品
* @param omsChoseProduct
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public ResultMsg insertChoseProduct(OmsChoseProduct omsChoseProduct){
if(omsChoseProduct.getProductId() == null){
return new ResultMsg(false,"传入商品为空");
}
omsChoseProduct.setMemberId(this.umsMemberService.getCurrentMemberId());
this.omsChoseProductMapper.insertSelective(omsChoseProduct);
return new ResultMsg(true,"操作成功");
}
/**
* 删除选择商品
* @param omsChoseProductDto
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public ResultMsg deleteChoseProduct(OmsChoseProductDto omsChoseProductDto){
if(omsChoseProductDto.getIds() == null || "".equals(omsChoseProductDto.getIds())){
return new ResultMsg(false,"传入id为空");
}
List idList = Arrays.asList(omsChoseProductDto.getIds().split(","));//根据逗号分隔转化为list
idList.forEach(id ->{
this.omsChoseProductMapper.deleteByPrimaryKey(Long.valueOf((String)id));
});
return new ResultMsg(true,"操作成功");
}
}
...@@ -3,9 +3,17 @@ ...@@ -3,9 +3,17 @@
<mapper namespace="com.macro.mall.dao.platform.PmsSearchWordDao"> <mapper namespace="com.macro.mall.dao.platform.PmsSearchWordDao">
<resultMap id="searchWordVoMap" type="com.macro.mall.domain.vo.platform.PmsSearchWordVo" extends="com.macro.mall.mapper.PmsSearchWordMapper.BaseResultMap"> <resultMap id="searchWordVoMap" type="com.macro.mall.domain.vo.platform.PmsSearchWordVo" extends="com.macro.mall.mapper.PmsSearchWordMapper.BaseResultMap">
</resultMap> </resultMap>
<resultMap id="BaseResultMap" type="com.macro.mall.model.PmsSearchWord" extends="com.macro.mall.mapper.PmsSearchWordMapper.BaseResultMap">
</resultMap>
<select id="queryList" resultMap="searchWordVoMap"> <select id="queryList" resultMap="searchWordVoMap">
select * from select * from
pms_search_word pms_search_word
order by create_date desc order by create_date desc
</select> </select>
<select id="selectOneByName" parameterType="java.lang.String" resultMap="BaseResultMap">
select * from pms_search_word
where word = #{word}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -541,23 +541,20 @@ ...@@ -541,23 +541,20 @@
order by b.sales_volume desc order by b.sales_volume desc
</select> </select>
<select id="getProductCount" resultType="Integer"> <select id="getProductCount" resultType="Integer" parameterType="com.macro.mall.model.PmsProduct">
select select
count(id) count(*)
from from
pms_product pms_product
<where> <where>
delete_status = 0 delete_status = 0
<if test="publishStatus != null and publishStatus != ''"> <if test="publishStatus != null">
and publish_status = #{publishStatus} and publish_status = #{publishStatus}
</if> </if>
<if test="promotionType != null and promotionType != ''"> <if test="verifyStatus != null ">
and promotion_type in (1,2,3,4,5) and verify_status = #{verifyStatus}
</if> </if>
<if test="newStatus != null and newStatus != ''"> <if test="mchtId != null">
and new_status = #{newStatus}
</if>
<if test="mchtId != null and mchtId != ''">
and mcht_id = #{mchtId} and mcht_id = #{mchtId}
</if> </if>
</where> </where>
...@@ -588,4 +585,6 @@ ...@@ -588,4 +585,6 @@
order by rand() order by rand()
limit 0,6 limit 0,6
</select> </select>
</mapper> </mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.macro.mall.dao.quanxing.OmsChoseProductDao">
<resultMap id="BaseResultMap" type="com.macro.mall.model.dto.quanxing.OmsChoseProductDto" extends="com.macro.mall.mapper.OmsChoseProductMapper.BaseResultMap">
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="price" jdbcType="DECIMAL" property="price" />
<result column="product_pic" jdbcType="VARCHAR" property="productPic" />
<result column="stock" jdbcType="INTEGER" property="stock" />
</resultMap>
<select id="selectListByMemberId" parameterType="java.lang.Long" resultMap="BaseResultMap">
select a.*,b.name,b.price,b.stock,b.product_pic from oms_chose_product a
left join pms_product b ON a.product_id = b.id
where a.member_id = #{memberId}
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.macro.mall.dao.quanxing.PmsProductSkuValueDao"> <mapper namespace="com.macro.mall.dao.quanxing.PmsProductSkuValueDao">
<resultMap id="BaseResultMap" type="com.macro.mall.model.PmsProductSkuValue" extends="com.macro.mall.mapper.PmsProductSkuValueMapper.BaseResultMap"> <resultMap id="BaseResultMap" type="com.macro.mall.model.dto.quanxing.PmsProductSkuValueDto" extends="com.macro.mall.mapper.PmsProductSkuValueMapper.BaseResultMap">
<result column="typeName" jdbcType="VARCHAR" property="typeName" />
</resultMap> </resultMap>
<insert id="insertList"> <insert id="insertList">
...@@ -16,9 +16,10 @@ ...@@ -16,9 +16,10 @@
</insert> </insert>
<select id="selectListByProductId" parameterType="java.lang.Long" resultMap="BaseResultMap"> <select id="selectListByProductId" parameterType="java.lang.Long" resultMap="BaseResultMap">
select * from pms_product_sku_value select a.* ,b.name typeName from pms_product_sku_value a
where product_id=#{productId} left join pms_product_attribute_type b ON a.product_attribute_id = b.id
and delete_status = 0 where a.product_id=#{productId}
and a.delete_status = 0
</select> </select>
<update id="updateDeleteStatusByProductId" parameterType="com.macro.mall.model.PmsProductSkuValue"> <update id="updateDeleteStatusByProductId" parameterType="com.macro.mall.model.PmsProductSkuValue">
......
...@@ -10,4 +10,13 @@ ...@@ -10,4 +10,13 @@
where member_id = #{memberId} where member_id = #{memberId}
</select> </select>
<select id="selectCount" resultType="java.lang.Integer" parameterType="com.macro.mall.model.PmsSupplierAudit">
select count(*) from pms_supplier_audit
where delete_status = 0
<if test="status != null">
and status = #{status}
</if>
</select>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment