浏览代码

提交代码

7 月之前
父节点
当前提交
ad8b163399
共有 24 个文件被更改,包括 1006 次插入79 次删除
  1. 66 0
      08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/master/product/controller/ProdAttrPriceController.java
  2. 4 1
      08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/master/product/controller/ProdClassController.java
  3. 1 2
      08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/master/product/domain/ProdAttrJointVo.java
  4. 27 0
      08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/master/product/domain/ProdAttrPriceVo.java
  5. 23 0
      08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/master/product/domain/ProdPicVo.java
  6. 22 0
      08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/master/product/mapper/ProdAttrPriceVoMapper.java
  7. 32 0
      08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/master/product/mapper/ProdPicVoMapper.java
  8. 20 0
      08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/master/product/service/IProdAttrPriceVoService.java
  9. 37 0
      08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/master/product/service/IProdPicVoService.java
  10. 32 0
      08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/master/product/service/impl/ProdAttrPriceVoServiceImpl.java
  11. 66 0
      08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/master/product/service/impl/ProdPicVoServiceImpl.java
  12. 69 0
      08.src/Xingxi/xingxi-admin/src/main/resources/mapper/ProdAttrPriceVoMapper.xml
  13. 42 0
      08.src/Xingxi/xingxi-admin/src/main/resources/mapper/ProdPicVoMapper.xml
  14. 57 2
      08.src/Xingxi/xingxi-admin/src/main/resources/templates/master/product/class/add.html
  15. 50 11
      08.src/Xingxi/xingxi-admin/src/main/resources/templates/master/product/class/edit.html
  16. 4 1
      08.src/Xingxi/xingxi-admin/src/main/resources/templates/master/product/class/prodClass.html
  17. 99 46
      08.src/Xingxi/xingxi-admin/src/main/resources/templates/master/product/prod/add.html
  18. 54 0
      08.src/Xingxi/xingxi-admin/src/main/resources/templates/master/product/prod/edit.html
  19. 5 0
      08.src/Xingxi/xingxi-admin/src/main/resources/templates/master/product/prod/prod.html
  20. 21 14
      08.src/Xingxi/xingxi-admin/src/main/resources/templates/master/product/prodAttr/prodAttr.html
  21. 110 0
      08.src/Xingxi/xingxi-admin/src/main/resources/templates/master/product/prodAttrPrice/prodAttrprice.html
  22. 147 0
      08.src/Xingxi/xingxi-admin/src/main/resources/templates/master/product/prodPic/editPic.html
  23. 13 2
      08.src/Xingxi/xingxi-system/src/main/java/com/xingxi/master/product/service/impl/ProdAttrPriceServiceImpl.java
  24. 5 0
      08.src/Xingxi/xingxi-system/src/main/java/com/xingxi/master/product/service/impl/ProdClassServiceImpl.java

+ 66 - 0
08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/master/product/controller/ProdAttrPriceController.java

@@ -0,0 +1,66 @@
+package com.xingxi.web.controller.master.product.controller;
+
+import com.xingxi.common.annotation.Log;
+import com.xingxi.common.core.controller.BaseController;
+import com.xingxi.common.core.domain.AjaxResult;
+import com.xingxi.common.enums.BusinessType;
+import com.xingxi.common.enums.ERoleKey;
+import com.xingxi.master.product.domain.ProdAttrPrice;
+import com.xingxi.web.controller.master.product.domain.ProdAttrPriceVo;
+import com.xingxi.web.controller.master.product.service.IProdAttrPriceVoService;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.ModelMap;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+
+/**
+ * 商品属性价格Controller
+ *
+ * @author ruoyi
+ * @date 2025-03-09
+ */
+@Controller
+@RequestMapping("/master/product/prodAttrPrice")
+public class ProdAttrPriceController extends BaseController {
+    private final String prefix = "master/product/prodAttrprice";
+
+    @Resource
+    private IProdAttrPriceVoService prodAttrPriceVoService;
+
+    @RequiresPermissions("master:product:prodAttrPrice:viewPrice")
+    @GetMapping()
+    public String price(@RequestParam("prodId") Long prodId,@RequestParam("prodAttrId") Long prodAttrId, ModelMap mMap) {
+        ProdAttrPriceVo cond = new ProdAttrPriceVo();
+        cond.setProdId(prodId);
+        cond.setProdAttrId(prodAttrId);
+        ProdAttrPriceVo prodAttrPriceVo = prodAttrPriceVoService.selectProdAttrPriceVo(cond);
+        if (prodAttrPriceVo == null) {
+            prodAttrPriceVo = new ProdAttrPriceVo();
+            prodAttrPriceVo.setProdId(prodId);
+            prodAttrPriceVo.setProdAttrId(prodAttrId);
+        }
+        prodAttrPriceVo.setSellerId(0L);
+        prodAttrPriceVo.setSellerName("用户");
+        prodAttrPriceVo.setSellerRoleKey(ERoleKey.PLATFORM.getCode());
+        prodAttrPriceVo.setSellerRoleName(ERoleKey.PLATFORM.getDesc());
+        prodAttrPriceVo.setBuyerId(100L);
+        prodAttrPriceVo.setBuyerName("平台");
+        prodAttrPriceVo.setBuyerRoleKey(ERoleKey.CUSTOMER.getCode());
+        prodAttrPriceVo.setBuyerRoleName(ERoleKey.CUSTOMER.getDesc());
+        mMap.put("prodAttrPriceVo", prodAttrPriceVo);
+        return prefix + "/prodAttrprice";
+    }
+
+    /**
+     * 修改保存商品
+     */
+    @RequiresPermissions("master:product:prodAttrPrice:editPrice")
+    @Log(title = "商品", businessType = BusinessType.UPDATE)
+    @PostMapping("/edit")
+    @ResponseBody
+    public AjaxResult editSave(@RequestBody ProdAttrPrice prodAttrPrice) {
+        return toAjax(prodAttrPriceVoService.updateProdAttrPrice(prodAttrPrice));
+    }
+}

+ 4 - 1
08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/master/product/controller/ProdClassController.java

@@ -4,7 +4,9 @@ import com.xingxi.common.annotation.Log;
 import com.xingxi.common.core.controller.BaseController;
 import com.xingxi.common.core.domain.AjaxResult;
 import com.xingxi.common.core.page.TableDataInfo;
+import com.xingxi.common.core.text.Convert;
 import com.xingxi.common.enums.BusinessType;
+import com.xingxi.common.enums.EDelFlag;
 import com.xingxi.common.utils.poi.ExcelUtil;
 import com.xingxi.master.product.domain.ProdClass;
 import com.xingxi.master.product.service.IProdClassService;
@@ -44,6 +46,7 @@ public class ProdClassController extends BaseController {
     @ResponseBody
     public TableDataInfo list(ProdClass prodClass) {
         startPage();
+        prodClass.setDelFlag(EDelFlag.NO.getVal());
         List<ProdClass> list = prodClassService.selectProdClassList(prodClass);
         return getDataTable(list);
     }
@@ -110,6 +113,6 @@ public class ProdClassController extends BaseController {
     @PostMapping("/remove")
     @ResponseBody
     public AjaxResult remove(String ids) {
-        return toAjax(prodClassService.deleteProdClassByProdClassIds(ids));
+        return toAjax(prodClassService.logicDeleteProdClassByProdClassIds(Convert.toStrArray(ids)));
     }
 }

+ 1 - 2
08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/master/product/domain/ProdAttrJointVo.java

@@ -1,6 +1,5 @@
 package com.xingxi.web.controller.master.product.domain;
 
-import com.xingxi.master.product.domain.ProdAttr;
 import com.xingxi.master.product.domain.ProdAttrJoint;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
@@ -17,7 +16,7 @@ import java.util.List;
 @Data
 @EqualsAndHashCode(callSuper = true)
 @ToString
-public class ProdAttrJointVo extends ProdAttr {
+public class ProdAttrJointVo extends ProdAttrJoint {
     private static final long serialVersionUID = 1L;
     //检索用商品属性标签名称
     private String prodAttrName;

+ 27 - 0
08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/master/product/domain/ProdAttrPriceVo.java

@@ -0,0 +1,27 @@
+package com.xingxi.web.controller.master.product.domain;
+
+import com.xingxi.master.product.domain.ProdAttrPrice;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+
+/**
+ * 商品属性对象 m_prod_attr
+ *
+ * @author xingxi
+ * @date 2025-03-06
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString
+public class ProdAttrPriceVo extends ProdAttrPrice {
+    private static final long serialVersionUID = 1L;
+    // 采购方名称
+    private String buyerName;
+    // 销售方名称
+    private String sellerName;
+    // 采购方角色
+    private String buyerRoleName;
+    // 销售方角色
+    private String sellerRoleName;
+}

+ 23 - 0
08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/master/product/domain/ProdPicVo.java

@@ -0,0 +1,23 @@
+package com.xingxi.web.controller.master.product.domain;
+
+import com.xingxi.master.product.domain.ProdPic;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+
+/**
+ * 商品标签对象 m_prod_Pic
+ *
+ * @author xingxi
+ * @date 2025-03-06
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString
+public class ProdPicVo extends ProdPic {
+    private static final long serialVersionUID = 1L;
+    //检索用标签名称
+    private String picName;
+    //选中的标签集合
+    private String picIds;
+}

+ 22 - 0
08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/master/product/mapper/ProdAttrPriceVoMapper.java

@@ -0,0 +1,22 @@
+package com.xingxi.web.controller.master.product.mapper;
+
+import com.xingxi.master.product.mapper.ProdAttrPriceMapper;
+import com.xingxi.web.controller.master.product.domain.ProdAttrPriceVo;
+import org.springframework.stereotype.Repository;
+
+/**
+ * 商品属性价格Mapper接口
+ *
+ * @author xingxi
+ * @date 2025-03-06
+ */
+@Repository
+public interface ProdAttrPriceVoMapper extends ProdAttrPriceMapper {
+    /**
+     * 查询商品属性价格VO
+     *
+     * @param prodAttrPriceVo 商品属性价格ID
+     * @return 商品属性价格VO
+     */
+    ProdAttrPriceVo selectProdAttrPriceVo(ProdAttrPriceVo prodAttrPriceVo);
+}

+ 32 - 0
08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/master/product/mapper/ProdPicVoMapper.java

@@ -0,0 +1,32 @@
+package com.xingxi.web.controller.master.product.mapper;
+
+import com.xingxi.master.product.mapper.ProdPicMapper;
+import com.xingxi.web.controller.master.product.domain.ProdPicVo;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+/**
+ * 商品标签Mapper接口
+ *
+ * @author xingxi
+ * @date 2025-03-06
+ */
+@Repository
+public interface ProdPicVoMapper extends ProdPicMapper {
+    /**
+     * 查询商品标签列表
+     *
+     * @param prodPicVo 商品标签
+     * @return 商品标签集合
+     */
+    List<ProdPicVo> selectProdPicVoList(ProdPicVo prodPicVo);
+
+    /**
+     * 删除商品标签
+     *
+     * @param prodPicVo 商品标签Vo
+     * @return 影响行数
+     */
+    int logicDeleteProdPicByCondition(ProdPicVo prodPicVo);
+}

+ 20 - 0
08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/master/product/service/IProdAttrPriceVoService.java

@@ -0,0 +1,20 @@
+package com.xingxi.web.controller.master.product.service;
+
+import com.xingxi.master.product.service.IProdAttrPriceService;
+import com.xingxi.web.controller.master.product.domain.ProdAttrPriceVo;
+
+/**
+ * 商品属性价格VO Service接口
+ *
+ * @author xingxi
+ * @date 2025-03-06
+ */
+public interface IProdAttrPriceVoService extends IProdAttrPriceService {
+    /**
+     * 查询商品属性价格VO
+     *
+     * @param prodAttrPriceVo 商品属性价格Vo
+     * @return 商品属性价格VO
+     */
+    ProdAttrPriceVo selectProdAttrPriceVo(ProdAttrPriceVo prodAttrPriceVo);
+}

+ 37 - 0
08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/master/product/service/IProdPicVoService.java

@@ -0,0 +1,37 @@
+package com.xingxi.web.controller.master.product.service;
+
+import com.xingxi.web.controller.master.product.domain.ProdPicVo;
+
+import java.util.List;
+
+/**
+ * 商品Service接口
+ *
+ * @author xingxi
+ * @date 2025-03-06
+ */
+public interface IProdPicVoService {
+    /**
+     * 查询商品标签列表
+     *
+     * @param prodPicVo 商品标签Vo
+     * @return 商品集合
+     */
+    List<ProdPicVo> selectProdPicVoList(ProdPicVo prodPicVo);
+
+    /**
+     * 添加商品标签
+     *
+     * @param prodPicVo 商品标签Vo
+     * @return 影响行数
+     */
+    int addProdPic(ProdPicVo prodPicVo);
+
+    /**
+     * 删除商品标签
+     *
+     * @param prodPicVo 商品标签Vo
+     * @return 影响行数
+     */
+    int logicDeleteProdPicByCondition(ProdPicVo prodPicVo);
+}

+ 32 - 0
08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/master/product/service/impl/ProdAttrPriceVoServiceImpl.java

@@ -0,0 +1,32 @@
+package com.xingxi.web.controller.master.product.service.impl;
+
+import com.xingxi.master.product.service.impl.ProdAttrPriceServiceImpl;
+import com.xingxi.web.controller.master.product.domain.ProdAttrPriceVo;
+import com.xingxi.web.controller.master.product.mapper.ProdAttrPriceVoMapper;
+import com.xingxi.web.controller.master.product.service.IProdAttrPriceVoService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+
+/**
+ * 商品属性价格Service业务层处理
+ *
+ * @author xingxi
+ * @date 2025-03-06
+ */
+@Service
+public  class ProdAttrPriceVoServiceImpl extends ProdAttrPriceServiceImpl implements IProdAttrPriceVoService {
+    @Resource
+    private ProdAttrPriceVoMapper prodAttrPriceVoMapper;
+
+    /**
+     * 查询商品属性价格VO
+     *
+     * @param prodAttrPriceVo 商品属性价格ID
+     * @return 商品属性价格VO
+     */
+    @Override
+    public ProdAttrPriceVo selectProdAttrPriceVo(ProdAttrPriceVo prodAttrPriceVo) {
+        return prodAttrPriceVoMapper.selectProdAttrPriceVo(prodAttrPriceVo);
+    }
+}

+ 66 - 0
08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/master/product/service/impl/ProdPicVoServiceImpl.java

@@ -0,0 +1,66 @@
+package com.xingxi.web.controller.master.product.service.impl;
+
+import com.xingxi.common.enums.EDelFlag;
+import com.xingxi.common.utils.DateUtils;
+import com.xingxi.common.utils.ShiroUtils;
+import com.xingxi.master.product.mapper.ProdPicMapper;
+import com.xingxi.web.controller.master.product.domain.ProdPicVo;
+import com.xingxi.web.controller.master.product.mapper.ProdPicVoMapper;
+import com.xingxi.web.controller.master.product.service.IProdPicVoService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * 商品标签Service业务层处理
+ *
+ * @author xingxi
+ * @date 2025-03-06
+ */
+@Service
+public class ProdPicVoServiceImpl implements IProdPicVoService {
+    @Resource
+    private ProdPicVoMapper prodPicVoMapper;
+    @Resource
+    private ProdPicMapper prodPicMapper;
+
+    /**
+     * 查询商品标签列表
+     *
+     * @param prodPicVo 商品标签
+     * @return 商品标签
+     */
+    @Override
+    public List<ProdPicVo> selectProdPicVoList(ProdPicVo prodPicVo) {
+        prodPicVo.setDelFlag(EDelFlag.NO.getVal());
+        return prodPicVoMapper.selectProdPicVoList(prodPicVo);
+    }
+
+    /**
+     * 添加商品标签
+     *
+     * @param prodPicVo 商品标签Vo
+     * @return 影响行数
+     */
+    @Override
+    public int addProdPic(ProdPicVo prodPicVo) {
+        prodPicVo.setDelFlag(EDelFlag.NO.getVal());
+        prodPicVo.setCreateUser(ShiroUtils.getLoginName());
+        prodPicVo.setCreateTime(DateUtils.getNowDate());
+        return prodPicMapper.insertProdPic(prodPicVo);
+    }
+
+    /**
+     * 删除商品标签
+     *
+     * @param prodPicVo 商品标签Vo
+     * @return 影响行数
+     */
+    @Override
+    public int logicDeleteProdPicByCondition(ProdPicVo prodPicVo) {
+        prodPicVo.setUpdateUser(ShiroUtils.getLoginName());
+        prodPicVo.setUpdateTime(DateUtils.getNowDate());
+        return prodPicVoMapper.logicDeleteProdPicByCondition(prodPicVo);
+    }
+}

+ 69 - 0
08.src/Xingxi/xingxi-admin/src/main/resources/mapper/ProdAttrPriceVoMapper.xml

@@ -0,0 +1,69 @@
+<?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.xingxi.web.controller.master.product.mapper.ProdAttrPriceVoMapper">
+    <resultMap type="ProdAttrPriceVo" id="ProdAttrPriceVoResult">
+        <result property="prodAttrPriceId"      column="prodAttrPriceId"    />
+        <result property="prodId"               column="prodId"             />
+        <result property="prodAttrId"           column="prodAttrId"         />
+        <result property="buyerId"              column="buyerId"            />
+        <result property="buyerRoleKey"         column="buyerRoleKey"       />
+        <result property="sellerId"             column="sellerId"           />
+        <result property="sellerRoleKey"        column="sellerRoleKey"      />
+        <result property="price"                column="price"              />
+        <result property="delFlag"              column="delFlag"            />
+        <result property="createTime"           column="createTime"         />
+        <result property="createUser"           column="createUser"         />
+        <result property="updateUser"           column="updateUser"         />
+        <result property="updateTime"           column="updateTime"         />
+        <result property="buyerName"            column="buyerName"          />
+        <result property="sellerName"           column="sellerName"         />
+        <result property="buyerRoleName"        column="buyerRoleName"      />
+        <result property="sellerRoleName"       column="sellerRoleName"     />
+    </resultMap>
+
+    <sql id="selectProdAttrPriceVo">
+        select m_prod_attr_price.prodAttrPriceId
+             , m_prod_attr_price.prodId
+             , m_prod_attr_price.prodAttrId
+             , m_prod_attr_price.buyerId
+             , m_prod_attr_price.buyerRoleKey
+             , m_prod_attr_price.sellerId
+             , m_prod_attr_price.sellerRoleKey
+             , m_prod_attr_price.price
+             , m_prod_attr_price.delFlag
+             , m_prod_attr_price.createUser
+             , m_prod_attr_price.createTime
+             , m_prod_attr_price.updateUser
+             , m_prod_attr_price.updateTime
+             , m_prod_attr_price.updateTime
+             , m_prod_attr_price.updateTime
+--              , buyer.user_name as buyerName
+--              , seller.user_name as sellerName
+--              , buyerrole.role_name as buyerRoleName
+--              , sellerrole.role_name as sellerRoleName
+        from m_prod_attr_price
+--                  inner join sys_user buyer on buyer.user_id = m_prod_attr_price.buyerId and buyer.del_flag = '0'
+--                  inner join sys_user seller on seller.user_id = m_prod_attr_price.sellerId and seller.del_flag = '0'
+--                  inner join sys_role buyerrole on buyerrole.role_key = m_prod_attr_price.buyerRoleKey and buyerrole.del_flag = '0'
+--                  inner join sys_role sellerrole on sellerrole.role_key = m_prod_attr_price.sellerRoleKey and sellerrole.del_flag = '0'
+    </sql>
+
+    <select id="selectProdAttrPriceVo" parameterType="ProdAttrPriceVo" resultMap="ProdAttrPriceVoResult">
+        <include refid="selectProdAttrPriceVo"/>
+        <where>
+            <if test="prodAttrPriceId != null "> and m_prod_attr_price.prodAttrPriceId = #{prodAttrPriceId}</if>
+            <if test="prodId != null "> and m_prod_attr_price.prodId = #{prodId}</if>
+            <if test="prodAttrId != null "> and m_prod_attr_price.prodAttrId = #{prodAttrId}</if>
+            <if test="buyerId != null "> and m_prod_attr_price.buyerId = #{buyerId}</if>
+            <if test="buyerRoleKey != null "> and m_prod_attr_price.buyerRoleKey = #{buyerRoleKey}</if>
+            <if test="sellerId != null "> and m_prod_attr_price.sellerId = #{sellerId}</if>
+            <if test="sellerRoleKey != null "> and m_prod_attr_price.sellerRoleKey = #{sellerRoleKey}</if>
+            <if test="price != null "> and m_prod_attr_price.price = #{price}</if>
+            <if test="delFlag != null and delFlag != ''"> and m_prod_attr_price.delFlag = #{delFlag}</if>
+<!--            <if test="buyerName != null and buyerName != ''"> and buyer.user_name like concat('%', #{buyerName}, '%')</if>-->
+<!--            <if test="sellerName != null and sellerName != ''"> and seller.user_name like concat('%', #{sellerName}, '%')</if>-->
+<!--            <if test="buyerRoleName != null and buyerRoleName != ''"> and buyerrole.role_name like concat('%', #{buyerRoleName}, '%')</if>-->
+<!--            <if test="sellerRoleName != null and sellerRoleName != ''"> and sellerrole.role_name like concat('%', #{sellerRoleName}, '%')</if>-->
+        </where>
+    </select>
+</mapper>

+ 42 - 0
08.src/Xingxi/xingxi-admin/src/main/resources/mapper/ProdPicVoMapper.xml

@@ -0,0 +1,42 @@
+<?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.xingxi.web.controller.master.product.mapper.ProdPicVoMapper">
+    <resultMap type="ProdPicVo" id="ProdPicResult">
+        <result property="id"                   column="id"                 />
+        <result property="prodId"               column="prodId"             />
+        <result property="picUrl"               column="picUrl"             />
+        <result property="sort"                 column="sort"               />
+    </resultMap>
+
+    <sql id="selectProdPicVo">
+        select m_prod_pic.id
+             , m_prod_pic.prodId
+             , m_prod_pic.picUrl
+             , m_prod_pic.sort
+        from m_prod_pic
+    </sql>
+
+    <select id="selectProdPicVoList" parameterType="ProdPicVo" resultMap="ProdPicResult">
+        <include refid="selectProdPicVo"/>
+        <where>
+            <if test="id != null "> and m_prod_pic.id = #{id}</if>
+            <if test="prodId != null "> and m_prod_pic.prodId = #{prodId}</if>
+            <if test="delFlag != null  and delFlag != ''"> and m_prod_pic.delFlag = #{delFlag}</if>
+        </where>
+        order by m_prod_pic.sort
+    </select>
+
+    <update id="logicDeleteProdPicByCondition" parameterType="ProdPic">
+        update m_prod_pic
+        <trim prefix="SET" suffixOverrides=",">
+            delFlag = '1',
+            <if test="updateUser != null">updateUser = #{updateUser},</if>
+            <if test="updateTime != null">updateTime = #{updateTime},</if>
+        </trim>
+        <where>
+            <if test="id != null "> and id = #{id}</if>
+            <if test="prodId != null "> and prodId = #{prodId}</if>
+            <if test="sort != null "> and sort = #{sort}</if>
+        </where>
+    </update>
+</mapper>

+ 57 - 2
08.src/Xingxi/xingxi-admin/src/main/resources/templates/master/product/class/add.html

@@ -18,7 +18,9 @@
                 <div class="form-group">
                     <label class="col-sm-3 control-label">商品分类图片:</label>
                     <div class="col-sm-8">
-                        <input name="classUrl" class="form-control" type="text">
+                        <img id="classImg" width="30%" height="30%">
+                        <input type="file" class="form-control" name="classImgUrl" id="classImgUrl" accept="image/*"/>
+                        <input type="hidden" class="form-control" name="classUrl" id="classUrl" />
                     </div>
                 </div>
             </div>
@@ -34,8 +36,61 @@
     </div>
     <th:block th:include="include :: footer" />
     <script th:inline="javascript">
-        var prefix = ctx + "system/class"
+        var prefix = ctx + "master/product/class"
+
+        $('#classImgUrl').change(function () {
+            var fileSize = this.files[0].size;
+            fileSize = Math.round(fileSize/1024*100)/100;
+
+            if(fileSize>2048){
+                layer.msg('上传文件不得大于2M,请重新上传。', {time: 3000, icon:6});
+                return false;
+            }
+
+            if (!/image\/\w+/.test(this.files[0].type)) {
+                layer.msg('上传的不是图片文件,请重新上传。', {time: 3000, icon:6});
+                return false;
+            }
+
+            if ($(this).val()) {
+                var formdata = new FormData();
+                formdata.append("imageFile", this.files[0]);
+                $.ajax({
+                    url: ctx + "common/upload/file/image",
+                    data: formdata,
+                    type: "post",
+                    processData: false,
+                    contentType: false,
+                    beforeSend: function () {
+                        $.modal.loading("正在处理中,请稍后...");
+                        $.modal.disable();
+                    },
+                    success: function (result) {
+                        if (result.code === web_status.SUCCESS) {
+                            $('#classImg').attr('src', result.imageUrl);
+                            $('#classUrl').val(result.imageUrl);
+                            $.modal.alertSuccess(result.msg)
+                        } else if (result.code === web_status.WARNING) {
+                            $.modal.alertWarning(result.msg)
+                        } else {
+                            $.modal.alertError(result.msg);
+                        }
+                        $.modal.closeLoading();
+                        $.modal.enable();
+                    }
+                })
+            }
+        });
+
         $("#form-class-add").validate({
+            rules: {
+                className: {
+                    required: true
+                },
+            },
+            messages: {
+                className: icon + "请输入商品分类名称",
+            },
             focusCleanup: true
         });
 

+ 50 - 11
08.src/Xingxi/xingxi-admin/src/main/resources/templates/master/product/class/edit.html

@@ -5,7 +5,7 @@
 </head>
 <body class="white-bg">
     <div class="wrapper wrapper-content animated fadeInRight ibox-content">
-        <form class="form-horizontal m" id="form-class-edit" th:object="${mProdClass}">
+        <form class="form-horizontal m" id="form-class-edit" th:object="${prodClass}">
             <input name="prodClassId" th:field="*{prodClassId}" type="hidden">
             <div class="col-xs-12">
                 <div class="form-group">
@@ -19,7 +19,9 @@
                 <div class="form-group">
                     <label class="col-sm-3 control-label">商品分类图片:</label>
                     <div class="col-sm-8">
-                        <input name="classUrl" th:field="*{classUrl}" class="form-control" type="text">
+                        <img id="classImg" width="30%" height="30%" th:src="*{classUrl}">
+                        <input type="file" class="form-control" name="classImgUrl" id="classImgUrl" accept="image/*"/>
+                        <input type="hidden" class="form-control" name="classUrl" id="classUrl" th:field="*{classUrl}" />
                     </div>
                 </div>
             </div>
@@ -31,19 +33,56 @@
                     </div>
                 </div>
             </div>
-            <div class="col-xs-12">
-                <div class="form-group">
-                    <label class="col-sm-3 control-label">删除标志:</label>
-                    <div class="col-sm-8">
-                        <input name="delFlag" th:field="*{delFlag}" class="form-control" type="text">
-                    </div>
-                </div>
-            </div>
         </form>
     </div>
     <th:block th:include="include :: footer" />
     <script th:inline="javascript">
-        var prefix = ctx + "system/class";
+        var prefix = ctx + "master/product/class"
+
+        $('#classImgUrl').change(function () {
+            var fileSize = this.files[0].size;
+            fileSize = Math.round(fileSize/1024*100)/100;
+
+            if(fileSize>2048){
+                layer.msg('上传文件不得大于2M,请重新上传。', {time: 3000, icon:6});
+                return false;
+            }
+
+            if (!/image\/\w+/.test(this.files[0].type)) {
+                layer.msg('上传的不是图片文件,请重新上传。', {time: 3000, icon:6});
+                return false;
+            }
+
+            if ($(this).val()) {
+                var formdata = new FormData();
+                formdata.append("imageFile", this.files[0]);
+                $.ajax({
+                    url: ctx + "common/upload/file/image",
+                    data: formdata,
+                    type: "post",
+                    processData: false,
+                    contentType: false,
+                    beforeSend: function () {
+                        $.modal.loading("正在处理中,请稍后...");
+                        $.modal.disable();
+                    },
+                    success: function (result) {
+                        if (result.code === web_status.SUCCESS) {
+                            $('#classImg').attr('src', result.imageUrl);
+                            $('#classUrl').val(result.imageUrl);
+                            $.modal.alertSuccess(result.msg)
+                        } else if (result.code === web_status.WARNING) {
+                            $.modal.alertWarning(result.msg)
+                        } else {
+                            $.modal.alertError(result.msg);
+                        }
+                        $.modal.closeLoading();
+                        $.modal.enable();
+                    }
+                })
+            }
+        });
+
         $("#form-class-edit").validate({
             focusCleanup: true
         });

+ 4 - 1
08.src/Xingxi/xingxi-admin/src/main/resources/templates/master/product/class/prodClass.html

@@ -67,7 +67,10 @@
                 },
                 {
                     field: 'classUrl',
-                    title: '商品分类图片'
+                    title: '商品分类图片',
+                    formatter: function(value, row, index) {
+                        return $.table.imageView(value);
+                    }
                 },
                 {
                     field: 'sort',

+ 99 - 46
08.src/Xingxi/xingxi-admin/src/main/resources/templates/master/product/prod/add.html

@@ -52,6 +52,16 @@
             </div>
             <div class="col-xs-12">
                 <div class="form-group">
+                    <label class="col-sm-3 control-label">商品图片:</label>
+                    <div class="col-sm-8">
+                        <img id="picUrlImg" width="30%" height="30%">
+                        <input type="file" class="form-control" name="picUrlImgUrl" id="picUrlImgUrl" accept="image/*"/>
+                        <input type="hidden" lass="form-control" name="picUrl" id="picUrl" />
+                    </div>
+                </div>
+            </div>
+            <div class="col-xs-12">
+                <div class="form-group">
                     <label class="col-sm-3 control-label">商品描述:</label>
                     <div class="col-sm-10" style="margin-left: 80px;">
                         <div class="summernote" style="border: red;" id="summernote"></div>
@@ -66,58 +76,101 @@
     <th:block th:include="include :: summernote-js" />
     <script th:inline="javascript">
         var prefix = ctx + "master/product/prod"
-        $("#form-prod-add").validate({
-            focusCleanup: true
-        });
 
-        $(document).ready(function () {
-            // 富文本框
-            $(".summernote").summernote({
-                lang: 'zh-CN',
-                callbacks:{
-                    onImageUpload: function (files) {
-                        var fileSize = 0;
-                        fileSize = files[0].size;
-                        fileSize=Math. round( fileSize/1024*100)/100;
+        $('#picUrlImgUrl').change(function () {
+            var fileSize = this.files[0].size;
+            fileSize = Math.round(fileSize/1024*100)/100;
 
-                        if(fileSize>2048){
-                            layer.msg('上传文件不得大于2M,请重新上传。', {time: 3000, icon:6});
-                            return false;
-                        }
+            if(fileSize>2048){
+                layer.msg('上传文件不得大于2M,请重新上传。', {time: 3000, icon:6});
+                return false;
+            }
 
-                        if (!/image\/\w+/.test(files[0].type)) {
-                            layer.msg('上传的不是图片文件,请重新上传。', {time: 3000, icon:6});
-                            return false;
+            if (!/image\/\w+/.test(this.files[0].type)) {
+                layer.msg('上传的不是图片文件,请重新上传。', {time: 3000, icon:6});
+                return false;
+            }
+
+            if ($(this).val()) {
+                var formdata = new FormData();
+                formdata.append("imageFile", this.files[0]);
+                $.ajax({
+                    url: ctx + "common/upload/file/image",
+                    data: formdata,
+                    type: "post",
+                    processData: false,
+                    contentType: false,
+                    beforeSend: function () {
+                        $.modal.loading("正在处理中,请稍后...");
+                        $.modal.disable();
+                    },
+                    success: function (result) {
+                        if (result.code === web_status.SUCCESS) {
+                            $('#picUrlImg').attr('src', result.imageUrl);
+                            $('#picUrl').val(result.imageUrl);
+                            $.modal.alertSuccess(result.msg)
+                        } else if (result.code === web_status.WARNING) {
+                            $.modal.alertWarning(result.msg)
+                        } else {
+                            $.modal.alertError(result.msg);
                         }
+                        $.modal.closeLoading();
+                        $.modal.enable();
+                    }
+                })
+            }
+        });
+
+        // 富文本框
+        $(".summernote").summernote({
+            lang: 'zh-CN',
+            callbacks:{
+                onImageUpload: function (files) {
+                    var fileSize = 0;
+                    fileSize = files[0].size;
+                    fileSize=Math. round( fileSize/1024*100)/100;
+
+                    if(fileSize>2048){
+                        layer.msg('上传文件不得大于2M,请重新上传。', {time: 3000, icon:6});
+                        return false;
+                    }
 
-                        var formData = new FormData();
-                        formData.append('imageFile', files[0]);
-                        $.ajax({
-                            url : ctx + "common/upload/file/image",
-                            type : 'POST',
-                            data : formData,
-                            processData : false,
-                            contentType : false,
-                            success : function(result) {
-                                $('.summernote').summernote('insertImage', result.imageUrl);
-                            },error:function(){
-                                $.modal.alertError("上传失败");
-                            }
-                        });
+                    if (!/image\/\w+/.test(files[0].type)) {
+                        layer.msg('上传的不是图片文件,请重新上传。', {time: 3000, icon:6});
+                        return false;
                     }
-                },
-                height: 600,
-                toolbar: [
-                    ['style', ['fontname', 'bold', 'italic', 'underline', 'clear']],
-                    ['font', ['strikethrough', 'superscript', 'subscript']],
-                    ['fontsize', ['fontsize', 'undo', 'redo']],
-                    ['color', ['color']],
-                    ['para', ['ul', 'ol', 'paragraph']],
-                    ['height', ['height']],
-                    ['insert', ['picture', 'table']],
-                    ['search', ['findnreplace', 'changecolor']]
-                ],
-            });
+
+                    var formData = new FormData();
+                    formData.append('imageFile', files[0]);
+                    $.ajax({
+                        url : ctx + "common/upload/file/image",
+                        type : 'POST',
+                        data : formData,
+                        processData : false,
+                        contentType : false,
+                        success : function(result) {
+                            $('.summernote').summernote('insertImage', result.imageUrl);
+                        },error:function(){
+                            $.modal.alertError("上传失败");
+                        }
+                    });
+                }
+            },
+            height: 600,
+            toolbar: [
+                ['style', ['fontname', 'bold', 'italic', 'underline', 'clear']],
+                ['font', ['strikethrough', 'superscript', 'subscript']],
+                ['fontsize', ['fontsize', 'undo', 'redo']],
+                ['color', ['color']],
+                ['para', ['ul', 'ol', 'paragraph']],
+                ['height', ['height']],
+                ['insert', ['picture', 'table']],
+                ['search', ['findnreplace', 'changecolor']]
+            ],
+        });
+
+        $("#form-prod-add").validate({
+            focusCleanup: true
         });
 
         function submitHandler() {

+ 54 - 0
08.src/Xingxi/xingxi-admin/src/main/resources/templates/master/product/prod/edit.html

@@ -53,6 +53,16 @@
             </div>
             <div class="col-xs-12">
                 <div class="form-group">
+                    <label class="col-sm-3 control-label">商品图片:</label>
+                    <div class="col-sm-8">
+                        <img id="picUrlImg" width="30%" height="30%">
+                        <input type="file" class="form-control" name="picUrlImgUrl" id="picUrlImgUrl" accept="image/*"/>
+                        <input type="hidden" lass="form-control" name="picUrl" id="picUrl" />
+                    </div>
+                </div>
+            </div>
+            <div class="col-xs-12">
+                <div class="form-group">
                     <label class="col-sm-3 control-label">商品描述:</label>
                     <div class="col-sm-10" style="margin-left: 80px">
                         <div class="summernote" style="border: red;" id="summernote"></div>
@@ -67,6 +77,50 @@
     <th:block th:include="include :: summernote-js" />
     <script th:inline="javascript">
         var prefix = ctx + "master/product/prod"
+        $('#picUrlImgUrl').change(function () {
+            var fileSize = this.files[0].size;
+            fileSize = Math.round(fileSize/1024*100)/100;
+
+            if(fileSize>2048){
+                layer.msg('上传文件不得大于2M,请重新上传。', {time: 3000, icon:6});
+                return false;
+            }
+
+            if (!/image\/\w+/.test(this.files[0].type)) {
+                layer.msg('上传的不是图片文件,请重新上传。', {time: 3000, icon:6});
+                return false;
+            }
+
+            if ($(this).val()) {
+                var formdata = new FormData();
+                formdata.append("imageFile", this.files[0]);
+                $.ajax({
+                    url: ctx + "common/upload/file/image",
+                    data: formdata,
+                    type: "post",
+                    processData: false,
+                    contentType: false,
+                    beforeSend: function () {
+                        $.modal.loading("正在处理中,请稍后...");
+                        $.modal.disable();
+                    },
+                    success: function (result) {
+                        if (result.code === web_status.SUCCESS) {
+                            $('#picUrlImg').attr('src', result.imageUrl);
+                            $('#picUrl').val(result.imageUrl);
+                            $.modal.alertSuccess(result.msg)
+                        } else if (result.code === web_status.WARNING) {
+                            $.modal.alertWarning(result.msg)
+                        } else {
+                            $.modal.alertError(result.msg);
+                        }
+                        $.modal.closeLoading();
+                        $.modal.enable();
+                    }
+                })
+            }
+        });
+
         $(".summernote").summernote({
             lang: 'zh-CN',
             callbacks:{

+ 5 - 0
08.src/Xingxi/xingxi-admin/src/main/resources/templates/master/product/prod/prod.html

@@ -124,6 +124,7 @@
                                 actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a> ');
                                 actions.push('<a class="btn btn-warning btn-xs ' + editAttrFlag + '" href="javascript:void(0)" onclick="editAttr(\'' + row.id + '\')"><i class="fa fa-at"></i>编辑属性</a> ');
                                 actions.push('<a class="btn btn-info btn-xs ' + editTagFlag + '" href="javascript:void(0)" onclick="editTag(\'' + row.id + '\')"><i class="fa fa-info"></i>编辑标签</a> ');
+                                actions.push('<a class="btn btn-primary btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="editPic(\'' + row.id + '\')"><i class="fa fa-file-picture-o"></i>商品图片</a> ');
                             }
                             if (row.prodStatus === 'SUBMITTED') {
                                 actions.push('<a class="btn btn-warning btn-xs ' + approveFlag + '" href="javascript:void(0)" onclick="approve(\'' + row.id + '\')"><i class="fa fa-thumbs-o-up"></i>审核</a> ');
@@ -145,6 +146,10 @@
             $.modal.openTab("商品标签信息", ctx + "master/product/prodTag/editTag/" + id);
         }
 
+        function editPic(id) {
+            $.modal.openTab("商品图片信息", ctx + "master/product/prodPic/editPic/" + id);
+        }
+
         function approve(id) {
             $.modal.confirm("确认同意该商品的申请吗?", function() {
                 $.operate.post(prefix + "/approve", {"id": id});

+ 21 - 14
08.src/Xingxi/xingxi-admin/src/main/resources/templates/master/product/prodAttr/prodAttr.html

@@ -21,8 +21,7 @@
     var datas = [[${@dict.getType('prod_attr_type')}]];
     var editFlag = [[${@permission.hasPermi('master:product:prodAttr:edit')}]];
     var removeFlag = [[${@permission.hasPermi('master:product:prodAttr:remove')}]];
-    var editJointFlag = [[${@permission.hasPermi('master:product:prodJoint:edit')}]];
-    var removeJointFlag = [[${@permission.hasPermi('master:product:prodJoint:remove')}]];
+    var editPriceFlag = [[${@permission.hasPermi('master:product:prodAttrPrice:viewPrice')}]];
 
     $("#form-prod-edit").validate({
         focusCleanup: true
@@ -61,6 +60,7 @@
                     formatter: function(value, row, index) {
                         var actions = [];
                         actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.prodAttrId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
+                        actions.push('<a class="btn btn-info btn-xs ' + editPriceFlag + '" href="javascript:void(0)" onclick="showEditPrice(\'' + row.prodAttrId + '\')"><i class="fa fa-money"></i>设定价格</a> ');
                         actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.prodAttrId + '\')"><i class="fa fa-remove"></i>删除</a> ');
                         return actions.join('');
                     }
@@ -85,16 +85,6 @@
                 {
                     field : 'attrName',
                     title : '属性名称'
-                },
-                {
-                    title: '操作',
-                    align: 'center',
-                    formatter: function (value, row, index) {
-                        var subActions = [];
-                        subActions.push('<a class="btn btn-success btn-xs ' + editJointFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
-                        subActions.push('<a class="btn btn-danger btn-xs ' + removeJointFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a> ');
-                        return subActions.join('');
-                    }
                 }
             ]
         });
@@ -104,8 +94,25 @@
         $.operate.add($("#prodId").val());
     }
 
-    function removeAttr() {
-        $.operate.add($("#prodId").val());
+    function showEditPrice(prodAttrId) {
+        var prodId = $("#prodId").val();
+        layer.open({
+            type: 2,
+            area: ['800px', '600px'],
+            fix: false,
+            //不固定
+            maxmin: true,
+            shade: 0.3,
+            title: "设定商品价格",
+            content: `${ctx}master/product/prodAttrPrice?prodId=${prodId}&prodAttrId=${prodAttrId}`,
+            btn: ['确定', '关闭'],
+            // 弹层外区域关闭
+            shadeClose: true,
+            yes: function(index, layero) {
+                var iframeWin = layero.find('iframe')[0];
+                iframeWin.contentWindow.submitHandler(index, layero);
+            }
+        });
     }
 </script>
 </body>

+ 110 - 0
08.src/Xingxi/xingxi-admin/src/main/resources/templates/master/product/prodAttrPrice/prodAttrprice.html

@@ -0,0 +1,110 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
+<head>
+    <th:block th:include="include :: header('编辑商品价格')" />
+</head>
+<body class="white-bg">
+    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
+        <form class="form-horizontal m" id="form-prodAttrPrice-edit" th:object="${prodAttrPriceVo}">
+            <input id="prodId" name="prodId" th:value="*{prodId}" type="hidden">
+            <input id="prodAttrId" name="prodAttrId" th:value="*{prodAttrId}" type="hidden">
+            <input id="prodAttrPriceId" name="prodAttrPriceId" th:value="*{prodAttrPriceId}" type="hidden">
+            <div class="col-xs-12">
+                <div class="form-group">
+                    <div class="select-list col-sm-12">
+                        <input name="buyerId" type="hidden" th:field="*{buyerId}">
+                        <input name="buyerRoleKey" type="hidden" th:field="*{buyerRoleKey}">
+                        <ul>
+                            <li>
+                                <label>采购方:</label>
+                                <input name="buyerName" class="form-control col-sm-1" type="text" th:field="*{buyerName}" readonly>
+                            </li>
+                            <li>
+                                <label>角色:</label>
+                                <input name="buyerRoleName" class="form-control col-sm-1" type="text" th:field="*{buyerRoleName}" readonly>
+                            </li>
+                        </ul>
+                    </div>
+                    <div class="select-list col-sm-12">
+                        <input name="sellerId" type="hidden" th:field="*{sellerId}">
+                        <input name="sellerRoleKey" type="hidden" th:field="*{sellerRoleKey}">
+                        <ul>
+                            <li>
+                                <label>销售方:</label>
+                                <input name="sellerName" class="form-control col-sm-1" type="text" th:field="*{sellerName}" readonly>
+                            </li>
+                            <li>
+                                <label>角色:</label>
+                                <input name="sellerRoleName" class="form-control col-sm-1" type="text" th:field="*{sellerRoleName}" readonly>
+                            </li>
+                        </ul>
+                    </div>
+                    <div class="select-list col-sm-12">
+                        <ul>
+                            <li>
+                                <label>单价:</label>
+                                <input name="price" class="form-control col-sm-1" type="text" th:field="*{price}">
+                            </li>
+                            <li>
+                            </li>
+                        </ul>
+                    </div>
+                </div>
+            </div>
+        </form>
+    </div>
+    <th:block th:include="include :: footer" />
+    <script th:inline="javascript">
+        var prefix = ctx + "master/product/prodAttrPrice";
+
+        $("#form-prodAttrPrice-edit").validate({
+            rules: {
+                buyerName: {
+                    required: true
+                },
+                sellerName: {
+                    required: true
+                },
+                price: {
+                    required: true
+                }
+            },
+            messages: {
+                buyerName: icon + "请选择购买方",
+                sellerName: icon + "请选择销售方",
+                price: icon + "请输入单价"
+            },
+            focusCleanup: true
+        });
+
+        function submitHandler() {
+            if ($.validate.form()) {
+                var data = {
+                    "prodAttrPriceId" : $("#prodAttrPriceId").val(),
+                    "prodId" : $("#prodId").val(),
+                    "prodAttrId" : $("#prodAttrId").val(),
+                    "buyerId" : $("input[name='buyerId']").val(),
+                    "buyerName" : $("input[name='buyerName']").val(),
+                    "buyerRoleKey" : $("input[name='buyerRoleKey']").val(),
+                    "buyerRoleName" : $("input[name='buyerRoleName']").val(),
+                    "sellerId" : $("input[name='sellerId']").val(),
+                    "sellerName" : $("input[name='sellerName']").val(),
+                    "sellerRoleKey" : $("input[name='sellerRoleKey']").val(),
+                    "sellerRoleName" : $("input[name='sellerRoleName']").val(),
+                    "price" : $("input[name='price']").val(),
+                }
+                $.ajax({
+                    url: prefix + "/edit",
+                    contentType: 'application/json',
+                    data: JSON.stringify(data),
+                    type: "post",
+                    processData: false,
+                    success: function(result) {
+                        $.operate.successCallback(result);
+                    }
+                });
+            }
+        }
+    </script>
+</body>
+</html>

+ 147 - 0
08.src/Xingxi/xingxi-admin/src/main/resources/templates/master/product/prodPic/editPic.html

@@ -0,0 +1,147 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
+<head>
+    <th:block th:include="include :: header('编辑商品图片')" />
+    <style>
+        .custom-btn {
+            cursor: pointer;
+        }
+    </style>
+</head>
+<body class="white-bg">
+    <input id="prodId" th:value="${prodId}" type="hidden">
+    <div class="wrapper wrapper-content animated fadeInRight">
+        <div class="row" id="ibox-container" style="width: 1260px">
+        </div>
+        <div style="display: none;">
+            <input type="file" class="form-control" name="imageFileUrl" id="imageFileUrl" accept="image/*"/>
+            <input type="hidden" name="picUrl" id="picUrl" />
+            <input type="hidden" id="picCount" />
+        </div>
+    </div>
+    <!-- 设置快递单类型区域 -->
+    <script id="addNewPicDiv" type="text/template">
+        <div class="col-sm-12 select-table table-striped">
+            <table id="newPic-table"></table>
+        </div>
+    </script>
+    <th:block th:include="include :: footer" />
+    <script th:inline="javascript">
+        var prefix = ctx + "master/product/prodPic";
+        var prodPicVoList = [[${prodPicVoList}]];
+        var iPicCount = 0;
+        prodPicVoList.forEach(item => {
+            iPicCount++;
+            var card = `<div class='col-sm-2'>
+                            <div style='width: 200px; height: 300px; border: 1px solid black'>
+                                <div style="position: absolute; width: 200px; height: 300px; top: 0; left: 14px;">
+                                    <img id='picImgSrc_${iPicCount}' style='width: 200px; height: 300px;' src='${item.picUrl}'>
+                                </div>
+                            </div>
+                            <div style='width: 300px; height: 30px; margin-left: 70px; margin-top: 10px;' class='custom-btn'>
+                                <a class="btn btn-primary btn-rounded btn-sm" onclick="removePic(${item.sort})"><i class="fa fa-search"></i>&nbsp;删除</a>
+                            </div>
+                        </div>`;
+            $("#ibox-container").append(card);
+        });
+        $("#picCount").val(iPicCount);
+        var newPicCard = `<div class='col-sm-2' id='addButton'>
+                            <div class='ibox' style='width: 200px; height: 300px;'>
+                                <div class='ibox-content custom-btn' style='width: 100%; height: 100%;' onclick='addNewPic()'>
+                                    <h5 style='margin-left: 40px; font-size: large'>添加图片</h5>
+                                </div>
+                            </div>
+                          </div>`;
+        $("#ibox-container").append(newPicCard);
+
+        $('#imageFileUrl').change(function () {
+            var fileSize = this.files[0].size;
+            fileSize = Math.round(fileSize/1024*100)/100;
+
+            if(fileSize>2048){
+                layer.msg('上传文件不得大于2M,请重新上传。', {time: 3000, icon:6});
+                return false;
+            }
+
+            if (!/image\/\w+/.test(this.files[0].type)) {
+                layer.msg('上传的不是图片文件,请重新上传。', {time: 3000, icon:6});
+                return false;
+            }
+
+            if ($(this).val()) {
+                var formdata = new FormData();
+                formdata.append("imageFile", this.files[0]);
+                $.ajax({
+                    url: ctx + "common/upload/file/image",
+                    data: formdata,
+                    type: "post",
+                    processData: false,
+                    contentType: false,
+                    beforeSend: function () {
+                        $.modal.loading("正在处理中,请稍后...");
+                        $.modal.disable();
+                    },
+                    success: function (result) {
+                        if (result.code === web_status.SUCCESS) {
+                            var nowPicCount = $("#picCount").val()*1 + 1;
+                            $("#picCount").val(nowPicCount);
+                            var appendCard =
+                                `<div class='col-sm-2'>
+                                    <div style='width: 200px; height: 300px; border: 1px solid black'>
+                                        <div style="position: absolute; width: 200px; height: 300px; top: 0; left: 14px;">
+                                            <img id='picImgSrc_${nowPicCount}' style='width: 200px; height: 300px;' src=''>
+                                        </div>
+                                    </div>
+                                    <div style='width: 300px; height: 30px; margin-left: 70px; margin-top: 10px;' class='custom-btn'>
+                                        <a class="btn btn-primary btn-rounded btn-sm" onclick="removePic(${nowPicCount})"><i class="fa fa-search"></i>&nbsp;删除</a>
+                                    </div>
+                                </div>`;
+                            $('#addButton').before(appendCard);
+                            $("#picImgSrc_" + nowPicCount).attr('src', result.imageUrl);
+                            $("#picUrl").val(result.imageUrl);
+                            savePic(nowPicCount);
+                            $.modal.alertSuccess(result.msg)
+                        } else if (result.code === web_status.WARNING) {
+                            $.modal.alertWarning(result.msg)
+                        } else {
+                            $.modal.alertError(result.msg);
+                        }
+                        $.modal.closeLoading();
+                        $.modal.enable();
+                    }
+                })
+            }
+        });
+
+        $("#form-prod-edit").validate({
+            focusCleanup: true
+        });
+
+        function removePic(sort) {
+            var data = {
+                "prodId": $("#prodId").val(),
+                "sort": sort,
+            };
+            $.operate.post(prefix + "/remove", data, refreshTab);
+        }
+
+        function savePic(picIdx) {
+            var data = {
+                "prodId": $("#prodId").val(),
+                "picUrl": $("#picUrl").val(),
+                "sort": picIdx,
+            };
+            $.operate.post(prefix + "/addProdPic", data, setIdToImg);
+        }
+
+        function refreshTab() {
+            location.reload();
+        }
+
+        function addNewPic() {
+            $("#imageFileUrl").click();
+        }
+
+    </script>
+</body>
+</html>

+ 13 - 2
08.src/Xingxi/xingxi-system/src/main/java/com/xingxi/master/product/service/impl/ProdAttrPriceServiceImpl.java

@@ -1,7 +1,9 @@
 package com.xingxi.master.product.service.impl;
 
 import com.xingxi.common.core.text.Convert;
+import com.xingxi.common.enums.EDelFlag;
 import com.xingxi.common.utils.DateUtils;
+import com.xingxi.common.utils.ShiroUtils;
 import com.xingxi.master.product.domain.ProdAttrPrice;
 import com.xingxi.master.product.mapper.ProdAttrPriceMapper;
 import com.xingxi.master.product.service.IProdAttrPriceService;
@@ -74,8 +76,17 @@ public class ProdAttrPriceServiceImpl implements IProdAttrPriceService {
      */
     @Override
     public int updateProdAttrPrice(ProdAttrPrice prodAttrPrice) {
-        prodAttrPrice.setUpdateTime(DateUtils.getNowDate());
-        return prodAttrPriceMapper.updateProdAttrPrice(prodAttrPrice);
+        ProdAttrPrice result = prodAttrPriceMapper.selectProdAttrPriceByProdAttrPriceId(prodAttrPrice.getProdAttrPriceId());
+        if (result == null) {
+            prodAttrPrice.setDelFlag(EDelFlag.NO.getVal());
+            prodAttrPrice.setCreateUser(ShiroUtils.getLoginName());
+            prodAttrPrice.setCreateTime(DateUtils.getNowDate());
+            return prodAttrPriceMapper.insertProdAttrPrice(prodAttrPrice);
+        } else {
+            prodAttrPrice.setUpdateUser(ShiroUtils.getLoginName());
+            prodAttrPrice.setUpdateTime(DateUtils.getNowDate());
+            return prodAttrPriceMapper.updateProdAttrPrice(prodAttrPrice);
+        }
     }
 
     /**

+ 5 - 0
08.src/Xingxi/xingxi-system/src/main/java/com/xingxi/master/product/service/impl/ProdClassServiceImpl.java

@@ -1,7 +1,9 @@
 package com.xingxi.master.product.service.impl;
 
 import com.xingxi.common.core.text.Convert;
+import com.xingxi.common.enums.EDelFlag;
 import com.xingxi.common.utils.DateUtils;
+import com.xingxi.common.utils.ShiroUtils;
 import com.xingxi.master.product.domain.ProdClass;
 import com.xingxi.master.product.mapper.ProdClassMapper;
 import com.xingxi.master.product.service.IProdClassService;
@@ -51,6 +53,8 @@ public class ProdClassServiceImpl implements IProdClassService {
      */
     @Override
     public int insertProdClass(ProdClass prodClass) {
+        prodClass.setDelFlag(EDelFlag.NO.getVal());
+        prodClass.setCreateUser(ShiroUtils.getLoginName());
         prodClass.setCreateTime(DateUtils.getNowDate());
         return prodClassMapper.insertProdClass(prodClass);
     }
@@ -74,6 +78,7 @@ public class ProdClassServiceImpl implements IProdClassService {
      */
     @Override
     public int updateProdClass(ProdClass prodClass) {
+        prodClass.setUpdateUser(ShiroUtils.getLoginName());
         prodClass.setUpdateTime(DateUtils.getNowDate());
         return prodClassMapper.updateProdClass(prodClass);
     }