Merge branch 'master' of http://120.27.238.55:7000/r/xc-mall
 
	
	
	
	
	
	
		
		16 files modified
	
		
		3 files added
	
	
 
	
	
	
	
	
	
	
	
 |  |  | 
 |  |  | import lombok.RequiredArgsConstructor; | 
 |  |  | import lombok.extern.slf4j.Slf4j; | 
 |  |  | import org.springframework.validation.annotation.Validated; | 
 |  |  | import org.springframework.web.bind.annotation.GetMapping; | 
 |  |  | import org.springframework.web.bind.annotation.PostMapping; | 
 |  |  | import org.springframework.web.bind.annotation.RequestMapping; | 
 |  |  | import org.springframework.web.bind.annotation.RestController; | 
 |  |  | import org.springframework.web.bind.annotation.*; | 
 |  |  |  | 
 |  |  | import javax.validation.Valid; | 
 |  |  | import javax.validation.constraints.NotNull; | 
 |  |  | import java.util.List; | 
 |  |  | import java.util.Map; | 
 |  |  |  | 
 |  |  | 
 |  |  |     public FebsResponse updateCategory(@Valid MallGoodsCategory mallGoodsCategory) { | 
 |  |  |         return goodsCategoryService.updateCategory(mallGoodsCategory); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 商品分类-删除 | 
 |  |  |      */ | 
 |  |  |     @GetMapping("delCategary/{id}") | 
 |  |  |     @ControllerEndpoint(operation = " 商品分类-删除", exceptionMessage = "操作失败") | 
 |  |  |     public FebsResponse delCategary(@NotNull(message = "{required}") @PathVariable Long id) { | 
 |  |  |         return goodsCategoryService.delCategary(id); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  | } | 
 
 |  |  | 
 |  |  | import cc.mrbird.febs.common.entity.FebsResponse; | 
 |  |  | import cc.mrbird.febs.common.entity.QueryRequest; | 
 |  |  | import cc.mrbird.febs.mall.dto.*; | 
 |  |  | import cc.mrbird.febs.mall.entity.AppVersion; | 
 |  |  | import cc.mrbird.febs.mall.entity.MallMember; | 
 |  |  | import cc.mrbird.febs.mall.entity.MallOrderRefund; | 
 |  |  | import cc.mrbird.febs.mall.service.IAdminMallMemberService; | 
 |  |  | import cc.mrbird.febs.mall.vo.AdminAgentLevelOptionTreeVo; | 
 |  |  | import cc.mrbird.febs.mall.vo.AdminMallGoodsCategoryTreeVo; | 
 |  |  | import lombok.RequiredArgsConstructor; | 
 |  |  | import lombok.extern.slf4j.Slf4j; | 
 |  |  | import org.springframework.validation.annotation.Validated; | 
 |  |  | 
 |  |  |         return mallMemberService.rankAwardUpdate(rankAwardUpdateDto); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * App版本-列表 | 
 |  |  |      * @param appVersion | 
 |  |  |      * @param request | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     @GetMapping("getAppVersionList") | 
 |  |  |     public FebsResponse getAppVersionList(AppVersion appVersion, QueryRequest request) { | 
 |  |  |         Map<String, Object> data = getDataTable(mallMemberService.getAppVersionList(appVersion, request)); | 
 |  |  |         return new FebsResponse().success().data(data); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * App版本-删除 | 
 |  |  |      */ | 
 |  |  |     @GetMapping("delAppVersion/{id}") | 
 |  |  |     @ControllerEndpoint(operation = " App版本-删除", exceptionMessage = "操作失败") | 
 |  |  |     public FebsResponse delAppVersion(@NotNull(message = "{required}") @PathVariable Long id) { | 
 |  |  |         return mallMemberService.delCategary(id); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * App版本-新增 | 
 |  |  |      */ | 
 |  |  |     @PostMapping("addAppVersion") | 
 |  |  |     @ControllerEndpoint(operation = " App版本-新增", exceptionMessage = "操作失败") | 
 |  |  |     public FebsResponse addAppVersion(@Valid AppVersion appVersion) { | 
 |  |  |         return mallMemberService.addAppVersion(appVersion); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * App版本-更新 | 
 |  |  |      */ | 
 |  |  |     @PostMapping("updateAppVersion") | 
 |  |  |     @ControllerEndpoint(operation = "App版本-更新", exceptionMessage = "操作失败") | 
 |  |  |     public FebsResponse updateAppVersion(@Valid AppVersion appVersion) { | 
 |  |  |         return mallMemberService.updateAppVersion(appVersion); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 
 |  |  | 
 |  |  | import cc.mrbird.febs.common.controller.BaseController; | 
 |  |  | import cc.mrbird.febs.common.entity.FebsConstant; | 
 |  |  | import cc.mrbird.febs.common.utils.FebsUtil; | 
 |  |  | import cc.mrbird.febs.mall.entity.AppVersion; | 
 |  |  | import cc.mrbird.febs.mall.entity.MallMember; | 
 |  |  | import cc.mrbird.febs.mall.service.IAdminMallMemberService; | 
 |  |  | import cc.mrbird.febs.mall.vo.AdminAgentLevelUpdateInfoVo; | 
 |  |  | import cc.mrbird.febs.mall.vo.AdminMallMemberPaymentVo; | 
 |  |  | import cc.mrbird.febs.mall.vo.AdminRankAwardUpdateInfoVo; | 
 |  |  | import cc.mrbird.febs.mall.vo.MallMemberVo; | 
 |  |  | import cc.mrbird.febs.mall.vo.*; | 
 |  |  | import lombok.RequiredArgsConstructor; | 
 |  |  | import org.apache.shiro.authz.annotation.RequiresPermissions; | 
 |  |  | import org.springframework.stereotype.Controller; | 
 |  |  | 
 |  |  |         return FebsUtil.view("modules/mallMember/rankAwardUpdate"); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * App版本-列表 | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     @GetMapping("appVersionList") | 
 |  |  |     @RequiresPermissions("appVersionList:view") | 
 |  |  |     public String appVersionList() { | 
 |  |  |         return FebsUtil.view("modules/mallMember/appVersionList"); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * App版本-新增 | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     @GetMapping("appVersionAdd") | 
 |  |  |     @RequiresPermissions("appVersionAdd:add") | 
 |  |  |     public String appVersionAdd() { | 
 |  |  |         return FebsUtil.view("modules/mallMember/appVersionAdd"); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * App版本-详情 | 
 |  |  |      * @param id | 
 |  |  |      * @param model | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     @GetMapping("appVerSionUpdate/{id}") | 
 |  |  |     @RequiresPermissions("appVerSionUpdate:update") | 
 |  |  |     public String appVerSionUpdate(@PathVariable long id, Model model) { | 
 |  |  |         AppVersion data = mallMemberService.getAppVersionInfoById(id); | 
 |  |  |         model.addAttribute("appVersion", data); | 
 |  |  |         return FebsUtil.view("modules/mallMember/appVerSionUpdate"); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 
 |  |  | 
 |  |  |     AdminMallGoodsCategoryVo getMallGoodsCategoryInfoById(@Param("id")long id); | 
 |  |  |  | 
 |  |  |     List<AdminMallGoodsCategoryTreeVo> getParentCategorys(); | 
 |  |  |  | 
 |  |  |     List<MallGoodsCategory> selectChildCategaryById(@Param("id")Long id); | 
 |  |  | } | 
 
 |  |  | 
 |  |  | import org.apache.ibatis.annotations.Param; | 
 |  |  |  | 
 |  |  | import java.math.BigDecimal; | 
 |  |  | import java.util.List; | 
 |  |  | import java.util.Map; | 
 |  |  |  | 
 |  |  | public interface MallGoodsMapper extends BaseMapper<MallGoods> { | 
 |  |  | 
 |  |  |     AdminMailGoodsDetailVo selectMallGoodsInfoById(@Param("id")long id); | 
 |  |  |  | 
 |  |  |     Map<String, BigDecimal> selectGoodsStockAndVolume(@Param("id") Long id); | 
 |  |  |  | 
 |  |  |     List<MallGoods> selectMallGoodsByCategaryId(@Param("categaryId")Long id); | 
 |  |  | } | 
 
 |  |  | 
 |  |  | import cc.mrbird.febs.mall.dto.AgentDto; | 
 |  |  | import cc.mrbird.febs.mall.dto.AgentLevelDto; | 
 |  |  | import cc.mrbird.febs.mall.dto.RankAwardDto; | 
 |  |  | import cc.mrbird.febs.mall.entity.AppVersion; | 
 |  |  | import cc.mrbird.febs.mall.entity.MallMember; | 
 |  |  | import cc.mrbird.febs.mall.vo.*; | 
 |  |  | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | 
 |  |  | 
 |  |  |     IPage<AdminRankAwardVo> getRankAwardListInPage(Page<AdminRankAwardVo> page, RankAwardDto rankAwardDto); | 
 |  |  |  | 
 |  |  |     BigDecimal getAgentTeamAmountByInviteId(@Param("inviteId")String inviteId); | 
 |  |  |  | 
 |  |  |     IPage<AppVersion> getAppVersionListInPage(Page<AppVersion> page, AppVersion appVersion); | 
 |  |  | } | 
 
 |  |  | 
 |  |  |     List<AdminMallGoodsCategoryTreeVo> getParentCategorys(); | 
 |  |  |  | 
 |  |  |     FebsResponse updateCategory(MallGoodsCategory mallGoodsCategory); | 
 |  |  |  | 
 |  |  |     FebsResponse delCategary(Long id); | 
 |  |  | } | 
 
 |  |  | 
 |  |  | import cc.mrbird.febs.common.entity.FebsResponse; | 
 |  |  | import cc.mrbird.febs.common.entity.QueryRequest; | 
 |  |  | import cc.mrbird.febs.mall.dto.*; | 
 |  |  | import cc.mrbird.febs.mall.entity.AppVersion; | 
 |  |  | import cc.mrbird.febs.mall.entity.MallMember; | 
 |  |  | import cc.mrbird.febs.mall.vo.*; | 
 |  |  | import com.baomidou.mybatisplus.core.metadata.IPage; | 
 |  |  | 
 |  |  |     AdminRankAwardUpdateInfoVo getRankAwardUpdateInfoById(long id); | 
 |  |  |  | 
 |  |  |     FebsResponse rankAwardUpdate(RankAwardUpdateDto rankAwardUpdateDto); | 
 |  |  |  | 
 |  |  |     IPage<AppVersion> getAppVersionList(AppVersion appVersion, QueryRequest request); | 
 |  |  |  | 
 |  |  |     FebsResponse delCategary(Long id); | 
 |  |  |  | 
 |  |  |     FebsResponse addAppVersion(AppVersion appVersion); | 
 |  |  |  | 
 |  |  |     AppVersion getAppVersionInfoById(long id); | 
 |  |  |  | 
 |  |  |     FebsResponse updateAppVersion(AppVersion appVersion); | 
 |  |  | } | 
 
 |  |  | 
 |  |  |  | 
 |  |  | import cc.mrbird.febs.common.entity.FebsResponse; | 
 |  |  | import cc.mrbird.febs.common.entity.QueryRequest; | 
 |  |  | import cc.mrbird.febs.mall.entity.MallGoods; | 
 |  |  | import cc.mrbird.febs.mall.entity.MallGoodsCategory; | 
 |  |  | import cc.mrbird.febs.mall.mapper.MallGoodsCategoryMapper; | 
 |  |  | import cc.mrbird.febs.mall.mapper.MallGoodsMapper; | 
 |  |  | import cc.mrbird.febs.mall.service.IAdminMallGoodsCategoryService; | 
 |  |  | import cc.mrbird.febs.mall.vo.AdminMallGoodsCategoryTreeVo; | 
 |  |  | import cc.mrbird.febs.mall.vo.AdminMallGoodsCategoryVo; | 
 |  |  | 
 |  |  | public class AdminMallGoodsCategoryService extends ServiceImpl<MallGoodsCategoryMapper, MallGoodsCategory> implements IAdminMallGoodsCategoryService { | 
 |  |  |  | 
 |  |  |     private final MallGoodsCategoryMapper mallGoodsCategoryMapper; | 
 |  |  |  | 
 |  |  |     private final MallGoodsMapper mallGoodsMapper; | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     public IPage<MallGoodsCategory> getCategoryList(MallGoodsCategory mallGoodsCategory, QueryRequest request) { | 
 |  |  | 
 |  |  |         return new FebsResponse().success(); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     public FebsResponse delCategary(Long id) { | 
 |  |  |         MallGoodsCategory mallGoodsCategory = mallGoodsCategoryMapper.selectById(id); | 
 |  |  |         if(ObjectUtil.isEmpty(mallGoodsCategory)){ | 
 |  |  |             return new FebsResponse().fail().message("系统繁忙,请刷新页面重试"); | 
 |  |  |         } | 
 |  |  |         List<MallGoodsCategory> childCategarys = mallGoodsCategoryMapper.selectChildCategaryById(id); | 
 |  |  |         if(CollUtil.isNotEmpty(childCategarys)){ | 
 |  |  |             for(MallGoodsCategory childCategary : childCategarys){ | 
 |  |  |                 Long childCategaryId = childCategary.getId(); | 
 |  |  |                 List<MallGoods> mallChildGoods = mallGoodsMapper.selectMallGoodsByCategaryId(childCategaryId); | 
 |  |  |                 if(CollUtil.isNotEmpty(mallChildGoods)){ | 
 |  |  |                     return new FebsResponse().fail().message("该分类下的子类【"+childCategary.getName()+"】还有商品,请先删除商品或者修改商品分类"); | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         if(CollUtil.isNotEmpty(childCategarys)){ | 
 |  |  |             return new FebsResponse().fail().message("该分类下还有子类,请先删除子类"); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         List<MallGoods> mallGoods = mallGoodsMapper.selectMallGoodsByCategaryId(id); | 
 |  |  |         if(CollUtil.isNotEmpty(mallGoods)){ | 
 |  |  |             return new FebsResponse().fail().message("该分类下还有商品,请先删除商品或者修改商品分类"); | 
 |  |  |         } | 
 |  |  |         mallGoodsCategoryMapper.deleteById(mallGoodsCategory); | 
 |  |  |         return new FebsResponse().success(); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | } | 
 
 |  |  | 
 |  |  |         if(ObjectUtil.isEmpty(categoryId)){ | 
 |  |  |             return new FebsResponse().fail().message("商品分类不能为空"); | 
 |  |  |         } | 
 |  |  |         List<AddMallGoodsSkuDto> addSkus = addMallGoodsDto.getAddMallGoodsSkuDtos(); | 
 |  |  |         if(CollUtil.isEmpty(addSkus)){ | 
 |  |  |             return new FebsResponse().fail().message("商品规格不能为空"); | 
 |  |  |         } | 
 |  |  |         for(AddMallGoodsSkuDto addSku : addSkus){ | 
 |  |  |             String skuName = addSku.getSkuName(); | 
 |  |  |             if(StrUtil.isEmpty(skuName)){ | 
 |  |  |                 return new FebsResponse().fail().message("商品规格名称不能为空"); | 
 |  |  |             } | 
 |  |  |             Integer skuVolume = addSku.getSkuVolume()==null?0: addSku.getSkuVolume(); | 
 |  |  |             if(skuVolume < 0){ | 
 |  |  |                 return new FebsResponse().fail().message("商品规格销售数量不能小于0"); | 
 |  |  |             } | 
 |  |  |             Integer stock = addSku.getStock()==null?0: addSku.getStock(); | 
 |  |  |             if(stock < 0){ | 
 |  |  |                 return new FebsResponse().fail().message("商品规格库存必须大于0"); | 
 |  |  |             } | 
 |  |  |             String originalPrice = addSku.getOriginalPrice(); | 
 |  |  |             if(StrUtil.isEmpty(originalPrice)){ | 
 |  |  |                 return new FebsResponse().fail().message("商品规格原价不能为空"); | 
 |  |  |             } | 
 |  |  |             String presentPrice = addSku.getPresentPrice(); | 
 |  |  |             if(StrUtil.isEmpty(presentPrice)){ | 
 |  |  |                 return new FebsResponse().fail().message("商品规格现价不能为空"); | 
 |  |  |             } | 
 |  |  |  | 
 |  |  |         } | 
 |  |  |         //新增商品 | 
 |  |  |         MallGoods mallGoods = new MallGoods(); | 
 |  |  |         mallGoods.setGoodsNo(addMallGoodsDto.getGoodsNo()); | 
 |  |  | 
 |  |  |                 MallGoodsSku mallGoodsSku = new MallGoodsSku(); | 
 |  |  |                 mallGoodsSku.setSkuName(addMallGoodsSkuDto.getSkuName()); | 
 |  |  |                 mallGoodsSku.setSkuImage(addMallGoodsSkuDto.getSkuImage()); | 
 |  |  |                 mallGoodsSku.setStock(addMallGoodsSkuDto.getStock()); | 
 |  |  |                 mallGoodsSku.setSkuVolume(addMallGoodsSkuDto.getSkuVolume()); | 
 |  |  |                 mallGoodsSku.setStock(addMallGoodsSkuDto.getStock()==null?0:addMallGoodsSkuDto.getStock()); | 
 |  |  |                 mallGoodsSku.setSkuVolume(addMallGoodsSkuDto.getSkuVolume()==null?0:addMallGoodsSkuDto.getSkuVolume()); | 
 |  |  |                 mallGoodsSku.setOriginalPrice(new BigDecimal(addMallGoodsSkuDto.getOriginalPrice())); | 
 |  |  |                 mallGoodsSku.setPresentPrice(new BigDecimal(addMallGoodsSkuDto.getPresentPrice())); | 
 |  |  |                 mallGoodsSku.setStyleId(mallGoodsStyle.getId()); | 
 
 |  |  | 
 |  |  | import cc.mrbird.febs.common.entity.FebsResponse; | 
 |  |  | import cc.mrbird.febs.common.entity.QueryRequest; | 
 |  |  | import cc.mrbird.febs.mall.dto.*; | 
 |  |  | import cc.mrbird.febs.mall.entity.AppVersion; | 
 |  |  | import cc.mrbird.febs.mall.entity.DataDictionaryCustom; | 
 |  |  | import cc.mrbird.febs.mall.entity.MallMember; | 
 |  |  | import cc.mrbird.febs.mall.entity.MallMoneyFlow; | 
 |  |  | import cc.mrbird.febs.mall.mapper.DataDictionaryCustomMapper; | 
 |  |  | import cc.mrbird.febs.mall.mapper.MallMemberMapper; | 
 |  |  | import cc.mrbird.febs.mall.mapper.MallMemberPaymentMapper; | 
 |  |  | import cc.mrbird.febs.mall.mapper.MallMoneyFlowMapper; | 
 |  |  | import cc.mrbird.febs.mall.mapper.*; | 
 |  |  | import cc.mrbird.febs.mall.service.IAdminMallMemberService; | 
 |  |  | import cc.mrbird.febs.mall.service.IApiMallMemberWalletService; | 
 |  |  | import cc.mrbird.febs.mall.vo.*; | 
 |  |  | 
 |  |  | import org.springframework.transaction.annotation.Transactional; | 
 |  |  |  | 
 |  |  | import java.math.BigDecimal; | 
 |  |  | import java.util.Date; | 
 |  |  | import java.util.List; | 
 |  |  |  | 
 |  |  | /** | 
 |  |  | 
 |  |  |     private final DataDictionaryCustomMapper dataDictionaryCustomMapper; | 
 |  |  |  | 
 |  |  |     private final IApiMallMemberWalletService iApiMallMemberWalletService; | 
 |  |  |  | 
 |  |  |     private final AppVersionMapper appVersionMapper; | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     public IPage<MallMember> getMallMemberList(MallMember mallMember, QueryRequest request) { | 
 |  |  | 
 |  |  |         return new FebsResponse().success(); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     public IPage<AppVersion> getAppVersionList(AppVersion appVersion, QueryRequest request) { | 
 |  |  |         Page<AppVersion> page = new Page<>(request.getPageNum(), request.getPageSize()); | 
 |  |  |         IPage<AppVersion> appVersions = this.baseMapper.getAppVersionListInPage(page, appVersion); | 
 |  |  |         return appVersions; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     public FebsResponse delCategary(Long id) { | 
 |  |  |         AppVersion appVersion = appVersionMapper.selectById(id); | 
 |  |  |         if(ObjectUtil.isEmpty(appVersion)){ | 
 |  |  |             return new FebsResponse().fail().message("系统繁忙,请刷新页面重试"); | 
 |  |  |         } | 
 |  |  |         appVersionMapper.deleteById(id); | 
 |  |  |         return new FebsResponse().success(); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     public FebsResponse addAppVersion(AppVersion appVersion) { | 
 |  |  |         appVersion.setCreatetime(new Date()); | 
 |  |  |         appVersionMapper.insert(appVersion); | 
 |  |  |         return new FebsResponse().success(); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     public AppVersion getAppVersionInfoById(long id) { | 
 |  |  |         return appVersionMapper.selectById(id); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     public FebsResponse updateAppVersion(AppVersion appVersion) { | 
 |  |  |         AppVersion appVersionBefore = appVersionMapper.selectById(appVersion.getId()); | 
 |  |  |         if(ObjectUtil.isEmpty(appVersionBefore)){ | 
 |  |  |             return new FebsResponse().fail().message("系统繁忙,请刷新页面重试"); | 
 |  |  |         } | 
 |  |  |         appVersion.setCreatetime(new Date()); | 
 |  |  |         appVersionMapper.updateById(appVersion); | 
 |  |  |         return new FebsResponse().success(); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | } | 
 
 |  |  | 
 |  |  |     <select id="getParentCategorys" resultType="cc.mrbird.febs.mall.vo.AdminMallGoodsCategoryTreeVo"> | 
 |  |  |         SELECT m.id parentId,m.name name  FROM mall_goods_category m where m.parent_id = 0 | 
 |  |  |     </select> | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     <select id="selectChildCategaryById" resultType="cc.mrbird.febs.mall.entity.MallGoodsCategory"> | 
 |  |  |         select * from mall_goods_category | 
 |  |  |         where parent_id = #{id} | 
 |  |  |     </select> | 
 |  |  | </mapper> | 
 
 |  |  | 
 |  |  |                 </if> | 
 |  |  |             </if> | 
 |  |  |         </where> | 
 |  |  |         group by a.id | 
 |  |  |         order by a.created_time desc | 
 |  |  |     </select> | 
 |  |  |  | 
 |  |  | 
 |  |  |         from mall_goods_sku | 
 |  |  |         where goods_id=#{id} | 
 |  |  |     </select> | 
 |  |  |  | 
 |  |  |     <select id="selectMallGoodsByCategaryId" resultType="cc.mrbird.febs.mall.entity.MallGoods"> | 
 |  |  |         select * from mall_goods a where a.category_id = #{categaryId} | 
 |  |  |     </select> | 
 |  |  | </mapper> | 
 
 |  |  | 
 |  |  |                OR e.referrer_id = #{inviteId} | 
 |  |  |                or find_in_set(#{inviteId}, e.referrer_ids) | 
 |  |  |     </select> | 
 |  |  |  | 
 |  |  |     <select id="getAppVersionListInPage" resultType="cc.mrbird.febs.mall.entity.AppVersion"> | 
 |  |  |         select a.* from app_version a | 
 |  |  |     </select> | 
 |  |  | </mapper> | 
 
 |  |  | 
 |  |  |                                 <div class="layui-col-lg6"> | 
 |  |  |                                     <label class="layui-form-label febs-form-item-require">所属分类:</label> | 
 |  |  |                                     <div class="layui-input-block"> | 
 |  |  |                                         <select name="parentId" class="categary-update-category" > | 
 |  |  |                                         <select name="categoryId" class="categary-update-category" > | 
 |  |  |                                             <option value="">请选择</option> | 
 |  |  |                                         </select> | 
 |  |  |                                     </div> | 
 
| New file | 
 |  |  | 
 |  |  | <style> | 
 |  |  |     #appVersion-update { | 
 |  |  |         padding: 20px 25px 25px 0; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     #appVersion-update .layui-treeSelect .ztree li a, .ztree li span { | 
 |  |  |         margin: 0 0 2px 3px !important; | 
 |  |  |     } | 
 |  |  |     #appVersion-update #data-permission-tree-block { | 
 |  |  |         border: 1px solid #eee; | 
 |  |  |         border-radius: 2px; | 
 |  |  |         padding: 3px 0; | 
 |  |  |     } | 
 |  |  |     #appVersion-update .layui-treeSelect .ztree li span.button.switch { | 
 |  |  |         top: 1px; | 
 |  |  |         left: 3px; | 
 |  |  |     } | 
 |  |  |     #appVersion-update img{ | 
 |  |  |         max-width:100px | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | </style> | 
 |  |  | <div class="layui-fluid" id="appVersion-update"> | 
 |  |  |     <form class="layui-form" action="" lay-filter="appVersion-update-form"> | 
 |  |  |         <div class="layui-form-item febs-hide"> | 
 |  |  |             <label class="layui-form-label febs-form-item-require">id:</label> | 
 |  |  |             <div class="layui-input-block"> | 
 |  |  |                 <input type="text" name="id" data-th-value="${appVersion.id}"> | 
 |  |  |             </div> | 
 |  |  |         </div> | 
 |  |  |         <div class="layui-form-item"> | 
 |  |  |             <label class="layui-form-label febs-form-item-require">版本号:</label> | 
 |  |  |             <div class="layui-input-block"> | 
 |  |  |                 <input type="text" name="version" lay-verify="required" | 
 |  |  |                        autocomplete="off" class="layui-input" > | 
 |  |  |             </div> | 
 |  |  |         </div> | 
 |  |  |         <div class="layui-form-item"> | 
 |  |  |             <label class="layui-form-label febs-form-item-require">更新内容:</label> | 
 |  |  |             <div class="layui-input-block"> | 
 |  |  |                 <input type="text" name="content" lay-verify="required" | 
 |  |  |                        autocomplete="off" class="layui-input" > | 
 |  |  |             </div> | 
 |  |  |         </div> | 
 |  |  |         <div class="layui-form-item"> | 
 |  |  |             <label class="layui-form-label febs-form-item-require">下载地址:</label> | 
 |  |  |             <div class="layui-input-block"> | 
 |  |  |                 <input type="text" name="address" lay-verify="required" | 
 |  |  |                        autocomplete="off" class="layui-input" > | 
 |  |  |             </div> | 
 |  |  |         </div> | 
 |  |  |         <div class="layui-form-item"> | 
 |  |  |             <label class="layui-form-label febs-form-item-require">类型:</label> | 
 |  |  |             <div class="layui-input-block"> | 
 |  |  |                 <input type="radio" name="type" value="1" title="安卓" checked=""> | 
 |  |  |                 <input type="radio" name="type" value="2" title="苹果"> | 
 |  |  |             </div> | 
 |  |  |         </div> | 
 |  |  |         <div class="layui-form-item febs-hide"> | 
 |  |  |             <button class="layui-btn" lay-submit="" lay-filter="appVersion-update-form-submit" id="submit"></button> | 
 |  |  |         </div> | 
 |  |  |     </form> | 
 |  |  | </div> | 
 |  |  |  | 
 |  |  | <script data-th-inline="javascript"> | 
 |  |  |     layui.use(['febs', 'form', 'formSelects', 'validate', 'treeSelect', 'eleTree', 'laydate'], function () { | 
 |  |  |         var $ = layui.$, | 
 |  |  |             febs = layui.febs, | 
 |  |  |             layer = layui.layer, | 
 |  |  |             formSelects = layui.formSelects, | 
 |  |  |             treeSelect = layui.treeSelect, | 
 |  |  |             form = layui.form, | 
 |  |  |             laydate = layui.laydate, | 
 |  |  |             eleTree = layui.eleTree, | 
 |  |  |             appVersion = [[${appVersion}]], | 
 |  |  |             $view = $('#appVersion-update'), | 
 |  |  |             validate = layui.validate; | 
 |  |  |  | 
 |  |  |         form.render(); | 
 |  |  |         laydate.render({ | 
 |  |  |             elem: '#febs-form-group-date' | 
 |  |  |         }); | 
 |  |  |  | 
 |  |  |         formSelects.render(); | 
 |  |  |  | 
 |  |  |  | 
 |  |  |         initUserValue(); | 
 |  |  |  | 
 |  |  |         function initUserValue() { | 
 |  |  |             form.val("appVersion-update-form", { | 
 |  |  |                 "id": appVersion.id, | 
 |  |  |                 "version": appVersion.version, | 
 |  |  |                 "content": appVersion.content, | 
 |  |  |                 "address": appVersion.address, | 
 |  |  |                 "type": appVersion.type | 
 |  |  |             }); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         form.on('submit(appVersion-update-form-submit)', function (data) { | 
 |  |  |             febs.post(ctx + 'admin/mallMember/updateAppVersion', data.field, function () { | 
 |  |  |                 layer.closeAll(); | 
 |  |  |                 febs.alert.success('操作成功'); | 
 |  |  |                 $('#febs-appVersion').find('#reset').click(); | 
 |  |  |             }); | 
 |  |  |             return false; | 
 |  |  |         }); | 
 |  |  |     }); | 
 |  |  | </script> | 
 
| New file | 
 |  |  | 
 |  |  | <style> | 
 |  |  |     #appVersion-add { | 
 |  |  |         padding: 20px 25px 25px 0; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     #appVersion-add .layui-treeSelect .ztree li a, .ztree li span { | 
 |  |  |         margin: 0 0 2px 3px !important; | 
 |  |  |     } | 
 |  |  |     #appVersion-add #data-permission-tree-block { | 
 |  |  |         border: 1px solid #eee; | 
 |  |  |         border-radius: 2px; | 
 |  |  |         padding: 3px 0; | 
 |  |  |     } | 
 |  |  |     #appVersion-add .layui-treeSelect .ztree li span.button.switch { | 
 |  |  |         top: 1px; | 
 |  |  |         left: 3px; | 
 |  |  |     } | 
 |  |  |     #appVersion-add img{ | 
 |  |  |         max-width:100px | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | </style> | 
 |  |  | <div class="layui-fluid" id="appVersion-add"> | 
 |  |  |     <form class="layui-form" action="" lay-filter="appVersion-add-form"> | 
 |  |  |         <div class="layui-form-item"> | 
 |  |  |             <label class="layui-form-label febs-form-item-require">版本号:</label> | 
 |  |  |             <div class="layui-input-block"> | 
 |  |  |                 <input type="text" name="version" lay-verify="required" | 
 |  |  |                        autocomplete="off" class="layui-input" > | 
 |  |  |             </div> | 
 |  |  |         </div> | 
 |  |  |             <div class="layui-form-item"> | 
 |  |  |                 <label class="layui-form-label febs-form-item-require">更新内容:</label> | 
 |  |  |                 <div class="layui-input-block"> | 
 |  |  |                     <input type="text" name="content" lay-verify="required" | 
 |  |  |                            autocomplete="off" class="layui-input" > | 
 |  |  |                 </div> | 
 |  |  |             </div> | 
 |  |  |             <div class="layui-form-item"> | 
 |  |  |                 <label class="layui-form-label febs-form-item-require">下载地址:</label> | 
 |  |  |                 <div class="layui-input-block"> | 
 |  |  |                     <input type="text" name="address" lay-verify="required" | 
 |  |  |                            autocomplete="off" class="layui-input" > | 
 |  |  |                 </div> | 
 |  |  |             </div> | 
 |  |  |             <div class="layui-form-item"> | 
 |  |  |                 <label class="layui-form-label febs-form-item-require">类型:</label> | 
 |  |  |                 <div class="layui-input-block"> | 
 |  |  |                     <input type="radio" name="type" value="1" title="安卓" checked=""> | 
 |  |  |                     <input type="radio" name="type" value="2" title="苹果"> | 
 |  |  |                 </div> | 
 |  |  |             </div> | 
 |  |  |         <div class="layui-form-item febs-hide"> | 
 |  |  |             <button class="layui-btn" lay-submit="" lay-filter="appVersion-add-form-submit" id="submit"></button> | 
 |  |  |         </div> | 
 |  |  |     </form> | 
 |  |  | </div> | 
 |  |  |  | 
 |  |  | <script data-th-inline="javascript"> | 
 |  |  |     layui.use(['febs', 'form', 'formSelects', 'validate', 'treeSelect', 'eleTree', 'laydate'], function () { | 
 |  |  |         var $ = layui.$, | 
 |  |  |             febs = layui.febs, | 
 |  |  |             layer = layui.layer, | 
 |  |  |             formSelects = layui.formSelects, | 
 |  |  |             treeSelect = layui.treeSelect, | 
 |  |  |             form = layui.form, | 
 |  |  |             laydate = layui.laydate, | 
 |  |  |             eleTree = layui.eleTree, | 
 |  |  |             $view = $('#appVersion-add'), | 
 |  |  |             validate = layui.validate; | 
 |  |  |  | 
 |  |  |         form.render(); | 
 |  |  |         laydate.render({ | 
 |  |  |             elem: '#febs-form-group-date' | 
 |  |  |         }); | 
 |  |  |  | 
 |  |  |         formSelects.render(); | 
 |  |  |  | 
 |  |  |         form.on('submit(appVersion-add-form-submit)', function (data) { | 
 |  |  |             febs.post(ctx + 'admin/mallMember/addAppVersion', data.field, function () { | 
 |  |  |                 layer.closeAll(); | 
 |  |  |                 febs.alert.success('操作成功'); | 
 |  |  |                 $('#febs-appVersion').find('#reset').click(); | 
 |  |  |             }); | 
 |  |  |             return false; | 
 |  |  |         }); | 
 |  |  |     }); | 
 |  |  | </script> | 
 
| New file | 
 |  |  | 
 |  |  | <div class="layui-fluid layui-anim febs-anim" id="febs-appVersion" lay-title="商品分类"> | 
 |  |  |     <div class="layui-row febs-container"> | 
 |  |  |         <div class="layui-col-md12"> | 
 |  |  |             <div class="layui-card"> | 
 |  |  |                 <div class="layui-card-body febs-table-full"> | 
 |  |  |                     <form class="layui-form layui-table-form" lay-filter="user-table-form"> | 
 |  |  |                         <div class="layui-row"> | 
 |  |  |                             <div class="layui-col-md2 layui-col-sm12 layui-col-xs12 table-action-area"> | 
 |  |  |                                 <div class="layui-btn layui-btn-sm layui-btn-primary febs-button-green-plain table-action" id="add"> | 
 |  |  |                                     新增 | 
 |  |  |                                 </div> | 
 |  |  |                                 <div class="layui-btn layui-btn-sm layui-btn-primary febs-button-blue-plain table-action" id="query"> | 
 |  |  |                                     <i class="layui-icon"></i> | 
 |  |  |                                 </div> | 
 |  |  |                                 <div class="layui-btn layui-btn-sm layui-btn-primary febs-button-green-plain table-action" id="reset"> | 
 |  |  |                                     <i class="layui-icon"></i> | 
 |  |  |                                 </div> | 
 |  |  |                             </div> | 
 |  |  |                         </div> | 
 |  |  |                     </form> | 
 |  |  |                     <table lay-filter="userTable" lay-data="{id: 'userTable'}"></table> | 
 |  |  |                 </div> | 
 |  |  |             </div> | 
 |  |  |         </div> | 
 |  |  |     </div> | 
 |  |  | </div> | 
 |  |  | <!-- 表格操作栏 start --> | 
 |  |  | <script type="text/html" id="user-option"> | 
 |  |  |     <span shiro:lacksPermission="user:view,user:update,user:delete"> | 
 |  |  |         <span class="layui-badge-dot febs-bg-orange"></span> 无权限 | 
 |  |  |     </span> | 
 |  |  |     <a lay-event="edit" shiro:hasPermission="user:update"><i | 
 |  |  |             class="layui-icon febs-edit-area febs-blue"></i></a> | 
 |  |  | </script> | 
 |  |  | <!-- 表格操作栏 end --> | 
 |  |  | <script data-th-inline="none" type="text/javascript"> | 
 |  |  |     // 引入组件并初始化 | 
 |  |  |     layui.use([ 'jquery', 'form', 'table', 'febs'], function () { | 
 |  |  |         var $ = layui.jquery, | 
 |  |  |             febs = layui.febs, | 
 |  |  |             form = layui.form, | 
 |  |  |             table = layui.table, | 
 |  |  |             $view = $('#febs-appVersion'), | 
 |  |  |             $query = $view.find('#query'), | 
 |  |  |             $add = $view.find('#add'), | 
 |  |  |             $reset = $view.find('#reset'), | 
 |  |  |             $searchForm = $view.find('form'), | 
 |  |  |             sortObject = {field: 'phone', type: null}, | 
 |  |  |             tableIns; | 
 |  |  |  | 
 |  |  |         form.render(); | 
 |  |  |  | 
 |  |  |         // 表格初始化 | 
 |  |  |         initTable(); | 
 |  |  |  | 
 |  |  |         // 初始化表格操作栏各个按钮功能 | 
 |  |  |         table.on('tool(userTable)', function (obj) { | 
 |  |  |             var data = obj.data, | 
 |  |  |                 layEvent = obj.event; | 
 |  |  |             if (layEvent === 'appVerSionUpdate') { | 
 |  |  |                 febs.modal.open('编辑', 'modules/mallMember/appVerSionUpdate/' + data.id, { | 
 |  |  |                     btn: ['提交', '取消'], | 
 |  |  |                     yes: function (index, layero) { | 
 |  |  |                         $('#appVersion-update').find('#submit').trigger('click'); | 
 |  |  |                     }, | 
 |  |  |                     btn2: function () { | 
 |  |  |                         layer.closeAll(); | 
 |  |  |                     } | 
 |  |  |                 }); | 
 |  |  |             } | 
 |  |  |             if (layEvent === 'delAppVersion') { | 
 |  |  |                 febs.modal.confirm('删除', '确认删除?', function () { | 
 |  |  |                     delAppVersion(data.id); | 
 |  |  |                 }); | 
 |  |  |             } | 
 |  |  |         }); | 
 |  |  |  | 
 |  |  |         function delAppVersion(id) { | 
 |  |  |             febs.get(ctx + 'admin/mallMember/delAppVersion/' + id, null, function () { | 
 |  |  |                 febs.alert.success('操作成功'); | 
 |  |  |                 $query.click(); | 
 |  |  |             }); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         // 查询按钮 | 
 |  |  |         $query.on('click', function () { | 
 |  |  |             var params = $.extend(getQueryParams(), {field: sortObject.field, order: sortObject.type}); | 
 |  |  |             tableIns.reload({where: params, page: {curr: 1}}); | 
 |  |  |         }); | 
 |  |  |  | 
 |  |  |         // 刷新按钮 | 
 |  |  |         $reset.on('click', function () { | 
 |  |  |             $searchForm[0].reset(); | 
 |  |  |             sortObject.type = 'null'; | 
 |  |  |             tableIns.reload({where: getQueryParams(), page: {curr: 1}, initSort: sortObject}); | 
 |  |  |         }); | 
 |  |  |  | 
 |  |  |         $add.on('click', function () { | 
 |  |  |             febs.modal.open('新增', 'modules/mallMember/appVersionAdd/', { | 
 |  |  |                 btn: ['提交', '取消'], | 
 |  |  |                 yes: function (index, layero) { | 
 |  |  |                     $('#appVersion-add').find('#submit').trigger('click'); | 
 |  |  |                 }, | 
 |  |  |                 btn2: function () { | 
 |  |  |                     layer.closeAll(); | 
 |  |  |                 } | 
 |  |  |             }); | 
 |  |  |         }); | 
 |  |  |  | 
 |  |  |         function initTable() { | 
 |  |  |             tableIns = febs.table.init({ | 
 |  |  |                 elem: $view.find('table'), | 
 |  |  |                 id: 'userTable', | 
 |  |  |                 url: ctx + 'admin/mallMember/getAppVersionList', | 
 |  |  |                 cols: [[ | 
 |  |  |                     {field: 'id', title: '', minWidth: 10,align:'center'}, | 
 |  |  |                     {field: 'version', title: '版本号', minWidth: 120,align:'center'}, | 
 |  |  |                     {field: 'content', title: '更新内容', minWidth: 120,align:'center'}, | 
 |  |  |                     {field: 'address', title: '下载地址', minWidth: 200,align:'center'}, | 
 |  |  |                     {field: 'createtime', title: '更新时间', minWidth: 200,align:'center'}, | 
 |  |  |                     {field: 'type', title: '类型', | 
 |  |  |                         templet: function (d) { | 
 |  |  |                             if(d.type === 1){ | 
 |  |  |                                 return '<span>安卓</span>' | 
 |  |  |                             }else if(d.type === 2){ | 
 |  |  |                                 return '<span>苹果</span>' | 
 |  |  |                             }else{ | 
 |  |  |                                 return '' | 
 |  |  |                             } | 
 |  |  |                         }, minWidth: 100,align:'center'}, | 
 |  |  |                     {title: '操作', | 
 |  |  |                         templet: function (d) { | 
 |  |  |                             return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="appVerSionUpdate" shiro:hasPermission="user:update">编辑</button>' | 
 |  |  |                                 +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="delAppVersion" shiro:hasPermission="user:update">删除</button>' | 
 |  |  |                         },minWidth: 300,align:'center'} | 
 |  |  |                 ]] | 
 |  |  |             }); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         // 获取查询参数 | 
 |  |  |         function getQueryParams() { | 
 |  |  |             return { | 
 |  |  |             }; | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |     }) | 
 |  |  | </script> | 
 
 |  |  | 
 |  |  |                     } | 
 |  |  |                 }); | 
 |  |  |             } | 
 |  |  |             if (layEvent === 'delCategary') { | 
 |  |  |                 febs.modal.confirm('删除', '确认删除?', function () { | 
 |  |  |                     delCategary(data.id); | 
 |  |  |                 }); | 
 |  |  |             } | 
 |  |  |             if (layEvent === 'seeImges') { | 
 |  |  |                 var t = $view.find('#seeImges'+data.id+''); | 
 |  |  |                 //页面层 | 
 |  |  | 
 |  |  |             } | 
 |  |  |         }); | 
 |  |  |  | 
 |  |  |         function delCategary(id) { | 
 |  |  |             febs.get(ctx + 'admin/goodsCategory/delCategary/' + id, null, function () { | 
 |  |  |                 febs.alert.success('操作成功'); | 
 |  |  |                 $query.click(); | 
 |  |  |             }); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         // 查询按钮 | 
 |  |  |         $query.on('click', function () { | 
 |  |  | 
 |  |  |                     {title: '操作', | 
 |  |  |                         templet: function (d) { | 
 |  |  |                             return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="see" shiro:hasPermission="user:update">编辑</button>' | 
 |  |  |                             +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="delCategary" shiro:hasPermission="user:update">删除</button>' | 
 |  |  |                         },minWidth: 300,align:'center'} | 
 |  |  |                 ]] | 
 |  |  |             }); |