¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.api.business; |
| | | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.core.annotation.excel.ExcelExporter; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.business.model.BaseGoods; |
| | | import com.doumee.dao.business.model.dto.BaseGoodsCreateOrUpdateRequest; |
| | | import com.doumee.dao.business.model.dto.BaseGoodsDTO; |
| | | import com.doumee.service.business.BaseGoodsService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author æ±è¹è¹ |
| | | * @date 2023/09/07 11:41 |
| | | */ |
| | | @Api(tags = "ç´ æåº-ååä¿¡æ¯è¡¨") |
| | | @RestController |
| | | @RequestMapping("/business/baseGoods") |
| | | public class BaseGoodsController extends BaseController { |
| | | |
| | | @Autowired |
| | | private BaseGoodsService baseGoodsService; |
| | | |
| | | |
| | | @ApiOperation("å页æ¥è¯¢") |
| | | @PostMapping("/page") |
| | | // @RequiresPermissions("business:basegoods:query") |
| | | public ApiResponse<PageData<BaseGoods>> findPage (@RequestBody PageWrap<BaseGoods> pageWrap) { |
| | | return ApiResponse.success(baseGoodsService.findPage(pageWrap)); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.core.annotation.excel.ExcelExporter; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.dao.business.model.BaseCateParam; |
| | | import com.doumee.dao.business.model.BaseCategory; |
| | | import com.doumee.dao.business.model.Category; |
| | | import com.doumee.service.business.BaseCateParamService; |
| | | import com.doumee.service.business.BaseCategoryService; |
| | | import com.doumee.service.business.CategoryService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.java.Log; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * @author æ±è¹è¹ |
| | |
| | | |
| | | @Autowired |
| | | private CategoryService categoryService; |
| | | |
| | | @Autowired |
| | | private BaseCategoryService baseCategoryService; |
| | | |
| | | @Autowired |
| | | private BaseCateParamService baseCateParamService; |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("æ°å»º") |
| | |
| | | @PostMapping("/page") |
| | | @RequiresPermissions("business:category:query") |
| | | public ApiResponse<PageData<Category>> findPage (@RequestBody PageWrap<Category> pageWrap) { |
| | | LoginUserInfo loginUserInfo = this.getLoginUser(); |
| | | pageWrap.getModel().setCompanyId(loginUserInfo.getCompanyId()); |
| | | return ApiResponse.success(categoryService.findPage(pageWrap)); |
| | | } |
| | | |
| | |
| | | return ApiResponse.success(categoryService.companyFindList(category)); |
| | | } |
| | | |
| | | @ApiOperation("å¹³å°åç±»å表") |
| | | @PostMapping("/baseCategoryList") |
| | | public ApiResponse<List<BaseCategory>> baseCategoryList () { |
| | | BaseCategory baseCategory = new BaseCategory(); |
| | | baseCategory.setIsdeleted(Constants.ZERO); |
| | | baseCategory.setStatus(Constants.ZERO); |
| | | baseCategoryService.findList(baseCategory); |
| | | List list = baseCategoryService.findList(baseCategory); |
| | | return ApiResponse.success(list); |
| | | } |
| | | |
| | | @ApiOperation("å¹³å°å类详æ
") |
| | | @GetMapping("/baseCategoryDetail") |
| | | public ApiResponse<BaseCategory> baseCategoryDetail (Integer baseCategoryId) { |
| | | |
| | | BaseCategory baseCategory = baseCategoryService.findById(baseCategoryId); |
| | | if(Objects.isNull(baseCategory)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | BaseCateParam baseCateParam = new BaseCateParam(); |
| | | baseCateParam.setIsdeleted(Constants.ZERO); |
| | | baseCateParam.setStatus(Constants.ZERO); |
| | | baseCateParam.setCategoryId(baseCategoryId); |
| | | baseCategory.setBaseCateParamList( |
| | | baseCateParamService.findList(baseCateParam) |
| | | ); |
| | | return ApiResponse.success(baseCategory); |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | String nowDate = DateUtil.getNowShortDate();// å½åæ¶é´ï¼å¹´ææ¥ï¼ |
| | | String fileName = UUID.randomUUID().toString() + nfix; |
| | | String tempFileName = nowDate + "/" + fileName; |
| | | String tempFileName = nowDate + "/" + fileName; |
| | | String key = folder + tempFileName;// æä»¶å |
| | | ALiYunUtil obs = new ALiYunUtil(endpoint,access_id, access_key); |
| | | if (obs.uploadOnlineObject(file.getInputStream(),bucketName, key,null)) { |
| | |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.core.constants.OperaType; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.dao.system.dto.CreateRoleMenuDTO; |
| | | import com.doumee.dao.system.dto.CreateRolePermissionDTO; |
| | | import com.doumee.dao.system.dto.QuerySystemRoleDTO; |
| | |
| | | @GetMapping("/all") |
| | | @RequiresPermissions("system:role:query") |
| | | public ApiResponse<List<SystemRole>> findAll () { |
| | | LoginUserInfo userInfo = this.getLoginUser(); |
| | | SystemRole systemRole = new SystemRole(); |
| | | systemRole.setDeleted(Boolean.FALSE); |
| | | if(userInfo.getType().equals(Constants.ONE)){ |
| | | systemRole.setType(userInfo.getType()); |
| | | } |
| | | return ApiResponse.success(systemRoleService.findList(systemRole)); |
| | | } |
| | | } |
| | |
| | | @PostMapping("/page") |
| | | @RequiresPermissions("system:user:query") |
| | | public ApiResponse<PageData<SystemUserListVO>> findPage (@RequestBody PageWrap<QuerySystemUserDTO> pageWrap) { |
| | | pageWrap.getModel().setCompanyId(this.getLoginUser().getCompanyId()); |
| | | return ApiResponse.success(systemUserService.findPage(pageWrap)); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation("å页æ¥è¯¢ç³»ç»ç¨æ·") |
| | | @PostMapping("/findAllList") |
| | |
| | | public ApiResponse findById(@PathVariable Integer id) { |
| | | return ApiResponse.success(systemUserService.findById(id)); |
| | | } |
| | | |
| | | |
| | | @Trace(withRequestParameters = false) |
| | | @PreventRepeat |
| | |
| | | @RequiresPermissions("system:user:create") |
| | | public ApiResponse companyUpdUser(@Validated(OperaType.Create.class) @RequestBody CreateCompanyUserDTO createCompanyUserDTO) { |
| | | createCompanyUserDTO.setType(Constants.UserType.COMPANY.getKey()); |
| | | systemUserBiz.companyCreateUser(createCompanyUserDTO); |
| | | systemUserBiz.companyUpdUser(createCompanyUserDTO); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("ä¿®æ¹ç¨æ·ç¶æ") |
| | | @GetMapping("/updUserStatus") |
| | | // @RequiresPermissions("system:user:create") |
| | | public ApiResponse updUserStatus( @RequestParam Integer id,@RequestParam Integer status) { |
| | | systemUserBiz.updUserStatus(id,status); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | |
| | | @Trace(withRequestParameters = false) |
| | | @PreventRepeat |
| | | @ApiOperation("ä¿®æ¹å¯ç ") |
| | |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对ä¸èµ·ï¼è´¦å·æå¯ç 䏿£ç¡®ï¼"); |
| | | } |
| | | if(!Constants.equalsInteger(user.getType(),Constants.UserType.COMPANY.getKey()) && !Constants.equalsInteger(user.getType(),Constants.UserType.ZHUBO.getKey())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对ä¸èµ·ï¼è´¦å·æå¯ç 䏿£ç¡®ï¼ï¼"); |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对ä¸èµ·ï¼éä¼ä¸è´¦æ·èº«ä»½ï¼æ æ³ç»å½è¯¥å¹³å°ï¼ï¼"); |
| | | } |
| | | if(!Constants.equalsInteger(user.getStatus(),Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对ä¸èµ·ï¼è´¦å·ä¿¡æ¯å·²è¢«ç¦ç¨ï¼å¦æçé®è¯·è系系ç»ç®¡çåï¼"); |
| | |
| | | |
| | | void updPassword(CreateCompanyUserDTO updCreateCompanyUserDTO); |
| | | |
| | | void updUserStatus(Integer id,Integer status); |
| | | |
| | | } |
| | |
| | | if(Objects.isNull(createCompanyUserDTO) |
| | | ||StringUtils.isBlank(createCompanyUserDTO.getUserName()) |
| | | ||StringUtils.isBlank(createCompanyUserDTO.getRealName()) |
| | | ||StringUtils.isBlank(createCompanyUserDTO.getPassword()) |
| | | ||StringUtils.isBlank(createCompanyUserDTO.getMobile())){ |
| | | ||StringUtils.isBlank(createCompanyUserDTO.getPassword()) ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | |
| | | systemUser.setPassword(Utils.Secure.encryptPassword(systemUser.getPassword(), salt)); |
| | | systemUser.setSalt(salt); |
| | | Integer userId = systemUserService.create(systemUser); |
| | | if(systemUser.getType().equals(Constants.UserType.COMPANY)){ |
| | | if(systemUser.getType().equals(Constants.UserType.COMPANY.getKey())){ |
| | | SystemUserRole newUserRole = new SystemUserRole(); |
| | | newUserRole.setUserId(userId); |
| | | newUserRole.setRoleId(createCompanyUserDTO.getRoleId()); |
| | |
| | | @Transactional(rollbackFor = {Exception.class,BusinessException.class}) |
| | | public void companyUpdUser(CreateCompanyUserDTO updCreateCompanyUserDTO) { |
| | | if(Objects.isNull(updCreateCompanyUserDTO) |
| | | ||Objects.isNull(updCreateCompanyUserDTO.getUserId()) |
| | | ||StringUtils.isBlank(updCreateCompanyUserDTO.getRealName()) |
| | | ||StringUtils.isBlank(updCreateCompanyUserDTO.getMobile())){ |
| | | ||Objects.isNull(updCreateCompanyUserDTO.getId()) |
| | | ||StringUtils.isBlank(updCreateCompanyUserDTO.getRealName())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | SystemUser systemUser = systemUserService.findById(updCreateCompanyUserDTO.getUserId()); |
| | | SystemUser systemUser = systemUserService.findById(updCreateCompanyUserDTO.getId()); |
| | | if(Objects.isNull(systemUser)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | systemUser.setRealname(updCreateCompanyUserDTO.getRealName()); |
| | | systemUser.setMobile(systemUser.getMobile()); |
| | | |
| | | // çæå¯ç ç |
| | | // String salt = RandomStringUtils.randomAlphabetic(6); |
| | | // // çæå¯ç |
| | | // systemUser.setPassword(Utils.Secure.encryptPassword(systemUser.getPassword(), salt)); |
| | | // systemUser.setSalt(salt); |
| | | systemUser.setMobile(updCreateCompanyUserDTO.getMobile()); |
| | | systemUserService.updateById(systemUser); |
| | | if(systemUser.getType().equals(Constants.UserType.COMPANY)){ |
| | | if(systemUser.getType().equals(Constants.UserType.COMPANY.getKey())){ |
| | | // å é¤å
³èè§è² |
| | | SystemUserRole deleteDto = new SystemUserRole(); |
| | | deleteDto.setUserId(systemUser.getId()); |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class,BusinessException.class}) |
| | | public void updUserStatus(Integer id,Integer status) { |
| | | |
| | | SystemUser systemUser = systemUserService.findById(id); |
| | | if(Objects.isNull(systemUser)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | systemUser.setStatus(status); |
| | | systemUserService.updateById(systemUser); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class,BusinessException.class}) |
| | | public void updPassword(CreateCompanyUserDTO updCreateCompanyUserDTO) { |
| | | if(Objects.isNull(updCreateCompanyUserDTO) |
| | | ||Objects.isNull(updCreateCompanyUserDTO.getUserId()) |
| | | ||Objects.isNull(updCreateCompanyUserDTO.getId()) |
| | | ||StringUtils.isBlank(updCreateCompanyUserDTO.getPassword())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | SystemUser systemUser = systemUserService.findById(updCreateCompanyUserDTO.getUserId()); |
| | | SystemUser systemUser = systemUserService.findById(updCreateCompanyUserDTO.getId()); |
| | | if(Objects.isNull(systemUser)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | |
| | | public static final String ACCESS_KEY = "ACCESS_KEY"; |
| | | public static final String ENDPOINT = "ENDPOINT"; |
| | | public static final String RESOURCE_PATH = "RESOURCE_PATH"; |
| | | public static final String WEB_PARAM = "WEB_PARAM"; |
| | | |
| | | |
| | | public static final String SYSTEM ="SYSTEM"; |
| | |
| | | @TableField(exist = false) |
| | | private BigDecimal cateRatePrice; |
| | | |
| | | @ApiModelProperty(value = "å
¨è·¯å¾å°å") |
| | | @TableField(exist = false) |
| | | private String fullImgUrl; |
| | | |
| | | |
| | | } |
| | |
| | | @TableField(exist = false) |
| | | private BigDecimal ePrice; |
| | | |
| | | @ApiModelProperty(value = "baseæå¯¼ä»·ï¼å
ï¼", example = "1") |
| | | @TableField(exist = false) |
| | | private BigDecimal baseZdPrice; |
| | | |
| | | @ApiModelProperty(value = "baseå
¥æä»·æ ¼ï¼å
ï¼", example = "1") |
| | | @TableField(exist = false) |
| | | private BigDecimal basePrice; |
| | | |
| | | @ApiModelProperty(value = "baseå ä»·ç³»æ°", example = "1") |
| | | @TableField(exist = false) |
| | | private BigDecimal basePriceRate; |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | package com.doumee.dao.business.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.doumee.core.annotation.excel.ExcelColumn; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | |
| | | @ApiModelProperty(value = "æ¯å¦å·²å é¤ 0æªå é¤ 1å·²å é¤", example = "1") |
| | | @ExcelColumn(name="æ¯å¦å·²å é¤ 0æªå é¤ 1å·²å é¤") |
| | | private Byte deleted; |
| | | private Integer deleted; |
| | | |
| | | @ApiModelProperty(value = "å建人ç¼ç ", example = "1") |
| | | @ExcelColumn(name="å建人ç¼ç ") |
| | |
| | | @ExcelColumn(name="èæ¯å¾") |
| | | private String bgImg; |
| | | |
| | | @ApiModelProperty(value = "é¡¶é¨å®£ä¼ å¾") |
| | | @ApiModelProperty(value = "é¡¶é¨å®£ä¼ å¾(å¤ä¸ªä»¥,åå²)") |
| | | @ExcelColumn(name="é¡¶é¨å®£ä¼ å¾") |
| | | private String topImg; |
| | | |
| | | @ApiModelProperty(value = "PKå°å¾") |
| | | @ApiModelProperty(value = "PKå°å¾(å¤ä¸ªä»¥,åå²)") |
| | | @ExcelColumn(name="PKå°å¾") |
| | | private String pkImg; |
| | | |
| | |
| | | @ExcelColumn(name="å
容èå´å°ºå¯¸") |
| | | private String rangeSize; |
| | | |
| | | @ApiModelProperty(value = "åç¼å°å") |
| | | @TableField(exist = false) |
| | | private String resourcePath; |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | @ApiModelProperty(value = "ç¨æ·ä¸»é®", example = "1") |
| | | private Integer userId; |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "è´¦å·", example = "1") |
| | | private String userName; |
| | |
| | | @ApiModelProperty(value = "ç¨æ·å") |
| | | private String username; |
| | | |
| | | |
| | | @ApiModelProperty(value = "ç¨æ·åãææºå·æ¨¡ç³æ¥è¯¢") |
| | | private String keyword; |
| | | |
| | | @ApiModelProperty(value = "å§å" , hidden = true) |
| | | private String realname; |
| | | |
| | |
| | | @ApiModelProperty(value = "çç¼ç ") |
| | | private Integer provinceId; |
| | | |
| | | @ApiModelProperty(value = "ç¶æï¼0 å¯ç¨ 1 ç¦ç¨") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "åå¸ç¼ç ", example = "1" ) |
| | | private Integer cityId; |
| | | |
| | | @ApiModelProperty(value = "åå¸ç¼ç ", hidden = true) |
| | | private List<Integer> cityIds; |
| | | @ApiModelProperty(value = "ç±»å 0å¹³å°ç¨æ· 1ä¼ä¸ç¨æ·") |
| | | @ApiModelProperty(value = "ç±»å 0å¹³å°ç¨æ· 1ä¼ä¸ç¨æ· 2主æ") |
| | | private Integer type; |
| | | |
| | | |
| | |
| | | @Override |
| | | public List<BaseCategory> findList(BaseCategory baseCategory) { |
| | | QueryWrapper<BaseCategory> wrapper = new QueryWrapper<>(baseCategory); |
| | | return baseCategoryMapper.selectList(wrapper); |
| | | List<BaseCategory> list = baseCategoryMapper.selectList(wrapper); |
| | | list.forEach(i->{ |
| | | i.setImgfullurl( |
| | | systemDictDataBiz.queryByCode(Constants.OSS,Constants.RESOURCE_PATH).getCode() + |
| | | systemDictDataBiz.queryByCode(Constants.OSS,Constants.CATEGORY_IMG).getCode() + i.getImgurl() |
| | | ); |
| | | }); |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | |
| | | .selectAs(Brand::getName,BaseGoods::getBrandName) |
| | | .selectAs(BaseCategory::getSortnum,BaseGoods::getCategoryName); |
| | | queryWrapper.orderByDesc(Goods::getId); |
| | | return PageData.from(baseGoodsJoinMapper.selectJoinPage(page,BaseGoods.class,queryWrapper)); |
| | | PageData<BaseGoods> pageData =PageData.from(baseGoodsJoinMapper.selectJoinPage(page,BaseGoods.class,queryWrapper)); |
| | | String prefixUrl = systemDictDataBiz.queryByCode(Constants.OSS, Constants.RESOURCE_PATH).getCode() |
| | | + systemDictDataBiz.queryByCode(Constants.OSS, Constants.GOODS_IMG).getCode(); |
| | | pageData.getRecords().forEach(i->{ |
| | | i.setFullImgUrl(prefixUrl + i.getImgurl()); |
| | | }); |
| | | return pageData; |
| | | } |
| | | |
| | | @Override |
| | |
| | | category.setCreateDate(new Date()); |
| | | category.setCreator(user.getId()); |
| | | category.setIsdeleted(Constants.ZERO); |
| | | category.setCompanyId(user.getCompanyId()); |
| | | //å¤çæ¼é³é®é¢ |
| | | category.setPinyin(PinYinUtil.getFullSpell(category.getName())); |
| | | category.setShortPinyin(PinYinUtil.getFirstSpell(category.getName())); |
| | |
| | | @Override |
| | | public Category findById(Integer id) { |
| | | Category category = categoryMapper.selectById(id); |
| | | String prefixUrl = systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.FILE_DIR).getCode() |
| | | + systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.PROJECTS).getCode(); |
| | | String prefixUrl = systemDictDataBiz.queryByCode(Constants.OSS, Constants.RESOURCE_PATH).getCode() |
| | | + systemDictDataBiz.queryByCode(Constants.OSS, Constants.CATEGORY_IMG).getCode(); |
| | | category.setPrefixUrl(prefixUrl); |
| | | category.setParamList(cateParamMapper.selectList(new QueryWrapper<CateParam>().eq("CATEGORY_ID",id).eq("ISDELETED",Constants.ZERO).orderByAsc(" SORTNUM "))); |
| | | category.setAttrFirstList(cateAttrMapper.selectList(new QueryWrapper<CateAttr>().eq("TYPE",Constants.ZERO).eq("ISDELETED",Constants.ZERO).eq("CATEGORY_ID",id).orderByAsc(" SORTNUM "))); |
| | | category.setAttrSecondList(cateAttrMapper.selectList(new QueryWrapper<CateAttr>().eq("TYPE",Constants.ONE).eq("ISDELETED",Constants.ZERO).eq("CATEGORY_ID",id).orderByAsc(" SORTNUM "))); |
| | | category.setBudgetList(cateBudgetMapper.selectList(new QueryWrapper<CateBudget>().eq("CATEGORY_ID",id).eq("ISDELETED",Constants.ZERO).orderByAsc(" SORTNUM "))); |
| | | category.setBudgetList(cateBudgetMapper.selectList(new QueryWrapper<CateBudget>().eq("CATEGORY_ID",id).eq("ISDELETED",Constants.ZERO).orderByAsc(" SORTNUM "))); |
| | | return category; |
| | | } |
| | | |
| | |
| | | if (pageWrap.getModel().getStatus() != null) { |
| | | queryWrapper.lambda().eq(Category::getStatus, pageWrap.getModel().getStatus()); |
| | | } |
| | | if (pageWrap.getModel().getCompanyId() != null) { |
| | | queryWrapper.lambda().eq(Category::getCompanyId, pageWrap.getModel().getCompanyId()); |
| | | } |
| | | queryWrapper.lambda().orderByAsc(Category::getSortnum); |
| | | IPage<Category> categoryIPage = categoryMapper.selectPage(page, queryWrapper); |
| | | String prefixUrl = systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.FILE_DIR).getCode() |
| | | + systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.PROJECTS).getCode(); |
| | | String prefixUrl = systemDictDataBiz.queryByCode(Constants.OSS, Constants.RESOURCE_PATH).getCode() |
| | | + systemDictDataBiz.queryByCode(Constants.OSS, Constants.CATEGORY_IMG).getCode(); |
| | | categoryIPage.getRecords().forEach(i->{ |
| | | i.setPrefixUrl(prefixUrl); |
| | | }); |
| | |
| | | @Override |
| | | public Goods findById(Integer id) { |
| | | Goods goods = goodsMapper.selectById(id); |
| | | String prefixUrl = systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.FILE_DIR).getCode() |
| | | + systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.PROJECTS).getCode(); |
| | | String prefixUrl = systemDictDataBiz.queryByCode(Constants.OSS, Constants.RESOURCE_PATH).getCode() |
| | | + systemDictDataBiz.queryByCode(Constants.OSS, Constants.GOODS_IMG).getCode(); |
| | | goods.setPrefixUrl(prefixUrl); |
| | | Brand brand = brandMapper.selectById(goods.getBrandId()); |
| | | if(!Objects.isNull(brand)){ |
| | |
| | | Goods::getPrice,goods.getSPrice(),goods.getEPrice()); |
| | | queryWrapper.orderByDesc(Goods::getId); |
| | | List<Goods> goodsList = goodsJoinMapper.selectJoinList(Goods.class,queryWrapper); |
| | | String prefixUrl = systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.FILE_DIR).getCode() |
| | | + systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.PROJECTS).getCode(); |
| | | String prefixUrl = systemDictDataBiz.queryByCode(Constants.OSS, Constants.RESOURCE_PATH).getCode() |
| | | + systemDictDataBiz.queryByCode(Constants.OSS, Constants.GOODS_IMG).getCode(); |
| | | goodsList.forEach(i->{ |
| | | i.setPrefixUrl(prefixUrl); |
| | | i.setMultifileList(multifileMapper.selectList(new QueryWrapper<Multifile>().eq("OBJ_ID",i.getId()).orderByAsc(" SORTNUM "))); |
| | |
| | | queryWrapper.selectAll(Goods.class); |
| | | |
| | | queryWrapper.selectAs(Category::getName, Goods::getCategoryName); |
| | | queryWrapper.selectAs(BaseGoods::getZdPrice, Goods::getBaseZdPrice); |
| | | queryWrapper.selectAs(BaseGoods::getPrice, Goods::getBasePrice); |
| | | queryWrapper.selectAs(Brand::getName, Goods::getBrandName); |
| | | queryWrapper.selectAs(Category::getAttrFirst, Goods::getAttrFirst); |
| | | queryWrapper.selectAs(Category::getAttrSecond, Goods::getAttrSecond); |
| | | queryWrapper.selectAs(BaseCategory::getPriceRate,Goods::getBasePriceRate); |
| | | queryWrapper.leftJoin(Category.class, Category::getId, Goods::getCategoryId); |
| | | queryWrapper.leftJoin(Brand.class, Brand::getId, Goods::getBrandId); |
| | | queryWrapper.leftJoin(BaseGoods.class,BaseGoods::getId,Goods::getGoodsId); |
| | | queryWrapper.leftJoin(BaseCategory.class,BaseCategory::getId,BaseGoods::getCategoryId); |
| | | |
| | | queryWrapper.eq(Goods::getIsdeleted, Constants.ZERO); |
| | | if (pageWrap.getModel().getId() != null) { |
| | |
| | | } |
| | | queryWrapper.orderByDesc(Goods::getId); |
| | | IPage<Goods> goodsIPage = goodsJoinMapper.selectJoinPage(page, Goods.class, queryWrapper); |
| | | String prefixUrl = systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.FILE_DIR).getCode() |
| | | + systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.PROJECTS).getCode(); |
| | | String prefixUrl = systemDictDataBiz.queryByCode(Constants.OSS, Constants.RESOURCE_PATH).getCode() |
| | | + systemDictDataBiz.queryByCode(Constants.OSS, Constants.GOODS_IMG).getCode(); |
| | | goodsIPage.getRecords().forEach(i->{ |
| | | i.setPrefixUrl(prefixUrl); |
| | | if(i.getType().equals(Constants.ONE)){ |
| | | i.setBasePrice(i.getBasePrice().multiply(i.getBasePriceRate())); |
| | | } |
| | | |
| | | }); |
| | | return PageData.from(goodsIPage); |
| | | } |
| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.WebParamMapper; |
| | | import com.doumee.dao.business.model.WebParam; |
| | |
| | | @Autowired |
| | | private WebParamMapper webParamMapper; |
| | | |
| | | @Autowired |
| | | private SystemDictDataBiz systemDictDataBiz; |
| | | |
| | | @Override |
| | | public WebParam findOne() { |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | QueryWrapper<WebParam> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("COMPANY_ID",user.getCompanyId()); |
| | | wrapper.last(" limit 1 "); |
| | | return webParamMapper.selectOne(wrapper); |
| | | WebParam webParam = webParamMapper.selectOne(wrapper); |
| | | if(!Objects.isNull(webParam)){ |
| | | webParam.setResourcePath(systemDictDataBiz.queryByCode(Constants.OSS,Constants.RESOURCE_PATH).getCode() + |
| | | systemDictDataBiz.queryByCode(Constants.OSS,Constants.WEB_PARAM).getCode()); |
| | | } |
| | | return webParam; |
| | | } |
| | | |
| | | |
| | |
| | | webParam = new WebParam(); |
| | | BeanUtils.copyProperties(updateWebParamDTO,webParam); |
| | | webParam.setCreateTime(new Date()); |
| | | webParam.setDeleted(Constants.ZERO); |
| | | webParam.setCompanyId(user.getCompanyId()); |
| | | webParam.setCreateUser(user.getId()); |
| | | webParamMapper.insert(webParam); |
| | |
| | | public PageData<SystemUserListVO> findPage(PageWrap<QuerySystemUserDTO> pageWrap) { |
| | | // æ ¹é¨é¨æ¡ä»¶å¤çï¼éæ¥è¯¢æ ¹é¨é¨ä¸ææé¨é¨çç¨æ·ï¼ |
| | | if (pageWrap.getModel().getRootDeptId() != null) { |
| | | pageWrap.getModel().setDepartmentIds(getDeptIds(pageWrap.getModel().getRootDeptId())); |
| | | // pageWrap.getModel().setDepartmentIds(getDeptIds(pageWrap.getModel().getRootDeptId())); |
| | | } else { |
| | | List<SystemDepartment> list = systemDepartmentService.findList(new QueryWrapper<>()); |
| | | List<Integer> collect = list.stream().map(s -> s.getId()).collect(Collectors.toList()); |
| | | pageWrap.getModel().setDepartmentIds(collect); |
| | | // List<SystemDepartment> list = systemDepartmentService.findList(new QueryWrapper<>()); |
| | | // List<Integer> collect = list.stream().map(s -> s.getId()).collect(Collectors.toList()); |
| | | // pageWrap.getModel().setDepartmentIds(collect); |
| | | } |
| | | // æ§è¡æ¥è¯¢ |
| | | PageHelper.startPage(pageWrap.getPage(), pageWrap.getCapacity()); |
| | |
| | | <if test="dto.strictDeptId != null"> |
| | | AND sdu.DEPARTMENT_ID = #{dto.strictDeptId} |
| | | </if> |
| | | <if test="dto.type != null"> |
| | | AND usr.TYPE = #{dto.type} |
| | | </if> |
| | | <if test="dto.status != null"> |
| | | AND usr.STATUS = #{dto.status} |
| | | </if> |
| | | <if test="dto.keyword != null and dto.keyword != ''"> |
| | | AND ( usr.`USERNAME` LIKE CONCAT('%', #{dto.keyword}, '%') or usr.`REALNAME` LIKE CONCAT('%', #{dto.keyword}, '%') ) |
| | | </if> |
| | | <if test="dto.companyId != null"> |
| | | AND usr.COMPANY_ID = #{dto.companyId} |
| | | </if> |
| | | <if test="dto.departmentIds != null and dto.departmentIds.size > 0"> |
| | | AND sdu.DEPARTMENT_ID IN |
| | | <foreach collection="dto.departmentIds" open="(" close=")" separator="," item="id"> |