瀏覽代碼

小程序管理后台bbc bug修复

hyq 6 年之前
父節點
當前提交
f440c73417

+ 3 - 1
kmall-admin/src/main/java/com/kmall/admin/controller/SupplierController.java

@@ -5,6 +5,7 @@ import java.util.Map;
 
 import com.kmall.admin.entity.SupplierEntity;
 import com.kmall.admin.service.SupplierService;
+import com.kmall.admin.utils.ParamUtils;
 import com.kmall.api.service.common.CommonPropertiesBuilder;
 import com.kmall.api.service.merch.OmsMerchPropertiesBuilder;
 import com.kmall.common.utils.PageUtils;
@@ -35,6 +36,7 @@ public class SupplierController {
     @RequiresPermissions("supplier:list")
     @ResponseBody
     public R list(@RequestParam Map<String, Object> params) {
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
         //查询列表数据
         Query query = new Query(params);
 
@@ -99,7 +101,7 @@ public class SupplierController {
     @RequestMapping("/queryAll")
     @ResponseBody
     public R queryAll(@RequestParam Map<String, Object> params) {
-
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", false);
         List<SupplierEntity> list = supplierService.queryList(params);
 
         return R.ok().put("list", list);

+ 30 - 27
kmall-admin/src/main/java/com/kmall/admin/service/impl/GoodsServiceImpl.java

@@ -168,7 +168,7 @@ public class GoodsServiceImpl implements GoodsService {
         }
         goods.setAttributeCategory(categoryDao.queryObject(goods.getCategoryId()).getParentId());
         goods.setAddTime(new Date());
-        goods.setIsDelete(0);
+        goods.setIsDelete(Integer.parseInt(Dict.isDelete.item_0.getItem()));
         goods.setIsNew(0);
         goods.setCreateUserId(user.getUserId());
         goods.setUpdateUserId(user.getUserId());
@@ -309,7 +309,7 @@ public class GoodsServiceImpl implements GoodsService {
             goods.setIsHot(0);
         }
         goods.setAttributeCategory(categoryDao.queryObject(goods.getCategoryId()).getParentId());
-        goods.setIsDelete(0);
+        goods.setIsDelete(Integer.parseInt(Dict.isDelete.item_0.getItem()));
         goods.setIsNew(0);
         goods.setUpdateUserId(user.getUserId());
         goods.setUpdateTime(new Date());
@@ -384,32 +384,33 @@ public class GoodsServiceImpl implements GoodsService {
             goodsSpecification = goodsSpecificationDao.queryByGoodsId(goods.getId());
             goodsSpecification.setValue(goods.getCiqProdModel());
             goodsSpecificationDao.update(goodsSpecification);
-        }
 
-        if(product == null){
-            product = new ProductEntity();
-            product.setGoodsSn(goods.getGoodsSn());
-            product.setGoodsSpecificationNameValue(goodsSpecification.getValue());
-            product.setGoodsSpecificationIds(goodsSpecification.getSpecificationId()+"");
-            product.setGoodsId(goods.getId());
-            product.setGoodsNumber(goods.getGoodsNumber());
-            product.setGoodsDefault(0);
-            return productDao.save(product);
-        }else{
-            product.setGoodsSpecificationNameValue(goodsSpecification.getValue());
-            return productDao.update(product);
+            if(product == null){
+                product = new ProductEntity();
+                product.setGoodsSn(goods.getGoodsSn());
+                product.setGoodsSpecificationNameValue(goodsSpecification.getValue());
+                product.setGoodsSpecificationIds(goodsSpecification.getId()+"");
+                product.setGoodsId(goods.getId());
+                product.setGoodsNumber(goods.getGoodsNumber());
+                product.setGoodsDefault(0);
+                return productDao.save(product);
+            }else{
+                product.setGoodsSpecificationIds(goodsSpecification.getId().toString());
+                product.setGoodsSpecificationNameValue(goodsSpecification.getValue());
+                return productDao.update(product);
+            }
         }
+        return 1;
     }
 
     @Override
     public int delete(Integer id) {
         SysUserEntity user = ShiroUtils.getUserEntity();
         GoodsEntity goodsEntity = goodsDao.queryObject(id);
-        goodsEntity.setIsDelete(1);
-        goodsEntity.setIsOnSale(0);
+        goodsEntity.setIsDelete(Integer.parseInt(Dict.isDelete.item_1.getItem()));
+        goodsEntity.setIsOnSale(Integer.parseInt(Dict.isOnSale.item_0.getItem()));
         goodsEntity.setUpdateUserId(user.getUserId());
         goodsEntity.setUpdateTime(new Date());
-        //更新团购
         Map params = new HashMap();
         params.put("goodsId", id);
         List<GoodsGroupEntity> groupVos = goodsGroupDao.queryList(params);
@@ -439,8 +440,8 @@ public class GoodsServiceImpl implements GoodsService {
         int result = 0;
         for (Integer id : ids) {
             GoodsEntity goodsEntity = queryObject(id);
-            goodsEntity.setIsDelete(0);
-            goodsEntity.setIsOnSale(1);
+            goodsEntity.setIsDelete(Integer.parseInt(Dict.isDelete.item_0.getItem()));
+            goodsEntity.setIsOnSale(Integer.parseInt(Dict.isOnSale.item_1.getItem()));
             goodsEntity.setUpdateUserId(user.getUserId());
             goodsEntity.setUpdateTime(new Date());
             result += goodsDao.update(goodsEntity);
@@ -455,7 +456,8 @@ public class GoodsServiceImpl implements GoodsService {
         if (1 == goodsEntity.getIsOnSale()) {
             throw new RRException("此商品已处于上架状态!");
         }
-        goodsEntity.setIsOnSale(1);
+        goodsEntity.setIsOnSale(Integer.parseInt(Dict.isOnSale.item_1.getItem()));
+        goodsEntity.setIsDelete(Integer.parseInt(Dict.isDelete.item_0.getItem()));
         goodsEntity.setUpdateUserId(user.getUserId());
         goodsEntity.setUpdateTime(new Date());
         return goodsDao.update(goodsEntity);
@@ -468,7 +470,7 @@ public class GoodsServiceImpl implements GoodsService {
         if (0 == goodsEntity.getIsOnSale()) {
             throw new RRException("此商品已处于下架状态!");
         }
-        goodsEntity.setIsOnSale(0);
+        goodsEntity.setIsOnSale(Integer.parseInt(Dict.isOnSale.item_0.getItem()));
         goodsEntity.setUpdateUserId(user.getUserId());
         goodsEntity.setUpdateTime(new Date());
         return goodsDao.update(goodsEntity);
@@ -480,7 +482,7 @@ public class GoodsServiceImpl implements GoodsService {
         SysUserEntity user = ShiroUtils.getUserEntity();
         for (Integer id : ids) {
             GoodsEntity goodsEntity = queryObject(id);
-            goodsEntity.setIsOnSale(1);
+            goodsEntity.setIsOnSale(Integer.parseInt(Dict.isOnSale.item_1.getItem()));
             goodsEntity.setUpdateUserId(user.getUserId());
             goodsEntity.setUpdateTime(new Date());
             result += goodsDao.update(goodsEntity);
@@ -494,7 +496,7 @@ public class GoodsServiceImpl implements GoodsService {
         SysUserEntity user = ShiroUtils.getUserEntity();
         for (Integer id : ids) {
             GoodsEntity goodsEntity = queryObject(id);
-            goodsEntity.setIsOnSale(0);
+            goodsEntity.setIsOnSale(Integer.parseInt(Dict.isOnSale.item_0.getItem()));
             goodsEntity.setUpdateUserId(user.getUserId());
             goodsEntity.setUpdateTime(new Date());
             result += goodsDao.update(goodsEntity);
@@ -679,7 +681,7 @@ public class GoodsServiceImpl implements GoodsService {
                 goodsEntity.setCusGoodsCode(goodsDto.getCusGoodsCode());
                 goodsEntity.setCusRecCode(goodsDto.getCusRecCode());
                 goodsEntity.setCiqProdModel(goodsDto.getCiqProdModel());
-                goodsEntity.setIsDelete(0);
+                goodsEntity.setIsDelete(Integer.parseInt(Dict.isDelete.item_0.getItem()));
                 goodsEntity.setIsNew(0);
                 goodsEntity.setUpdateUserId(user.getUserId());
                 goodsEntity.setAddTime(new Date());
@@ -715,7 +717,7 @@ public class GoodsServiceImpl implements GoodsService {
                         // 添加商品规格
                         GoodsSpecificationEntity specificationEntity = goodsSpecificationDao.queryByGoodsId(goodsEntity.getId());
                         if(specificationEntity ==null) {
-                            goodsSpecification.setGoodsId(goodsEntity.getId() );
+                            goodsSpecification.setGoodsId(goodsEntity.getId());
                             goodsSpecification.setValue(goodsEntity.getCiqProdModel());
                             goodsSpecification.setSpecificationId(1);
                             goodsSpecificationDao.save(goodsSpecification);
@@ -729,12 +731,13 @@ public class GoodsServiceImpl implements GoodsService {
                         product = new ProductEntity();
                         product.setGoodsSn(goodsDto.getGoodsSn());
                         product.setGoodsSpecificationNameValue(goodsSpecification.getValue());
-                        product.setGoodsSpecificationIds(goodsSpecification.getSpecificationId()+"");
+                        product.setGoodsSpecificationIds(goodsSpecification.getId().toString());
                         product.setGoodsId(goodsEntity.getId());
                         product.setGoodsDefault(0);
                         product.setGoodsNumber(goodsEntity.getGoodsNumber());
                         productDao.save(product);
                     }else{
+                        product.setGoodsSpecificationIds(goodsSpecification.getId().toString());
                         product.setGoodsSpecificationNameValue(goodsSpecification.getValue());
                         productDao.update(product);
                     }

+ 5 - 0
kmall-admin/src/main/java/com/kmall/admin/service/impl/ProductStoreRelaServiceImpl.java

@@ -103,6 +103,10 @@ public class ProductStoreRelaServiceImpl implements ProductStoreRelaService {
         SysUserEntity user = ShiroUtils.getUserEntity();
         ProductEntity product = productDao.queryObjectBySn(goodsEntity.getGoodsSn());
         if (Dict.orderBizType.item_11.getItem().equals(goodsEntity.getGoodsBizType())) {
+            GoodsSpecificationEntity goodsSpecificationEntity = goodsSpecificationDao.queryByGoodsId(goodsEntity.getId());
+            if(goodsSpecificationEntity != null){
+                goodsSpecificationDao.delete(goodsSpecificationEntity.getId());
+            }
             // 添加商品规格
             GoodsSpecificationEntity goodsSpecification = new GoodsSpecificationEntity();
             goodsSpecification.setGoodsId(goodsEntity.getId());
@@ -114,6 +118,7 @@ public class ProductStoreRelaServiceImpl implements ProductStoreRelaService {
             product.setGoodsSpecificationIds(goodsSpecification.getId().toString());
             product.setGoodsSpecificationNameValue(goodsSpecification.getValue());
             productDao.update(product);
+
         } else {
             productStoreRela.setRetailPrice(goodsEntity.getRetailPrice());
             productStoreRela.setMarketPrice(goodsEntity.getMarketPrice());

+ 6 - 0
kmall-admin/src/main/resources/mybatis/mapper/ExportExceptionDataDao.xml

@@ -77,6 +77,12 @@
         <if test="name != null and name.trim() != ''">
             AND name LIKE concat('%',#{name},'%')
         </if>
+		<if test="storeId != null and storeId != '' ">
+			AND store_id = #{storeId}
+		</if>
+		<if test="merchSn != null and merchSn.trim() != '' ">
+			AND merch_sn = #{merchSn}
+		</if>
 	</select>
 	 
 	<insert id="save" parameterType="com.kmall.admin.entity.ExportExceptionDataEntity" useGeneratedKeys="true" keyProperty="id">

+ 6 - 0
kmall-admin/src/main/resources/mybatis/mapper/FeedbackDao.xml

@@ -76,6 +76,12 @@
 		<if test="userName != null and userName.trim() != ''">
 			AND user_name LIKE concat('%',#{userName},'%')
 		</if>
+		<if test="storeId != null and storeId != '' ">
+			AND f.store_id = #{storeId}
+		</if>
+		<if test="merchSn != null and merchSn.trim() != '' ">
+			AND f.merch_sn = #{merchSn}
+		</if>
 	</select>
 
 	<insert id="save" parameterType="com.kmall.admin.entity.FeedbackEntity" useGeneratedKeys="true" keyProperty="msgId">

+ 3 - 0
kmall-admin/src/main/resources/mybatis/mapper/FreightItemDao.xml

@@ -62,6 +62,9 @@
         <if test="name != null and name.trim() != ''">
             AND name LIKE concat('%',#{name},'%')
         </if>
+		<if test="freId != null and freId != ''">
+			AND fre_id = #{freId}
+		</if>
 	</select>
 	 
 	<insert id="save" parameterType="com.kmall.admin.entity.FreightItemEntity" useGeneratedKeys="true" keyProperty="id">

+ 3 - 0
kmall-admin/src/main/resources/mybatis/mapper/GoodsGalleryDao.xml

@@ -95,6 +95,9 @@
         <if test="goodsId != null">
             AND mall_goods_gallery.goods_id = #{goodsId}
         </if>
+        <if test="fileType != null">
+            AND mall_goods_gallery.file_type = #{fileType}
+        </if>
     </select>
 
     <insert id="save" parameterType="com.kmall.admin.entity.GoodsGalleryEntity" useGeneratedKeys="true" keyProperty="id">

+ 8 - 1
kmall-admin/src/main/resources/mybatis/mapper/GoodsIssueDao.xml

@@ -71,9 +71,16 @@
 
     <select id="queryTotal" resultType="int">
         select count(*) from mall_goods_issue
+
         WHERE 1=1
+        <if test="storeId != null and storeId != '' ">
+            AND store_id = #{storeId}
+        </if>
+        <if test="merchSn != null and merchSn.trim() != '' ">
+            AND merch_sn = #{merchSn}
+        </if>
         <if test="question != null and question.trim() != ''">
-            AND mall_goods_issue.question LIKE concat('%',#{question},'%')
+            AND question LIKE concat('%',#{question},'%')
         </if>
     </select>
 

+ 7 - 1
kmall-admin/src/main/resources/mybatis/mapper/HelpIssueDao.xml

@@ -48,7 +48,7 @@
 			AND h.merch_sn = #{merchSn}
 		</if>
 		<if test="typeName != null and typeName.trim() != ''">
-			AND h.type_name LIKE concat('%',#{typeName},'%')
+			AND t.type_name LIKE concat('%',#{typeName},'%')
 		</if>
         <choose>
             <when test="sidx != null and sidx.trim() != ''">
@@ -67,6 +67,12 @@
 		select count(*) from mall_help_issue
 		LEFT JOIN mall_help_type on mall_help_issue.type_id = mall_help_type.id
 		WHERE 1=1
+		<if test="storeId != null and storeId != '' ">
+			AND mall_help_issue.store_id = #{storeId}
+		</if>
+		<if test="merchSn != null and merchSn.trim() != '' ">
+			AND mall_help_issue.merch_sn = #{merchSn}
+		</if>
 		<if test="typeName != null and typeName.trim() != ''">
 			AND mall_help_type.type_name LIKE concat('%',#{typeName},'%')
 		</if>

+ 8 - 1
kmall-admin/src/main/resources/mybatis/mapper/SpecificationDao.xml

@@ -37,7 +37,14 @@
 	</select>
 	
  	<select id="queryTotal" resultType="int">
-		select count(*) from mall_specification
+		select count(*) from mall_specification a
+		WHERE 1=1
+		<if test="ids != null">
+			and a.id in
+			<foreach item="item" collection="ids" open="(" separator="," close=")">
+				#{item}
+			</foreach>
+		</if>
 	</select>
 	 
 	<insert id="save" parameterType="com.kmall.admin.entity.SpecificationEntity" useGeneratedKeys="true" keyProperty="id">

+ 3 - 0
kmall-admin/src/main/resources/mybatis/mapper/StoreDao.xml

@@ -110,6 +110,9 @@
  	<select id="queryTotal" resultType="int">
 		select count(*) from mall_store
 		WHERE 1=1
+		<if test="merchSn != null and merchSn.trim() != ''">
+			AND merch_sn = #{merchSn}
+		</if>
 		<if test="storeName != null and storeName.trim() != ''">
 			AND store_name LIKE concat('%',#{storeName},'%')
 		</if>

+ 5 - 5
kmall-admin/src/main/resources/mybatis/mapper/SupplierDao.xml

@@ -53,8 +53,8 @@
     		`is_show`
 		from mall_supplier
 		WHERE 1=1
-		<if test="name != null and name.trim() != ''">
-			AND name LIKE concat('%',#{name},'%')
+		<if test="merchSn != null and merchSn.trim() != ''">
+			AND level_merch_sn = #{merchSn}
 		</if>
         <choose>
             <when test="sidx != null and sidx.trim() != ''">
@@ -72,9 +72,9 @@
  	<select id="queryTotal" resultType="int">
 		select count(*) from mall_supplier
 		WHERE 1=1
-        <if test="name != null and name.trim() != ''">
-            AND name LIKE concat('%',#{name},'%')
-        </if>
+		<if test="merchSn != null and merchSn.trim() != ''">
+			AND level_merch_sn = #{merchSn}
+		</if>
 	</select>
 	 
 	<insert id="save" parameterType="com.kmall.admin.entity.SupplierEntity">

+ 8 - 3
kmall-admin/src/main/resources/mybatis/mapper/UserDao.xml

@@ -44,9 +44,6 @@
         <if test="username != null and username.trim() != ''">
             and username like concat('%',#{username},'%')
         </if>
-        <if test="username != null and username.trim() != ''">
-            and username like concat('%',#{username},'%')
-        </if>
         <if test="mobile != null and mobile.trim() != ''">
             and mobile like concat('%',#{mobile},'%')
         </if>
@@ -65,7 +62,15 @@
 
     <select id="queryTotal" resultType="int">
         select count(*) from mall_user
+        LEFT JOIN mall_merch_user ON mall_user.id=mall_merch_user.user_id
+        LEFT JOIN mall_user_level ON mall_user.user_level_id=mall_user_level.id
         WHERE 1=1
+        <if test="storeId != null">
+            and store_id = #{storeId}
+        </if>
+        <if test="merchSn != null and merchSn.trim() != ''">
+            and merch_sn = #{merchSn}
+        </if>
         <if test="username != null and username.trim() != ''">
             and username like concat('%',#{username},'%')
         </if>

+ 56 - 0
kmall-api/src/main/java/com/kmall/api/contants/Dict.java

@@ -639,5 +639,61 @@ public class Dict {
             this.itemName = itemName;
         }
     }
+    public enum isDelete {
+        item_0("0", "未删除"),
+        item_1("1", "已删除");
+
+        private String item;
+        private String itemName;
+
+        isDelete(String item, String itemName) {
+            this.item = item;
+            this.itemName = itemName;
+        }
+
+        public String getItem() {
+            return item;
+        }
+
+        public void setItem(String item) {
+            this.item = item;
+        }
+
+        public String getItemName() {
+            return itemName;
+        }
+
+        public void setItemName(String itemName) {
+            this.itemName = itemName;
+        }
+    }
+    public enum isOnSale {
+        item_0("0", "下架"),
+        item_1("1", "上架");
+
+        private String item;
+        private String itemName;
+
+        isOnSale(String item, String itemName) {
+            this.item = item;
+            this.itemName = itemName;
+        }
+
+        public String getItem() {
+            return item;
+        }
+
+        public void setItem(String item) {
+            this.item = item;
+        }
+
+        public String getItemName() {
+            return itemName;
+        }
+
+        public void setItemName(String itemName) {
+            this.itemName = itemName;
+        }
+    }
 
 }

+ 22 - 1
kmall-api/src/main/resources/mybatis/mapper/ApiAdMapper.xml

@@ -61,7 +61,28 @@
     </select>
 
     <select id="queryTotal" resultType="int">
-		select count(*) from mall_ad
+		select count(*) from mall_ad where 1 = 1 and enabled = 1
+        <if test="ad_position_id != null and ad_position_id != null">
+            and ad_position_id = #{ad_position_id}
+        </if>
+        <if test="storeId != null and storeId != null">
+            and store_id = #{storeId}
+        </if>
+        <if test="merchSn != null and merchSn != null">
+            and mersh_sn = #{merchSn}
+        </if>
+        <if test="ad_position_ids != null and ad_position_ids.length > 0">
+            and ad_position_id in
+            <foreach item="item" collection="ad_position_ids" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="media_types != null">
+            and media_type in
+            <foreach item="item" collection="media_types" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
 	</select>
 
     <insert id="save" parameterType="com.kmall.api.entity.AdVo" useGeneratedKeys="true" keyProperty="id">

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

@@ -55,7 +55,7 @@
         left join mall_goods b on a.goods_id = b.id
         left join mall_product c on c.goods_id = a.goods_id and c.id = a.product_id
         left join mall_product_store_rela psr on psr.product_id = c.id and psr.store_id = #{store_id}
-        where 1 = 1
+        where 1 = 1  and b.is_delete = 0
         and psr.stock_num > 0
         <if test="user_id != null">
             AND a.user_id = #{user_id}
@@ -67,7 +67,7 @@
             AND a.product_id = #{product_id}
         </if>
         <if test="store_id != null">
-            AND psr.store_id = #{store_id}
+            AND a.store_id = #{store_id}
         </if>
         <if test="checked != null">
             AND a.checked = #{checked}

+ 1 - 1
kmall-api/src/main/resources/mybatis/mapper/ApiFootprintMapper.xml

@@ -34,7 +34,7 @@
         left join mall_goods g on f.goods_id = g.id
         LEFT JOIN mall_product_store_rela psr ON psr.goods_id = g.id
         <where>
-            1=1 and psr.stock_num >0
+            1=1 and psr.stock_num >0  and g.is_delete = 0
             <if test="user_id != null">
                 and f.user_id = #{user_id}
             </if>