提交 7f64a5ff authored 作者: zgy's avatar zgy

商品详情显示邮费

上级 d09eb45b
...@@ -49,6 +49,8 @@ public class KeyConstant { ...@@ -49,6 +49,8 @@ public class KeyConstant {
//点赞 //点赞
public final static String GIVE_LIKE = "give_like"; public final static String GIVE_LIKE = "give_like";
public final static String YES="yes"; public final static String YES = "yes";
public final static String POSTAGE = "0";
} }
...@@ -94,7 +94,7 @@ public class ShopifyController { ...@@ -94,7 +94,7 @@ public class ShopifyController {
@ApiOperation(value = "查询商品评论") @ApiOperation(value = "查询商品评论")
@GetMapping("/querylastcomment") @GetMapping("/querylastcomment")
public Result queryLastComment(@ApiParam("商品ID") @RequestParam(value = "itemId") String itemId, public Result queryLastComment(@ApiParam("商品ID") @RequestParam(value = "itemId") String itemId,
@ApiParam("商品ID") @RequestParam(value = "userId", required = false) String userId) { @ApiParam("用户ID") @RequestParam(value = "userId", required = false) String userId) {
return tbCfItemCommentService.queryLastComment(itemId, userId); return tbCfItemCommentService.queryLastComment(itemId, userId);
} }
...@@ -112,7 +112,7 @@ public class ShopifyController { ...@@ -112,7 +112,7 @@ public class ShopifyController {
public Result queryComments(@ApiParam("商品ID") @RequestParam(value = "itemId") String itemId, public Result queryComments(@ApiParam("商品ID") @RequestParam(value = "itemId") String itemId,
@ApiParam(value = "页数 默认1") @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum, @ApiParam(value = "页数 默认1") @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@ApiParam(value = "每页大小 默认10") @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, @ApiParam(value = "每页大小 默认10") @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
@ApiParam("商品ID") @RequestParam(value = "userId", required = false) String userId) { @ApiParam("用户ID") @RequestParam(value = "userId", required = false) String userId) {
return tbCfItemCommentService.querycomments(itemId, pageNum, pageSize, userId); return tbCfItemCommentService.querycomments(itemId, pageNum, pageSize, userId);
} }
......
package com.diaoyun.zion.chinafrica.dao;
import com.diaoyun.zion.chinafrica.entity.TbCfDescripitonEntity;
import com.diaoyun.zion.master.dao.BaseDao;
/**
* Dao
*
* @author lipengjun
* @date 2020-01-10 11:01:40
*/
public interface TbCfDescripitonDao extends BaseDao<TbCfDescripitonEntity> {
TbCfDescripitonEntity queryPostage(String itemId);
}
package com.diaoyun.zion.chinafrica.entity; package com.diaoyun.zion.chinafrica.entity;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/** /**
* 实体 * 实体
* 表名 tb_cf_descripiton * 表名 tb_cf_descripiton
* *
* @author lipengjun * @author lipengjun
* @date 2019-10-16 11:32:22 * @date 2020-01-10 11:01:40
*/ */
public class TbCfDescripitonEntity implements Serializable { public class TbCfDescripitonEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -32,6 +34,18 @@ public class TbCfDescripitonEntity implements Serializable { ...@@ -32,6 +34,18 @@ public class TbCfDescripitonEntity implements Serializable {
* 二级分类Id * 二级分类Id
*/ */
private String goodstwotypeId; private String goodstwotypeId;
/**
* 品名图片
*/
private String image;
/**
* 单件邮费
*/
private BigDecimal postage;
/**
* 续件邮费
*/
private BigDecimal morePostage;
/** /**
* 设置:品名Id * 设置:品名Id
...@@ -98,4 +112,43 @@ public class TbCfDescripitonEntity implements Serializable { ...@@ -98,4 +112,43 @@ public class TbCfDescripitonEntity implements Serializable {
public String getGoodstwotypeId() { public String getGoodstwotypeId() {
return goodstwotypeId; return goodstwotypeId;
} }
/**
* 设置:品名图片
*/
public void setImage(String image) {
this.image = image;
}
/**
* 获取:品名图片
*/
public String getImage() {
return image;
}
/**
* 设置:单件邮费
*/
public void setPostage(BigDecimal postage) {
this.postage = postage;
}
/**
* 获取:单件邮费
*/
public BigDecimal getPostage() {
return postage;
}
/**
* 设置:续件邮费
*/
public void setMorePostage(BigDecimal morePostage) {
this.morePostage = morePostage;
}
/**
* 获取:续件邮费
*/
public BigDecimal getMorePostage() {
return morePostage;
}
} }
...@@ -54,6 +54,9 @@ public class TbCfStationItemServiceImpl implements TbCfStationItemService { ...@@ -54,6 +54,9 @@ public class TbCfStationItemServiceImpl implements TbCfStationItemService {
@Autowired @Autowired
private TbCfItemCommentDao tbCfItemCommentDao; private TbCfItemCommentDao tbCfItemCommentDao;
@Autowired
private TbCfDescripitonDao tbCfDescripitonDao;
@Override @Override
public TbCfStationItemEntity queryObject(String itemId) { public TbCfStationItemEntity queryObject(String itemId) {
return tbCfStationItemDao.queryObject(itemId); return tbCfStationItemDao.queryObject(itemId);
...@@ -147,6 +150,12 @@ public class TbCfStationItemServiceImpl implements TbCfStationItemService { ...@@ -147,6 +150,12 @@ public class TbCfStationItemServiceImpl implements TbCfStationItemService {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
boolean collection = false; boolean collection = false;
try { try {
//商品邮费
TbCfDescripitonEntity postage = tbCfDescripitonDao.queryPostage(itemId);
map.put("postage", KeyConstant.POSTAGE);
if (postage != null) {
map.put("postage", postage.getPostage().toString());
}
//判断商品是否被收藏 //判断商品是否被收藏
if (!StringUtils.isBlank(userId)) { if (!StringUtils.isBlank(userId)) {
TbCfItemCollectionEntity isCollection = tbCfItemCollectionDao.queryIsCollection(userId, itemId); TbCfItemCollectionEntity isCollection = tbCfItemCollectionDao.queryIsCollection(userId, itemId);
......
<?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.diaoyun.zion.chinafrica.dao.TbCfDescripitonDao">
<resultMap type="com.diaoyun.zion.chinafrica.entity.TbCfDescripitonEntity" id="tbCfDescripitonMap">
<result property="descripitionId" column="descripition_id"/>
<result property="descripitionName" column="descripition_name"/>
<result property="descripitionCode" column="descripition_code"/>
<result property="goodstypeId" column="goodstype_id"/>
<result property="goodstwotypeId" column="goodstwotype_id"/>
<result property="image" column="image"/>
<result property="postage" column="postage"/>
<result property="morePostage" column="more_postage"/>
</resultMap>
<select id="queryObject" resultType="com.diaoyun.zion.chinafrica.entity.TbCfDescripitonEntity">
select
`descripition_id`,
`descripition_name`,
`descripition_code`,
`goodstype_id`,
`goodstwotype_id`,
`image`,
`postage`,
`more_postage`
from tb_cf_descripiton
where descripition_id = #{id}
</select>
<select id="queryList" resultType="com.diaoyun.zion.chinafrica.entity.TbCfDescripitonEntity">
select
`descripition_id`,
`descripition_name`,
`descripition_code`,
`goodstype_id`,
`goodstwotype_id`,
`image`,
`postage`,
`more_postage`
from tb_cf_descripiton
WHERE 1=1
<if test="name != null and name.trim() != ''">
AND name LIKE concat('%',#{name},'%')
</if>
<choose>
<when test="sidx != null and sidx.trim() != ''">
order by ${sidx} ${order}
</when>
<otherwise>
order by descripition_id desc
</otherwise>
</choose>
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
<select id="queryPostage" resultType="com.diaoyun.zion.chinafrica.entity.TbCfDescripitonEntity">
SELECT
*
FROM
tb_cf_descripiton
WHERE
descripition_id = ( SELECT item_descrition_id FROM tb_cf_station_item WHERE item_id = #{itemId} )
</select>
<select id="queryTotal" resultType="int">
select count(*) from tb_cf_descripiton
WHERE 1=1
<if test="name != null and name.trim() != ''">
AND name LIKE concat('%',#{name},'%')
</if>
</select>
<insert id="save" parameterType="com.diaoyun.zion.chinafrica.entity.TbCfDescripitonEntity">
insert into tb_cf_descripiton(
`descripition_id`,
`descripition_name`,
`descripition_code`,
`goodstype_id`,
`goodstwotype_id`,
`image`,
`postage`,
`more_postage`)
values(
#{descripitionId},
#{descripitionName},
#{descripitionCode},
#{goodstypeId},
#{goodstwotypeId},
#{image},
#{postage},
#{morePostage})
</insert>
<update id="update" parameterType="com.diaoyun.zion.chinafrica.entity.TbCfDescripitonEntity">
update tb_cf_descripiton
<set>
<if test="descripitionName != null">`descripition_name` = #{descripitionName},</if>
<if test="descripitionCode != null">`descripition_code` = #{descripitionCode},</if>
<if test="goodstypeId != null">`goodstype_id` = #{goodstypeId},</if>
<if test="goodstwotypeId != null">`goodstwotype_id` = #{goodstwotypeId},</if>
<if test="image != null">`image` = #{image},</if>
<if test="postage != null">`postage` = #{postage},</if>
<if test="morePostage != null">`more_postage` = #{morePostage}</if>
</set>
where descripition_id = #{descripitionId}
</update>
<delete id="delete">
delete from tb_cf_descripiton where descripition_id = #{value}
</delete>
<delete id="deleteBatch">
delete from tb_cf_descripiton where descripition_id in
<foreach item="descripitionId" collection="array" open="(" separator="," close=")">
#{descripitionId}
</foreach>
</delete>
</mapper>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论