Explorar el Código

api模块修改订单商品详情页扫描值

hyq hace 6 años
padre
commit
c888599cb3

+ 15 - 0
kmall-api/src/main/java/com/kmall/api/dao/mk/MkDistSellStatisMapper.java

@@ -0,0 +1,15 @@
+package com.kmall.api.dao.mk;
+
+import com.kmall.api.entity.mk.MkDistSellStatisVo;
+import com.kmall.manager.dao.BaseDao;
+
+/**
+ * 购买商品生成销售分配记录统计,渠道销售统计Dao
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2019-04-09 18:04:46
+ */
+public interface MkDistSellStatisMapper extends BaseDao<MkDistSellStatisVo> {
+
+}

+ 352 - 0
kmall-api/src/main/java/com/kmall/api/entity/mk/MkDistSellStatisVo.java

@@ -0,0 +1,352 @@
+package com.kmall.api.entity.mk;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 购买商品生成销售分配记录统计,渠道销售统计实体
+ * 表名 mk_dist_sell_statis
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2019-04-09 18:04:46
+ */
+public class MkDistSellStatisVo implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 编号
+     */
+    private Integer id;
+    /**
+     * 分销渠道名称
+     */
+    private String distFlag;
+    /**
+     * 所属三方商户
+     */
+    private Integer thirdMerchSn;
+    /**
+     * 所属供应商
+     */
+    private Integer supplierId;
+    /**
+     * 商品所属分销商id
+     */
+    private Integer distId;
+    /**
+     * 商品id
+     */
+    private String goodsId;
+    /**
+     * 商品价格
+     */
+    private BigDecimal goodsPrice;
+    /**
+     * 分配方式,【alloc_type,00:比例,10:金额】
+     */
+    private String allocType;
+    /**
+     * 支出分销商id
+     */
+    private Integer expendDistId;
+    /**
+     * 支出分销商金额【点数/金额】,公式:商品价格*设置点数/金额
+     */
+    private BigDecimal expendDistPrice;
+    /**
+     * 支出分销商等级 1 一级,2 二级,3 三级
+     */
+    private String expendDistLevel;
+    /**
+     * 来源
+     */
+    private String expendSource;
+    /**
+     * 是否有效,0:有效,1:无效
+     */
+    private String isValid;
+    /**
+     * 备注
+     */
+    private String note;
+    /**
+     * 创建人编号
+     */
+    private String createrSn;
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+    /**
+     * 修改人编号
+     */
+    private String moderSn;
+    /**
+     * 修改时间
+     */
+    private Date modTime;
+    /**
+     * 时间戳
+     */
+    private Date tstm;
+
+    private String orderSn;
+
+    public String getOrderSn() {
+        return orderSn;
+    }
+
+    public void setOrderSn(String orderSn) {
+        this.orderSn = orderSn;
+    }
+
+    /**
+     * 设置:编号
+     */
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    /**
+     * 获取:编号
+     */
+    public Integer getId() {
+        return id;
+    }
+    /**
+     * 设置:分销渠道名称
+     */
+    public void setDistFlag(String distFlag) {
+        this.distFlag = distFlag;
+    }
+
+    /**
+     * 获取:分销渠道名称
+     */
+    public String getDistFlag() {
+        return distFlag;
+    }
+    /**
+     * 设置:所属三方商户
+     */
+    public void setThirdMerchSn(Integer thirdMerchSn) {
+        this.thirdMerchSn = thirdMerchSn;
+    }
+
+    /**
+     * 获取:所属三方商户
+     */
+    public Integer getThirdMerchSn() {
+        return thirdMerchSn;
+    }
+    /**
+     * 设置:所属供应商
+     */
+    public void setSupplierId(Integer supplierId) {
+        this.supplierId = supplierId;
+    }
+
+    /**
+     * 获取:所属供应商
+     */
+    public Integer getSupplierId() {
+        return supplierId;
+    }
+    /**
+     * 设置:商品所属分销商id
+     */
+    public void setDistId(Integer distId) {
+        this.distId = distId;
+    }
+
+    /**
+     * 获取:商品所属分销商id
+     */
+    public Integer getDistId() {
+        return distId;
+    }
+    /**
+     * 设置:商品id
+     */
+    public void setGoodsId(String goodsId) {
+        this.goodsId = goodsId;
+    }
+
+    /**
+     * 获取:商品id
+     */
+    public String getGoodsId() {
+        return goodsId;
+    }
+    /**
+     * 设置:商品价格
+     */
+    public void setGoodsPrice(BigDecimal goodsPrice) {
+        this.goodsPrice = goodsPrice;
+    }
+
+    /**
+     * 获取:商品价格
+     */
+    public BigDecimal getGoodsPrice() {
+        return goodsPrice;
+    }
+    /**
+     * 设置:分配方式,【alloc_type,00:比例,10:金额】
+     */
+    public void setAllocType(String allocType) {
+        this.allocType = allocType;
+    }
+
+    /**
+     * 获取:分配方式,【alloc_type,00:比例,10:金额】
+     */
+    public String getAllocType() {
+        return allocType;
+    }
+    /**
+     * 设置:支出分销商id
+     */
+    public void setExpendDistId(Integer expendDistId) {
+        this.expendDistId = expendDistId;
+    }
+
+    /**
+     * 获取:支出分销商id
+     */
+    public Integer getExpendDistId() {
+        return expendDistId;
+    }
+    /**
+     * 设置:支出分销商金额【点数/金额】,公式:商品价格*设置点数/金额
+     */
+    public void setExpendDistPrice(BigDecimal expendDistPrice) {
+        this.expendDistPrice = expendDistPrice;
+    }
+
+    /**
+     * 获取:支出分销商金额【点数/金额】,公式:商品价格*设置点数/金额
+     */
+    public BigDecimal getExpendDistPrice() {
+        return expendDistPrice;
+    }
+    /**
+     * 设置:支出分销商等级 1 一级,2 二级,3 三级
+     */
+    public void setExpendDistLevel(String expendDistLevel) {
+        this.expendDistLevel = expendDistLevel;
+    }
+
+    /**
+     * 获取:支出分销商等级 1 一级,2 二级,3 三级
+     */
+    public String getExpendDistLevel() {
+        return expendDistLevel;
+    }
+    /**
+     * 设置:来源
+     */
+    public void setExpendSource(String expendSource) {
+        this.expendSource = expendSource;
+    }
+
+    /**
+     * 获取:来源
+     */
+    public String getExpendSource() {
+        return expendSource;
+    }
+    /**
+     * 设置:是否有效,0:有效,1:无效
+     */
+    public void setIsValid(String isValid) {
+        this.isValid = isValid;
+    }
+
+    /**
+     * 获取:是否有效,0:有效,1:无效
+     */
+    public String getIsValid() {
+        return isValid;
+    }
+    /**
+     * 设置:备注
+     */
+    public void setNote(String note) {
+        this.note = note;
+    }
+
+    /**
+     * 获取:备注
+     */
+    public String getNote() {
+        return note;
+    }
+    /**
+     * 设置:创建人编号
+     */
+    public void setCreaterSn(String createrSn) {
+        this.createrSn = createrSn;
+    }
+
+    /**
+     * 获取:创建人编号
+     */
+    public String getCreaterSn() {
+        return createrSn;
+    }
+    /**
+     * 设置:创建时间
+     */
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    /**
+     * 获取:创建时间
+     */
+    public Date getCreateTime() {
+        return createTime;
+    }
+    /**
+     * 设置:修改人编号
+     */
+    public void setModerSn(String moderSn) {
+        this.moderSn = moderSn;
+    }
+
+    /**
+     * 获取:修改人编号
+     */
+    public String getModerSn() {
+        return moderSn;
+    }
+    /**
+     * 设置:修改时间
+     */
+    public void setModTime(Date modTime) {
+        this.modTime = modTime;
+    }
+
+    /**
+     * 获取:修改时间
+     */
+    public Date getModTime() {
+        return modTime;
+    }
+    /**
+     * 设置:时间戳
+     */
+    public void setTstm(Date tstm) {
+        this.tstm = tstm;
+    }
+
+    /**
+     * 获取:时间戳
+     */
+    public Date getTstm() {
+        return tstm;
+    }
+}

+ 62 - 0
kmall-api/src/main/java/com/kmall/api/service/mk/ApiMkDistSellStatisService.java

@@ -0,0 +1,62 @@
+package com.kmall.api.service.mk;
+
+import com.kmall.api.dao.mk.MkDistSellStatisMapper;
+import com.kmall.api.entity.mk.MkDistSellStatisVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 购买商品生成销售分配记录统计,渠道销售统计Service实现类
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2019-04-09 18:04:46
+ */
+@Service
+public class ApiMkDistSellStatisService {
+    @Autowired
+    private MkDistSellStatisMapper mkDistSellStatisMapper;
+
+    
+    public MkDistSellStatisVo queryObject(Integer id) {
+        return mkDistSellStatisMapper.queryObject(id);
+    }
+
+
+    public List<MkDistSellStatisVo> queryList(Map<String, Object> map) {
+        return mkDistSellStatisMapper.queryList(map);
+    }
+
+
+    public int queryTotal(Map<String, Object> map) {
+        return mkDistSellStatisMapper.queryTotal(map);
+    }
+
+
+    public int save(MkDistSellStatisVo mkDistSellStatis) {
+//        mkDistSellStatis.setCreaterSn(ShiroUtils.getUserEntity().getUsername());
+        mkDistSellStatis.setCreateTime(new Date());
+        return mkDistSellStatisMapper.save(mkDistSellStatis);
+    }
+
+
+    public int update(MkDistSellStatisVo mkDistSellStatis) {
+//        mkDistSellStatis.setModerSn(ShiroUtils.getUserEntity().getUsername());
+        mkDistSellStatis.setModTime(new Date());
+        return mkDistSellStatisMapper.update(mkDistSellStatis);
+    }
+
+
+    public int delete(Integer id) {
+        return mkDistSellStatisMapper.delete(id);
+    }
+
+
+    public int deleteBatch(Integer[]ids) {
+        return mkDistSellStatisMapper.deleteBatch(ids);
+    }
+}

+ 2 - 0
kmall-api/src/main/resources/mybatis/mapper/ApiOrderGoodsMapper.xml

@@ -73,6 +73,7 @@
 			`is_real`, 
 			`goods_specification_ids`,
 			`list_pic_url`,
+            is_dist_sell_scan,
             <if test="goodsRate != null" >
                 goods_rate,
             </if>
@@ -113,6 +114,7 @@
 			#{is_real},
 			#{goods_specification_ids},
 			#{list_pic_url},
+            0,
         <if test="goodsRate != null" >
             #{goodsRate},
         </if>

+ 181 - 0
kmall-api/src/main/resources/mybatis/mapper/mk/MkDistSellStatisMapper.xml

@@ -0,0 +1,181 @@
+<?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.kmall.api.dao.mk.MkDistSellStatisMapper">
+
+    <resultMap type="com.kmall.api.entity.mk.MkDistSellStatisVo" id="mkDistSellStatisMap">
+        <result property="id" column="id"/>
+        <result property="distFlag" column="dist_flag"/>
+        <result property="thirdMerchSn" column="third_merch_sn"/>
+        <result property="supplierId" column="supplier_id"/>
+        <result property="distId" column="dist_id"/>
+        <result property="goodsId" column="goods_id"/>
+        <result property="goodsPrice" column="goods_price"/>
+        <result property="allocType" column="alloc_type"/>
+        <result property="expendDistId" column="expend_dist_id"/>
+        <result property="expendDistPrice" column="expend_dist_price"/>
+        <result property="expendDistLevel" column="expend_dist_level"/>
+        <result property="expendSource" column="expend_source"/>
+        <result property="isValid" column="is_valid"/>
+        <result property="note" column="note"/>
+        <result property="createrSn" column="creater_sn"/>
+        <result property="createTime" column="create_time"/>
+        <result property="moderSn" column="moder_sn"/>
+        <result property="modTime" column="mod_time"/>
+        <result property="tstm" column="tstm"/>
+		<result property="orderSn" column="order_sn"/>
+    </resultMap>
+
+	<select id="queryObject" resultType="com.kmall.api.entity.mk.MkDistSellStatisVo">
+		select
+			`id`,
+			`dist_flag`,
+			`third_merch_sn`,
+			`supplier_id`,
+			`dist_id`,
+			`goods_id`,
+			`goods_price`,
+			`alloc_type`,
+			`expend_dist_id`,
+			`expend_dist_price`,
+			`expend_dist_level`,
+			`expend_source`,
+			`is_valid`,
+			`note`,
+			`creater_sn`,
+			`create_time`,
+			`moder_sn`,
+			`mod_time`,
+			`tstm`,order_sn
+		from mk_dist_sell_statis
+		where id = #{id}
+	</select>
+
+	<select id="queryList" resultType="com.kmall.api.entity.mk.MkDistSellStatisVo">
+		select
+    		`id`,
+    		`dist_flag`,
+    		`third_merch_sn`,
+    		`supplier_id`,
+    		`dist_id`,
+    		`goods_id`,
+    		`goods_price`,
+    		`alloc_type`,
+    		`expend_dist_id`,
+    		`expend_dist_price`,
+    		`expend_dist_level`,
+    		`expend_source`,
+    		`is_valid`,
+    		`note`,
+    		`creater_sn`,
+    		`create_time`,
+    		`moder_sn`,
+    		`mod_time`,
+    		`tstm`,order_sn
+		from mk_dist_sell_statis
+		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 id desc
+			</otherwise>
+        </choose>
+		<if test="offset != null and limit != null">
+			limit #{offset}, #{limit}
+		</if>
+	</select>
+	
+ 	<select id="queryTotal" resultType="int">
+		select count(*) from mk_dist_sell_statis
+		WHERE 1=1
+        <if test="name != null and name.trim() != ''">
+            AND name LIKE concat('%',#{name},'%')
+        </if>
+	</select>
+
+	<insert id="save" parameterType="com.kmall.api.entity.mk.MkDistSellStatisVo" useGeneratedKeys="true" keyProperty="id">
+		insert into mk_dist_sell_statis(
+			`dist_flag`,
+			`third_merch_sn`,
+			`supplier_id`,
+			`dist_id`,
+			order_sn,
+			`goods_id`,
+			`goods_price`,
+			`alloc_type`,
+			`expend_dist_id`,
+			`expend_dist_price`,
+			`expend_dist_level`,
+			`expend_source`,
+			`is_valid`,
+			`note`,
+			`creater_sn`,
+			`create_time`,
+			`moder_sn`,
+			`mod_time`,
+			`tstm`)
+		values(
+			#{distFlag},
+			#{thirdMerchSn},
+			#{supplierId},
+			#{distId},
+			#{orderSn},
+			#{goodsId},
+			#{goodsPrice},
+			#{allocType},
+			#{expendDistId},
+			#{expendDistPrice},
+			#{expendDistLevel},
+			#{expendSource},
+			#{isValid},
+			#{note},
+			#{createrSn},
+			#{createTime},
+			#{moderSn},
+			#{modTime},
+			#{tstm})
+	</insert>
+
+	<update id="update" parameterType="com.kmall.api.entity.mk.MkDistSellStatisVo">
+		update mk_dist_sell_statis 
+		<set>
+			<if test="distFlag != null">`dist_flag` = #{distFlag}, </if>
+			<if test="thirdMerchSn != null">`third_merch_sn` = #{thirdMerchSn}, </if>
+			<if test="supplierId != null">`supplier_id` = #{supplierId}, </if>
+			<if test="distId != null">`dist_id` = #{distId}, </if>
+			<if test="orderSn != null">`order_sn` = #{orderSn}, </if>
+			<if test="goodsId != null">`goods_id` = #{goodsId}, </if>
+			<if test="goodsPrice != null">`goods_price` = #{goodsPrice}, </if>
+			<if test="allocType != null">`alloc_type` = #{allocType}, </if>
+			<if test="expendDistId != null">`expend_dist_id` = #{expendDistId}, </if>
+			<if test="expendDistPrice != null">`expend_dist_price` = #{expendDistPrice}, </if>
+			<if test="expendDistLevel != null">`expend_dist_level` = #{expendDistLevel}, </if>
+			<if test="expendSource != null">`expend_source` = #{expendSource}, </if>
+			<if test="isValid != null">`is_valid` = #{isValid}, </if>
+			<if test="note != null">`note` = #{note}, </if>
+			<if test="createrSn != null">`creater_sn` = #{createrSn}, </if>
+			<if test="createTime != null">`create_time` = #{createTime}, </if>
+			<if test="moderSn != null">`moder_sn` = #{moderSn}, </if>
+			<if test="modTime != null">`mod_time` = #{modTime}, </if>
+			<if test="tstm != null">`tstm` = #{tstm}</if>
+		</set>
+		where id = #{id}
+	</update>
+	
+	<delete id="delete">
+		delete from mk_dist_sell_statis where id = #{value}
+	</delete>
+	
+	<delete id="deleteBatch">
+		delete from mk_dist_sell_statis where id in 
+		<foreach item="id" collection="array" open="(" separator="," close=")">
+			#{id}
+		</foreach>
+	</delete>
+
+</mapper>