master:返回给前端的数据调优;

pull/1121/head
liujiang 2025-04-05 12:43:55 +08:00
parent 715dedf78b
commit 729a2f614f
30 changed files with 319 additions and 686 deletions

View File

@ -6,11 +6,9 @@ import com.ruoyi.common.core.controller.XktBaseController;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.page.Page;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.web.controller.xkt.vo.storeCustomer.StoreCusFuzzyResVO;
import com.ruoyi.web.controller.xkt.vo.storeCustomer.StoreCusPageVO;
import com.ruoyi.web.controller.xkt.vo.storeCustomer.StoreCusVO;
import com.ruoyi.xkt.domain.StoreCustomer;
import com.ruoyi.xkt.dto.storeCustomer.StoreCusDTO;
import com.ruoyi.xkt.dto.storeCustomer.StoreCusPageDTO;
import com.ruoyi.xkt.dto.storeCustomer.StoreCusPageResDTO;
@ -18,12 +16,10 @@ import com.ruoyi.xkt.service.IStoreCustomerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
@ -46,8 +42,8 @@ public class StoreCustomerController extends XktBaseController {
@PreAuthorize("@ss.hasPermi('system:customer:query')")
@ApiOperation(value = "模糊查询档口客户", httpMethod = "GET", response = R.class)
@GetMapping(value = "/fuzzy")
public R fuzzyQueryColorList(@RequestParam(value = "cusName", required = false) String cusName,
@RequestParam("storeId") Long storeId) {
public R<List<StoreCusFuzzyResVO>> fuzzyQueryColorList(@RequestParam(value = "cusName", required = false) String cusName,
@RequestParam("storeId") Long storeId) {
return R.ok(BeanUtil.copyToList(storeCusService.fuzzyQueryList(storeId, cusName), StoreCusFuzzyResVO.class));
}
@ -59,7 +55,7 @@ public class StoreCustomerController extends XktBaseController {
@ApiOperation(value = "新增档口客户", httpMethod = "POST", response = R.class)
@Log(title = "新增档口客户", businessType = BusinessType.INSERT)
@PostMapping
public R add(@Validated @RequestBody StoreCusVO storeCusVO) {
public R<Integer> add(@Validated @RequestBody StoreCusVO storeCusVO) {
return R.ok(storeCusService.create(BeanUtil.toBean(storeCusVO, StoreCusDTO.class)));
}
@ -70,7 +66,7 @@ public class StoreCustomerController extends XktBaseController {
@ApiOperation(value = "修改档口客户", httpMethod = "PUT", response = R.class)
@Log(title = "修改档口客户", businessType = BusinessType.UPDATE)
@PutMapping
public R edit(@Validated @RequestBody StoreCusVO storeCusVO) {
public R<Integer> edit(@Validated @RequestBody StoreCusVO storeCusVO) {
return R.ok(storeCusService.updateStoreCus(BeanUtil.toBean(storeCusVO, StoreCusDTO.class)));
}
@ -92,7 +88,7 @@ public class StoreCustomerController extends XktBaseController {
@PreAuthorize("@ss.hasPermi('system:customer:query')")
@ApiOperation(value = "获取档口客户详细信息", httpMethod = "GET", response = R.class)
@GetMapping(value = "/{storeCusId}")
public R getInfo(@PathVariable("storeCusId") Long storeCusId) {
public R<StoreCusVO> getInfo(@PathVariable("storeCusId") Long storeCusId) {
return R.ok(BeanUtil.toBean(storeCusService.selectStoreCustomerByStoreCusId(storeCusId), StoreCusVO.class));
}
@ -102,22 +98,8 @@ public class StoreCustomerController extends XktBaseController {
@PreAuthorize("@ss.hasPermi('system:customer:list')")
@ApiOperation(value = "查询档口客户列表", httpMethod = "GET", response = R.class)
@PostMapping("/page")
public R<Page> selectPage(@Validated @RequestBody StoreCusPageVO pageVO) {
public R<Page<StoreCusPageResDTO>> selectPage(@Validated @RequestBody StoreCusPageVO pageVO) {
return R.ok(storeCusService.selectPage(BeanUtil.toBean(pageVO, StoreCusPageDTO.class)));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:customer:export')")
@Log(title = "档口客户", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, StoreCustomer storeCustomer) {
List<StoreCustomer> list = storeCusService.selectStoreCustomerList(storeCustomer);
ExcelUtil<StoreCustomer> util = new ExcelUtil<StoreCustomer>(StoreCustomer.class);
util.exportExcel(response, list, "档口客户数据");
}
}

View File

@ -58,7 +58,7 @@ public class StoreFactoryController extends XktBaseController {
@ApiOperation(value = "修改档口合作工厂", httpMethod = "PUT", response = R.class)
@Log(title = "修改档口合作工厂", businessType = BusinessType.UPDATE)
@PutMapping
public R edit(@Validated @RequestBody StoreFactoryVO storeFactoryVO) {
public R<Integer> edit(@Validated @RequestBody StoreFactoryVO storeFactoryVO) {
return R.ok(storeFactoryService.updateStoreFactory(BeanUtil.toBean(storeFactoryVO, StoreFactoryDTO.class)));
}
@ -79,14 +79,11 @@ public class StoreFactoryController extends XktBaseController {
@ApiOperation(value = "获取档口合作工厂详细信息", httpMethod = "GET", response = R.class)
@GetMapping(value = "/{storeId}/{storeFactoryId}")
public R<StoreFactoryVO> getInfo(@PathVariable("storeId") Long storeId, @PathVariable("storeFactoryId") Long storeFactoryId) {
StoreFactoryResDTO res = storeFactoryService.selectByStoreFacId(storeId ,storeFactoryId);
return ObjectUtils.isEmpty(res) ? R.ok() : R.ok(BeanUtil.toBean(res, StoreFactoryVO.class));
return R.ok(BeanUtil.toBean(storeFactoryService.selectByStoreFacId(storeId ,storeFactoryId), StoreFactoryVO.class));
}
/**
*
*/

View File

@ -11,6 +11,7 @@ import com.ruoyi.web.controller.xkt.vo.storePordColor.StoreProdColorResVO;
import com.ruoyi.xkt.domain.StoreProductColor;
import com.ruoyi.xkt.service.IStoreProductColorService;
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.*;
@ -36,72 +37,11 @@ public class StoreProductColorController extends XktBaseController {
*
*/
@PreAuthorize("@ss.hasPermi('system:color:query')")
@ApiOperation(value = "模糊查询档口所有的商品颜色分类", httpMethod = "GET", response = R.class)
@GetMapping(value = "/fuzzy")
public R fuzzyQueryColorList(@RequestParam(value = "prodArtNum", required = false) String prodArtNum,
public R<StoreProdColorResVO> fuzzyQueryColorList(@RequestParam(value = "prodArtNum", required = false) String prodArtNum,
@RequestParam("storeId") Long storeId) {
return success(BeanUtil.copyToList(storeProdColorService.fuzzyQueryColorList(storeId, prodArtNum), StoreProdColorResVO.class));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:color:list')")
@GetMapping("/list")
public TableDataInfo list(StoreProductColor storeProductColor) {
startPage();
List<StoreProductColor> list = storeProdColorService.selectStoreProductColorList(storeProductColor);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:color:export')")
@Log(title = "档口当前商品颜色", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, StoreProductColor storeProductColor) {
List<StoreProductColor> list = storeProdColorService.selectStoreProductColorList(storeProductColor);
ExcelUtil<StoreProductColor> util = new ExcelUtil<StoreProductColor>(StoreProductColor.class);
util.exportExcel(response, list, "档口当前商品颜色数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:color:query')")
@GetMapping(value = "/{storeProdColorId}")
public R getInfo(@PathVariable("storeProdColorId") Long storeProdColorId) {
return success(storeProdColorService.selectStoreProductColorByStoreProdColorId(storeProdColorId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:color:add')")
@Log(title = "档口当前商品颜色", businessType = BusinessType.INSERT)
@PostMapping
public R add(@RequestBody StoreProductColor storeProductColor) {
return success(storeProdColorService.insertStoreProductColor(storeProductColor));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:color:edit')")
@Log(title = "档口当前商品颜色", businessType = BusinessType.UPDATE)
@PutMapping
public R edit(@RequestBody StoreProductColor storeProductColor) {
return success(storeProdColorService.updateStoreProductColor(storeProductColor));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:color:remove')")
@Log(title = "档口当前商品颜色", businessType = BusinessType.DELETE)
@DeleteMapping("/{storeProdColorIds}")
public R remove(@PathVariable Long[] storeProdColorIds) {
return success(storeProdColorService.deleteStoreProductColorByStoreProdColorIds(storeProdColorIds));
}
}

View File

@ -17,7 +17,6 @@ import com.ruoyi.xkt.service.IStoreProductService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@ -45,8 +44,8 @@ public class StoreProductController extends XktBaseController {
@PreAuthorize("@ss.hasPermi('system:product:query')")
@ApiOperation(value = "模糊查询档口商品", httpMethod = "GET", response = R.class)
@GetMapping(value = "/fuzzy")
public R fuzzyQueryColorList(@RequestParam(value = "prodArtNum", required = false) String prodArtNum,
@RequestParam("storeId") Long storeId) {
public R<List<StoreProdFuzzyResVO>> fuzzyQueryColorList(@RequestParam(value = "prodArtNum", required = false) String prodArtNum,
@RequestParam("storeId") Long storeId) {
return R.ok(BeanUtil.copyToList(storeProdService.fuzzyQueryList(storeId, prodArtNum), StoreProdFuzzyResVO.class));
}
@ -60,25 +59,13 @@ public class StoreProductController extends XktBaseController {
return R.ok(storeProdService.page(BeanUtil.toBean(pageVO, StoreProdPageDTO.class)));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:product:export')")
@Log(title = "档口商品", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, StoreProduct storeProduct) {
List<StoreProduct> list = storeProdService.selectStoreProductList(storeProduct);
ExcelUtil<StoreProduct> util = new ExcelUtil<StoreProduct>(StoreProduct.class);
util.exportExcel(response, list, "档口商品数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:product:query')")
@ApiOperation(value = "获取档口商品详细信息", httpMethod = "GET", response = R.class)
@GetMapping(value = "/{storeProdId}")
public R getInfo(@PathVariable("storeProdId") Long storeProdId) {
public R<StoreProdResVO> getInfo(@PathVariable("storeProdId") Long storeProdId) {
return R.ok(BeanUtil.toBean(storeProdService.selectStoreProductByStoreProdId(storeProdId), StoreProdResVO.class));
}
@ -89,7 +76,7 @@ public class StoreProductController extends XktBaseController {
@Log(title = "档口商品", businessType = BusinessType.INSERT)
@ApiOperation(value = "新增档口商品", httpMethod = "POST", response = R.class)
@PostMapping
public R add(@Validated @RequestBody StoreProdVO storeProdVO) {
public R<Integer> add(@Validated @RequestBody StoreProdVO storeProdVO) {
return R.ok(storeProdService.insertStoreProduct(BeanUtil.toBean(storeProdVO, StoreProdDTO.class)));
}
@ -100,7 +87,7 @@ public class StoreProductController extends XktBaseController {
@ApiOperation(value = "修改档口商品", httpMethod = "PUT", response = R.class)
@Log(title = "档口商品", businessType = BusinessType.UPDATE)
@PutMapping("/{storeProdId}")
public R edit(@PathVariable Long storeProdId, @Validated @RequestBody StoreProdVO storeProdVO) {
public R<Integer> edit(@PathVariable Long storeProdId, @Validated @RequestBody StoreProdVO storeProdVO) {
return R.ok(storeProdService.updateStoreProduct(storeProdId, BeanUtil.toBean(storeProdVO, StoreProdDTO.class)));
}
@ -122,9 +109,22 @@ public class StoreProductController extends XktBaseController {
@PreAuthorize("@ss.hasPermi('system:product:query')")
@ApiOperation(value = "获取档口图片空间", httpMethod = "GET", response = R.class)
@GetMapping(value = "/pic-space/{storeId}")
public R getStoreProductPicSpace(@PathVariable("storeId") Long storeId) {
public R<StoreProdPicSpaceResVO> getStoreProductPicSpace(@PathVariable("storeId") Long storeId) {
return R.ok(BeanUtil.toBean(storeProdService.getStoreProductPicSpace(storeId), StoreProdPicSpaceResVO.class));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:product:export')")
@Log(title = "档口商品", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, StoreProduct storeProduct) {
List<StoreProduct> list = storeProdService.selectStoreProductList(storeProduct);
ExcelUtil<StoreProduct> util = new ExcelUtil<StoreProduct>(StoreProduct.class);
util.exportExcel(response, list, "档口商品数据");
}
}

View File

@ -60,8 +60,7 @@ public class StoreProductDemandController extends XktBaseController {
@PreAuthorize("@ss.hasPermi('system:demand:query')")
@GetMapping(value = "/exists-quantity/{storeId}/{storeProdId}")
public R<List<StoreProdDemandQuantityVO>> getStockAndProduceQuantity(@PathVariable("storeId") Long storeId, @PathVariable("storeProdId") Long storeProdId) {
List<StoreProdDemandQuantityDTO> list = storeProdDemandService.getStockAndProduceQuantity(storeId, storeProdId);
return CollectionUtils.isEmpty(list) ? R.ok() : R.ok(BeanUtil.copyToList(list, StoreProdDemandQuantityVO.class));
return R.ok(BeanUtil.copyToList(storeProdDemandService.getStockAndProduceQuantity(storeId, storeProdId), StoreProdDemandQuantityVO.class));
}
/**
@ -86,34 +85,6 @@ public class StoreProductDemandController extends XktBaseController {
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:demand:list')")
@GetMapping("/list")
public TableDataInfo list(StoreProductDemand storeProductDemand) {
startPage();
List<StoreProductDemand> list = storeProdDemandService.selectStoreProductDemandList(storeProductDemand);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:demand:export')")
@Log(title = "档口商品需求单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, StoreProductDemand storeProductDemand) {
List<StoreProductDemand> list = storeProdDemandService.selectStoreProductDemandList(storeProductDemand);
ExcelUtil<StoreProductDemand> util = new ExcelUtil<StoreProductDemand>(StoreProductDemand.class);
util.exportExcel(response, list, "档口商品需求单数据");
}
/**
*
*/
@ -124,7 +95,6 @@ public class StoreProductDemandController extends XktBaseController {
}
/**
*
*/

View File

@ -5,14 +5,13 @@ 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.Page;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.web.controller.xkt.vo.storeProdStock.StoreProdStockPageVO;
import com.ruoyi.web.controller.xkt.vo.storeProdStock.StoreProdStockResVO;
import com.ruoyi.web.controller.xkt.vo.storeProdStock.StoreProdStockVO;
import com.ruoyi.xkt.domain.StoreProductStock;
import com.ruoyi.xkt.dto.storeProductStock.StoreProdStockPageDTO;
import com.ruoyi.xkt.dto.storeProductStock.StoreProdStockDTO;
import com.ruoyi.xkt.dto.storeProductStock.StoreProdStockPageDTO;
import com.ruoyi.xkt.dto.storeProductStock.StoreProdStockPageResDTO;
import com.ruoyi.xkt.service.IStoreProductStockService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -21,7 +20,6 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.Collections;
import java.util.List;
@ -54,7 +52,7 @@ public class StoreProductStockController extends XktBaseController {
@PreAuthorize("@ss.hasPermi('system:stock:list')")
@ApiOperation(value = "查询档口库存列表", httpMethod = "POST", response = R.class)
@PostMapping("/page")
public R<Page> selectPage(@Validated @RequestBody StoreProdStockPageVO pageVO) {
public R<Page<StoreProdStockPageResDTO>> selectPage(@Validated @RequestBody StoreProdStockPageVO pageVO) {
return R.ok(storeProdStockService.selectPage(BeanUtil.toBean(pageVO, StoreProdStockPageDTO.class)));
}
@ -87,8 +85,8 @@ public class StoreProductStockController extends XktBaseController {
@PreAuthorize("@ss.hasPermi('system:stock:query')")
@ApiOperation(value = "查询档口商品库存详情", httpMethod = "GET", response = R.class)
@GetMapping(value = "/{storeId}/{storeProdStockId}")
public R getInfo(@PathVariable("storeId") Long storeId, @PathVariable("storeProdStockId") Long storeProdStockId) {
return R.ok(storeProdStockService.selectByStoreProdStockId(storeId, storeProdStockId));
public R<StoreProdStockResVO> getInfo(@PathVariable("storeId") Long storeId, @PathVariable("storeProdStockId") Long storeProdStockId) {
return R.ok(BeanUtil.toBean(storeProdStockService.selectByStoreProdStockId(storeId, storeProdStockId), StoreProdStockResVO.class));
}
/**
@ -97,68 +95,8 @@ public class StoreProductStockController extends XktBaseController {
@PreAuthorize("@ss.hasPermi('system:stock:query')")
@ApiOperation(value = "根据货号查询档口商品库存", httpMethod = "GET", response = R.class)
@GetMapping(value = "/{storeId}/prod-art-num/{prodArtNum}")
public R getInfo(@PathVariable("storeId") Long storeId, @PathVariable("prodArtNum") String prodArtNum) {
return R.ok(storeProdStockService.selectByStoreIdAndProdArtNum(storeId, prodArtNum));
public R<List<StoreProdStockResVO>> getInfo(@PathVariable("storeId") Long storeId, @PathVariable("prodArtNum") String prodArtNum) {
return R.ok(BeanUtil.copyToList(storeProdStockService.selectByStoreIdAndProdArtNum(storeId, prodArtNum), StoreProdStockResVO.class));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:stock:list')")
@GetMapping("/list")
public TableDataInfo list(StoreProductStock storeProductStock) {
startPage();
List<StoreProductStock> list = storeProdStockService.selectStoreProductStockList(storeProductStock);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:stock:export')")
@Log(title = "档口商品库存", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, StoreProductStock storeProductStock) {
List<StoreProductStock> list = storeProdStockService.selectStoreProductStockList(storeProductStock);
ExcelUtil<StoreProductStock> util = new ExcelUtil<StoreProductStock>(StoreProductStock.class);
util.exportExcel(response, list, "档口商品库存数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:stock:add')")
@Log(title = "档口商品库存", businessType = BusinessType.INSERT)
@PostMapping
public R add(@RequestBody StoreProductStock storeProductStock) {
return success(storeProdStockService.insertStoreProductStock(storeProductStock));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:stock:remove')")
@Log(title = "档口商品库存", businessType = BusinessType.DELETE)
@DeleteMapping("/{storeProdStockIds}")
public R remove(@PathVariable Long[] storeProdStockIds) {
return success(storeProdStockService.deleteStoreProductStockByStoreProdStockIds(storeProdStockIds));
}
}

View File

@ -71,9 +71,9 @@ public class StoreProductStorageController extends XktBaseController {
@PreAuthorize("@ss.hasPermi('system:storage:remove')")
@ApiOperation(value = "撤销档口商品入库", httpMethod = "DELETE", response = R.class)
@Log(title = "撤销档口商品入库", businessType = BusinessType.DELETE)
@DeleteMapping("/{storeProdStorId}")
public R remove(@PathVariable Long storeProdStorId) {
return R.ok(storeProdStorageService.deleteByStoreProdStorId(storeProdStorId));
@DeleteMapping("/{storeProdStorageId}")
public R remove(@PathVariable Long storeProdStorageId) {
return R.ok(storeProdStorageService.deleteByStoreProdStorId(storeProdStorageId));
}

View File

@ -4,22 +4,20 @@ import cn.hutool.core.bean.BeanUtil;
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.system.domain.vo.menu.SysMenuDTO;
import com.ruoyi.system.service.ISysMenuService;
import com.ruoyi.web.controller.xkt.vo.storeQuickFunction.StoreQuickFuncVO;
import com.ruoyi.xkt.domain.StoreQuickFunction;
import com.ruoyi.xkt.dto.storeQuickFunction.StoreQuickFuncDTO;
import com.ruoyi.xkt.service.IStoreQuickFunctionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
@ -29,6 +27,7 @@ import java.util.List;
* @author ruoyi
* @date 2025-03-26
*/
@Api(tags = "档口快捷功能")
@RestController
@RequiredArgsConstructor
@RequestMapping("/rest/v1/quick-functions")
@ -41,90 +40,30 @@ public class StoreQuickFunctionController extends XktBaseController {
*
*/
@PreAuthorize("@ss.hasPermi('system:function:list')")
@ApiOperation(value = "查看当前档口已绑定的所有快捷菜单", httpMethod = "GET", response = R.class)
@GetMapping("/menus/{storeId}")
public StoreQuickFuncVO getMenus(@PathVariable Long storeId) {
public R<StoreQuickFuncVO> getMenus(@PathVariable Long storeId) {
// 找到当前档口所有的快捷菜单
List<StoreQuickFuncDTO.DetailDTO> checkedList = storeQuickFuncService.getCheckedMenuList(storeId);
// 找到系统所有的二级菜单
List<SysMenuDTO> sysMenuList = menuService.selectMenuListByRoleIdAndMenuType(2L, "C");
return StoreQuickFuncVO.builder().storeId(storeId)
return R.ok(StoreQuickFuncVO.builder().storeId(storeId)
.checkedList(CollectionUtils.isEmpty(checkedList) ? new ArrayList<>() : BeanUtil.copyToList(checkedList, StoreQuickFuncVO.QuickFuncDetailVO.class))
.menuList(CollectionUtils.isEmpty(sysMenuList) ? new ArrayList<>() : BeanUtil.copyToList(sysMenuList, StoreQuickFuncVO.QuickFuncDetailVO.class))
.build();
.build());
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:function:edit')")
@Log(title = "档口快捷功能", businessType = BusinessType.UPDATE)
@ApiOperation(value = "修改档口快捷功能", httpMethod = "PUT", response = R.class)
@Log(title = "修改档口快捷功能", businessType = BusinessType.UPDATE)
@PutMapping("/checked")
public R editCheckedList( @Validated @RequestBody StoreQuickFuncVO quickFuncVO) {
public R editCheckedList(@Validated @RequestBody StoreQuickFuncVO quickFuncVO) {
storeQuickFuncService.updateCheckedList(BeanUtil.toBean(quickFuncVO, StoreQuickFuncDTO.class));
return success();
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:function:list')")
@GetMapping("/list")
public TableDataInfo list(StoreQuickFunction storeQuickFunction) {
startPage();
List<StoreQuickFunction> list = storeQuickFuncService.selectStoreQuickFunctionList(storeQuickFunction);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:function:export')")
@Log(title = "档口快捷功能", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, StoreQuickFunction storeQuickFunction) {
List<StoreQuickFunction> list = storeQuickFuncService.selectStoreQuickFunctionList(storeQuickFunction);
ExcelUtil<StoreQuickFunction> util = new ExcelUtil<StoreQuickFunction>(StoreQuickFunction.class);
util.exportExcel(response, list, "档口快捷功能数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:function:query')")
@GetMapping(value = "/{storeQuickFuncId}")
public R getInfo(@PathVariable("storeQuickFuncId") Long storeQuickFuncId) {
return success(storeQuickFuncService.selectStoreQuickFunctionByStoreQuickFuncId(storeQuickFuncId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:function:add')")
@Log(title = "档口快捷功能", businessType = BusinessType.INSERT)
@PostMapping
public R add(@RequestBody StoreQuickFunction storeQuickFunction) {
return success(storeQuickFuncService.insertStoreQuickFunction(storeQuickFunction));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:function:edit')")
@Log(title = "档口快捷功能", businessType = BusinessType.UPDATE)
@PutMapping
public R edit(@RequestBody StoreQuickFunction storeQuickFunction) {
return success(storeQuickFuncService.updateStoreQuickFunction(storeQuickFunction));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:function:remove')")
@Log(title = "档口快捷功能", businessType = BusinessType.DELETE)
@DeleteMapping("/{storeQuickFuncIds}")
public R remove(@PathVariable Long[] storeQuickFuncIds) {
return success(storeQuickFuncService.deleteStoreQuickFunctionByStoreQuickFuncIds(storeQuickFuncIds));
}
}

View File

@ -6,14 +6,13 @@ import com.ruoyi.common.core.controller.XktBaseController;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.page.Page;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.web.controller.xkt.vo.storeCustomer.StoreCusGeneralSaleVO;
import com.ruoyi.web.controller.xkt.vo.storeSale.StoreSalePageVO;
import com.ruoyi.web.controller.xkt.vo.storeSale.StoreSalePayStatusVO;
import com.ruoyi.web.controller.xkt.vo.storeSale.StoreSaleVO;
import com.ruoyi.xkt.domain.StoreSale;
import com.ruoyi.xkt.dto.storeSale.StoreSaleDTO;
import com.ruoyi.xkt.dto.storeSale.StoreSalePageDTO;
import com.ruoyi.xkt.dto.storeSale.StoreSalePageResDTO;
import com.ruoyi.xkt.dto.storeSale.StoreSalePayStatusDTO;
import com.ruoyi.xkt.service.IStoreSaleService;
import io.swagger.annotations.Api;
@ -23,9 +22,6 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* Controller
*
@ -46,8 +42,8 @@ public class StoreSaleController extends XktBaseController {
@PreAuthorize("@ss.hasPermi('system:sale:list')")
@ApiOperation(value = "根据当前客户查询最近的销售业绩,以及欠款金额", httpMethod = "GET", response = R.class)
@GetMapping("/cus-overall")
public R getCusGeneralSale(@RequestParam("days") Integer days, @RequestParam("storeId") Long storeId,
@RequestParam("storeCusId") Long storeCusId) {
public R<StoreCusGeneralSaleVO> getCusGeneralSale(@RequestParam("days") Integer days, @RequestParam("storeId") Long storeId,
@RequestParam("storeCusId") Long storeCusId) {
return R.ok(BeanUtil.toBean(storeSaleService.getCusGeneralSale(days, storeId, storeCusId), StoreCusGeneralSaleVO.class));
}
@ -57,7 +53,7 @@ public class StoreSaleController extends XktBaseController {
@PreAuthorize("@ss.hasPermi('system:sale:list')")
@ApiOperation(value = "查询档口销售出库列表", httpMethod = "POST", response = R.class)
@PostMapping("/page")
public R<Page> page(@Validated @RequestBody StoreSalePageVO salePageVO) {
public R<Page<StoreSalePageResDTO>> page(@Validated @RequestBody StoreSalePageVO salePageVO) {
return R.ok(storeSaleService.page(BeanUtil.toBean(salePageVO, StoreSalePageDTO.class)));
}
@ -68,7 +64,7 @@ public class StoreSaleController extends XktBaseController {
@ApiOperation(value = "新增档口销售出库", httpMethod = "POST", response = R.class)
@Log(title = "档口销售出库", businessType = BusinessType.INSERT)
@PostMapping
public R add(@Validated @RequestBody StoreSaleVO storeSaleVO) {
public R<Integer> add(@Validated @RequestBody StoreSaleVO storeSaleVO) {
return R.ok(storeSaleService.insertStoreSale(BeanUtil.toBean(storeSaleVO, StoreSaleDTO.class)));
}
@ -79,7 +75,7 @@ public class StoreSaleController extends XktBaseController {
@Log(title = "修改档口销售出库", businessType = BusinessType.UPDATE)
@ApiOperation(value = "返单后,更新档口销售出库", httpMethod = "PUT", response = R.class)
@PutMapping
public R edit(@Validated @RequestBody StoreSaleVO storeSaleVO) {
public R<Integer> edit(@Validated @RequestBody StoreSaleVO storeSaleVO) {
return R.ok(storeSaleService.updateStoreSale(BeanUtil.toBean(storeSaleVO, StoreSaleDTO.class)));
}
@ -89,8 +85,8 @@ public class StoreSaleController extends XktBaseController {
@PreAuthorize("@ss.hasPermi('system:sale:query')")
@ApiOperation(value = "查询档口销售出库详情", httpMethod = "GET", response = R.class)
@GetMapping(value = "/{storeSaleId}")
public R getInfo(@PathVariable("storeSaleId") Long storeSaleId) {
return R.ok(storeSaleService.selectStoreSaleByStoreSaleId(storeSaleId));
public R<StoreSaleVO> getInfo(@PathVariable("storeSaleId") Long storeSaleId) {
return R.ok(BeanUtil.toBean(storeSaleService.selectStoreSaleByStoreSaleId(storeSaleId), StoreSaleVO.class));
}
/**
@ -100,9 +96,8 @@ public class StoreSaleController extends XktBaseController {
@Log(title = "客户欠款结算", businessType = BusinessType.UPDATE)
@ApiOperation(value = "客户欠款结算", httpMethod = "PUT", response = R.class)
@PutMapping("/clear-debt")
public R clearStoreCusDebt(@Validated @RequestBody StoreSalePayStatusVO payStatusVO) {
storeSaleService.clearStoreCusDebt(BeanUtil.toBean(payStatusVO, StoreSalePayStatusDTO.class));
return R.ok();
public R<Integer> clearStoreCusDebt(@Validated @RequestBody StoreSalePayStatusVO payStatusVO) {
return R.ok(storeSaleService.clearStoreCusDebt(BeanUtil.toBean(payStatusVO, StoreSalePayStatusDTO.class)));
}
/**
@ -111,40 +106,8 @@ public class StoreSaleController extends XktBaseController {
@PreAuthorize("@ss.hasPermi('system:sale:remove')")
@Log(title = "档口销售出库", businessType = BusinessType.DELETE)
@DeleteMapping("/{storeSaleId}")
public R remove(@PathVariable Long storeSaleId) {
// TODO 扣件库存
// TODO 扣件库存
// TODO 扣件库存
// TODO 扣件库存
// TODO 扣件库存
// TODO 扣件库存
// TODO 增加库存
// TODO 增加库存
// TODO 增加库存
// TODO 增加库存
// TODO 增加库存
// TODO 增加库存
public R<Integer> remove(@PathVariable Long storeSaleId) {
return R.ok(storeSaleService.deleteStoreSaleByStoreSaleId(storeSaleId));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('system:sale:export')")
@Log(title = "档口销售出库", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, StoreSale storeSale) {
List<StoreSale> list = storeSaleService.selectStoreSaleList(storeSale);
ExcelUtil<StoreSale> util = new ExcelUtil<StoreSale>(StoreSale.class);
util.exportExcel(response, list, "档口销售出库数据");
}
}

View File

@ -73,7 +73,7 @@ public class StoreProdResVO {
@ApiModelProperty(name = "文件大小")
private BigDecimal fileSize;
@ApiModelProperty(name = "文件类型")
private String fileType;
private Integer fileType;
@ApiModelProperty(name = "排序")
private Integer orderNum;
}
@ -93,7 +93,7 @@ public class StoreProdResVO {
@ApiModelProperty(name = "商品尺码")
private Integer size;
@ApiModelProperty(name = "是否是标准尺码")
private String standard;
private Integer standard;
}
@Data

View File

@ -105,7 +105,7 @@ public class StoreProdVO {
private BigDecimal fileSize;
@NotBlank(message = "文件类型不能为空!")
@ApiModelProperty(name = "文件类型")
private String fileType;
private Integer fileType;
@ApiModelProperty(name = "排序")
@NotNull(message = "排序不能为空!")
private Integer orderNum;
@ -142,7 +142,7 @@ public class StoreProdVO {
private Integer size;
@NotBlank(message = "是否是标准尺码不能为空!")
@ApiModelProperty(name = "是否是标准尺码")
private String standard;
private Integer standard;
}
@Data

View File

@ -0,0 +1,61 @@
package com.ruoyi.web.controller.xkt.vo.storeProdStock;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* @author liujiang
* @version v1.0
* @date 2025/3/27 15:12
*/
@ApiModel("档口商品库存详情数据")
@Data
@Accessors(chain = true)
public class StoreProdStockResVO {
@ApiModelProperty(name = "档口商品库存ID")
private Long storeProdStockId;
@ApiModelProperty(name = "档口商品ID")
private Long storeProdId;
@ApiModelProperty(name = "档口商品主图url")
private String mainPicUrl;
@ApiModelProperty(name = "商品货号")
private String prodArtNum;
@ApiModelProperty(name = "颜色名称")
private String colorName;
@ApiModelProperty(name = "分类类目")
private String prodCateName;
@ApiModelProperty(name = "尺码30")
private Integer size30;
@ApiModelProperty(name = "尺码31")
private Integer size31;
@ApiModelProperty(name = "尺码32")
private Integer size32;
@ApiModelProperty(name = "尺码33")
private Integer size33;
@ApiModelProperty(name = "尺码34")
private Integer size34;
@ApiModelProperty(name = "尺码35")
private Integer size35;
@ApiModelProperty(name = "尺码36")
private Integer size36;
@ApiModelProperty(name = "尺码37")
private Integer size37;
@ApiModelProperty(name = "尺码38")
private Integer size38;
@ApiModelProperty(name = "尺码39")
private Integer size39;
@ApiModelProperty(name = "尺码40")
private Integer size40;
@ApiModelProperty(name = "尺码41")
private Integer size41;
@ApiModelProperty(name = "尺码42")
private Integer size42;
@ApiModelProperty(name = "尺码43")
private Integer size43;
@ApiModelProperty(name = "总数量")
private Integer totalStock;
}

View File

@ -1,5 +1,6 @@
package com.ruoyi.xkt.dto.storeProdColor;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -14,6 +15,8 @@ import lombok.RequiredArgsConstructor;
@Data
public class StoreProdColorDTO {
@ApiModelProperty(name = "档口商品颜色ID")
private Long storeProdColorId;
@ApiModelProperty(name = "档口颜色ID")
private Long storeColorId;
@ApiModelProperty(name = "颜色名称")

View File

@ -1,13 +1,9 @@
package com.ruoyi.xkt.dto.storeProdColorSize;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* @author liujiang
* @version v1.0
@ -17,11 +13,13 @@ import javax.validation.constraints.NotNull;
@Data
public class StoreProdColorSizeDTO {
@ApiModelProperty(name = "档口商品颜色尺码ID")
private Long storeProdColorSizeId;
@ApiModelProperty(name = "档口颜色ID")
private Long storeColorId;
@ApiModelProperty(name = "商品尺码")
private Integer size;
@ApiModelProperty(name = "是否是标准尺码")
private String standard;
private Integer standard;
}

View File

@ -66,9 +66,9 @@ public class StoreProdDTO {
private List<StoreColorDTO> allColorList;
@ApiModelProperty(name = "商品颜色列表")
private List<StoreProdColorDTO> colorList;
@ApiModelProperty(name = "档口尺码列表")
@ApiModelProperty(name = "档口商品尺码列表")
private List<StoreProdColorSizeDTO> sizeList;
@ApiModelProperty(name = "档口颜色列表")
@ApiModelProperty(name = "档口价格列表")
private List<StoreProdColorPriceDTO> priceList;
@ApiModelProperty(name = "档口服务承诺")
private StoreProdSvcDTO svc;

View File

@ -5,6 +5,7 @@ import com.ruoyi.xkt.dto.storeColor.StoreColorDTO;
import com.ruoyi.xkt.dto.storeProdCateAttr.StoreProdCateAttrDTO;
import com.ruoyi.xkt.dto.storeProdColor.StoreProdColorDTO;
import com.ruoyi.xkt.dto.storeProdColorPrice.StoreProdColorPriceDTO;
import com.ruoyi.xkt.dto.storeProdColorSize.StoreProdColorSizeDTO;
import com.ruoyi.xkt.dto.storeProdDetail.StoreProdDetailDTO;
import com.ruoyi.xkt.dto.storeProdProcess.StoreProdProcessDTO;
import com.ruoyi.xkt.dto.storeProdSvc.StoreProdSvcDTO;
@ -63,6 +64,8 @@ public class StoreProdResDTO {
private List<StoreColorDTO> allColorList;
@ApiModelProperty(name = "档口颜色列表")
private List<StoreProdColorDTO> colorList;
@ApiModelProperty(name = "档口商品尺码列表")
private List<StoreProdColorSizeDTO> sizeList;
@ApiModelProperty(name = "档口颜色价格列表")
private List<StoreProdColorPriceDTO> priceList;
@ApiModelProperty(name = "档口服务承诺")

View File

@ -24,7 +24,7 @@ public class StoreProdFileDTO {
@ApiModelProperty(name = "文件大小")
private BigDecimal fileSize;
@ApiModelProperty(name = "文件类型")
private String fileType;
private Integer fileType;
@ApiModelProperty(name = "排序")
private Integer orderNum;

View File

@ -22,7 +22,7 @@ public class StoreProdFileResDTO {
@ApiModelProperty(name = "文件路径")
private String fileUrl;
@ApiModelProperty(name = "文件类型")
private String fileType;
private Integer fileType;
@ApiModelProperty(name = "文件名称")
private String fileName;
@ApiModelProperty(name = "文件大小")

View File

@ -2,6 +2,7 @@ package com.ruoyi.xkt.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.xkt.domain.StoreProductColorSize;
import com.ruoyi.xkt.dto.storeProdColorSize.StoreProdColorSizeDTO;
import org.springframework.stereotype.Repository;
import java.util.List;
@ -64,4 +65,11 @@ public interface StoreProductColorSizeMapper extends BaseMapper<StoreProductColo
void updateDelFlagByStoreProdId(Long storeProdId);
/**
* ID
* @param storeProdId ID
* @return List<StoreProdColorSizeDTO>
*/
List<StoreProdColorSizeDTO> selectListByStoreProdId(Long storeProdId);
}

View File

@ -12,54 +12,6 @@ import java.util.List;
* @date 2025-03-26
*/
public interface IStoreProductColorService {
/**
*
*
* @param storeProdColorId
* @return
*/
public StoreProductColor selectStoreProductColorByStoreProdColorId(Long storeProdColorId);
/**
*
*
* @param storeProductColor
* @return
*/
public List<StoreProductColor> selectStoreProductColorList(StoreProductColor storeProductColor);
/**
*
*
* @param storeProductColor
* @return
*/
public int insertStoreProductColor(StoreProductColor storeProductColor);
/**
*
*
* @param storeProductColor
* @return
*/
public int updateStoreProductColor(StoreProductColor storeProductColor);
/**
*
*
* @param storeProdColorIds
* @return
*/
public int deleteStoreProductColorByStoreProdColorIds(Long[] storeProdColorIds);
/**
*
*
* @param storeProdColorId
* @return
*/
public int deleteStoreProductColorByStoreProdColorId(Long storeProdColorId);
/**
* ID
*

View File

@ -34,10 +34,10 @@ public interface IStoreProductStorageService {
/**
*
*
* @param storeProdStorId
* @param storeProdStorageId
* @return
*/
public int deleteByStoreProdStorId(Long storeProdStorId);
public int deleteByStoreProdStorId(Long storeProdStorageId);
/**
*

View File

@ -12,54 +12,6 @@ import java.util.List;
* @date 2025-03-26
*/
public interface IStoreQuickFunctionService {
/**
*
*
* @param storeQuickFuncId
* @return
*/
public StoreQuickFunction selectStoreQuickFunctionByStoreQuickFuncId(Long storeQuickFuncId);
/**
*
*
* @param storeQuickFunction
* @return
*/
public List<StoreQuickFunction> selectStoreQuickFunctionList(StoreQuickFunction storeQuickFunction);
/**
*
*
* @param storeQuickFunction
* @return
*/
public int insertStoreQuickFunction(StoreQuickFunction storeQuickFunction);
/**
*
*
* @param storeQuickFunction
* @return
*/
public int updateStoreQuickFunction(StoreQuickFunction storeQuickFunction);
/**
*
*
* @param storeQuickFuncIds
* @return
*/
public int deleteStoreQuickFunctionByStoreQuickFuncIds(Long[] storeQuickFuncIds);
/**
*
*
* @param storeQuickFuncId
* @return
*/
public int deleteStoreQuickFunctionByStoreQuickFuncId(Long storeQuickFuncId);
/**
*
* @param storeId ID

View File

@ -25,14 +25,6 @@ public interface IStoreSaleService {
*/
public StoreSaleDTO selectStoreSaleByStoreSaleId(Long storeSaleId);
/**
*
*
* @param storeSale
* @return
*/
public List<StoreSale> selectStoreSaleList(StoreSale storeSale);
/**
*
*
@ -49,14 +41,6 @@ public interface IStoreSaleService {
*/
public int updateStoreSale(StoreSaleDTO storeSaleDTO);
/**
*
*
* @param storeSaleIds
* @return
*/
public int deleteStoreSaleByStoreSaleIds(Long[] storeSaleIds);
/**
*
*
@ -82,10 +66,14 @@ public interface IStoreSaleService {
Page<StoreSalePageResDTO> page(StoreSalePageDTO pageDTO);
/**
*
* @param payStatusDTO
* @return int
*
*
*
*
*
* @param payStatusDTO DTO
* @return
*/
void clearStoreCusDebt(StoreSalePayStatusDTO payStatusDTO);
Integer clearStoreCusDebt(StoreSalePayStatusDTO payStatusDTO);
}

View File

@ -1,12 +1,9 @@
package com.ruoyi.xkt.service.impl;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.xkt.domain.StoreProductColor;
import com.ruoyi.xkt.dto.storeProdColor.StoreProdColorResDTO;
import com.ruoyi.xkt.mapper.StoreProductColorMapper;
import com.ruoyi.xkt.service.IStoreProductColorService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -24,80 +21,6 @@ public class StoreProductColorServiceImpl implements IStoreProductColorService {
final StoreProductColorMapper storeProdColorMapper;
/**
*
*
* @param storeProdColorId
* @return
*/
@Override
@Transactional(readOnly = true)
public StoreProductColor selectStoreProductColorByStoreProdColorId(Long storeProdColorId) {
return storeProdColorMapper.selectStoreProductColorByStoreProdColorId(storeProdColorId);
}
/**
*
*
* @param storeProductColor
* @return
*/
@Override
@Transactional(readOnly = true)
public List<StoreProductColor> selectStoreProductColorList(StoreProductColor storeProductColor) {
return storeProdColorMapper.selectStoreProductColorList(storeProductColor);
}
/**
*
*
* @param storeProductColor
* @return
*/
@Override
@Transactional
public int insertStoreProductColor(StoreProductColor storeProductColor) {
storeProductColor.setCreateTime(DateUtils.getNowDate());
return storeProdColorMapper.insertStoreProductColor(storeProductColor);
}
/**
*
*
* @param storeProductColor
* @return
*/
@Override
@Transactional
public int updateStoreProductColor(StoreProductColor storeProductColor) {
storeProductColor.setUpdateTime(DateUtils.getNowDate());
return storeProdColorMapper.updateStoreProductColor(storeProductColor);
}
/**
*
*
* @param storeProdColorIds
* @return
*/
@Override
@Transactional
public int deleteStoreProductColorByStoreProdColorIds(Long[] storeProdColorIds) {
return storeProdColorMapper.deleteStoreProductColorByStoreProdColorIds(storeProdColorIds);
}
/**
*
*
* @param storeProdColorId
* @return
*/
@Override
@Transactional
public int deleteStoreProductColorByStoreProdColorId(Long storeProdColorId) {
return storeProdColorMapper.deleteStoreProductColorByStoreProdColorId(storeProdColorId);
}
/**
* ID
*

View File

@ -11,10 +11,10 @@ import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.xkt.domain.*;
import com.ruoyi.xkt.dto.storeColor.StoreColorDTO;
import com.ruoyi.xkt.dto.storeCustomer.StoreCusPageResDTO;
import com.ruoyi.xkt.dto.storeProdCateAttr.StoreProdCateAttrDTO;
import com.ruoyi.xkt.dto.storeProdColor.StoreProdColorDTO;
import com.ruoyi.xkt.dto.storeProdColorPrice.StoreProdColorPriceDTO;
import com.ruoyi.xkt.dto.storeProdColorSize.StoreProdColorSizeDTO;
import com.ruoyi.xkt.dto.storeProdDetail.StoreProdDetailDTO;
import com.ruoyi.xkt.dto.storeProdProcess.StoreProdProcessDTO;
import com.ruoyi.xkt.dto.storeProdSvc.StoreProdSvcDTO;
@ -34,6 +34,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
@ -74,29 +75,27 @@ public class StoreProductServiceImpl implements IStoreProductService {
StoreProdResDTO storeProdResDTO = BeanUtil.toBean(storeProd, StoreProdResDTO.class).setStoreProdId(storeProd.getId());
// 档口文件(商品主图、主图视频、下载的商品详情)
List<StoreProdFileResDTO> fileResList = this.storeProdFileMapper.selectListByStoreProdId(storeProdId);
storeProdResDTO.setFileList(CollectionUtils.isEmpty(fileResList) ? new ArrayList<>() : BeanUtil.copyToList(fileResList, StoreProdFileResDTO.class));
// 档口类目属性列表
List<StoreProdCateAttrDTO> cateAttrList = this.storeProdCateAttrMapper.selectListByStoreProdId(storeProdId);
storeProdResDTO.setCateAttrList(CollectionUtils.isEmpty(cateAttrList) ? new ArrayList<>() : BeanUtil.copyToList(cateAttrList, StoreProdCateAttrDTO.class));
// 档口所有颜色列表
List<StoreColorDTO> allColorList = this.storeColorMapper.selectListByStoreProdId(storeProd.getStoreId());
storeProdResDTO.setAllColorList(CollectionUtils.isEmpty(allColorList) ? new ArrayList<>() : BeanUtil.copyToList(allColorList, StoreColorDTO.class));
// 档口当前商品颜色列表
List<StoreProdColorDTO> colorList = this.storeProdColorMapper.selectListByStoreProdId(storeProdId);
storeProdResDTO.setColorList(CollectionUtils.isEmpty(colorList) ? new ArrayList<>() : BeanUtil.copyToList(colorList, StoreProdColorDTO.class));
// 档口商品颜色尺码列表
List<StoreProdColorSizeDTO> sizeList = this.storeProdColorSizeMapper.selectListByStoreProdId(storeProdId);
// 档口颜色价格列表
List<StoreProdColorPriceDTO> priceList = this.storeProdColorPriceMapper.selectListByStoreProdId(storeProdId);
storeProdResDTO.setPriceList(CollectionUtils.isEmpty(priceList) ? new ArrayList<>() : BeanUtil.copyToList(priceList, StoreProdColorPriceDTO.class));
// 档口商品详情
StoreProductDetail prodDetail = this.storeProdDetailMapper.selectByStoreProdId(storeProdId);
storeProdResDTO.setDetail(ObjectUtils.isEmpty(prodDetail) ? null : BeanUtil.toBean(prodDetail, StoreProdDetailDTO.class));
// 档口服务承诺
StoreProductService storeProductSvc = this.storeProdSvcMapper.selectByStoreProdId(storeProdId);
storeProdResDTO.setSvc(ObjectUtils.isEmpty(storeProductSvc) ? null : BeanUtil.toBean(storeProductSvc, StoreProdSvcDTO.class));
// 档口生产工艺信息
StoreProductProcess prodProcess = this.storeProdProcMapper.selectByStoreProdId(storeProdId);
storeProdResDTO.setProcess(ObjectUtils.isEmpty(prodProcess) ? null : BeanUtil.toBean(prodProcess, StoreProdProcessDTO.class));
return storeProdResDTO;
return storeProdResDTO.setFileList(fileResList).setCateAttrList(cateAttrList).setAllColorList(allColorList)
.setColorList(colorList).setPriceList(priceList).setSizeList(sizeList)
.setDetail(ObjectUtils.isEmpty(prodDetail) ? null : BeanUtil.toBean(prodDetail, StoreProdDetailDTO.class))
.setSvc(ObjectUtils.isEmpty(storeProductSvc) ? null : BeanUtil.toBean(storeProductSvc, StoreProdSvcDTO.class))
.setProcess(ObjectUtils.isEmpty(prodProcess) ? null : BeanUtil.toBean(prodProcess, StoreProdProcessDTO.class));
}
@Override
@ -162,6 +161,10 @@ public class StoreProductServiceImpl implements IStoreProductService {
// 组装StoreProduct数据
StoreProduct storeProd = BeanUtil.toBean(storeProdDTO, StoreProduct.class).setVoucherDate(DateUtils.getNowDate());
int count = this.storeProdMapper.insert(storeProd);
// 处理编辑档口商品颜色
this.handleStoreProdColorList(storeProdDTO.getColorList(), storeProd.getId(), storeProd.getStoreId(), Boolean.TRUE);
// 处理编辑档口商品颜色尺码
this.handleStoreProdColorSizeList(storeProdDTO.getSizeList(), storeProd.getId(), Boolean.TRUE);
// 处理StoreProduct其它属性
this.handleStoreProdProperties(storeProd, storeProdDTO);
return count;
@ -187,10 +190,6 @@ public class StoreProductServiceImpl implements IStoreProductService {
this.storeProdFileMapper.updateDelFlagByStoreProdId(storeProdId);
// 档口类目属性列表的 del_flag置为2
this.storeProdCateAttrMapper.updateDelFlagByStoreProdId(storeProdId);
// 档口颜色列表的del_flag置为2
this.storeProdColorMapper.updateDelFlagByStoreProdId(storeProdId);
// 档口颜色尺码列表的del_flag置为2
this.storeProdColorSizeMapper.updateDelFlagByStoreProdId(storeProdId);
// 档口颜色价格列表的del_flag置为2
this.storeProdColorPriceMapper.updateDelFlagByStoreProdId(storeProdId);
// 档口详情内容的del_flag置为2
@ -201,9 +200,120 @@ public class StoreProductServiceImpl implements IStoreProductService {
this.storeProdProcMapper.updateDelFlagByStoreProdId(storeProdId);
// 处理更新逻辑
this.handleStoreProdProperties(storeProd, storeProdDTO);
// 处理编辑档口商品颜色
this.handleStoreProdColorList(storeProdDTO.getColorList(), storeProdId, storeProd.getStoreId(), Boolean.FALSE);
// 处理编辑档口商品颜色尺码
this.handleStoreProdColorSizeList(storeProdDTO.getSizeList(), storeProdId, Boolean.FALSE);
return count;
}
/**
*
*
* @param sizeDTOList DTO
* @param storeProdId ID
* @param isInsert
*/
private void handleStoreProdColorSizeList(List<StoreProdColorSizeDTO> sizeDTOList, Long storeProdId, Boolean isInsert) {
// 过滤出需要添加的颜色尺码信息,并转换为实体类对象
List<StoreProductColorSize> toAddList = sizeDTOList.stream().filter(x -> ObjectUtils.isEmpty(x.getStoreProdColorSizeId()))
.map(x -> BeanUtil.toBean(x, StoreProductColorSize.class).setStoreProdId(storeProdId)).collect(Collectors.toList());
// 根据是否是插入操作来决定执行插入还是更新操作
if (isInsert) {
// 如果是插入操作,直接插入新的颜色尺码信息
this.storeProdColorSizeMapper.insert(toAddList);
} else {
// 如果不是插入操作,首先获取数据库中的颜色尺码信息
List<StoreProductColorSize> colorSizeList = Optional.ofNullable(this.storeProdColorSizeMapper.selectList(new LambdaQueryWrapper<StoreProductColorSize>()
.eq(StoreProductColorSize::getStoreProdId, storeProdId).eq(StoreProductColorSize::getDelFlag, Constants.UNDELETED)))
.orElseThrow(() -> new ServiceException("该档口下没有商品及颜色", HttpStatus.ERROR));
// 将数据库中的颜色尺码信息转换为Map便于后续操作
Map<Long, StoreProductColorSize> dbProdColorSizeMap = colorSizeList.stream().collect(Collectors.toMap(StoreProductColorSize::getId, Function.identity()));
// 将前端传入的颜色尺码信息转换为Map便于后续操作
Map<Long, StoreProdColorSizeDTO> frontProdColorSizeMap = sizeDTOList.stream()
.filter(x -> ObjectUtils.isNotEmpty(x.getStoreProdColorSizeId())).collect(Collectors.toMap(StoreProdColorSizeDTO::getStoreProdColorSizeId, Function.identity()));
// 过滤出需要更新的颜色尺码信息,并更新其属性
List<StoreProductColorSize> toUpdateList = sizeDTOList.stream().filter(x -> ObjectUtils.isNotEmpty(x.getStoreProdColorSizeId()))
.map(x -> {
StoreProductColorSize dbProdColor = Optional.ofNullable(dbProdColorSizeMap.get(x.getStoreProdColorSizeId())).orElseThrow(() -> new ServiceException("该档口商品颜色尺码不存在", HttpStatus.ERROR));
BeanUtil.copyProperties(x, dbProdColor);
return dbProdColor;
}).collect(Collectors.toList());
// 过滤出需要删除的颜色尺码信息,并设置其删除标志
List<StoreProductColorSize> toDeleteList = colorSizeList.stream().filter(x -> !frontProdColorSizeMap.containsKey(x.getId())).peek(x -> x.setDelFlag(Constants.DELETED)).collect(Collectors.toList());
// 将所有需要更新的颜色尺码信息合并到一个列表中
List<StoreProductColorSize> allUpdateList = new ArrayList<StoreProductColorSize>() {{
if (CollectionUtils.isNotEmpty(toAddList)) {
addAll(toAddList);
}
if (CollectionUtils.isNotEmpty(toUpdateList)) {
addAll(toUpdateList);
}
if (CollectionUtils.isNotEmpty(toDeleteList)) {
addAll(toDeleteList);
}
}};
// 如果有需要更新的颜色尺码信息,则执行更新操作
if (CollectionUtils.isNotEmpty(allUpdateList)) {
this.storeProdColorSizeMapper.insertOrUpdate(allUpdateList);
}
}
}
/**
*
*
* @param colorDTOList DTO
* @param storeProdId ID
* @param storeId ID
* @param isInsert
*/
private void handleStoreProdColorList(List<StoreProdColorDTO> colorDTOList, Long storeProdId, Long storeId, Boolean isInsert) {
// 过滤出需要添加的商品颜色并转换为StoreProductColor对象
List<StoreProductColor> toAddList = colorDTOList.stream().filter(x -> ObjectUtils.isEmpty(x.getStoreProdColorId()))
.map(x -> BeanUtil.toBean(x, StoreProductColor.class).setStoreProdId(storeProdId).setStoreId(storeId)).collect(Collectors.toList());
if (isInsert) {
// 如果是插入操作,直接添加新的商品颜色
this.storeProdColorMapper.insert(toAddList);
} else {
// 如果不是插入操作,获取当前店铺商品颜色列表
List<StoreProductColor> colorList = Optional.ofNullable(this.storeProdColorMapper.selectList(new LambdaQueryWrapper<StoreProductColor>()
.eq(StoreProductColor::getStoreProdId, storeProdId).eq(StoreProductColor::getDelFlag, Constants.UNDELETED)
.eq(StoreProductColor::getStoreId, storeId)))
.orElseThrow(() -> new ServiceException("该档口下没有商品及颜色", HttpStatus.ERROR));
// 将数据库中的商品颜色信息转换为Map便于后续操作
Map<Long, StoreProductColor> dbProdColorMap = colorList.stream().collect(Collectors.toMap(StoreProductColor::getId, Function.identity()));
// 将前端传入的商品颜色信息转换为Map便于后续操作
Map<Long, StoreProdColorDTO> frontProdColorMap = colorDTOList.stream()
.filter(x -> ObjectUtils.isNotEmpty(x.getStoreProdColorId())).collect(Collectors.toMap(StoreProdColorDTO::getStoreProdColorId, Function.identity()));
// 过滤出需要更新的商品颜色,并更新信息
List<StoreProductColor> toUpdateList = colorDTOList.stream().filter(x -> ObjectUtils.isNotEmpty(x.getStoreProdColorId()))
.map(x -> {
StoreProductColor dbProdColor = Optional.ofNullable(dbProdColorMap.get(x.getStoreProdColorId())).orElseThrow(() -> new ServiceException("该档口商品颜色不存在", HttpStatus.ERROR));
BeanUtil.copyProperties(x, dbProdColor);
return dbProdColor;
}).collect(Collectors.toList());
// 过滤出需要删除的商品颜色,并设置删除标志
List<StoreProductColor> toDeleteList = colorList.stream().filter(x -> !frontProdColorMap.containsKey(x.getId())).peek(x -> x.setDelFlag(Constants.DELETED)).collect(Collectors.toList());
// 合并所有需要更新的商品颜色列表
List<StoreProductColor> allUpdateList = new ArrayList<StoreProductColor>() {{
if (CollectionUtils.isNotEmpty(toAddList)) {
addAll(toAddList);
}
if (CollectionUtils.isNotEmpty(toUpdateList)) {
addAll(toUpdateList);
}
if (CollectionUtils.isNotEmpty(toDeleteList)) {
addAll(toDeleteList);
}
}};
// 如果有需要更新的商品颜色,执行更新操作
if (CollectionUtils.isNotEmpty(allUpdateList)) {
this.storeProdColorMapper.insertOrUpdate(allUpdateList);
}
}
}
/**
*
@ -262,7 +372,7 @@ public class StoreProductServiceImpl implements IStoreProductService {
/**
* ID
*
* @param storeId ID
* @param storeId ID
* @param prodArtNum
* @return
*/
@ -300,7 +410,7 @@ public class StoreProductServiceImpl implements IStoreProductService {
/**
*
*
* @param storeProd
* @param storeProd
* @param storeProdDTO
*/
private void handleStoreProdProperties(StoreProduct storeProd, StoreProdDTO storeProdDTO) {
@ -323,18 +433,6 @@ public class StoreProductServiceImpl implements IStoreProductService {
.setStoreProdId(storeProd.getId()))
.collect(Collectors.toList());
this.storeProdCateAttrMapper.insert(cateAttrList);
// 商品颜色列表
List<StoreProductColor> colorList = storeProdDTO.getColorList().stream()
.map(x -> BeanUtil.toBean(x, StoreProductColor.class)
.setStoreProdId(storeProd.getId()).setStoreId(storeProdDTO.getStoreId()))
.collect(Collectors.toList());
this.storeProdColorMapper.insert(colorList);
// 档口颜色尺码列表
List<StoreProductColorSize> sizeList = storeProdDTO.getSizeList().stream()
.map(x -> BeanUtil.toBean(x, StoreProductColorSize.class)
.setStoreProdId(storeProd.getId()))
.collect(Collectors.toList());
this.storeProdColorSizeMapper.insert(sizeList);
// 档口颜色价格列表
List<StoreProductColorPrice> priceList = storeProdDTO.getPriceList().stream()
.map(x -> BeanUtil.toBean(x, StoreProductColorPrice.class)
@ -360,12 +458,11 @@ public class StoreProductServiceImpl implements IStoreProductService {
.eq(StoreColor::getStoreId, storeProdDTO.getStoreId()).eq(StoreColor::getDelFlag, Constants.UNDELETED));
List<Long> dbStoreColorIdList = storeColorList.stream().map(StoreColor::getId).collect(Collectors.toList());
// 新增的颜色列表
List<StoreColor> addColorList =storeProdDTO.getAllColorList().stream().filter(x -> !dbStoreColorIdList.contains(x.getStoreColorId()))
List<StoreColor> addColorList = storeProdDTO.getAllColorList().stream().filter(x -> !dbStoreColorIdList.contains(x.getStoreColorId()))
.map(x -> BeanUtil.toBean(x, StoreColor.class).setStoreId(storeProdDTO.getStoreId())).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(addColorList)) {
this.storeColorMapper.insert(addColorList);
}
}
}

View File

@ -473,21 +473,21 @@ public class StoreProductStorageServiceImpl implements IStoreProductStorageServi
/**
*
*
* @param storeProdStorId
* @param storeProdStorageId
* @return
*/
@Override
@Transactional
public int deleteByStoreProdStorId(Long storeProdStorId) {
public int deleteByStoreProdStorId(Long storeProdStorageId) {
// 档口商品入库
StoreProductStorage storage = Optional.ofNullable(this.storageMapper.selectOne(new LambdaQueryWrapper<StoreProductStorage>()
.eq(StoreProductStorage::getId, storeProdStorId).eq(StoreProductStorage::getDelFlag, Constants.UNDELETED)))
.eq(StoreProductStorage::getId, storeProdStorageId).eq(StoreProductStorage::getDelFlag, Constants.UNDELETED)))
.orElseThrow(() -> new ServiceException("档口商品入库不存在!", HttpStatus.ERROR));
storage.setDelFlag(Constants.DELETED);
int count = this.storageMapper.updateById(storage);
// 档口商品入库明细
List<StoreProductStorageDetail> storageDetailList = storageDetailMapper.selectList(new LambdaQueryWrapper<StoreProductStorageDetail>()
.eq(StoreProductStorageDetail::getStoreProdStorId, storeProdStorId).eq(StoreProductStorageDetail::getDelFlag, Constants.UNDELETED));
.eq(StoreProductStorageDetail::getStoreProdStorId, storeProdStorageId).eq(StoreProductStorageDetail::getDelFlag, Constants.UNDELETED));
storageDetailList.forEach(x -> x.setDelFlag(Constants.DELETED));
this.storageDetailMapper.updateById(storageDetailList);
// 减少档口商品库存

View File

@ -3,7 +3,6 @@ package com.ruoyi.xkt.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.xkt.domain.StoreQuickFunction;
import com.ruoyi.xkt.dto.storeQuickFunction.StoreQuickFuncDTO;
import com.ruoyi.xkt.mapper.StoreQuickFunctionMapper;
@ -32,7 +31,7 @@ public class StoreQuickFunctionServiceImpl implements IStoreQuickFunctionService
@Transactional(readOnly = true)
public List<StoreQuickFuncDTO.DetailDTO> getCheckedMenuList(Long storeId) {
List<StoreQuickFunction> storeQuickFuncList = storeQuickFuncMapper.selectList(new LambdaQueryWrapper<StoreQuickFunction>()
.eq(StoreQuickFunction::getStoreId,storeId).eq(StoreQuickFunction::getDelFlag, Constants.UNDELETED));
.eq(StoreQuickFunction::getStoreId, storeId).eq(StoreQuickFunction::getDelFlag, Constants.UNDELETED));
return CollectionUtils.isEmpty(storeQuickFuncList) ? new ArrayList<>() : BeanUtil.copyToList(storeQuickFuncList, StoreQuickFuncDTO.DetailDTO.class);
}
@ -43,6 +42,7 @@ public class StoreQuickFunctionServiceImpl implements IStoreQuickFunctionService
* @return
*/
@Override
@Transactional
public void updateCheckedList(StoreQuickFuncDTO storeQuickFuncDTO) {
// 先将旧的绑定关系置为无效
this.storeQuickFuncMapper.updateDelFlagByStoreId(storeQuickFuncDTO.getStoreId());
@ -52,79 +52,4 @@ public class StoreQuickFunctionServiceImpl implements IStoreQuickFunctionService
this.storeQuickFuncMapper.insert(checkedList);
}
/**
*
*
* @param storeQuickFuncId
* @return
*/
@Override
@Transactional(readOnly = true)
public StoreQuickFunction selectStoreQuickFunctionByStoreQuickFuncId(Long storeQuickFuncId) {
return storeQuickFuncMapper.selectStoreQuickFunctionByStoreQuickFuncId(storeQuickFuncId);
}
/**
*
*
* @param storeQuickFunction
* @return
*/
@Override
@Transactional(readOnly = true)
public List<StoreQuickFunction> selectStoreQuickFunctionList(StoreQuickFunction storeQuickFunction) {
return storeQuickFuncMapper.selectStoreQuickFunctionList(storeQuickFunction);
}
/**
*
*
* @param storeQuickFunction
* @return
*/
@Override
@Transactional
public int insertStoreQuickFunction(StoreQuickFunction storeQuickFunction) {
storeQuickFunction.setCreateTime(DateUtils.getNowDate());
return storeQuickFuncMapper.insertStoreQuickFunction(storeQuickFunction);
}
/**
*
*
* @param storeQuickFunction
* @return
*/
@Override
@Transactional
public int updateStoreQuickFunction(StoreQuickFunction storeQuickFunction) {
storeQuickFunction.setUpdateTime(DateUtils.getNowDate());
return storeQuickFuncMapper.updateStoreQuickFunction(storeQuickFunction);
}
/**
*
*
* @param storeQuickFuncIds
* @return
*/
@Override
@Transactional
public int deleteStoreQuickFunctionByStoreQuickFuncIds(Long[] storeQuickFuncIds) {
return storeQuickFuncMapper.deleteStoreQuickFunctionByStoreQuickFuncIds(storeQuickFuncIds);
}
/**
*
*
* @param storeQuickFuncId
* @return
*/
@Override
@Transactional
public int deleteStoreQuickFunctionByStoreQuickFuncId(Long storeQuickFuncId) {
return storeQuickFuncMapper.deleteStoreQuickFunctionByStoreQuickFuncId(storeQuickFuncId);
}
}

View File

@ -28,6 +28,7 @@ import lombok.RequiredArgsConstructor;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.ibatis.executor.BatchResult;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -109,16 +110,19 @@ public class StoreSaleServiceImpl implements IStoreSaleService {
}
/**
*
*
* <p>
*
*
*
* @param payStatusDTO
* @return int
* @param payStatusDTO DTO
* @return
*/
@Override
@Transactional
public void clearStoreCusDebt(StoreSalePayStatusDTO payStatusDTO) {
public Integer clearStoreCusDebt(StoreSalePayStatusDTO payStatusDTO) {
List<StoreSale> storeSaleList = Optional.ofNullable(this.storeSaleMapper.selectList(new LambdaQueryWrapper<StoreSale>()
.in(StoreSale::getId, payStatusDTO.getStoreSaleIdList()).eq(StoreSale::getDelFlag, Constants.UNDELETED)))
.in(StoreSale::getId, payStatusDTO.getStoreSaleIdList()).eq(StoreSale::getDelFlag, Constants.UNDELETED)))
.orElseThrow(() -> new ServiceException("没有找到对应的销售出库单!", HttpStatus.ERROR));
// 勾选订单是否有已结算的
List<StoreSale> settledList = storeSaleList.stream().filter(x -> Objects.equals(x.getPaymentStatus(), PaymentStatus.SETTLED.getValue())).collect(Collectors.toList());
@ -126,7 +130,8 @@ public class StoreSaleServiceImpl implements IStoreSaleService {
throw new ServiceException("当前订单已结算!" + settledList.stream().map(StoreSale::getCode).collect(Collectors.toList()), HttpStatus.ERROR);
}
storeSaleList.forEach(x -> x.setPaymentStatus(PaymentStatus.SETTLED.getValue()));
this.storeSaleMapper.updateById(storeSaleList);
List<BatchResult> list = this.storeSaleMapper.updateById(storeSaleList);
return list.size();
}
/**
@ -166,7 +171,6 @@ public class StoreSaleServiceImpl implements IStoreSaleService {
}
/**
*
*
@ -210,7 +214,7 @@ public class StoreSaleServiceImpl implements IStoreSaleService {
.setSaleType(storeSaleDTO.getSaleType()).setStoreSaleId(storeSale.getId())).collect(Collectors.toList());
this.storeSaleDetailMapper.insert(detailList);
// 汇总编辑的存货总数量
final List<StoreSaleDetail> totalList = new ArrayList<StoreSaleDetail>(saleDetailList){{
final List<StoreSaleDetail> totalList = new ArrayList<StoreSaleDetail>(saleDetailList) {{
addAll(detailList);
}};
// 先汇总当前这笔订单商品明细的销售数量,包括销售及退货 key prodArtNum + storeProdId + storeProdColorId + colorName, value: map(key:size,value:count)
@ -273,33 +277,10 @@ public class StoreSaleServiceImpl implements IStoreSaleService {
}
/**
*
*
* @param storeSaleIds
* @return
*/
@Override
@Transactional
public int deleteStoreSaleByStoreSaleIds(Long[] storeSaleIds) {
return storeSaleMapper.deleteStoreSaleByStoreSaleIds(storeSaleIds);
}
/**
*
*
* @param storeSale
* @return
*/
@Override
public List<StoreSale> selectStoreSaleList(StoreSale storeSale) {
return null;
}
/**
*
* @param saleCountMap map
*
* @param saleCountMap map
* @param multiplierFactor 1 -1
* @return List<StoreProdStockUpdateDTO>
*/

View File

@ -97,6 +97,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectListByStoreProdId" parameterType="Long" resultType="com.ruoyi.xkt.dto.storeProdColor.StoreProdColorDTO">
SELECT
id AS storeProdColorId,
store_color_id AS storeColorId,
color_name AS colorName,
order_num AS orderNum

View File

@ -103,4 +103,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
UPDATE store_product_color_size SET del_flag = 2 WHERE store_prod_id = #{storeProdId}
</update>
<select id="selectListByStoreProdId" parameterType="Long" resultType="com.ruoyi.xkt.dto.storeProdColorSize.StoreProdColorSizeDTO">
SELECT
id AS storeProdColorSizeId,
store_color_id,
size,
standard
FROM
store_product_color_size
WHERE
del_flag = 0 AND store_prod_id = #{storeProdId}
</select>
</mapper>