提交 24c630b9 作者: zhenjie

商品评价

上级 19df9061
...@@ -3,10 +3,7 @@ package com.mmc.oms.controller.uav; ...@@ -3,10 +3,7 @@ package com.mmc.oms.controller.uav;
import com.mmc.oms.common.result.ResultBody; import com.mmc.oms.common.result.ResultBody;
import com.mmc.oms.controller.BaseController; import com.mmc.oms.controller.BaseController;
import com.mmc.oms.model.dto.ContractInfoDTO; import com.mmc.oms.model.dto.ContractInfoDTO;
import com.mmc.oms.model.dto.uav.MultiUavOrderDTO; import com.mmc.oms.model.dto.uav.*;
import com.mmc.oms.model.dto.uav.UavCartCompanyDTO;
import com.mmc.oms.model.dto.uav.UavOrderDTO;
import com.mmc.oms.model.dto.uav.UavOrderStatusDTO;
import com.mmc.oms.model.qo.uav.UavOrderQO; import com.mmc.oms.model.qo.uav.UavOrderQO;
import com.mmc.oms.model.vo.uav.*; import com.mmc.oms.model.vo.uav.*;
import com.mmc.oms.service.uav.UavOrderService; import com.mmc.oms.service.uav.UavOrderService;
...@@ -144,6 +141,13 @@ public class UavOrderController extends BaseController { ...@@ -144,6 +141,13 @@ public class UavOrderController extends BaseController {
return uavOrderService.removeUavOrder(id); return uavOrderService.removeUavOrder(id);
} }
@ApiOperation(value = "商品评价")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = UavOrderRemarkDTO.class)})
@GetMapping("listGoodsRemark")
public List<UavOrderRemarkDTO> listGoodsRemark(@RequestParam Integer remarkType, @RequestParam Integer goodsId) {
return uavOrderService.listGoodsRemark(remarkType, goodsId);
}
// 设置订单抽成比例 // 设置订单抽成比例
// 微信完成回调-修改订单状态 // 微信完成回调-修改订单状态
......
...@@ -43,7 +43,7 @@ public interface UavOrderDao { ...@@ -43,7 +43,7 @@ public interface UavOrderDao {
void checkPay(UavOrderPayDO uavOrderPayDO); void checkPay(UavOrderPayDO uavOrderPayDO);
void addRemarkOrder(UavOrderRemarkDO uavOrderRemarkDO); void addRemarkOrder(List<UavOrderRemarkDO> uavOrderRemarkDOS);
UavOrderPayDO getUavOrderPayById(Integer id); UavOrderPayDO getUavOrderPayById(Integer id);
...@@ -56,4 +56,6 @@ public interface UavOrderDao { ...@@ -56,4 +56,6 @@ public interface UavOrderDao {
int getOrderCount(); int getOrderCount();
BigDecimal getSaleOrderGMV(); BigDecimal getSaleOrderGMV();
List<UavOrderRemarkDO> listGoodsRemark(Integer remarkType, Integer goodsId);
} }
package com.mmc.oms.entity.uav; package com.mmc.oms.entity.uav;
import com.mmc.oms.model.dto.uav.UavOrderRemarkDTO;
import com.mmc.oms.model.vo.uav.UavOrderRemarkVO; import com.mmc.oms.model.vo.uav.UavOrderRemarkVO;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -21,6 +22,8 @@ public class UavOrderRemarkDO implements Serializable { ...@@ -21,6 +22,8 @@ public class UavOrderRemarkDO implements Serializable {
private static final long serialVersionUID = 3316555339556069007L; private static final long serialVersionUID = 3316555339556069007L;
@ApiModelProperty(value = "评价id") @ApiModelProperty(value = "评价id")
private Integer id; private Integer id;
@ApiModelProperty(value = "评价类型,0商城,1租赁")
private Integer remarkType;
@ApiModelProperty(value = "商品id") @ApiModelProperty(value = "商品id")
private Integer mallGoodsId; private Integer mallGoodsId;
@ApiModelProperty(value = "订单id") @ApiModelProperty(value = "订单id")
...@@ -32,6 +35,12 @@ public class UavOrderRemarkDO implements Serializable { ...@@ -32,6 +35,12 @@ public class UavOrderRemarkDO implements Serializable {
@ApiModelProperty(value = "评论内容") @ApiModelProperty(value = "评论内容")
private String content; private String content;
public UavOrderRemarkDTO buildUavOrderRemarkDTO() {
return UavOrderRemarkDTO.builder().id(this.id).remarkType(this.remarkType).mallGoodsId(this.mallGoodsId)
.uavOrderId(this.uavOrderId).remarkLevel(this.remarkLevel).content(this.content).uavImages(this.uavImages)
.build();
}
public UavOrderRemarkDO(UavOrderRemarkVO uavOrderRemarkVO){ public UavOrderRemarkDO(UavOrderRemarkVO uavOrderRemarkVO){
this.id = uavOrderRemarkVO.getId(); this.id = uavOrderRemarkVO.getId();
this.mallGoodsId = uavOrderRemarkVO.getMallGoodsId(); this.mallGoodsId = uavOrderRemarkVO.getMallGoodsId();
......
...@@ -39,7 +39,10 @@ public class AuthSignatureFilter implements AuthFilter { ...@@ -39,7 +39,10 @@ public class AuthSignatureFilter implements AuthFilter {
/** /**
* 无需登录白名单 * 无需登录白名单
*/ */
private static final String[] IGNORE_URLS = {"/oms/swagger-resources", "/oms/v2/api-docs", "/oms/doc.html", "/oms/mallorder/listStatus","/oms/actuator/health/readiness", "/oms/uav-order/finishSign", "/oms/uav-order/statusList"}; private static final String[] IGNORE_URLS = {"/oms/swagger-resources", "/oms/v2/api-docs", "/oms/doc.html",
"/oms/mallorder/listStatus","/oms/actuator/health/readiness", "/oms/uav-order/finishSign", "/oms/uav-order/statusList",
"/oms/uav-order/listGoodsRemark"
};
/*无需加密狗无需登录白名单*/ /*无需加密狗无需登录白名单*/
private static final String[] USE_KEY = {"/oms/account/loginByUsbKey"}; private static final String[] USE_KEY = {"/oms/account/loginByUsbKey"};
......
package com.mmc.oms.model.dto.uav;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @author: zj
* @Date: 2023/9/23 15:05
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class UavOrderRemarkDTO implements Serializable {
private static final long serialVersionUID = 2751635245494487278L;
@ApiModelProperty(value = "评价id")
private Integer id;
@ApiModelProperty(value = "评价类型,0商城,1租赁")
private Integer remarkType;
@ApiModelProperty(value = "订单id")
private Integer uavOrderId;
@ApiModelProperty(value = "商品id")
private Integer mallGoodsId;
@ApiModelProperty(value = "评分")
private Integer remarkLevel;
@ApiModelProperty(value = "图片地址,‘,’隔开")
private String uavImages;
@ApiModelProperty(value = "评论内容")
private String content;
}
package com.mmc.oms.service.uav; package com.mmc.oms.service.uav;
import com.mmc.oms.common.result.ResultBody; import com.mmc.oms.common.result.ResultBody;
import com.mmc.oms.model.dto.uav.UavOrderRemarkDTO;
import com.mmc.oms.model.dto.user.BaseAccountDTO; import com.mmc.oms.model.dto.user.BaseAccountDTO;
import com.mmc.oms.model.qo.uav.UavOrderQO; import com.mmc.oms.model.qo.uav.UavOrderQO;
import com.mmc.oms.model.vo.uav.*; import com.mmc.oms.model.vo.uav.*;
...@@ -8,6 +9,7 @@ import com.mmc.oms.model.vo.wallet.TopUpOrderVO; ...@@ -8,6 +9,7 @@ import com.mmc.oms.model.vo.wallet.TopUpOrderVO;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.List;
/** /**
* @author: zj * @author: zj
...@@ -54,4 +56,6 @@ public interface UavOrderService { ...@@ -54,4 +56,6 @@ public interface UavOrderService {
ResultBody deductWallet(BigDecimal allShareAmount, BigDecimal allSalaryAmount, BaseAccountDTO currentAccount); ResultBody deductWallet(BigDecimal allShareAmount, BigDecimal allSalaryAmount, BaseAccountDTO currentAccount);
List<UavOrderRemarkDTO> listGoodsRemark(Integer remarkType, Integer goodsId);
} }
...@@ -458,9 +458,17 @@ public class UavOrderServiceImpl implements UavOrderService { ...@@ -458,9 +458,17 @@ public class UavOrderServiceImpl implements UavOrderService {
} }
// 修改订单状态 // 修改订单状态
this.updateUavOrderStatus(uavOrderRemarkVO.getUavOrderId(), UavOrderStatus.WAITING_REMARK); this.updateUavOrderStatus(uavOrderRemarkVO.getUavOrderId(), UavOrderStatus.WAITING_REMARK);
// 填入评价内容 List<UavOrderSkuDO> uavOrderSkuDOS = uavOrderDao.listUavOrderSkuDO(uavOrderDO.getId());
UavOrderRemarkDO uavOrderRemarkDO = new UavOrderRemarkDO(uavOrderRemarkVO); List<Integer> mallGoodsIds = uavOrderSkuDOS.stream().map(i -> i.getMallGoodsId()).distinct().collect(Collectors.toList());
uavOrderDao.addRemarkOrder(uavOrderRemarkDO); List<UavOrderRemarkDO> uavOrderRemarkDOS = new ArrayList<UavOrderRemarkDO>();
for (Integer mallGoodsId : mallGoodsIds) {
// 填入评价内容
UavOrderRemarkDO uavOrderRemarkDO = new UavOrderRemarkDO(uavOrderRemarkVO);
uavOrderRemarkDO.setRemarkType(0);
uavOrderRemarkDO.setMallGoodsId(mallGoodsId);
uavOrderRemarkDOS.add(uavOrderRemarkDO);
}
uavOrderDao.addRemarkOrder(uavOrderRemarkDOS);
return ResultBody.success(); return ResultBody.success();
} }
...@@ -855,4 +863,11 @@ public class UavOrderServiceImpl implements UavOrderService { ...@@ -855,4 +863,11 @@ public class UavOrderServiceImpl implements UavOrderService {
} }
return ResultBody.success(); return ResultBody.success();
} }
@Override
public List<UavOrderRemarkDTO> listGoodsRemark(Integer remarkType, Integer goodsId) {
List<UavOrderRemarkDO> remarkDOS = uavOrderDao.listGoodsRemark(remarkType, goodsId);
return CollectionUtils.isNotEmpty(remarkDOS) ? remarkDOS.stream()
.map(UavOrderRemarkDO::buildUavOrderRemarkDTO).collect(Collectors.toList()) : null;
}
} }
...@@ -87,9 +87,12 @@ ...@@ -87,9 +87,12 @@
#{refuseReason}, NOW(), #{checkTime}) #{refuseReason}, NOW(), #{checkTime})
</insert> </insert>
<insert id="addRemarkOrder" parameterType="com.mmc.oms.entity.uav.UavOrderRemarkDO"> <insert id="addRemarkOrder" keyProperty="id" useGeneratedKeys="true">
insert into uav_order_remark (mall_goods_id, uav_order_id, remark_level, uav_images, content, create_time) insert into uav_order_remark (remark_type, mall_goods_id, uav_order_id, remark_level, uav_images, content, create_time)
values (#{mallGoodsId}, #{uavOrderId}, #{remarkLevel}, #{uavImages}, #{content}, NOW()) values
<foreach item="item" collection="list" separator=",">
(#{item.remarkType}, #{item.mallGoodsId}, #{item.uavOrderId}, #{item.remarkLevel}, #{item.uavImages}, #{item.content}, NOW())
</foreach>
</insert> </insert>
<insert id="batchAddOrder" keyProperty="id" useGeneratedKeys="true"> <insert id="batchAddOrder" keyProperty="id" useGeneratedKeys="true">
...@@ -306,4 +309,10 @@ ...@@ -306,4 +309,10 @@
FROM uav_order FROM uav_order
WHERE status_code <![CDATA[<>]]> 900 WHERE status_code <![CDATA[<>]]> 900
</select> </select>
<select id="listGoodsRemark" resultType="com.mmc.oms.entity.uav.UavOrderRemarkDO">
select id, remark_type, mall_goods_id, uav_order_id, remark_level, uav_images, content, create_time
from uav_order_remark
where mall_goods_id = #{goodsId} and remark_type = #{remarkType}
</select>
</mapper> </mapper>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论