master:系统调优;

pull/1121/head
liujiang 2025-06-08 17:46:28 +08:00
parent a30417649c
commit 53ddb0cc98
11 changed files with 7 additions and 466 deletions

View File

@ -31,10 +31,6 @@ public class ShoppingCartController extends XktBaseController {
final IShoppingCartService shopCartService;
/**
*
*/
// // @PreAuthorize("@ss.hasPermi('system:cart:add')")
@ApiOperation(value = "电商卖家添加商品到进货车", httpMethod = "POST", response = R.class)
@Log(title = "电商卖家添加商品到进货车", businessType = BusinessType.INSERT)
@PostMapping
@ -42,10 +38,6 @@ public class ShoppingCartController extends XktBaseController {
return R.ok(shopCartService.create(BeanUtil.toBean(shopCartVO, ShoppingCartDTO.class)));
}
/**
*
*/
// // @PreAuthorize("@ss.hasPermi('system:store:edit')")
@ApiOperation(value = "电商卖家编辑进货车商品", httpMethod = "PUT", response = R.class)
@Log(title = "电商卖家编辑进货车商品", businessType = BusinessType.UPDATE)
@PutMapping
@ -53,40 +45,24 @@ public class ShoppingCartController extends XktBaseController {
return R.ok(shopCartService.update(BeanUtil.toBean(editVO, ShoppingCartEditDTO.class)));
}
/**
*
*/
// // @PreAuthorize("@ss.hasPermi('system:cart:list')")
@ApiOperation(value = "获取用户进货车列表", httpMethod = "POST", response = R.class)
@PostMapping("/page")
public R<Page<ShopCartPageResDTO>> page(@Validated @RequestBody ShopCartPageVO pageVO) {
return R.ok(shopCartService.page(BeanUtil.toBean(pageVO, ShopCartPageDTO.class)));
}
/**
*
*/
// // @PreAuthorize("@ss.hasPermi('system:cart:list')")
@ApiOperation(value = "用户进货车列表点击编辑获取数据", httpMethod = "GET", response = R.class)
@GetMapping("/edit/{shoppingCartId}")
public R<ShopCartEditDetailResVO> getEditInfo(@PathVariable Long shoppingCartId) {
return R.ok(BeanUtil.toBean(shopCartService.getEditInfo(shoppingCartId), ShopCartEditDetailResVO.class));
}
/**
*
*/
@ApiOperation(value = "进货车下单时及商品下单时获取商品列表", httpMethod = "POST", response = R.class)
@PostMapping("/list")
public R<List<ShopCartResVO>> getList(@Validated @RequestBody ShopCartListVO listVO) {
return R.ok(BeanUtil.copyToList(shopCartService.getList(BeanUtil.toBean(listVO, ShopCartListDTO.class)), ShopCartResVO.class));
}
/**
*
*/
// // @PreAuthorize("@ss.hasPermi('system:sale:remove')")
@ApiOperation(value = "用户删除进货车商品", httpMethod = "DELETE", response = R.class)
@Log(title = "用户删除进货车商品", businessType = BusinessType.DELETE)
@DeleteMapping
@ -95,5 +71,4 @@ public class ShoppingCartController extends XktBaseController {
}
}

View File

@ -12,7 +12,6 @@ import com.ruoyi.xkt.service.IStoreCertificateService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@ -30,10 +29,6 @@ public class StoreCertificateController extends XktBaseController {
final IStoreCertificateService storeCertService;
/**
*
*/
// // @PreAuthorize("@ss.hasPermi('system:certificate:add')")
@ApiOperation(value = "新增档口认证", httpMethod = "POST", response = R.class)
@Log(title = "新增档口认证", businessType = BusinessType.INSERT)
@PostMapping
@ -41,20 +36,12 @@ public class StoreCertificateController extends XktBaseController {
return R.ok(storeCertService.create(BeanUtil.toBean(storeCertVO, StoreCertDTO.class)));
}
/**
*
*/
// @PreAuthorize("@ss.hasPermi('system:certificate:query')")
@ApiOperation(value = "获取档口认证详细信息", httpMethod = "GET", response = R.class)
@GetMapping(value = "/{storeId}")
public R<StoreCertResVO> getInfo(@PathVariable("storeId") Long storeId) {
return R.ok(BeanUtil.toBean(storeCertService.getInfo(storeId), StoreCertResVO.class));
}
/**
*
*/
// @PreAuthorize("@ss.hasPermi('system:certificate:edit')")
@ApiOperation(value = "修改档口认证", httpMethod = "PUT", response = R.class)
@Log(title = "修改档口认证", businessType = BusinessType.UPDATE)
@PutMapping

View File

@ -8,7 +8,6 @@ import com.ruoyi.xkt.service.IStoreColorService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
@ -30,10 +29,6 @@ public class StoreColorController extends XktBaseController {
final IStoreColorService storeColorService;
/**
*
*/
// // @PreAuthorize("@ss.hasPermi('system:product:list')")
@ApiOperation(value = "查询档口颜色列表", httpMethod = "GET", response = R.class)
@GetMapping("/list/{storeId}")
public R<List<StoreColorVO>> list(@PathVariable Long storeId) {

View File

@ -1,91 +0,0 @@
package com.ruoyi.web.controller.xkt;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.XktBaseController;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.xkt.domain.UserQuickFunction;
import com.ruoyi.xkt.service.IUserQuickFunctionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* Controller
*
* @author ruoyi
* @date 2025-03-26
*/
@RestController
@RequestMapping("/rest/v1/user-quick-funcs")
public class UserQuickFunctionController extends XktBaseController {
@Autowired
private IUserQuickFunctionService userQuickFunctionService;
/**
*
*/
// @PreAuthorize("@ss.hasPermi('system:function:list')")
@GetMapping("/list")
public TableDataInfo list(UserQuickFunction userQuickFunction) {
startPage();
List<UserQuickFunction> list = userQuickFunctionService.selectUserQuickFunctionList(userQuickFunction);
return getDataTable(list);
}
/**
*
*/
// @PreAuthorize("@ss.hasPermi('system:function:export')")
@Log(title = "用户快捷功能", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, UserQuickFunction userQuickFunction) {
List<UserQuickFunction> list = userQuickFunctionService.selectUserQuickFunctionList(userQuickFunction);
ExcelUtil<UserQuickFunction> util = new ExcelUtil<UserQuickFunction>(UserQuickFunction.class);
util.exportExcel(response, list, "用户快捷功能数据");
}
/**
*
*/
// @PreAuthorize("@ss.hasPermi('system:function:query')")
@GetMapping(value = "/{userQuickFuncId}")
public R getInfo(@PathVariable("userQuickFuncId") Long userQuickFuncId) {
return success(userQuickFunctionService.selectUserQuickFunctionByUserQuickFuncId(userQuickFuncId));
}
/**
*
*/
// @PreAuthorize("@ss.hasPermi('system:function:add')")
@Log(title = "用户快捷功能", businessType = BusinessType.INSERT)
@PostMapping
public R add(@RequestBody UserQuickFunction userQuickFunction) {
return success(userQuickFunctionService.insertUserQuickFunction(userQuickFunction));
}
/**
*
*/
// @PreAuthorize("@ss.hasPermi('system:function:edit')")
@Log(title = "用户快捷功能", businessType = BusinessType.UPDATE)
@PutMapping
public R edit(@RequestBody UserQuickFunction userQuickFunction) {
return success(userQuickFunctionService.updateUserQuickFunction(userQuickFunction));
}
/**
*
*/
// @PreAuthorize("@ss.hasPermi('system:function:remove')")
@Log(title = "用户快捷功能", businessType = BusinessType.DELETE)
@DeleteMapping("/{userQuickFuncIds}")
public R remove(@PathVariable Long[] userQuickFuncIds) {
return success(userQuickFunctionService.deleteUserQuickFunctionByUserQuickFuncIds(userQuickFuncIds));
}
}

View File

@ -28,6 +28,8 @@ public class ShoppingCartDTO {
private Long storeProdId;
@ApiModelProperty(value = "商品货号")
private String prodArtNum;
@ApiModelProperty(value = "商品主图")
private String mainPicUrl;
@ApiModelProperty(value = "进货车明细列表")
List<SCDetailDTO> detailList;

View File

@ -52,18 +52,6 @@ public interface StoreProductFileMapper extends BaseMapper<StoreProductFile> {
List<StoreProdFilePicSpaceResDTO> selectPicSpaceList(@Param("storeId") Long storeId, @Param("fileType") Integer fileType,
@Param("storeProdIdList") List<Long> storeProdIdList);
/**
*
*
* @param storeProdId ID
* @param storeId ID
* @param fileType
* @return
*/
List<StoreProdFileResDTO> selectTotalMainPicList(@Param("storeProdId") Long storeProdId,
@Param("storeId") Long storeId,
@Param("fileType") Integer fileType);
/**
* storeProdIdList
*

View File

@ -1,62 +0,0 @@
package com.ruoyi.xkt.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.xkt.domain.UserQuickFunction;
import java.util.List;
/**
* Mapper
*
* @author ruoyi
* @date 2025-03-26
*/
public interface UserQuickFunctionMapper extends BaseMapper<UserQuickFunction> {
/**
*
*
* @param id
* @return
*/
public UserQuickFunction selectUserQuickFunctionByUserQuickFuncId(Long id);
/**
*
*
* @param userQuickFunction
* @return
*/
public List<UserQuickFunction> selectUserQuickFunctionList(UserQuickFunction userQuickFunction);
/**
*
*
* @param userQuickFunction
* @return
*/
public int insertUserQuickFunction(UserQuickFunction userQuickFunction);
/**
*
*
* @param userQuickFunction
* @return
*/
public int updateUserQuickFunction(UserQuickFunction userQuickFunction);
/**
*
*
* @param id
* @return
*/
public int deleteUserQuickFunctionByUserQuickFuncId(Long id);
/**
*
*
* @param userQuickFuncIds
* @return
*/
public int deleteUserQuickFunctionByUserQuickFuncIds(Long[] userQuickFuncIds);
}

View File

@ -1,61 +0,0 @@
package com.ruoyi.xkt.service;
import com.ruoyi.xkt.domain.UserQuickFunction;
import java.util.List;
/**
* Service
*
* @author ruoyi
* @date 2025-03-26
*/
public interface IUserQuickFunctionService {
/**
*
*
* @param userQuickFuncId
* @return
*/
public UserQuickFunction selectUserQuickFunctionByUserQuickFuncId(Long userQuickFuncId);
/**
*
*
* @param userQuickFunction
* @return
*/
public List<UserQuickFunction> selectUserQuickFunctionList(UserQuickFunction userQuickFunction);
/**
*
*
* @param userQuickFunction
* @return
*/
public int insertUserQuickFunction(UserQuickFunction userQuickFunction);
/**
*
*
* @param userQuickFunction
* @return
*/
public int updateUserQuickFunction(UserQuickFunction userQuickFunction);
/**
*
*
* @param userQuickFuncIds
* @return
*/
public int deleteUserQuickFunctionByUserQuickFuncIds(Long[] userQuickFuncIds);
/**
*
*
* @param userQuickFuncId
* @return
*/
public int deleteUserQuickFunctionByUserQuickFuncId(Long userQuickFuncId);
}

View File

@ -69,8 +69,6 @@ public class ShoppingCartServiceImpl implements IShoppingCartService {
// TODO 判断当前登录用户角色,只有电商卖家才可操作,其它角色不允许操作,直接报错
// 判断当前商品是否已添加过进货车
/* List<ShoppingCart> existList = this.shopCartMapper.selectList(new LambdaQueryWrapper<ShoppingCart>()
.eq(ShoppingCart::getUserId, loginUser.getUserId()).eq(ShoppingCart::getStoreProdId, shoppingCartDTO.getStoreProdId())
@ -287,6 +285,10 @@ public class ShoppingCartServiceImpl implements IShoppingCartService {
.in(ShoppingCartDetail::getShoppingCartId, shoppingCartList.stream().map(ShoppingCart::getId).collect(Collectors.toList()))
.eq(ShoppingCartDetail::getDelFlag, Constants.UNDELETED));
Map<Long, List<ShoppingCartDetail>> detailMap = detailList.stream().collect(Collectors.groupingBy(ShoppingCartDetail::getShoppingCartId));
// 商品第一张主图
List<StoreProdMainPicDTO> mainPicList = this.prodFileMapper.selectMainPicByStoreProdIdList(listDTO.getStoreProdIdList(), FileType.MAIN_PIC.getValue(), ORDER_NUM_1);
Map<Long, String> mainPicMap = CollectionUtils.isEmpty(mainPicList) ? new HashMap<>() : mainPicList.stream()
.collect(Collectors.toMap(StoreProdMainPicDTO::getStoreProdId, StoreProdMainPicDTO::getFileUrl));
// 获取明细商品的价格
List<StoreProductColorPrice> priceList = this.prodColorPriceMapper.selectList(new LambdaQueryWrapper<StoreProductColorPrice>()
.in(StoreProductColorPrice::getStoreProdId, shoppingCartList.stream().map(ShoppingCart::getStoreProdId).collect(Collectors.toList()))
@ -304,7 +306,7 @@ public class ShoppingCartServiceImpl implements IShoppingCartService {
Map<String, Long> priceSizeMap = priceSizeList.stream().collect(Collectors
.toMap(x -> x.getStoreProdId().toString() + x.getStoreColorId().toString() + x.getSize(), StoreProductColorSize::getId));
return shoppingCartList.stream().map(x -> {
ShoppingCartDTO shopCartDTO = BeanUtil.toBean(x, ShoppingCartDTO.class)
ShoppingCartDTO shopCartDTO = BeanUtil.toBean(x, ShoppingCartDTO.class).setMainPicUrl(mainPicMap.get(x.getStoreProdId()))
.setStoreName(ObjectUtils.isNotEmpty(storeMap.get(x.getStoreId())) ? storeMap.get(x.getStoreId()).getStoreName() : "");
List<ShoppingCartDTO.SCDetailDTO> shopCartDetailList = detailMap.get(x.getId()).stream().map(detail -> {
final BigDecimal price = ObjectUtils.defaultIfNull(priceMap.get(x.getStoreProdId().toString() + detail.getStoreColorId().toString()), BigDecimal.ZERO);

View File

@ -1,93 +0,0 @@
package com.ruoyi.xkt.service.impl;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.xkt.domain.UserQuickFunction;
import com.ruoyi.xkt.mapper.UserQuickFunctionMapper;
import com.ruoyi.xkt.service.IUserQuickFunctionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* Service
*
* @author ruoyi
* @date 2025-03-26
*/
@Service
public class UserQuickFunctionServiceImpl implements IUserQuickFunctionService {
@Autowired
private UserQuickFunctionMapper userQuickFunctionMapper;
/**
*
*
* @param userQuickFuncId
* @return
*/
@Override
public UserQuickFunction selectUserQuickFunctionByUserQuickFuncId(Long userQuickFuncId) {
return userQuickFunctionMapper.selectUserQuickFunctionByUserQuickFuncId(userQuickFuncId);
}
/**
*
*
* @param userQuickFunction
* @return
*/
@Override
public List<UserQuickFunction> selectUserQuickFunctionList(UserQuickFunction userQuickFunction) {
return userQuickFunctionMapper.selectUserQuickFunctionList(userQuickFunction);
}
/**
*
*
* @param userQuickFunction
* @return
*/
@Override
@Transactional
public int insertUserQuickFunction(UserQuickFunction userQuickFunction) {
userQuickFunction.setCreateTime(DateUtils.getNowDate());
return userQuickFunctionMapper.insertUserQuickFunction(userQuickFunction);
}
/**
*
*
* @param userQuickFunction
* @return
*/
@Override
@Transactional
public int updateUserQuickFunction(UserQuickFunction userQuickFunction) {
userQuickFunction.setUpdateTime(DateUtils.getNowDate());
return userQuickFunctionMapper.updateUserQuickFunction(userQuickFunction);
}
/**
*
*
* @param userQuickFuncIds
* @return
*/
@Override
public int deleteUserQuickFunctionByUserQuickFuncIds(Long[] userQuickFuncIds) {
return userQuickFunctionMapper.deleteUserQuickFunctionByUserQuickFuncIds(userQuickFuncIds);
}
/**
*
*
* @param userQuickFuncId
* @return
*/
@Override
public int deleteUserQuickFunctionByUserQuickFuncId(Long userQuickFuncId) {
return userQuickFunctionMapper.deleteUserQuickFunctionByUserQuickFuncId(userQuickFuncId);
}
}

View File

@ -1,101 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.xkt.mapper.UserQuickFunctionMapper">
<resultMap type="UserQuickFunction" id="UserQuickFunctionResult">
<result property="id" column="id" />
<result property="userId" column="user_id" />
<result property="funcName" column="func_name" />
<result property="funcIcon" column="func_icon" />
<result property="funcUrl" column="func_url" />
<result property="orderNum" column="order_num" />
<result property="version" column="version" />
<result property="delFlag" column="del_flag" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectUserQuickFunctionVo">
select id, user_id, func_name, func_icon, func_url, order_num, version, del_flag, create_by, create_time, update_by, update_time from user_quick_function
</sql>
<select id="selectUserQuickFunctionList" parameterType="UserQuickFunction" resultMap="UserQuickFunctionResult">
<include refid="selectUserQuickFunctionVo"/>
<where>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="funcName != null and funcName != ''"> and func_name like concat('%', #{funcName}, '%')</if>
<if test="funcIcon != null and funcIcon != ''"> and func_icon = #{funcIcon}</if>
<if test="funcUrl != null and funcUrl != ''"> and func_url = #{funcUrl}</if>
<if test="orderNum != null "> and order_num = #{orderNum}</if>
<if test="version != null "> and version = #{version}</if>
</where>
</select>
<select id="selectUserQuickFunctionByUserQuickFuncId" parameterType="Long" resultMap="UserQuickFunctionResult">
<include refid="selectUserQuickFunctionVo"/>
where id = #{id}
</select>
<insert id="insertUserQuickFunction" parameterType="UserQuickFunction" useGeneratedKeys="true" keyProperty="userQuickFuncId">
insert into user_quick_function
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null">user_id,</if>
<if test="funcName != null">func_name,</if>
<if test="funcIcon != null">func_icon,</if>
<if test="funcUrl != null">func_url,</if>
<if test="orderNum != null">order_num,</if>
<if test="version != null">version,</if>
<if test="delFlag != null">del_flag,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null">#{userId},</if>
<if test="funcName != null">#{funcName},</if>
<if test="funcIcon != null">#{funcIcon},</if>
<if test="funcUrl != null">#{funcUrl},</if>
<if test="orderNum != null">#{orderNum},</if>
<if test="version != null">#{version},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateUserQuickFunction" parameterType="UserQuickFunction">
update user_quick_function
<trim prefix="SET" suffixOverrides=",">
<if test="userId != null">user_id = #{userId},</if>
<if test="funcName != null">func_name = #{funcName},</if>
<if test="funcIcon != null">func_icon = #{funcIcon},</if>
<if test="funcUrl != null">func_url = #{funcUrl},</if>
<if test="orderNum != null">order_num = #{orderNum},</if>
<if test="version != null">version = #{version},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteUserQuickFunctionByUserQuickFuncId" parameterType="Long">
delete from user_quick_function where id = #{id}
</delete>
<delete id="deleteUserQuickFunctionByUserQuickFuncIds" parameterType="String">
delete from user_quick_function where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>