| | |
| | | import com.sinata.modular.mall.service.ICommissionSettlementMonthService; |
| | | import com.sinata.modular.member.model.MemUser; |
| | | import com.sinata.modular.member.service.IMemUserService; |
| | | import com.sinata.modular.system.model.Role; |
| | | import com.sinata.modular.system.service.IRoleService; |
| | | import java.util.stream.Collectors; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | @Autowired |
| | | private ICommissionSettlementMonthService commissionSettlementMonthService; |
| | | |
| | | @Autowired |
| | | private IRoleService roleService; |
| | | |
| | | /** |
| | | * 跳转到佣金结算明细首页 |
| | |
| | | try { |
| | | // 【城市管理员】数据查询 |
| | | ShiroUser shiroUser = ShiroKit.getUser(); |
| | | if (shiroUser.getRoleList().contains(EnumCityRole.PROVINCE_ROLE.index)) { |
| | | // 省级城市管理员 |
| | | cityCode = shiroUser.getCityCode().substring(0, 2); |
| | | } else if (shiroUser.getRoleList().contains(EnumCityRole.CITY_ROLE.index)) { |
| | | List<Integer> roleList = shiroUser.getRoleList(); |
| | | List<Integer> cityRoleList = roleService.selectList( |
| | | new EntityWrapper<Role>().in("id", roleList)).stream().map(Role::getCityRole) |
| | | .collect( |
| | | Collectors.toList()); |
| | | if (cityRoleList.contains(EnumCityRole.CITY_ROLE.index)) { |
| | | // 市级城市管理员 |
| | | cityCode = shiroUser.getCityCode().substring(0, 4); |
| | | } |
| | | else if (cityRoleList.contains(EnumCityRole.PROVINCE_ROLE.index)) { |
| | | // 省级城市管理员 |
| | | cityCode = shiroUser.getCityCode().substring(0, 2); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | import com.sinata.core.common.constant.factory.PageFactory; |
| | | import com.sinata.core.common.exception.BizExceptionEnum; |
| | | import com.sinata.core.log.LogObjectHolder; |
| | | import com.sinata.core.shiro.ShiroKit; |
| | | import com.sinata.core.util.Convert; |
| | | import com.sinata.core.util.DateUtils2; |
| | | import com.sinata.core.util.ExcelExportUtil; |
| | | import com.sinata.core.util.SpringContextHolder; |
| | | import com.sinata.modular.mall.model.*; |
| | | import com.sinata.modular.mall.service.*; |
| | | import org.apache.commons.collections.CollectionUtils; |
| | |
| | | public List<MallGoodsSku> getGoodsSpecData(Integer goodsId) { |
| | | List<MallGoodsSku> skuList = mallGoodsSkuService.selectList( |
| | | new EntityWrapper<MallGoodsSku>() |
| | | .setSqlSelect("spec_ids id, grep_name, stock") |
| | | .setSqlSelect("spec_ids id, grep_name, stock,price_sale,price_member") |
| | | .eq("goods_id", goodsId) |
| | | .eq("merchant_id", 0) |
| | | ); |
| | |
| | | wrapper.eq("group_type", groupType); |
| | | } |
| | | List<MallGoods> goodsList = mallGoodsService.selectList(wrapper); |
| | | List<HashMap<String, Object>> goodsMapList = goodsList.stream().map(goods -> { |
| | | HashMap<String, Object> goodMap = new HashMap<>(); |
| | | //商品编号 |
| | | goodMap.put("aGoodsNo", goods.getGoodsNo()); |
| | | goodMap.put("bName", goods.getGoodsName()); |
| | | goodMap.put("cGroupType", goods.getGroupType()); |
| | | String groupTypName = goods.getGroupType() > 0 ? (goods.getGroupType() == 1 ? "黄金套餐" : "钻石套餐") : "普通商品"; |
| | | goodMap.put("cGroupTypeName", groupTypName); |
| | | goodMap.put("dPrice", goods.getPrice()); |
| | | goodMap.put("dPriceDale", goods.getPriceSale()); |
| | | goodMap.put("ePriceMember", goods.getPriceMember()); |
| | | goodMap.put("fStock", goods.getStock()); |
| | | goodMap.put("gBuyCount", goods.getBuyCount()); |
| | | goodMap.put("hId", goods.getId()); |
| | | return goodMap; |
| | | }).collect(Collectors.toList()); |
| | | Set<Integer> goodsIdList = goodsList.stream().map(MallGoods::getId).collect(Collectors.toSet()); |
| | | Wrapper skuWrapper = new EntityWrapper<MallGoodsSku>().in("goods_id", goodsIdList) |
| | | .eq("merchant_id", 0).orderBy("id", false); |
| | | List<MallGoodsSku> skuList = mallGoodsSkuService.selectList(skuWrapper); |
| | | List<HashMap<String, Object>> result = new ArrayList<>(); |
| | | goodsList.forEach(goods -> { |
| | | List<MallGoodsSku> goodsSkuList = skuList.stream() |
| | | .filter(sku -> sku.getGoodsId().equals(goods.getId())) |
| | | .collect(Collectors.toList()); |
| | | List<HashMap<String, Object>> goodsMapList = goodsSkuList.stream().map(sku -> { |
| | | HashMap<String, Object> goodMap = new HashMap<>(); |
| | | //商品编号 |
| | | goodMap.put("aGoodsNo", goods.getGoodsNo()); |
| | | goodMap.put("bName", goods.getGoodsName()); |
| | | goodMap.put("bbGrepName", sku.getGrepName()); |
| | | goodMap.put("cGroupType", goods.getGroupType()); |
| | | String groupTypName = goods.getGroupType() > 0 ? (goods.getGroupType() == 1 ? "黄金套餐" |
| | | : "钻石套餐") : "普通商品"; |
| | | goodMap.put("cGroupTypeName", groupTypName); |
| | | goodMap.put("dPrice", goods.getPrice()); |
| | | goodMap.put("dPriceDale", sku.getPriceSale()); |
| | | goodMap.put("ePriceMember", sku.getPriceMember()); |
| | | goodMap.put("fStock", sku.getStock()); |
| | | goodMap.put("gBuyCount", goods.getBuyCount()); |
| | | goodMap.put("hId", goods.getId()); |
| | | goodMap.put("iSpecIds", sku.getSpecIds()); |
| | | goodMap.put("jSkuId", sku.getId()); |
| | | return goodMap; |
| | | }).collect(Collectors.toList()); |
| | | result.addAll(goodsMapList); |
| | | }); |
| | | /*for (int i = 0; i < result.size(); i++) { |
| | | for (int j = i+1; j < result.size(); j++) { |
| | | if (result.get(i).get("hId").equals(result.get(j).get("hId"))) { |
| | | result.get(j).put("bName",""); |
| | | } |
| | | } |
| | | }*/ |
| | | return new HashMap<String, Object>() {{ |
| | | put("code", 200); |
| | | put("value", goodsMapList); |
| | | put("value", result); |
| | | }}; |
| | | } |
| | | |
| | |
| | | |
| | | @BussinessLog(value = "获取商品规格") |
| | | @RequestMapping(value = "/getGoodsSpecs") |
| | | public Object getGoodsSpecs(Integer oneClassifyId, Integer twoClassifyId, Model model) { |
| | | public Object getGoodsSpecs(Integer oneClassifyId, Integer twoClassifyId,@RequestParam(required = false) List<String> selectedItems, Model model) { |
| | | Wrapper<MallGoodsSpec> wrapper = new EntityWrapper<MallGoodsSpec>() |
| | | .eq("is_delete", EnumIsDelete.EXISTED.index) |
| | | .addFilter("concat(',',classify_id_one,',') like concat( '%,', {0}, ',%' )", oneClassifyId); |
| | |
| | | if (CollectionUtils.isEmpty(goodsSpecs)) { |
| | | goodsSpecs = Lists.newArrayList(); |
| | | } |
| | | if (!selectedItems.isEmpty()) { |
| | | goodsSpecs = goodsSpecs.stream() |
| | | .filter(specs -> !selectedItems.contains(specs.getSpecName())).collect( |
| | | Collectors.toList()); |
| | | } |
| | | model.addAttribute("goodsSpecs", goodsSpecs); |
| | | return PREFIX + "add_specs.html"; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.toolkit.CollectionUtils; |
| | | import com.google.common.collect.Lists; |
| | | import com.sinata.common.enums.EnumCityRole; |
| | | import com.sinata.common.enums.EnumMemberGrade; |
| | |
| | | import com.sinata.modular.member.model.MemUserRelation; |
| | | import com.sinata.modular.member.service.IMemUserRelationService; |
| | | import com.sinata.modular.member.service.IMemUserService; |
| | | import com.sinata.modular.system.model.Role; |
| | | import com.sinata.modular.system.service.IMyCouponService; |
| | | import com.sinata.modular.system.service.IRoleService; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | |
| | | @Resource |
| | | private IMallOrderDetailGroupSpecService mallOrderDetailGroupSpecService; |
| | | |
| | | @Resource |
| | | private IRoleService roleService; |
| | | @Resource |
| | | private IMallGoodsSkuService mallGoodsSkuService; |
| | | |
| | | private MallOrder selectById(String orderNo) { |
| | | return this.mallOrderService.selectOne(new EntityWrapper<MallOrder>() |
| | |
| | | try { |
| | | // 【城市管理员】数据查询 |
| | | ShiroUser shiroUser = ShiroKit.getUser(); |
| | | if (shiroUser.getRoleList().contains(EnumCityRole.PROVINCE_ROLE.index)) { |
| | | // 省级城市管理员 |
| | | wrapper.like("o.city_code", shiroUser.getCityCode().substring(0, 2), SqlLike.RIGHT); |
| | | } else if (shiroUser.getRoleList().contains(EnumCityRole.CITY_ROLE.index)) { |
| | | List<Integer> roleList = shiroUser.getRoleList(); |
| | | List<Integer> cityRoleList = roleService.selectList( |
| | | new EntityWrapper<Role>().in("id", roleList)).stream().map(Role::getCityRole) |
| | | .collect( |
| | | Collectors.toList()); |
| | | if (cityRoleList.contains(EnumCityRole.CITY_ROLE.index)) { |
| | | // 市级城市管理员 |
| | | wrapper.like("o.city_code", shiroUser.getCityCode().substring(0, 4), SqlLike.RIGHT); |
| | | } |
| | | else if (cityRoleList.contains(EnumCityRole.PROVINCE_ROLE.index)) { |
| | | // 省级城市管理员 |
| | | wrapper.like("o.city_code", shiroUser.getCityCode().substring(0, 2), SqlLike.RIGHT); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping(value = "/orderShip") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Object orderShip(String orderNo, Integer expressCompany) { |
| | | MallOrder order = this.mallOrderService.selectOne( |
| | | new EntityWrapper<MallOrder>() |
| | |
| | | } |
| | | |
| | | this.mallOrderService.updateById(order); |
| | | |
| | | //退回库存 |
| | | List<MallOrderDetail> orderDetailList = this.mallOrderDetailService.selectList(new EntityWrapper<MallOrderDetail>().eq("order_no", orderNo)); |
| | | if (CollectionUtils.isNotEmpty(orderDetailList)) { |
| | | Map<Integer, MallOrderDetail> orderDetailMap = orderDetailList.stream() |
| | | .collect(Collectors.toMap(MallOrderDetail::getSkuId, e -> e)); |
| | | Set<Integer> skuIdList = orderDetailList.stream().map(MallOrderDetail::getSkuId) |
| | | .collect(Collectors.toSet()); |
| | | List<MallGoodsSku> skuList = mallGoodsSkuService.selectList( |
| | | new EntityWrapper<MallGoodsSku>().in("id", skuIdList)); |
| | | for (MallGoodsSku mallGoodsSku : skuList) { |
| | | MallOrderDetail mallOrderDetail = orderDetailMap.get(mallGoodsSku.getId()); |
| | | mallGoodsSku.setStock(mallGoodsSku.getStock() + mallOrderDetail.getGoodsNum()); |
| | | mallGoodsSkuService.updateById(mallGoodsSku); |
| | | } |
| | | } |
| | | return SUCCESS_TIP; |
| | | } |
| | | } |
| | |
| | | <select id="queryMerchantGoodsList" resultType="java.util.HashMap"> |
| | | SELECT md.id |
| | | , md.goods_name |
| | | , mu.grep_name |
| | | , mu.price |
| | | ,mu.spec_ids |
| | | , mu.price_sale |
| | | , mu.price_member |
| | | , mu.price_merchant |
| | | , md.stock |
| | | , mu.stock |
| | | , md.buy_count |
| | | , mu.id goodsSkuId |
| | | , mu.state |
| | |
| | | FROM `mall_goods_sku` mu |
| | | join mall_goods md on md.id = mu.goods_id |
| | | WHERE mu.merchant_id = #{merchantId} |
| | | GROUP BY mu.goods_id |
| | | </select> |
| | | </mapper> |
| | |
| | | LEFT JOIN mem_user u ON o.user_id = u.id |
| | | LEFT JOIN mem_user user2 ON o.sale_user_id = user2.id |
| | | left join mem_merchant mm on mm.id= o.merchant_id |
| | | LEFT JOIN (SELECT order_no,goods_name,grep_name,COUNT(1)as goods_num FROM mall_order_detail GROUP BY order_no) |
| | | LEFT JOIN (SELECT order_no,goods_name,grep_name, goods_num FROM mall_order_detail GROUP BY order_no) |
| | | order_goods on |
| | | order_goods.order_no = o.order_no |
| | | <where>o.cms_delete = false ${ew.sqlSegment}</where> |
| | |
| | | List<MallGoodsSku> goodsSkus = mallGoods.getGoodsSkus().stream().peek(sku -> { |
| | | sku.setGoodsId(mallGoods.getId()); |
| | | sku.setPrice(mallGoods.getPrice()); |
| | | sku.setPriceMember(mallGoods.getPriceMember()); |
| | | sku.setPriceSale(mallGoods.getPriceSale()); |
| | | }).collect(Collectors.toList()); |
| | | this.mallGoodsSkuService.insertBatch(goodsSkus); |
| | | } |
| | |
| | | .peek(sku -> { |
| | | sku.setGoodsId(mallGoods.getId()); |
| | | sku.setPrice(mallGoods.getPrice()); |
| | | sku.setPriceMember(mallGoods.getPriceMember()); |
| | | sku.setPriceSale(mallGoods.getPriceSale()); |
| | | }) |
| | | .map(MallGoodsSku::getId) |
| | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.google.common.collect.Lists; |
| | | import com.sinata.common.enums.EnumIsDelete; |
| | | import com.sinata.core.base.controller.BaseController; |
| | | import com.sinata.core.base.tips.ErrorTip; |
| | |
| | | import com.sinata.modular.system.model.StoreService; |
| | | import com.sinata.modular.system.service.IAreaCityService; |
| | | import com.sinata.modular.system.service.IStoreServiceService; |
| | | import java.util.HashMap; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | |
| | | wrapper2.eq("is_open", 1); |
| | | wrapper2.eq("is_delete", EnumIsDelete.EXISTED.index); |
| | | model.addAttribute("cityAreaList", areaCityService.selectList(wrapper2)); |
| | | model.addAttribute("merchantGoodsList", mallGoodsSkuService.queryMerchantGoodsList(memMerchant.getId())); |
| | | List<HashMap<String, Object>> list = mallGoodsSkuService.queryMerchantGoodsList( |
| | | memMerchant.getId()); |
| | | model.addAttribute("merchantGoodsList", list); |
| | | LogObjectHolder.me().set(memMerchant); |
| | | return PREFIX + "memMerchant_edit.html"; |
| | | } |
| | |
| | | MallGoodsSku sku = new MallGoodsSku(); |
| | | sku.setPriceMerchant(jsonObject.getBigDecimal("price")); |
| | | sku.setState(jsonObject.getInteger("state")); |
| | | wrapper.eq("merchant_id", merchantId); |
| | | wrapper.eq("merchant_id", merchantId) |
| | | .eq("id", jsonObject.getInteger("goodsSkuId")); |
| | | mallGoodsSkuService.update(sku, wrapper); |
| | | } else { |
| | | wrapper.eq("merchant_id", 0); |
| | | List<MallGoodsSku> skuList = mallGoodsSkuService.selectList(wrapper); |
| | | goodsList.addAll(skuList.stream().map(sku -> { |
| | | MallGoodsSku goodsSku = new MallGoodsSku(); |
| | | BeanUtils.copyProperties(sku, goodsSku); |
| | | goodsSku.setPriceMerchant(jsonObject.getBigDecimal("price")); |
| | | goodsSku.setPrice(sku.getPrice()); |
| | | goodsSku.setPriceMember(sku.getPriceMember()); |
| | | goodsSku.setPriceSale(sku.getPriceSale()); |
| | | goodsSku.setId(null); |
| | | goodsSku.setState(jsonObject.getInteger("state")); |
| | | goodsSku.setSkuId(sku.getId()); |
| | | goodsSku.setMerchantId(merchantId); |
| | | return goodsSku; |
| | | }).collect(Collectors.toList()) |
| | | ); |
| | | //查询门店sku,防止重复添加 |
| | | wrapper.eq("merchant_id", merchantId). |
| | | eq("spec_ids", jsonObject.getInteger("specIds")); |
| | | MallGoodsSku specSku = mallGoodsSkuService.selectOne(wrapper); |
| | | if (Objects.nonNull(specSku)) { |
| | | specSku.setPriceMerchant(jsonObject.getBigDecimal("price")); |
| | | specSku.setState(jsonObject.getInteger("state")); |
| | | mallGoodsSkuService.updateById(specSku); |
| | | } else { |
| | | wrapper = new EntityWrapper<MallGoodsSku>(); |
| | | wrapper.eq("spec_ids", jsonObject.getInteger("specIds")) |
| | | .eq("merchant_id", 0) |
| | | .eq("goods_id", jsonObject.getInteger("goodsId")); |
| | | MallGoodsSku sku = mallGoodsSkuService.selectOne(wrapper); |
| | | MallGoodsSku goodsSku = new MallGoodsSku(); |
| | | BeanUtils.copyProperties(sku, goodsSku); |
| | | goodsSku.setPriceMerchant(jsonObject.getBigDecimal("price")); |
| | | goodsSku.setPrice(sku.getPrice()); |
| | | goodsSku.setPriceMember(sku.getPriceMember()); |
| | | goodsSku.setPriceSale(sku.getPriceSale()); |
| | | goodsSku.setId(null); |
| | | goodsSku.setState(jsonObject.getInteger("state")); |
| | | goodsSku.setSkuId(sku.getId()); |
| | | goodsSku.setMerchantId(merchantId); |
| | | goodsList.addAll(Lists.newArrayList(goodsSku)); |
| | | } |
| | | } |
| | | } |
| | | if (goodsList.size() > 0) { |
| | |
| | | new EntityWrapper<Role>().in("id", roleList)).stream().map(Role::getCityRole) |
| | | .collect( |
| | | Collectors.toList()); |
| | | if (cityRoleList.contains(EnumCityRole.PROVINCE_ROLE.index)) { |
| | | // 省级城市管理员 |
| | | wrapper.like("o.city_code", shiroUser.getCityCode().substring(0, 2), SqlLike.RIGHT); |
| | | } else if (cityRoleList.contains(EnumCityRole.CITY_ROLE.index)) { |
| | | if (cityRoleList.contains(EnumCityRole.CITY_ROLE.index)) { |
| | | // 市级城市管理员 |
| | | wrapper.like("o.city_code", shiroUser.getCityCode().substring(0, 4), SqlLike.RIGHT); |
| | | } |
| | | else if (cityRoleList.contains(EnumCityRole.PROVINCE_ROLE.index)) { |
| | | // 省级城市管理员 |
| | | wrapper.like("o.city_code", shiroUser.getCityCode().substring(0, 2), SqlLike.RIGHT); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | |
| | | if (parentV4V5User[0] != null) { |
| | | map.put("v4ShowId", parentV4V5User[0].getShowId()); |
| | | map.put("v4Team", parentV4V5User[0].getRealName()); |
| | | } else if (parentV4V5User[1] != null) { |
| | | map.put("v4ShowId", parentV4V5User[1].getShowId()); |
| | | map.put("v4Team", parentV4V5User[1].getRealName()); |
| | | map.put("v5ShowId", parentV4V5User[1].getShowId()); |
| | | map.put("v5Team", parentV4V5User[1].getRealName()); |
| | | } |
| | | if (parentV4V5User[1] != null) { |
| | | map.put("v5ShowId", parentV4V5User[1].getShowId()); |
| | |
| | | Integer gradeId = 0; |
| | | // 判断用是否为普通会员、VIP会员,可直接升级黄金营销员、城市合伙人 |
| | | if (memUser.getMemberGradeId() == EnumMemberGrade.G_1.index || memUser.getMemberGradeId() == EnumMemberGrade.G_2.index) { |
| | | //2024年4月改:购买钻石套餐成为城市合伙人的时间节点:次日、次月、次季度(和人员职级晋升维持设置 一致) |
| | | if (order.getOrderType() == EnumMallGoodsGroupType.GROUP_DIAMOND.index) { |
| | | gradeId = EnumMemberGrade.G_4.index; |
| | | gradeId = EnumMemberGrade.G_3.index; |
| | | setSql +=", upgrade_status = 0"; |
| | | } else if (order.getOrderType() == EnumMallGoodsGroupType.GROUP_GOLD.index) { |
| | | gradeId = EnumMemberGrade.G_3.index; |
| | | setSql +=", upgrade_status = 1"; |
| | | } |
| | | } |
| | | // 判断用是否为黄金营销员,可升级城市合伙人 |
| | | else if (memUser.getMemberGradeId() == EnumMemberGrade.G_3.index) { |
| | | if (order.getOrderType() == EnumMallGoodsGroupType.GROUP_DIAMOND.index) { |
| | | gradeId = EnumMemberGrade.G_4.index; |
| | | } |
| | | } |
| | | // else if (memUser.getMemberGradeId() == EnumMemberGrade.G_3.index) { |
| | | // if (order.getOrderType() == EnumMallGoodsGroupType.GROUP_DIAMOND.index) { |
| | | // gradeId = EnumMemberGrade.G_4.index; |
| | | // } |
| | | // } |
| | | // 其他(城市合伙人、市场总监)不处理 |
| | | |
| | | // 升级、重置品行(处理降级的要重置) |
| | |
| | | @RequestMapping(value = "/editUserLevel") |
| | | public Object editUserLevel(Integer userId, String memberGradeId) { |
| | | String whereSql = "member_grade_id = " + memberGradeId; |
| | | MemUser memUser = memUserService.selectById(userId); |
| | | if (Objects.nonNull(memUser)) { |
| | | String equityOrderNo = memUser.getEquityOrderNo(); |
| | | MallOrder order = mallOrderService.selectOne(new EntityWrapper<MallOrder>() |
| | | .eq("order_no", equityOrderNo)); |
| | | if (Objects.nonNull(order)) { |
| | | if (order.getOrderType() == 2 && memUser.getMemberGradeId() == 3) { |
| | | whereSql += ", upgrade_status = 1"; |
| | | } |
| | | } |
| | | } |
| | | |
| | | boolean flag = memUserService.updateForSet(whereSql, new EntityWrapper<MemUser>().eq("id", userId)); |
| | | return returnByFlag(flag, null); |
| | | } |
| | |
| | | <select id="getMapList" resultType="java.util.Map"> |
| | | SELECT |
| | | o.*, |
| | | ur.relation_path, |
| | | CASE |
| | | WHEN city.NAME = county.NAME THEN |
| | | CONCAT( province.NAME, '-', city.NAME ) ELSE CONCAT( province.NAME, '-', city.NAME, '-', county.NAME ) |
| | | END AS userAddress |
| | | ur.relation_path |
| | | FROM |
| | | mem_user o |
| | | LEFT JOIN mem_user_relation ur ON ur.id = o.id |
| | |
| | | <select id="getMapListAuth" resultType="java.util.Map"> |
| | | SELECT |
| | | o.*, |
| | | ur.relation_path, |
| | | CASE |
| | | WHEN city.NAME = county.NAME THEN |
| | | CONCAT( province.NAME, '-', city.NAME ) ELSE CONCAT( province.NAME, '-', city.NAME, '-', county.NAME ) |
| | | END AS userAddress |
| | | ur.relation_path |
| | | FROM |
| | | mem_user o |
| | | LEFT JOIN mem_user_relation ur ON ur.id = o.id |
| | |
| | | public String set_300(Model model) { |
| | | Integer[] idArray = new Integer[]{ |
| | | EnumSystemSetKey.SET_301.index, EnumSystemSetKey.SET_302.index, EnumSystemSetKey.SET_303.index, EnumSystemSetKey.SET_304.index, EnumSystemSetKey.SET_305.index, |
| | | EnumSystemSetKey.SET_321.index, EnumSystemSetKey.SET_322.index, EnumSystemSetKey.SET_323.index, EnumSystemSetKey.SET_324.index, EnumSystemSetKey.SET_325.index, |
| | | EnumSystemSetKey.SET_326.index, EnumSystemSetKey.SET_327.index, EnumSystemSetKey.SET_328.index, |
| | | EnumSystemSetKey.SET_341.index, EnumSystemSetKey.SET_342.index, EnumSystemSetKey.SET_343.index, EnumSystemSetKey.SET_344.index, EnumSystemSetKey.SET_345.index, |
| | | EnumSystemSetKey.SET_346.index, EnumSystemSetKey.SET_347.index, EnumSystemSetKey.SET_348.index |
| | | EnumSystemSetKey.SET_306.index,EnumSystemSetKey.SET_321.index, EnumSystemSetKey.SET_322.index, EnumSystemSetKey.SET_323.index, EnumSystemSetKey.SET_324.index, |
| | | EnumSystemSetKey.SET_325.index,EnumSystemSetKey.SET_326.index, EnumSystemSetKey.SET_327.index, EnumSystemSetKey.SET_328.index, EnumSystemSetKey.SET_341.index, |
| | | EnumSystemSetKey.SET_342.index, EnumSystemSetKey.SET_343.index, EnumSystemSetKey.SET_344.index, EnumSystemSetKey.SET_345.index,EnumSystemSetKey.SET_346.index, |
| | | EnumSystemSetKey.SET_347.index, EnumSystemSetKey.SET_348.index |
| | | }; |
| | | // 封装Model数据 |
| | | getModelByIdArray(model, idArray); |
| | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/update_300") |
| | | public Object update_300( |
| | | String t_301, String t_302, String t_303, String t_304, String t_305, |
| | | String t_301, String t_302, String t_303, String t_304, String t_305,String t_306, |
| | | String t_321, String t_322, String t_323, String t_324, String t_325, |
| | | String t_326, String t_327, String t_328, |
| | | String t_341, String t_342, String t_343, String t_344, String t_345, |
| | |
| | | new TSystemSet().setId(EnumSystemSetKey.SET_303.index).setValueStr(t_303), |
| | | new TSystemSet().setId(EnumSystemSetKey.SET_304.index).setValueStr(t_304), |
| | | new TSystemSet().setId(EnumSystemSetKey.SET_305.index).setValueStr(t_305), |
| | | new TSystemSet().setId(EnumSystemSetKey.SET_306.index).setValueStr(t_306), |
| | | |
| | | new TSystemSet().setId(EnumSystemSetKey.SET_321.index).setValueStr(t_321), |
| | | new TSystemSet().setId(EnumSystemSetKey.SET_322.index).setValueStr(t_322), |
| | |
| | | effectiveFieldsAlias: fieldsAlias, |
| | | keyField: ("${showName!}"||"name") |
| | | }).on('onSetSelectValue', function (e, item) { |
| | | var tbody = document.getElementById("product_tbody"); |
| | | $( "#${id}").val(item.id) |
| | | var search = document.getElementById("${id}_ul").getElementsByClassName("jhover")[0].innerHTML; |
| | | var iSpecIds = document.getElementById("${id}_ul").getElementsByClassName("jhover")[0].querySelector('[data-name="iSpecIds"]').textContent; |
| | | var html = search + '<td style="text-align: center; " data-field="number">' |
| | | + '<div class="fht-cell"><input type="text"></div></td>' |
| | | + '<td style="text-align: center; " data-field="number">' |
| | | + '<div class="fht-cell">' + |
| | | '<input calss="status" value="1" style="display:none;" > ' + |
| | | '<input class="status" value="1" style="display:none;" > ' + |
| | | '<input class="specIds" value="'+iSpecIds+'" style="display:none;" > ' + |
| | | '<button type="button" class="btn btn-outline btn-danger btn-xs" onclick="setStatusValue(this)" value="1">下架</button>' + |
| | | ' <button type="button" class="btn btn-outline btn-danger btn-xs" onclick="delTr(this)"" value="1">删除</button>' + |
| | | '</div></td>'; |
| | |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal" id="formId"> |
| | | <select id="specsId" name="specsId" data-placeholder="请选择规格" multiple="multiple" class="form-control chosen-select m-b-10"> |
| | | <option value="">请选择规格</option> |
| | | @for(info in goodsSpecs) { |
| | | <option value="${info.id}" data->${info.specName}</option> |
| | | @} |
| | | <option value="" disabled>请选择规格</option> |
| | | @for(info in goodsSpecs) { |
| | | <option value="${info.id}">${info.specName}</option> |
| | | @} |
| | | </select> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | |
| | | DialogInfo.get_submit_data = function() { |
| | | var specGroup = []; |
| | | $("#specsId").find("option:selected").each(function(i, item) { |
| | | specGroup[i] = { id: $(this).val(), grepName: $(this).text(), classifyName: "", stock: 0}; |
| | | specGroup[i] = { id: $(this).val(), grepName: $(this).text(), classifyName: "", stock: 0,priceSale:0,priceMember:0}; |
| | | }); |
| | | return specGroup; |
| | | } |
| | |
| | | <input class="form-control" id="price" name="price" type="text"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">美天销售价</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="priceSale" name="priceSale" type="text"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">会员价</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="priceMember" name="priceMember" type="text"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">商品库存</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="stock" name="stock" type="text"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="col-sm-6"> |
| | |
| | | </div> |
| | | </div> |
| | | |
| | | <#select id="classifyIdOne" name="商品分类"> |
| | | <#select id="classifyIdOne" name="商品分类" onchange="MallGoodsInfoDlg.cleanSpecs()"> |
| | | <option value="">请选择分类</option> |
| | | </#select> |
| | | <script>$(function(){ |
| | |
| | | <button class="btn btn-primary" onclick="MallGoodsInfoDlg.add_specs()">添加规格</button> |
| | | </div> |
| | | <div class="col-sm-9 col-sm-offset-3"> |
| | | <table class="table table-bordered table-striped" id="specsTable"></table> |
| | | <table class="table table-bordered table-striped" style="table-layout: fixed; word-break:break-all;" id="specsTable"></table> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-4"> |
| | | <!-- <div class="col-sm-4"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-4 control-label">会员价</label> |
| | | <div class="col-sm-8 form-control-static"> |
| | |
| | | ${item.priceSale!} |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div>--> |
| | | <div class="col-sm-4"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-4 control-label">商品库存</label> |
| | |
| | | <input class="form-control" id="price" name="price" value="${item.price}" type="text"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">美天销售价</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="priceSale" name="priceSale" value="${item.priceSale}" type="text"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">会员价</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="priceMember" name="priceMember" value="${item.priceMember}" type="text"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">商品库存</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="stock" name="stock" value="${item.stock}" type="text"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="col-sm-6"> |
| | |
| | | <button class="btn btn-primary" onclick="MallGoodsInfoDlg.add_specs()">添加规格</button> |
| | | </div> |
| | | <div class="col-sm-9 col-sm-offset-3"> |
| | | <table class="table table-bordered table-striped" id="specsTable"></table> |
| | | <table class="table table-bordered table-striped" id="specsTable" style="table-layout: fixed; word-break:break-all;"></table> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | <div class="panel-body"> |
| | | <div class="col-sm-6" id="goodsId_div" > |
| | | <#input_search_merchant_product id="goodsId" name="选择商品" showName="bName" |
| | | show-fields="aGoodsNo,bName,dPrice,dPriceDale,ePriceMember,gBuyCount,fStock,hId" fields-alias="商品编号,商品名称,市场价,美天销售价,会员价,销售量,商品库存,商品ID" url="mallGoods/mallGoodsList?groupType=0" value="" required="true"/> |
| | | show-fields="aGoodsNo,bName,bbGrepName,dPrice,dPriceDale,ePriceMember,gBuyCount,fStock,hId,iSpecIds" fields-alias="商品编号,商品名称,规格名称,市场价,美天销售价,会员价,销售量,商品库存,商品ID,规格编号" url="mallGoods/mallGoodsList?groupType=0" value="" required="true"/> |
| | | </div> |
| | | <div class="col-sm-12"> |
| | | <table id="macTable" data-mobile-responsive="true" data-click-to-select="true" class="table table-hover" style="margin-top: 0px;"> |
| | |
| | | <div class="th-inner ">商品库存</div> |
| | | <div class="fht-cell"></div> |
| | | </th> |
| | | <th style="text-align: center; " data-field="iSpecIds"> |
| | | <div class="th-inner ">规格编号</div> |
| | | <div class="fht-cell"></div> |
| | | </th> |
| | | <th style="text-align: center; " data-field="cGrepName"> |
| | | <div class="th-inner ">规格名称</div> |
| | | <div class="fht-cell"></div> |
| | | </th> |
| | | <th style="text-align: center; " data-field="macIp"> |
| | | <div class="th-inner ">商品编号</div> |
| | | <div class="fht-cell"></div> |
| | |
| | | <th style="text-align: center; " data-field="macName"> |
| | | <div class="th-inner ">商品名称</div> |
| | | </th> |
| | | |
| | | <th style="text-align: center; " data-field="macIp"> |
| | | <div class="th-inner ">市场价</div> |
| | | </th> |
| | |
| | | </th> |
| | | <th style="text-align: center; " data-field="passWord"> |
| | | <div class="th-inner ">会员价</div> |
| | | </th> |
| | | <th style="text-align: center; " data-field="cGrepName"> |
| | | <div class="th-inner ">规格名称</div> |
| | | <div class="fht-cell"></div> |
| | | </th> |
| | | <th style="text-align: center; " data-field="number"> |
| | | <div class="th-inner ">销售量</div> |
| | |
| | | <td style="text-align: center; " data-name="classifyIdOne">${merchantGoods.price}</td> |
| | | <td style="text-align: center; " data-name="classifyIdOne">${merchantGoods.price_sale}</td> |
| | | <td style="text-align: center; " data-name="classifyIdOne">${merchantGoods.price_member}</td> |
| | | <td style="text-align: center; " data-name="classifyIdOne">${merchantGoods.grep_name}</td> |
| | | <td style="text-align: center; " data-name="classifyIdOne">${merchantGoods.buy_count}</td> |
| | | <td style="text-align: center; " data-name="classifyIdOne">${merchantGoods.stock}</td> |
| | | <td style="text-align: center; " data-name="classifyIdOne">${merchantGoods.price_merchant}</td> |
| | |
| | | <div class="panel-body"> |
| | | <div class="col-sm-6" id="goodsId_div" > |
| | | <#input_search_merchant_product id="goodsId" name="选择商品" showName="bName" |
| | | show-fields="aGoodsNo,bName,dPrice,dPriceDale,ePriceMember,gBuyCount,fStock,hId" fields-alias="商品编号,商品名称,市场价,美天销售价,会员价,销售量,商品库存,商品ID" url="mallGoods/mallGoodsList?groupType=0" value="" required="true"/> |
| | | show-fields="aGoodsNo,bName,bbGrepName,dPrice,dPriceDale,ePriceMember,gBuyCount,fStock,hId,iSpecIds" fields-alias="商品编号,商品名称,规格名称,市场价,美天销售价,会员价,销售量,商品库存,商品ID,规格编号" url="mallGoods/mallGoodsList?groupType=0" value="" required="true"/> |
| | | </div> |
| | | <div class="col-sm-12"> |
| | | <table id="macTable" data-mobile-responsive="true" data-click-to-select="true" class="table table-hover" style="margin-top: 0px;"> |
| | |
| | | </th> |
| | | <th style="text-align: center; " data-field="passWord"> |
| | | <div class="th-inner ">商品库存</div> |
| | | <div class="fht-cell"></div> |
| | | </th> |
| | | <th style="text-align: center; " data-field="iSpecIds"> |
| | | <div class="th-inner ">规格编号</div> |
| | | <div class="fht-cell"></div> |
| | | </th> |
| | | <th style="text-align: center; " data-field="cGrepName"> |
| | | <div class="th-inner ">规格名称</div> |
| | | <div class="fht-cell"></div> |
| | | </th> |
| | | <th style="text-align: center; " data-field="macIp"> |
| | |
| | | @for(merchantGoods in merchantGoodsList){ |
| | | <tr> |
| | | <td style="text-align: center; " data-name="classifyIdOne">${merchantGoods.id}</td> |
| | | <td style="text-align: center; " data-name="classifyIdOne">${merchantGoods.goods_name}</td> |
| | | <td style="text-align: center; " data-name="classifyIdOne">${merchantGoods.goods_name!}</td> |
| | | <td style="text-align: center; " data-name="classifyIdOne">${merchantGoods.price}</td> |
| | | <td style="text-align: center; " data-name="classifyIdOne">${merchantGoods.stock}</td> |
| | | <td style="text-align: center; " data-name="classifyIdOne">${merchantGoods.spec_ids}</td> |
| | | <td style="text-align: center; " data-name="classifyIdOne">${merchantGoods.grep_name}</td> |
| | | <td style="text-align: center; " data-name="classifyIdOne">${merchantGoods.goods_no}</td> |
| | | <td style="text-align: center; " data-name="classifyIdOne">${merchantGoods.price_sale}</td> |
| | | <td style="text-align: center; " data-name="classifyIdOne">${merchantGoods.price_member}</td> |
| | | <td style="text-align: center; " data-name="classifyIdOne">${merchantGoods.price_sale}</td> |
| | | <td style="text-align: center; " data-name="classifyIdOne">${merchantGoods.buy_count}</td> |
| | | <td style="text-align: center; " data-name="classifyIdOne"><input type="text" value="${merchantGoods.price_merchant}"></td> |
| | | <td style="text-align: center; " data-name="classifyIdOne"> |
| | |
| | | <label class="col-sm-2 control-label">${item.cardType=="0"?"身份证图片(正面)":"护照个人资料页"}</label> |
| | | <div class="col-sm-2 form-control-static"> |
| | | @if(isNotEmpty(item.idCardFrontImage)){ |
| | | <img height="150px" src="${item.idCardFrontImage}" onclick="Feng.lookBigImg('${item.idCardFrontImage}')" /> |
| | | <img height="150px" src="${item.idCardBackImage}" onclick="Feng.lookBigImg('${item.idCardBackImage}')" /> |
| | | @}else{ |
| | | <img height="150px" src="${ctxPath}/static/img/NoPIC.png" onclick="Feng.lookBigImg('${ctxPath}/static/img/NoPIC.png}')" /> |
| | | @} |
| | |
| | | <label class="col-sm-2 control-label">${item.cardType=="0"?"身份证图片(反面)":"入境盖章页"}</label> |
| | | <div class="col-sm-2 form-control-static"> |
| | | @if(isNotEmpty(item.idCardBackImage)){ |
| | | <img height="150px" src="${item.idCardBackImage}" onclick="Feng.lookBigImg('${item.idCardBackImage}')" /> |
| | | <img height="150px" src="${item.idCardFrontImage}" onclick="Feng.lookBigImg('${item.idCardFrontImage}')" /> |
| | | @}else{ |
| | | <img height="150px" src="${ctxPath}/static/img/NoPIC.png" onclick="Feng.lookBigImg('${ctxPath}/static/img/NoPIC.png}')" /> |
| | | @} |
| | |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label">职级</label> |
| | | <div class="col-sm-2 form-control-static">${item.memberGradeId!}</div> |
| | | <label class="col-sm-2 control-label">关联订单</label> |
| | | <div class="col-sm-2 form-control-static">${item.equityOrderNo!}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | </div> |
| | | <div class="col-sm-12 form-group" style="margin-bottom: 10px; margin-left: 35px;"> |
| | | 方案2.直接购买钻石套餐即可晋升城市合伙人。 |
| | | 可与<select id="t_306" class="form-control"> |
| | | <option value="1" ${t_306=='1'?'selected="selected"':''} >次日</option> |
| | | <option value="2" ${t_306=='2'?'selected="selected"':''} >次月</option> |
| | | <option value="3" ${t_306=='3'?'selected="selected"':''} >次季度</option> |
| | | </select>晋升为城市合伙人(不含推荐本人) |
| | | </div> |
| | | <div class="col-sm-12 form-group" style="margin-bottom: 10px"> |
| | | <button type="button" class="btn btn-sm btn-success">维持</button> |
| | |
| | | ajax.set("t_303", $("#t_303").val()); |
| | | ajax.set("t_304", $("#t_304").val()); |
| | | ajax.set("t_305", $("#t_305").val()); |
| | | ajax.set("t_306", $("#t_306").val()); |
| | | |
| | | ajax.set("t_321", $("#t_321").val()); |
| | | ajax.set("t_322", $("#t_322").val()); |
| | |
| | | </div> |
| | | <div class="col-sm-12 form-group" style="margin-bottom: 10px; margin-left: 35px;"> |
| | | 方案2.直接购买钻石套餐即可晋升城市合伙人。 |
| | | 可与<select id="t_306" class="form-control"> |
| | | <option value="1" ${t_306=='1'?'selected="selected"':''} >次日</option> |
| | | <option value="2" ${t_306=='2'?'selected="selected"':''} >次月</option> |
| | | <option value="3" ${t_306=='3'?'selected="selected"':''} >次季度</option> |
| | | </select>晋升为城市合伙人(不含推荐本人) |
| | | </div> |
| | | <div class="col-sm-12 form-group" style="margin-bottom: 10px"> |
| | | <button type="button" class="btn btn-sm btn-success">维持</button> |
| | |
| | | {title: '商品副标题', field: 'goodsTitle', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '商品图', field: 'goodsImage', visible: true, align: 'center', valign: 'middle', formatter: Feng.getImageDom}, |
| | | {title: '商品标签', field: 'tagIds', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '规格', field: 'specNames', visible: true, align: 'center', valign: 'middle'}, |
| | | // {title: '规格', field: 'specNames', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '销售量', field: 'buyCount', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '商品库存', field: 'stock', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '售卖门店数', field: 'merchantCount', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '销售价', field: 'priceSale', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '会员价', field: 'priceMember', visible: true, align: 'center', valign: 'middle'}, |
| | | // {title: '销售价', field: 'priceSale', visible: true, align: 'center', valign: 'middle'}, |
| | | // {title: '会员价', field: 'priceMember', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '商品状态', field: 'state', visible: true, align: 'center', valign: 'middle', formatter: function (value, row) { |
| | | return Feng.getOptionFormatter( "#state")(value) + (value == 5 ? ("("+ (row['auditRemark']||"") +")"):""); |
| | | }}, |
| | |
| | | $(".specGroup").each(function (i, item) { |
| | | // 遍历循环拿到列中所有input元素值 |
| | | let inputSpec = $(item).find(".inputSpec"); |
| | | specGroup[i] = {"spec_ids": inputSpec[0].value, "grep_name": inputSpec[1].value, "stock": inputSpec[2].value} |
| | | specGroup[i] = {"spec_ids": inputSpec[0].value, "grep_name": inputSpec[1].value, "stock": inputSpec[2].value,"price_sale": inputSpec[3].value,"price_member": inputSpec[4].value} |
| | | }); |
| | | return specGroup; |
| | | } |
| | |
| | | } |
| | | |
| | | MallGoodsInfoDlg.add_specs = function () { |
| | | let specsItems = []; |
| | | var query_item = { |
| | | oneClassifyId: this.get( "classifyIdOne") |
| | | oneClassifyId: this.get( "classifyIdOne"), |
| | | selectedItems: specsItems, |
| | | }; |
| | | $(".specGroup").each(function (i, item) { |
| | | // 遍历循环拿到列中所有input元素值 |
| | | let inputSpec = $(item).find(".inputSpec"); |
| | | specsItems[i] = inputSpec[1].value |
| | | }); |
| | | console.log(specsItems) |
| | | if ( !query_item.oneClassifyId) { |
| | | return Feng.error( "请先选择分类!") |
| | | } |
| | |
| | | } |
| | | }); |
| | | } |
| | | function delTr(buttonElement) { |
| | | // 获取按钮所在的<tr>元素 |
| | | var row = buttonElement.closest('tr'); |
| | | |
| | | // 从DOM中移除该<tr>元素 |
| | | row.parentNode.removeChild(row); |
| | | } |
| | | /** |
| | | * 生成规格表格 |
| | | * @param specGroup |
| | | */ |
| | | MallGoodsInfoDlg.setSpecTable = function(specGroup) { |
| | | // specGroup = [{"id":1,"grepName":"规格1","stock":1},{"id":2,"grepName":"规格2","stock":2}] |
| | | // specGroup = [{"id":1,"grepName":"规格1","stock":1, priceMember: 20, priceSale: 10},{"id":2,"grepName":"规格2","stock":2, priceMember: 20, priceSale: 10}] |
| | | // 商品分类 |
| | | let className = $('#classifyIdOne option:selected').text(); |
| | | |
| | | let thStr = "<tr><td>规格名称</td><td>商品分类</td><td>商品库存</td></tr>"; |
| | | let thStr = "<thead><tr><th>规格名称</th><th>商品分类</th><th>商品库存</th><th>美天销售价</th><th>会员价</th><th>操作</th></tr></thead><tbody></tbody>"; |
| | | if (!$("#specsTable").html()){ |
| | | $("#specsTable").html(thStr); |
| | | } |
| | | let tdStr = ''; |
| | | for (let i = 0; i < specGroup.length; i++) { |
| | | let item = specGroup[i]; |
| | |
| | | specGroup += (iitem.value == "" ? "0" : iitem.value) + "__"; |
| | | }); |
| | | |
| | | tdStr += "<tr class='specGroup'>" + |
| | | tdStr = "<tr class='specGroup'>" + |
| | | "<td>" + |
| | | "<input type='hidden' class='inputSpec' value='" + item.id + "'>" + |
| | | "<input type='hidden' class='inputSpec' value='" + item.grepName + "'>" + |
| | | item.grepName + |
| | | "</td>" + |
| | | "<td>" + (item.classifyName != "" ? item.classifyName : className) + "</td>" + |
| | | "<td><input type='text' class='inputSpec' value='" + item.stock + "'></td>" + |
| | | "<td><input type='text' class='inputSpec' value='" + item.stock + "' style='width: 92px'></td>" + |
| | | "<td><input type='text' class='inputSpec' value='" + item.priceSale + "' style='width: 92px'></td>" + |
| | | "<td><input type='text' class='inputSpec' value='" + item.priceMember + "' style='width: 92px'></td>" + |
| | | '<td><button type="button" class="btn btn-outline btn-danger btn-xs" onclick="delTr(this)" value="1">删除</button></td>' + |
| | | "</tr>"; |
| | | // 生成规格表格 |
| | | $("#specsTable tbody").append(tdStr) |
| | | } |
| | | |
| | | // 生成规格表格 |
| | | $("#specsTable").html(thStr + tdStr); |
| | | } |
| | | |
| | | /** |
| | | * 提交添加 |
| | | */ |
| | |
| | | this.memMerchantInfoData[key] = ser.join() |
| | | } |
| | | }else if(key =='goodsIds') { |
| | | debugger |
| | | var trList = document.getElementById("product_tbody").getElementsByTagName("tr"); |
| | | var product = []; |
| | | for(var ti = 0;ti < trList.length;ti++){ |
| | | var productInfo = {}; |
| | | var childrenList = trList[ti].getElementsByTagName("td")[9].getElementsByTagName("div")[0].children; |
| | | var childrenList = trList[ti].getElementsByTagName("td")[11].getElementsByTagName("div")[0].children; |
| | | if($(childrenList[0]).is(":hidden")){ |
| | | productInfo.state = $(childrenList[0]).val(); |
| | | } |
| | | if($(childrenList[childrenList.length-1]).is(":hidden")){ |
| | | productInfo.goodsSkuId = $(childrenList[childrenList.length-1]).val(); |
| | | if ($(childrenList[childrenList.length - 1]).is(":hidden")) { |
| | | productInfo.goodsSkuId = $( |
| | | childrenList[childrenList.length - 1]).val(); |
| | | } else { |
| | | productInfo.specIds = trList[ti].getElementsByTagName("td")[4].innerHTML; |
| | | } |
| | | productInfo.goodsId = trList[ti].getElementsByTagName("td")[0].innerHTML; |
| | | var price1 = trList[ti].getElementsByTagName("td")[6].innerHTML; |
| | | var price = trList[ti].getElementsByTagName("td")[8].getElementsByTagName("input"); |
| | | var price1 = trList[ti].getElementsByTagName("td")[8].innerHTML; |
| | | var price = trList[ti].getElementsByTagName("td")[10].getElementsByTagName("input"); |
| | | productInfo.price = $(price[0]).val()?$(price[0]).val():price1; |
| | | product[ti] = productInfo; |
| | | } |
| | |
| | | MemUserSales.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', checkbox: true, visible: true}, |
| | | {title: '推荐人所在城市', field: 'equityUserCityCode', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '工号', field: 'show_id', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | return value != 0 ? value : ""; |
| | | } |
| | | }, |
| | | {title: '提交时间', field: 'apply_time', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '推荐人工号', field: 'equityUserShowId', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '推荐人', field: 'equityUserRealName', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '推荐人所在城市', field: 'equityUserCityCode', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '姓名', field: 'real_name', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '性别', field: 'sex', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '生日', field: 'birthday', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '营销员所在城市', field: 'userAddress', visible: true, align: 'center', valign: 'middle',width:'150px'}, |
| | | {title: '营销员所在城市', field: 'cityCode', visible: true, align: 'center', valign: 'middle',width:'150px'}, |
| | | {title: '联系电话', field: 'phone', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '证件类型', field: 'card_type', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | |
| | | } |
| | | }, |
| | | {title: '证件号码', field: 'id_card', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '提交时间', field: 'apply_time', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '开户行', field: 'bank_name', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '银行卡号', field: 'bank_number', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '品行分', field: 'credit_score', visible: true, align: 'center', valign: 'middle'}, |
| | |
| | | return {0: "在职", 1: "离职"}[value]; |
| | | } |
| | | }, |
| | | {title: '推荐人工号', field: 'equityUserShowId', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '推荐人', field: 'equityUserRealName', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '城市合伙人工号', field: 'v4ShowId', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '城市合伙人团队', field: 'v4Team', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '市场总监工号', field: 'v5ShowId', visible: true, align: 'center', valign: 'middle'}, |
| | |
| | | MemUserSales.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', checkbox: true, visible: true}, |
| | | {title: '推荐人所在城市', field: 'equityUserCityCode', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '工号', field: 'show_id', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | return value != 0 ? value : ""; |
| | | } |
| | | }, |
| | | {title: '提交时间', field: 'apply_time', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '推荐人工号', field: 'equityUserShowId', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '推荐人', field: 'equityUserRealName', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '推荐人所在城市', field: 'equityUserCityCode', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '姓名', field: 'real_name', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '性别', field: 'sex', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '生日', field: 'birthday', visible: true, align: 'center', valign: 'middle'}, |
| | |
| | | } |
| | | }, |
| | | {title: '积分', field: 'integral', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '提交时间', field: 'apply_time', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '入司时间', field: 'audit_time', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '推荐人工号', field: 'equityUserShowId', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '推荐人', field: 'equityUserRealName', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '状态', field: 'is_leave_office', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | return {0: "在职", 1: "离职"}[value]; |
| | |
| | | SET_303(303, "【职级晋升维持】黄金营销员-晋升:且品行分不能低于{}分"), |
| | | SET_304(304, "【职级晋升维持】黄金营销员-晋升:可于{1次日/2次月/3次季度}晋升为城市合伙人"), |
| | | SET_305(305, "【职级晋升维持】黄金营销员-维持:品行分不能低于{}分,低于改分数直接降级为普通会员"), |
| | | SET_306(306, "【职级晋升维持】黄金营销员-晋升:方案2.直接购买钻石套餐课晋升城市合伙人。可于{1次日/2次月/3次季度}晋升为城市合伙人"), |
| | | SET_321(321, "【职级晋升维持】城市合伙人-晋升:城市合伙人滚动半年直接推荐{}个黄金营销员"), |
| | | SET_322(322, "【职级晋升维持】城市合伙人-晋升:且育成{}城市合伙人"), |
| | | SET_323(323, "【职级晋升维持】城市合伙人-晋升:直属团队达成{}万元业绩"), |
| | |
| | | package com.sinata.rest.modular.mall.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import java.math.BigDecimal; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.Optional; |
| | | import java.util.function.Function; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | Page page = new Page<VoGoods>(current, size); |
| | | // 查询商品信息 |
| | | List<VoGoods> list = goodsService.listGoods(EnumMallGoodsGroupType.GOODS.index, merchantId, goodsName, firstClassifyId, null, type, sortType, page); |
| | | Map<Integer, BigDecimal> minPriceSale = goodsSkuService.queryPlatMinSalePrice(null).stream() |
| | | .collect(Collectors.toMap(MallGoodsSku::getGoodsId, MallGoodsSku::getPriceSale)); |
| | | return ApiUtils.returnOK( |
| | | list.stream() |
| | | .map(o -> { |
| | | BigDecimal money = minPriceSale.get(o.getId()); |
| | | o.setTagList(mallTagService.getTagListByGoodsId(mallTags, o.getTagIds())); |
| | | o.setPriceSale(Optional.ofNullable(money).orElse(o.getPriceSale())); |
| | | return o; |
| | | }) |
| | | .collect(Collectors.toList()) |
| | |
| | | }) |
| | | public ApiUtils<VoGoodsDetail> detail(@PathVariable("id") Integer id) { |
| | | VoGoodsDetail o = goodsService.goodsDetail(id, null); |
| | | List<MallGoodsSku> skuList = goodsSkuService.queryPlatMinSalePrice(null); |
| | | Map<Integer, BigDecimal> minPriceSale = skuList.stream() |
| | | .collect(Collectors.toMap(MallGoodsSku::getGoodsId, MallGoodsSku::getPriceSale)); |
| | | Map<Integer, BigDecimal> minPriceMember = skuList.stream() |
| | | .collect(Collectors.toMap(MallGoodsSku::getGoodsId, MallGoodsSku::getPriceMember)); |
| | | if (o != null) { |
| | | BigDecimal money = minPriceSale.get(o.getId()); |
| | | BigDecimal minMemberMoney = minPriceMember.get(o.getId()); |
| | | o.setTagList(mallTagService.getTagListByGoodsId(null, o.getTagIds())); |
| | | o.setPriceSale(Optional.ofNullable(money).orElse(o.getPriceSale())); |
| | | o.setPriceMember(Optional.ofNullable(minMemberMoney).orElse(o.getPriceMerchant())); |
| | | } |
| | | return ApiUtils.returnOK(o); |
| | | } |
| | |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.google.common.collect.Lists; |
| | | import com.sinata.common.enums.mall.EnumMallGoodsGroupType; |
| | | import com.sinata.common.enums.mall.EnumMallOrderState; |
| | | import com.sinata.common.user.VoUserGradeParent; |
| | |
| | | import com.sinata.rest.modular.mall.controller.body.BodyApplySaleUser; |
| | | import com.sinata.rest.modular.mall.controller.body.BodyUserAuthentication; |
| | | import com.sinata.rest.modular.mall.controller.vo.*; |
| | | import com.sinata.rest.modular.mall.model.MallGoods; |
| | | import com.sinata.rest.modular.mall.model.MallOrder; |
| | | import com.sinata.rest.modular.mall.model.MallVipEquity; |
| | | import com.sinata.rest.modular.mall.model.MyUserSubstanceCoupon; |
| | | import com.sinata.rest.modular.mall.service.IMallGoodsService; |
| | | import com.sinata.rest.modular.mall.service.IMallOrderService; |
| | | import com.sinata.rest.modular.mall.service.IMallVipEquityService; |
| | | import com.sinata.rest.modular.member.model.MemUser; |
| | |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import java.util.Optional; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | @RestController |
| | | @RequestMapping("/mall/goodsGroup") |
| | | @Api(tags = "商城-套餐商品") |
| | | @SuppressWarnings("unchecked") |
| | | public class MallGoodsGroupController { |
| | | |
| | | @Autowired |
| | |
| | | |
| | | @Autowired |
| | | private TelecomUtil telecomUtil; |
| | | |
| | | @Autowired |
| | | private IMallGoodsService mallGoodsService; |
| | | |
| | | @GetMapping(value = "/myShare") |
| | | @ApiOperation(value = "我的推广") |
| | |
| | | .ne(MallOrder::getOrderType, EnumMallGoodsGroupType.GOODS.index) |
| | | .eq(MallOrder::getUserId, userId) |
| | | // 订单材料受益人,0未申请入司 |
| | | .eq(MallOrder::getUseUserId, 0) |
| | | // .eq(MallOrder::getUseUserId, 0) |
| | | .in(MallOrder::getState, Arrays.asList( |
| | | EnumMallOrderState.WAIT_CHECK.index, |
| | | EnumMallOrderState.USE.index, |
| | | EnumMallOrderState.SUCCESS.index |
| | | )) |
| | | )).orderByAsc(MallOrder::getUseUserId) |
| | | ); |
| | | |
| | | // 权益列表 |
| | | List<MallVipEquity> vipEquityList = mallVipEquityService.list(); |
| | | |
| | | List<VoMallOrderEquity> voList = BeanUtil.copyToList(list, VoMallOrderEquity.class); |
| | | voList.stream().map(o -> { |
| | | List<String> contentList = new ArrayList(); |
| | | for (MallVipEquity eq : vipEquityList) { |
| | | if (o.getOrderType().equals(eq.getGroupType())) { |
| | | contentList.add(eq.getContent()); |
| | | } |
| | | } |
| | | o.setEquityContent(contentList); |
| | | |
| | | // 销售人员ID |
| | | MemUser saleUser = memUserService.getById(o.getSaleUserId()); |
| | | if (saleUser != null) { |
| | | o.setSaleUserNickName(saleUser.getNickName()); |
| | | o.setSaleUserRealName(saleUser.getRealName()); |
| | | } |
| | | |
| | | return o; |
| | | }).collect(Collectors.toList()); |
| | | voList.stream().map(o -> toVoMallOrderEquity(o, vipEquityList)).collect(Collectors.toList()); |
| | | |
| | | return ApiUtils.returnOK(voList); |
| | | } |
| | | private VoMallOrderEquity toVoMallOrderEquity(VoMallOrderEquity o,List<MallVipEquity> vipEquityList) { |
| | | List<String> contentList = new ArrayList(); |
| | | for (MallVipEquity eq : vipEquityList) { |
| | | if (o.getOrderType().equals(eq.getGroupType())) { |
| | | contentList.add(eq.getContent()); |
| | | } |
| | | } |
| | | o.setEquityContent(contentList); |
| | | |
| | | // 销售人员ID |
| | | MemUser saleUser = memUserService.getById(o.getSaleUserId()); |
| | | if (saleUser != null) { |
| | | o.setSaleUserNickName(saleUser.getNickName()); |
| | | o.setSaleUserRealName(saleUser.getRealName()); |
| | | } |
| | | MallGoods goods = mallGoodsService.getById(o.getGoodsId()); |
| | | Optional.ofNullable(goods).ifPresent(item ->{ |
| | | o.setGoodsName(item.getGoodsName()); |
| | | o.setPriceSale(item.getPriceSale()); |
| | | o.setGoodsImage(item.getGoodsImage()); |
| | | }); |
| | | return o; |
| | | } |
| | | @PostMapping(value = "/applySaleUser") |
| | | @ApiOperation(value = "推荐他人入司") |
| | | public ApiUtils applySaleUser(@RequestBody BodyApplySaleUser body) { |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.sinata.common.enums.EnumCityRole; |
| | | import com.sinata.common.enums.EnumIsDelete; |
| | | import com.sinata.common.enums.mall.EnumMallOrderState; |
| | | import com.sinata.common.util.QRCodeUtils; |
| | |
| | | import com.sinata.rest.modular.mall.model.MallOrder; |
| | | import com.sinata.rest.modular.mall.model.MallOrderDetail; |
| | | import com.sinata.rest.modular.mall.model.MallOrderMain; |
| | | import com.sinata.rest.modular.mall.service.*; |
| | | import com.sinata.rest.modular.mall.service.IMallGoodsService; |
| | | import com.sinata.rest.modular.mall.service.IMallGoodsSkuService; |
| | | import com.sinata.rest.modular.mall.service.IMallGroupSpecService; |
| | | import com.sinata.rest.modular.mall.service.IMallOrderDetailGroupSpecService; |
| | | import com.sinata.rest.modular.mall.service.IMallOrderDetailService; |
| | | import com.sinata.rest.modular.mall.service.IMallOrderMainService; |
| | | import com.sinata.rest.modular.mall.service.IMallOrderService; |
| | | import com.sinata.rest.modular.member.model.MemUser; |
| | | import com.sinata.rest.modular.member.model.MyCoupon; |
| | | import com.sinata.rest.modular.member.service.IMyCouponService; |
| | |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | import javax.annotation.Resource; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.math.BigDecimal; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | |
| | | @ApiModelProperty(value = "主订单编号") |
| | | private String orderMainNo; |
| | | |
| | | @ApiModelProperty(value = "套餐名称") |
| | | private String goodsName; |
| | | |
| | | @ApiModelProperty(value = "美天销售价") |
| | | private BigDecimal priceSale; |
| | | |
| | | @ApiModelProperty(value = "商品ID") |
| | | private Integer goodsId; |
| | | |
| | | @ApiModelProperty(value = "商品列表图") |
| | | private String goodsImage; |
| | | |
| | | @ApiModelProperty(value = "订单编号") |
| | | private String orderNo; |
| | | |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.sinata.rest.modular.mall.model.MallGoodsSku; |
| | | import java.util.List; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | |
| | | * 商品修改增加/减少库存 |
| | | */ |
| | | void updateStock(@Param("skuId") Integer skuId, @Param("goodsNum") Integer goodsNum); |
| | | |
| | | List<MallGoodsSku> queryPlatMinSalePrice(Integer goodsId); |
| | | } |
| | |
| | | |
| | | <select id="getHotGoodsByBody" resultType="com.sinata.rest.modular.mall.controller.vo.VoGoods"> |
| | | SELECT |
| | | *, IFNULL( orderCount, 0 ) orderCount |
| | | goods.id,goods.buy_count,goods.classify_id_one,goods.goods_image,goods.goods_name,goods.goods_no,goods.state,goods.stock,goods.tag_ids, |
| | | goods.goods_title,goods.group_type,sku.price, sku.price_sale, sku.price_member, IFNULL( orderCount, 0 ) orderCount |
| | | FROM |
| | | mall_goods goods |
| | | LEFT JOIN mall_goods_sku sku ON goods.id = sku.goods_id AND sku.merchant_id = 0 |
| | | LEFT JOIN ( |
| | | SELECT |
| | | count( 1 ) orderCount, o.goods_id, county_code |
| | |
| | | SET stock = stock + #{goodsNum} |
| | | WHERE id = #{skuId} |
| | | </update> |
| | | <select id="queryPlatMinSalePrice" resultType="com.sinata.rest.modular.mall.model.MallGoodsSku" |
| | | parameterType="java.lang.Integer"> |
| | | SELECT g1.* |
| | | FROM `mall_goods_sku` g1 |
| | | JOIN ( |
| | | SELECT goods_id, MIN(price_sale) AS min_price |
| | | FROM `mall_goods_sku` |
| | | WHERE merchant_id = 0 |
| | | GROUP BY goods_id |
| | | ) g2 |
| | | ON g1.goods_id = g2.goods_id AND g1.price_sale = g2.min_price |
| | | WHERE 1=1 |
| | | AND g1.merchant_id = 0 |
| | | <if test="goodsId !=null and goodsId !=''"> |
| | | AND g1.goodsId = #{goodsId} |
| | | </if> |
| | | GROUP BY goods_id |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | } if (set_304 == 3 && DateUtil.isSameDay(DateUtil.date(), DateUtil.beginOfQuarter(DateUtil.date()))) { |
| | | v3Up(); |
| | | } |
| | | } |
| | | |
| | | Integer set_306 = setService.getIntegerById(EnumSystemSetKey.SET_306.index); |
| | | if (set_306 == 1) { |
| | | v3UpPlan2(); |
| | | } if (set_306 == 2 && DateUtil.thisDayOfMonth() == 1) { |
| | | v3UpPlan2(); |
| | | } if (set_306 == 3 && DateUtil.isSameDay(DateUtil.date(), DateUtil.beginOfQuarter(DateUtil.date()))) { |
| | | v3UpPlan2(); |
| | | } |
| | | } |
| | | @Scheduled(cron = "0 0 17 * * ?") |
| | | public void runTest() { |
| | | log.info("---------------开始执行人员晋升任务-----------------" ); |
| | | Integer set_306 = setService.getIntegerById(EnumSystemSetKey.SET_306.index); |
| | | if (set_306 == 1) { |
| | | v3UpPlan2(); |
| | | } if (set_306 == 2 && DateUtil.thisDayOfMonth() == 1) { |
| | | v3UpPlan2(); |
| | | } if (set_306 == 3 && DateUtil.isSameDay(DateUtil.date(), DateUtil.beginOfQuarter(DateUtil.date()))) { |
| | | v3UpPlan2(); |
| | | } |
| | | } |
| | | public void v3Up() { |
| | | // 自然季度开始结束时间 |
| | | String beginTime = DateUtil.beginOfQuarter(DateUtil.date()).toString(); |
| | |
| | | user.updateById(); |
| | | } |
| | | } |
| | | |
| | | public void v3UpPlan2(){ |
| | | List<MemUser> memUsers = memUserService.queryLevelUpUserList(); |
| | | for (MemUser user : memUsers) { |
| | | user.setMemberGradeId(EnumMemberGrade.G_4.index); |
| | | user.setMemberGradeTime(DateUtil.date()); |
| | | user.setCreditScore(BigDecimal.valueOf(100)); |
| | | user.setUpgradeStatus(1); |
| | | user.updateById(); |
| | | log.info("【黄金营销员晋升为城市合伙人】用户:{} / {},品行分:{}", |
| | | user.getId(), user.getRealName(), user.getCreditScore() |
| | | ); |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.sinata.rest.modular.mall.job; |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.sinata.common.enums.EnumIsDelete; |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.sinata.rest.modular.mall.model.MallGoodsSku; |
| | | import java.util.List; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | /** |
| | |
| | | * 商品修改增加/减少库存 |
| | | */ |
| | | void updateStock(Integer skuId, Integer goodsNum); |
| | | |
| | | List<MallGoodsSku> queryPlatMinSalePrice(Integer goodsId); |
| | | } |
| | |
| | | package com.sinata.rest.modular.mall.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.sinata.rest.modular.mall.dao.MallGoodsSkuMapper; |
| | | import com.sinata.rest.modular.mall.model.MallGoodsSku; |
| | | import com.sinata.rest.modular.mall.service.IMallGoodsSkuService; |
| | | import java.util.List; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | |
| | | public void updateStock(Integer skuId, Integer goodsNum) { |
| | | this.baseMapper.updateStock(skuId, goodsNum); |
| | | } |
| | | |
| | | @Override |
| | | public List<MallGoodsSku> queryPlatMinSalePrice(Integer goodsId) { |
| | | return baseMapper.queryPlatMinSalePrice(goodsId); |
| | | } |
| | | } |
| | |
| | | // 美天销售价 |
| | | sellCost = skuVo.getPriceSale(); |
| | | } else { |
| | | if (user != null && user.getMemberGradeId() != EnumMemberGrade.G_1.index) { |
| | | if (user != null && user.getMemberGradeId() != EnumMemberGrade.G_1.index && EnumMemberGrade.G_2.index != user.getMemberGradeId()) { |
| | | // 会员价 |
| | | sellCost = skuVo.getPriceMember(); |
| | | } else { |
| | |
| | | } |
| | | } else { |
| | | // 套餐商品(优先销售价(门店价存得值),未设置为美天销售价) |
| | | if (skuVo.getPriceMerchant() == null || skuVo.getPriceMerchant().compareTo(BigDecimal.ZERO) <= 0) { |
| | | /* if (skuVo.getPriceMerchant() == null || skuVo.getPriceMerchant().compareTo(BigDecimal.ZERO) <= 0) { |
| | | // 美天销售价 |
| | | sellCost = skuVo.getPriceSale(); |
| | | } else { |
| | | // 销售价 |
| | | sellCost = skuVo.getPriceMerchant(); |
| | | } |
| | | |
| | | }*/ |
| | | // 美天销售价 |
| | | sellCost = skuVo.getPriceSale(); |
| | | // 查询套餐规格组ID |
| | | MallGroupSpec mallGroupSpec = mallGroupSpecService.getById(skuVo.getSpecIds()); |
| | | List<GroupSpecGoodsSkuJsonVo> groupSpecGoodsSkuJsonVoList = JSONUtil.parseArray(mallGroupSpec.getGoodsSkuJson()).toList(GroupSpecGoodsSkuJsonVo.class); |
| | |
| | | import com.sinata.rest.modular.auth.util.AccountCheckUtil; |
| | | import com.sinata.rest.modular.auth.util.JwtTokenUtil; |
| | | import com.sinata.rest.modular.auth.util.ThreadPoolUtil; |
| | | import com.sinata.rest.modular.mall.job.UserV3UpDownWork; |
| | | import com.sinata.rest.modular.member.controller.common.body.BodyPwd; |
| | | import com.sinata.rest.modular.member.controller.common.body.BodyRegister; |
| | | import com.sinata.rest.modular.member.controller.common.body.BodyUser; |
| | |
| | | @PostMapping(value = "/edit") |
| | | @ApiOperation(value = "修改用户信息", notes = "字段有就传,没有就不传", response = RegisterVo.class) |
| | | public Object editUser(@RequestBody BodyUser info, HttpServletRequest request) { |
| | | log.info("修改用户信息---------->:{}", info); |
| | | /************************ 拦截Token校验-begin ******************************/ |
| | | // 验证用户ID |
| | | int authCode = authUserId(request, info.userId); |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.sinata.rest.modular.mall.controller.vo.VoUserAndShareInfo; |
| | | import com.sinata.rest.modular.member.model.MemUser; |
| | | import java.util.List; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | |
| | |
| | | Integer updateUserGradeByCreditScore(@Param("creditScoreSetId") Integer creditScoreSetId, @Param("byGrade") Integer byGrade, @Param("setGrade") Integer setGrade); |
| | | |
| | | VoUserAndShareInfo getUserAndSharerById(@Param("userId") Integer userId); |
| | | |
| | | List<MemUser> queryLevelUpUserList(); |
| | | } |
| | |
| | | <result column="equity_user_id" property="equityUserId" /> |
| | | <result column="equity_order_no" property="equityOrderNo"/> |
| | | <result column="is_buy_grade" property="isBuyGrade"/> |
| | | <result column="upgrade_status" property="upgradeStatus"/> |
| | | </resultMap> |
| | | |
| | | <select id="selectLast" resultMap="BaseResultMap"> |
| | |
| | | u.id = #{userId} |
| | | </where> |
| | | </select> |
| | | <select id="queryLevelUpUserList" |
| | | resultType="com.sinata.rest.modular.member.model.MemUser"> |
| | | SELECT |
| | | * |
| | | FROM |
| | | mem_user u |
| | | LEFT JOIN mall_order o ON u.equity_order_no = o.order_no |
| | | WHERE |
| | | u.member_grade_id = 3 |
| | | AND o.order_type = 2 |
| | | AND u.upgrade_status = 0 |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | @ApiModelProperty(value = "套餐购买等级") |
| | | private Integer isBuyGrade; |
| | | |
| | | @TableField("upgrade_status") |
| | | @ApiModelProperty(value = "是否晋升城市合伙人 0未晋升 1已晋升") |
| | | private Integer upgradeStatus; |
| | | |
| | | /** |
| | | * 邀请关系 |
| | | */ |
| | |
| | | import com.sinata.rest.modular.member.model.MemUser; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | void addIntegralShareCommission(Integer userId, BigDecimal orderAmount); |
| | | |
| | | List<MemUser> queryLevelUpUserList(); |
| | | } |
| | |
| | | import com.sinata.rest.modular.system.model.SystemNotice; |
| | | import com.sinata.rest.modular.system.service.ISmsRecordService; |
| | | import com.sinata.rest.modular.system.service.ISystemSetService; |
| | | import java.util.List; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public List<MemUser> queryLevelUpUserList() { |
| | | return baseMapper.queryLevelUpUserList(); |
| | | } |
| | | } |
| | |
| | | |
| | | <select id="queryMerchantGoodsList" resultType="java.util.HashMap"> |
| | | SELECT |
| | | md.id,md.goods_name,mu.price,mu.price_sale,mu.price_member,mu.price_merchant |
| | | ,md.stock,md.buy_count,mu.id goodsSkuId,mu.state,md.goods_no |
| | | md.goods_name, |
| | | md.buy_count, |
| | | sku.grep_name, |
| | | sku.price_merchant, |
| | | sku.stock |
| | | FROM |
| | | `mall_goods_sku` mu |
| | | join mall_goods md on md.id = mu.goods_id |
| | | mall_goods md |
| | | LEFT JOIN `mall_goods_sku` sku on sku.goods_id = md.id |
| | | WHERE |
| | | mu.merchant_id = #{merchantId} |
| | | GROUP BY mu.goods_id |
| | | sku.merchant_id = #{merchantId} |
| | | </select> |
| | | |
| | | <select id="getGoodsListByMerchantId" resultType="java.util.Map"> |
| | | SELECT |
| | | o.* |
| | | o.goods_name, |
| | | o.buy_count, |
| | | sku.grep_name, |
| | | sku.price_merchant, |
| | | sku.stock |
| | | FROM |
| | | mall_goods o |
| | | LEFT JOIN mall_goods_sku sku ON o.id = sku.goods_id |
| | | mall_goods_sku sku |
| | | LEFT JOIN mall_goods o ON sku.goods_id = o.id |
| | | <where> |
| | | sku.state = 1 |
| | | <if test="merchantId != null"> |
| | |
| | | */ |
| | | private Integer version; |
| | | |
| | | private Integer cityRole; |
| | | /* private Integer cityRole; |
| | | |
| | | public Integer getCityRole() { |
| | | return cityRole; |
| | |
| | | |
| | | public void setCityRole(Integer cityRole) { |
| | | this.cityRole = cityRole; |
| | | } |
| | | }*/ |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | |
| | | <th style="text-align: center; " data-field="macName"> |
| | | <div class="th-inner ">商品名称</div> |
| | | </th> |
| | | <th style="text-align: center; " data-field="macName"> |
| | | <div class="th-inner ">规格名称</div> |
| | | </th> |
| | | <th style="text-align: center; " data-field="number"> |
| | | <div class="th-inner ">门店销售价</div> |
| | | </th> |
| | |
| | | @for(merchantGoods in merchantGoodsList){ |
| | | <tr> |
| | | <td style="text-align: center; " data-name="classifyIdOne">${merchantGoods.goods_name}</td> |
| | | <td style="text-align: center; " data-name="classifyIdOne">${merchantGoods.grep_name}</td> |
| | | <td style="text-align: center; " data-name="classifyIdOne">${merchantGoods.price_merchant}</td> |
| | | <td style="text-align: center; " data-name="classifyIdOne">${merchantGoods.buy_count}</td> |
| | | <td style="text-align: center; " data-name="classifyIdOne">${merchantGoods.stock}</td> |