jsk 商超管理

This commit is contained in:
skjia 2025-04-10 18:27:46 +08:00
parent 67c7bbc121
commit 86e5c43d69
24 changed files with 1938 additions and 0 deletions

View File

@ -0,0 +1,85 @@
package com.bonus.canteen.core.supermarket.controller;
import com.bonus.canteen.core.supermarket.domain.SupermarketInfo;
import com.bonus.canteen.core.supermarket.service.SupermarketInfoService;
import com.bonus.common.core.utils.poi.ExcelUtil;
import com.bonus.common.core.web.controller.BaseController;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.common.core.web.page.TableDataInfo;
import com.bonus.common.log.annotation.SysLog;
import com.bonus.common.log.enums.OperaType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 超市Controller
*
* @author xsheng
* @date 2025-04-05
*/
@Api(tags = "超市接口")
@RestController
@RequestMapping("/supermarket_info")
public class SupermarketInfoController extends BaseController {
@Autowired
private SupermarketInfoService supermarketInfoService;
/**
* 查询超市列表
*/
@ApiOperation(value = "查询超市列表")
@GetMapping("/list")
public TableDataInfo list(SupermarketInfo SupermarketInfo) {
startPage();
List<SupermarketInfo> list = supermarketInfoService.selectSupermarketInfoList(SupermarketInfo);
return getDataTable(list);
}
/**
* 新增超市
*/
@ApiOperation(value = "新增超市")
//@PreventRepeatSubmit
//@RequiresPermissions("Supermarket:info:add")
@SysLog(title = "超市", businessType = OperaType.INSERT, logType = 1,module = "商超管理->新增超市")
@PostMapping("/add")
public AjaxResult add(@RequestBody SupermarketInfo SupermarketInfo) {
try {
return toAjax(supermarketInfoService.insertSupermarketInfo(SupermarketInfo));
} catch (Exception e) {
return error("系统错误, " + e.getMessage());
}
}
/**
* 修改超市
*/
@ApiOperation(value = "修改超市")
//@PreventRepeatSubmit
//@RequiresPermissions("Supermarket:info:edit")
@SysLog(title = "超市", businessType = OperaType.UPDATE, logType = 1,module = "商超管理->修改超市")
@PostMapping("/edit")
public AjaxResult edit(@RequestBody SupermarketInfo SupermarketInfo) {
try {
return toAjax(supermarketInfoService.updateSupermarketInfo(SupermarketInfo));
} catch (Exception e) {
return error("系统错误, " + e.getMessage());
}
}
/**
* 删除超市
*/
@ApiOperation(value = "删除超市")
@SysLog(title = "超市", businessType = OperaType.DELETE, logType = 1,module = "商超管理->删除超市")
@PostMapping("/del")
public AjaxResult remove(@RequestBody SupermarketInfo supermarketInfo) {
return toAjax(supermarketInfoService.deleteSupermarketInfoBySupermarketId(supermarketInfo));
}
}

View File

@ -0,0 +1,98 @@
package com.bonus.canteen.core.supermarket.controller;
import com.bonus.canteen.core.alloc.domain.AllocArea;
import com.bonus.canteen.core.supermarket.domain.SupermarketProduct;
import com.bonus.canteen.core.supermarket.service.SupermarketProductService;
import com.bonus.common.core.web.controller.BaseController;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.common.core.web.page.TableDataInfo;
import com.bonus.common.log.annotation.SysLog;
import com.bonus.common.log.enums.OperaType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 商品Controller
*
* @author xsheng
* @date 2025-04-05
*/
@Api(tags = "商品接口")
@RestController
@RequestMapping("/supermarket_product")
public class SupermarketProductController extends BaseController {
@Autowired
private SupermarketProductService supermarketProductService;
/**
* 查询商品列表
*/
@ApiOperation(value = "查询商品列表")
@GetMapping("/list")
public TableDataInfo list(SupermarketProduct SupermarketProduct) {
startPage();
List<SupermarketProduct> list = supermarketProductService.selectSupermarketProductList(SupermarketProduct);
return getDataTable(list);
}
/**
* 新增商品
*/
@ApiOperation(value = "新增商品")
@SysLog(title = "商品", businessType = OperaType.INSERT, logType = 1,module = "商超管理->新增商品")
@PostMapping("/add")
public AjaxResult add(@RequestBody SupermarketProduct SupermarketProduct) {
try {
return toAjax(supermarketProductService.insertSupermarketProduct(SupermarketProduct));
} catch (Exception e) {
return error("系统错误, " + e.getMessage());
}
}
/**
* 修改商品
*/
@ApiOperation(value = "修改商品")
@SysLog(title = "商品", businessType = OperaType.UPDATE, logType = 1,module = "商超管理->修改商品")
@PostMapping("/edit")
public AjaxResult edit(@RequestBody SupermarketProduct SupermarketProduct) {
try {
return toAjax(supermarketProductService.updateSupermarketProduct(SupermarketProduct));
} catch (Exception e) {
return error("系统错误, " + e.getMessage());
}
}
/**
* 修改商品状态
*/
@ApiOperation(value = "修改商品状态")
@SysLog(title = "商品", businessType = OperaType.UPDATE, logType = 1,module = "商超管理->修改商品状态")
@PostMapping("/editState")
public AjaxResult editState(@RequestBody SupermarketProduct SupermarketProduct) {
try {
return toAjax(supermarketProductService.updateSupermarketProductState(SupermarketProduct));
} catch (Exception e) {
return error("系统错误, " + e.getMessage());
}
}
/**
* 删除商品
*/
@ApiOperation(value = "批量删除商品")
@SysLog(title = "商品", businessType = OperaType.DELETE, logType = 1,module = "商超管理->删除商品")
@PostMapping("/dels")
public AjaxResult removes(@RequestBody SupermarketProduct supermarketProducts) {
return toAjax(supermarketProductService.deleteSupermarketProductByProductIds(supermarketProducts));
}
@ApiOperation(value = "删除商品")
@SysLog(title = "商品", businessType = OperaType.DELETE, logType = 1,module = "商超管理->删除商品")
@PostMapping("/del")
public AjaxResult remove(@RequestBody SupermarketProduct supermarketProduct) {
return toAjax(supermarketProductService.deleteSupermarketProductByProductId(supermarketProduct));
}
}

View File

@ -0,0 +1,79 @@
package com.bonus.canteen.core.supermarket.controller;
import com.bonus.canteen.core.supermarket.domain.SupermarketUnit;
import com.bonus.canteen.core.supermarket.service.SupermarketUnitService;
import com.bonus.common.core.web.controller.BaseController;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.common.core.web.page.TableDataInfo;
import com.bonus.common.log.annotation.SysLog;
import com.bonus.common.log.enums.OperaType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 单位Controller
*
* @author xsheng
* @date 2025-04-05
*/
@Api(tags = "单位接口")
@RestController
@RequestMapping("/supermarket_unit")
public class SupermarketUnitController extends BaseController {
@Autowired
private SupermarketUnitService supermarketUnitService;
/**
* 查询单位列表
*/
@ApiOperation(value = "查询单位列表")
@GetMapping("/list")
public TableDataInfo list(SupermarketUnit SupermarketUnit) {
startPage();
List<SupermarketUnit> list = supermarketUnitService.selectSupermarketUnitList(SupermarketUnit);
return getDataTable(list);
}
/**
* 新增单位
*/
@ApiOperation(value = "新增单位")
@SysLog(title = "单位", businessType = OperaType.INSERT, logType = 1,module = "商超管理->新增单位")
@PostMapping("/add")
public AjaxResult add(@RequestBody SupermarketUnit SupermarketUnit) {
try {
return toAjax(supermarketUnitService.insertSupermarketUnit(SupermarketUnit));
} catch (Exception e) {
return error("系统错误, " + e.getMessage());
}
}
/**
* 修改单位
*/
@ApiOperation(value = "修改单位")
@SysLog(title = "单位", businessType = OperaType.UPDATE, logType = 1,module = "商超管理->修改单位")
@PostMapping("/edit")
public AjaxResult edit(@RequestBody SupermarketUnit SupermarketUnit) {
try {
return toAjax(supermarketUnitService.updateSupermarketUnit(SupermarketUnit));
} catch (Exception e) {
return error("系统错误, " + e.getMessage());
}
}
/**
* 删除单位
*/
@ApiOperation(value = "删除单位")
@SysLog(title = "单位", businessType = OperaType.DELETE, logType = 1,module = "商超管理->删除单位")
@PostMapping("/del")
public AjaxResult remove(@PathVariable Long SupermarketIds) {
return toAjax(supermarketUnitService.deleteSupermarketUnitBySupermarketId(SupermarketIds));
}
}

View File

@ -0,0 +1,82 @@
package com.bonus.canteen.core.supermarket.domain;
import com.bonus.common.core.annotation.Excel;
import com.bonus.common.core.web.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import java.util.Date;
/**
* 超市对象 orderInfo
*
* @author xsheng
* @date 2025-04-05
*/
@Data
@ToString
public class SupermarketInfo extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 超市id */
private String supermarketId ;
/** 超市名称 */
private String supermarketName ;
/** 管理员 */
private String userId ;
private String userName ;
/** 用户类别 */
private String userType ;
/** 联系电话 */
private String mobile ;
/** 仓库id */
private String warehouseId ;
private String warehouseName ;
/** 超市地址 */
private String address ;
/** 图片url */
private String imgUrl ;
/** 是否立即打印 */
private String ifPrintNow ;
/** 线上销售模式(1现货2预定) */
private String appSaleMode ;
/** 最少配送时间(分) */
private String minDeliveryTime ;
/** 选择时间间隔(分) */
private String selectTimeInterval;
/** 配送费(元) */
private String deliveryCost ;
/** 自动核销天数(天) */
private String autoVerifyDay ;
/** 配送方式(1自取2配送) */
private String deliveryWay ;
/** 退单限制时间(分) */
private String refundLimitTime ;
/** 是否关联出入库(1是2否) */
private String ifRelateDrp ;
/** 范围id */
private String effId ;
private String effName ;
/** 流水号前缀 */
private String mealCode ;
/** 区域id */
private String areaId ;
private String areaName ;
/** 是否删除 */
private String delFlag ;
/** 乐观锁 */
private String revision ;
/** 创建人 */
private String createBy ;
/** 更新人 */
private String updateBy ;
/** 是否启用收款码(1是2否) */
private String ifEnablePayCode ;
/** 超市收款码链接 */
private String payCodeUrl ;
}

View File

@ -0,0 +1,71 @@
package com.bonus.canteen.core.supermarket.domain;
import com.bonus.common.core.web.domain.BaseEntity;
import lombok.Data;
import lombok.ToString;
/**
* 单位对象 orderInfo
*
* @author xsheng
* @date 2025-04-05
*/
@Data
@ToString
public class SupermarketProduct extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 商品id */
private String productId ;
/** 超市id */
private String supermarketId ;
/** 超市名称 */
private String supermarketName ;
/** 商品名称 */
private String productName ;
/** 条码 */
private String barCode ;
/** 零售价 */
private String salePrice ;
/** 计重类型 1 称重 2 按份 */
private String salesMode ;
/** 所属区域 */
private String areaId ;
/** 所属区域名称 */
private String areaName ;
/** 商品单位 */
private String unitId ;
/** 商品单位名称 */
private String unitName ;
/** 类型(1原料2商品) */
private String materialId ;
/** 商品类型名称 */
private String materialName ;
/** 商品进价 */
private String prefPrice ;
/** 保质期时间类别 1 年 2月 3日 */
private String qualityType ;
/** 保质期时间 */
private String qualityNum ;
/** 供应资格证书 */
private String supplyCertificate;
/** 商品介绍 */
private String productRemark ;
/** 上架状态(1-上架,2-下架) */
private String putawayState ;
/** 是否线上销售(1是2否) */
private String ifOnline ;
private String personLimit ;
private String oneDayLimit ;
/** 图片 */
private String imgUrl ;
private String inventoryNum ;
private String revision ;
private String createBy ;
private String updateBy ;
private String productCode ;
private String productType ;
}

View File

@ -0,0 +1,41 @@
package com.bonus.canteen.core.supermarket.domain;
import com.bonus.common.core.web.domain.BaseEntity;
import lombok.Data;
import lombok.ToString;
/**
* 单位对象 orderInfo
*
* @author xsheng
* @date 2025-04-05
*/
@Data
@ToString
public class SupermarketUnit extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 主键id */
private String id ;
/** 区域id */
private String areaId ;
private String areaName ;
/** 计量单位id */
private String unitId ;
/** 计量单位名称 */
private String unitName ;
/** 换算比率(换算成g) */
private String rate ;
/** 单位类型(1-按份,2-称重) */
private String weighType ;
/** 删除标识(1删除,2正常) */
private String delFlag ;
/** */
private String revision ;
/** 创建人 */
private String createBy ;
/** 更新人 */
private String updateBy ;
}

View File

@ -0,0 +1,55 @@
package com.bonus.canteen.core.supermarket.mapper;
import com.bonus.canteen.core.supermarket.domain.SupermarketInfo;
import java.util.List;
/**
* 超市Mapper接口
*
* @author xsheng
* @date 2025-04-05
*/
public interface SupermarketInfoMapper {
/**
* 查询超市列表
*
* @param orderInfo 超市
* @return 超市集合
*/
public List<SupermarketInfo> selectSupermarketInfoList(SupermarketInfo orderInfo);
/**
* 新增超市
*
* @param orderInfo 超市
* @return 结果
*/
public int insertSupermarketInfo(SupermarketInfo orderInfo);
/**
* 修改超市
*
* @param orderInfo 超市
* @return 结果
*/
public int updateSupermarketInfo(SupermarketInfo orderInfo);
/**
* 删除超市
*
* @param supermarketInfo 超市主键
* @return 结果
*/
public int deleteSupermarketInfoBySupermarketId(SupermarketInfo supermarketInfo);
/**
* 批量删除超市
*
* @param orderIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteSupermarketInfoBySupermarketIds(Long[] orderIds);
}

View File

@ -0,0 +1,56 @@
package com.bonus.canteen.core.supermarket.mapper;
import com.bonus.canteen.core.supermarket.domain.SupermarketProduct;
import java.util.List;
/**
* 商品Mapper接口
*
* @author xsheng
* @date 2025-04-05
*/
public interface SupermarketProductMapper {
/**
* 查询商品列表
*
* @param productInfo 商品
* @return 商品集合
*/
public List<SupermarketProduct> selectSupermarketProductList(SupermarketProduct productInfo);
/**
* 新增商品
*
* @param productInfo 商品
* @return 结果
*/
public int insertSupermarketProduct(SupermarketProduct productInfo);
/**
* 修改商品
*
* @param productInfo 商品
* @return 结果
*/
public int updateSupermarketProduct(SupermarketProduct productInfo);
public int updateSupermarketProductState(SupermarketProduct productInfo);
/**
* 删除商品
*
* @param productId 商品主键
* @return 结果
*/
public int deleteSupermarketProductBySupermarketId(Long productId);
/**
* 批量删除商品
*
* @param productIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteSupermarketProductBySupermarketIds(String[] productIds);
}

View File

@ -0,0 +1,55 @@
package com.bonus.canteen.core.supermarket.mapper;
import com.bonus.canteen.core.supermarket.domain.SupermarketUnit;
import java.util.List;
/**
* 单位Mapper接口
*
* @author xsheng
* @date 2025-04-05
*/
public interface SupermarketUnitMapper {
/**
* 查询单位列表
*
* @param orderInfo 单位
* @return 单位集合
*/
public List<SupermarketUnit> selectSupermarketUnitList(SupermarketUnit orderInfo);
/**
* 新增单位
*
* @param orderInfo 单位
* @return 结果
*/
public int insertSupermarketUnit(SupermarketUnit orderInfo);
/**
* 修改单位
*
* @param orderInfo 单位
* @return 结果
*/
public int updateSupermarketUnit(SupermarketUnit orderInfo);
/**
* 删除单位
*
* @param orderId 单位主键
* @return 结果
*/
public int deleteSupermarketUnitBySupermarketId(Long orderId);
/**
* 批量删除单位
*
* @param orderIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteSupermarketUnitBySupermarketIds(Long[] orderIds);
}

View File

@ -0,0 +1,54 @@
package com.bonus.canteen.core.supermarket.service;
import com.bonus.canteen.core.supermarket.domain.SupermarketInfo;
import java.util.List;
/**
* 超市Service接口
*
* @author xsheng
* @date 2025-04-05
*/
public interface SupermarketInfoService {
/**
* 查询超市列表
*
* @param orderInfo 超市
* @return 超市集合
*/
public List<SupermarketInfo> selectSupermarketInfoList(SupermarketInfo orderInfo);
/**
* 新增超市
*
* @param orderInfo 超市
* @return 结果
*/
public int insertSupermarketInfo(SupermarketInfo orderInfo);
/**
* 修改超市
*
* @param orderInfo 超市
* @return 结果
*/
public int updateSupermarketInfo(SupermarketInfo orderInfo);
/**
* 批量删除超市
*
* @param orderIds 需要删除的超市主键集合
* @return 结果
*/
public int deleteSupermarketInfoBySupermarketIds(Long[] orderIds);
/**
* 删除超市信息
*
* @param orderId 超市主键
* @return 结果
*/
public int deleteSupermarketInfoBySupermarketId(SupermarketInfo supermarketInfo);
}

View File

@ -0,0 +1,56 @@
package com.bonus.canteen.core.supermarket.service;
import com.bonus.canteen.core.supermarket.domain.SupermarketProduct;
import java.util.List;
/**
* 商品Service接口
*
* @author xsheng
* @date 2025-04-05
*/
public interface SupermarketProductService {
/**
* 查询商品列表
*
* @param productInfo 商品
* @return 商品集合
*/
public List<SupermarketProduct> selectSupermarketProductList(SupermarketProduct productInfo);
/**
* 新增商品
*
* @param productInfo 商品
* @return 结果
*/
public int insertSupermarketProduct(SupermarketProduct productInfo);
/**
* 修改商品
*
* @param productInfo 商品
* @return 结果
*/
public int updateSupermarketProduct(SupermarketProduct productInfo);
public int updateSupermarketProductState(SupermarketProduct productInfo);
/**
* 批量删除商品
*
* @param productIds 需要删除的商品主键集合
* @return 结果
*/
public int deleteSupermarketProductByProductIds(SupermarketProduct productIds);
/**
* 删除商品信息
*
* @param productId 商品主键
* @return 结果
*/
public int deleteSupermarketProductByProductId(SupermarketProduct productId);
}

View File

@ -0,0 +1,54 @@
package com.bonus.canteen.core.supermarket.service;
import com.bonus.canteen.core.supermarket.domain.SupermarketUnit;
import java.util.List;
/**
* 单位Service接口
*
* @author xsheng
* @date 2025-04-05
*/
public interface SupermarketUnitService {
/**
* 查询单位列表
*
* @param orderInfo 单位
* @return 单位集合
*/
public List<SupermarketUnit> selectSupermarketUnitList(SupermarketUnit orderInfo);
/**
* 新增单位
*
* @param orderInfo 单位
* @return 结果
*/
public int insertSupermarketUnit(SupermarketUnit orderInfo);
/**
* 修改单位
*
* @param orderInfo 单位
* @return 结果
*/
public int updateSupermarketUnit(SupermarketUnit orderInfo);
/**
* 批量删除单位
*
* @param orderIds 需要删除的单位主键集合
* @return 结果
*/
public int deleteSupermarketUnitBySupermarketIds(Long[] orderIds);
/**
* 删除单位信息
*
* @param orderId 单位主键
* @return 结果
*/
public int deleteSupermarketUnitBySupermarketId(Long orderId);
}

View File

@ -0,0 +1,89 @@
package com.bonus.canteen.core.supermarket.service.impl;
import com.bonus.canteen.core.supermarket.domain.SupermarketInfo;
import com.bonus.canteen.core.supermarket.mapper.SupermarketInfoMapper;
import com.bonus.canteen.core.supermarket.service.SupermarketInfoService;
import com.bonus.common.core.exception.ServiceException;
import com.bonus.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 超市Service业务层处理
*
* @author xsheng
* @date 2025-04-05
*/
@Service
public class SupermarketInfoServiceImpl implements SupermarketInfoService {
@Autowired
private SupermarketInfoMapper supermarketInfoMapper;
/**
* 查询超市列表
*
* @param SupermarketInfo 超市
* @return 超市
*/
@Override
public List<SupermarketInfo> selectSupermarketInfoList(SupermarketInfo SupermarketInfo) {
return supermarketInfoMapper.selectSupermarketInfoList(SupermarketInfo);
}
/**
* 新增超市
*
* @param SupermarketInfo 超市
* @return 结果
*/
@Override
public int insertSupermarketInfo(SupermarketInfo supermarketInfo) {
supermarketInfo.setCreateTime(DateUtils.getNowDate());
supermarketInfo.setUpdateTime(DateUtils.getNowDate());
try {
return supermarketInfoMapper.insertSupermarketInfo(supermarketInfo);
} catch (Exception e) {
throw new ServiceException("错误信息描述");
}
}
/**
* 修改超市
*
* @param SupermarketInfo 超市
* @return 结果
*/
@Override
public int updateSupermarketInfo(SupermarketInfo SupermarketInfo) {
SupermarketInfo.setUpdateTime(DateUtils.getNowDate());
try {
return supermarketInfoMapper.updateSupermarketInfo(SupermarketInfo);
} catch (Exception e) {
throw new ServiceException("错误信息描述");
}
}
/**
* 批量删除超市
*
* @param SupermarketIds 需要删除的超市主键
* @return 结果
*/
@Override
public int deleteSupermarketInfoBySupermarketIds(Long[] SupermarketIds) {
return supermarketInfoMapper.deleteSupermarketInfoBySupermarketIds(SupermarketIds);
}
/**
* 删除超市信息
*
* @param supermarketInfo 超市主键
* @return 结果
*/
@Override
public int deleteSupermarketInfoBySupermarketId(SupermarketInfo supermarketInfo) {
return supermarketInfoMapper.deleteSupermarketInfoBySupermarketId(supermarketInfo);
}
}

View File

@ -0,0 +1,99 @@
package com.bonus.canteen.core.supermarket.service.impl;
import com.bonus.canteen.core.supermarket.domain.SupermarketProduct;
import com.bonus.canteen.core.supermarket.mapper.SupermarketProductMapper;
import com.bonus.canteen.core.supermarket.service.SupermarketProductService;
import com.bonus.common.core.exception.ServiceException;
import com.bonus.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 商品Service业务层处理
*
* @author xsheng
* @date 2025-04-05
*/
@Service
public class SupermarketProductServiceImpl implements SupermarketProductService {
@Autowired
private SupermarketProductMapper supermarketProductMapper;
/**
* 查询商品列表
*
* @param SupermarketProduct 商品
* @return 商品
*/
@Override
public List<SupermarketProduct> selectSupermarketProductList(SupermarketProduct SupermarketProduct) {
return supermarketProductMapper.selectSupermarketProductList(SupermarketProduct);
}
/**
* 新增商品
*
* @param SupermarketProduct 商品
* @return 结果
*/
@Override
public int insertSupermarketProduct(SupermarketProduct SupermarketProduct) {
SupermarketProduct.setCreateTime(DateUtils.getNowDate());
try {
return supermarketProductMapper.insertSupermarketProduct(SupermarketProduct);
} catch (Exception e) {
throw new ServiceException("错误信息描述");
}
}
/**
* 修改商品
*
* @param SupermarketProduct 商品
* @return 结果
*/
@Override
public int updateSupermarketProduct(SupermarketProduct SupermarketProduct) {
SupermarketProduct.setUpdateTime(DateUtils.getNowDate());
try {
return supermarketProductMapper.updateSupermarketProduct(SupermarketProduct);
} catch (Exception e) {
throw new ServiceException("错误信息描述");
}
}
@Override
public int updateSupermarketProductState(SupermarketProduct SupermarketProduct) {
SupermarketProduct.setUpdateTime(DateUtils.getNowDate());
try {
return supermarketProductMapper.updateSupermarketProductState(SupermarketProduct);
} catch (Exception e) {
throw new ServiceException("错误信息描述");
}
}
/**
* 批量删除商品
*
* @param productIds 需要删除的商品主键
* @return 结果
*/
@Override
public int deleteSupermarketProductByProductIds(SupermarketProduct productIds) {
String[] productIdsl=productIds.getProductId().split(",");
return supermarketProductMapper.deleteSupermarketProductBySupermarketIds(productIdsl);
}
/**
* 删除商品信息
*
* @param productId 商品主键
* @return 结果
*/
@Override
public int deleteSupermarketProductByProductId(SupermarketProduct productId) {
Long productIdl=Long.parseLong(productId.getProductId());
return supermarketProductMapper.deleteSupermarketProductBySupermarketId(productIdl);
}
}

View File

@ -0,0 +1,88 @@
package com.bonus.canteen.core.supermarket.service.impl;
import com.bonus.canteen.core.supermarket.domain.SupermarketUnit;
import com.bonus.canteen.core.supermarket.mapper.SupermarketUnitMapper;
import com.bonus.canteen.core.supermarket.service.SupermarketUnitService;
import com.bonus.common.core.exception.ServiceException;
import com.bonus.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 单位Service业务层处理
*
* @author xsheng
* @date 2025-04-05
*/
@Service
public class SupermarketUnitServiceImpl implements SupermarketUnitService {
@Autowired
private SupermarketUnitMapper supermarketUnitMapper;
/**
* 查询单位列表
*
* @param SupermarketUnit 单位
* @return 单位
*/
@Override
public List<SupermarketUnit> selectSupermarketUnitList(SupermarketUnit SupermarketUnit) {
return supermarketUnitMapper.selectSupermarketUnitList(SupermarketUnit);
}
/**
* 新增单位
*
* @param SupermarketUnit 单位
* @return 结果
*/
@Override
public int insertSupermarketUnit(SupermarketUnit SupermarketUnit) {
SupermarketUnit.setCreateTime(DateUtils.getNowDate());
try {
return supermarketUnitMapper.insertSupermarketUnit(SupermarketUnit);
} catch (Exception e) {
throw new ServiceException("错误信息描述");
}
}
/**
* 修改单位
*
* @param SupermarketUnit 单位
* @return 结果
*/
@Override
public int updateSupermarketUnit(SupermarketUnit SupermarketUnit) {
SupermarketUnit.setUpdateTime(DateUtils.getNowDate());
try {
return supermarketUnitMapper.updateSupermarketUnit(SupermarketUnit);
} catch (Exception e) {
throw new ServiceException("错误信息描述");
}
}
/**
* 批量删除单位
*
* @param SupermarketIds 需要删除的单位主键
* @return 结果
*/
@Override
public int deleteSupermarketUnitBySupermarketIds(Long[] SupermarketIds) {
return supermarketUnitMapper.deleteSupermarketUnitBySupermarketIds(SupermarketIds);
}
/**
* 删除单位信息
*
* @param SupermarketId 单位主键
* @return 结果
*/
@Override
public int deleteSupermarketUnitBySupermarketId(Long SupermarketId) {
return supermarketUnitMapper.deleteSupermarketUnitBySupermarketId(SupermarketId);
}
}

View File

@ -0,0 +1,85 @@
package com.bonus.canteen.core.warehouse.controller;
import com.bonus.canteen.core.warehouse.domain.WareHouseInfo;
import com.bonus.canteen.core.warehouse.service.WareHouseInfoService;
import com.bonus.common.core.web.controller.BaseController;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.common.core.web.page.TableDataInfo;
import com.bonus.common.log.annotation.SysLog;
import com.bonus.common.log.enums.OperaType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 仓库Controller
*
* @author xsheng
* @date 2025-04-05
*/
@Api(tags = "仓库接口")
@RestController
@RequestMapping("/warehouse_info")
public class WareHouseInfoController extends BaseController {
@Autowired
private WareHouseInfoService wareHouseInfoService;
/**
* 查询仓库列表
*/
@ApiOperation(value = "查询仓库列表")
@GetMapping("/list")
public TableDataInfo list(WareHouseInfo WareHouseInfo) {
startPage();
List<WareHouseInfo> list = wareHouseInfoService.selectWareHouseInfoList(WareHouseInfo);
return getDataTable(list);
}
/**
* 新增仓库
*/
@ApiOperation(value = "新增仓库")
//@PreventRepeatSubmit
//@RequiresPermissions("WareHouse:info:add")
@SysLog(title = "仓库", businessType = OperaType.INSERT, logType = 1,module = "商超管理->新增仓库")
@PostMapping("/add")
public AjaxResult add(@RequestBody WareHouseInfo WareHouseInfo) {
try {
return toAjax(wareHouseInfoService.insertWareHouseInfo(WareHouseInfo));
} catch (Exception e) {
return error("系统错误, " + e.getMessage());
}
}
/**
* 修改仓库
*/
@ApiOperation(value = "修改仓库")
//@PreventRepeatSubmit
//@RequiresPermissions("WareHouse:info:edit")
@SysLog(title = "仓库", businessType = OperaType.UPDATE, logType = 1,module = "商超管理->修改仓库")
@PostMapping("/edit")
public AjaxResult edit(@RequestBody WareHouseInfo WareHouseInfo) {
try {
return toAjax(wareHouseInfoService.updateWareHouseInfo(WareHouseInfo));
} catch (Exception e) {
return error("系统错误, " + e.getMessage());
}
}
/**
* 删除仓库
*/
@ApiOperation(value = "删除仓库")
//@PreventRepeatSubmit
//@RequiresPermissions("WareHouse:info:remove")
@SysLog(title = "仓库", businessType = OperaType.DELETE, logType = 1,module = "商超管理->删除仓库")
@PostMapping("/del")
public AjaxResult remove(@PathVariable Long WareHouseId) {
return toAjax(wareHouseInfoService.deleteWareHouseInfoByWareHouseId(WareHouseId));
}
}

View File

@ -0,0 +1,42 @@
package com.bonus.canteen.core.warehouse.domain;
import com.bonus.common.core.web.domain.BaseEntity;
import lombok.Data;
import lombok.ToString;
/**
* 超市对象 orderInfo
*
* @author xsheng
* @date 2025-04-05
*/
@Data
@ToString
public class WareHouseInfo extends BaseEntity {
private static final long serialVersionUID = 1L;
private String warehouseId ;
private String warehouseNum ;
private String warehouseName ;
private String userId ;
private String regionProvince ;
private String regionCity ;
private String regionDistrict ;
private String address ;
private String warehouseType ;
private String status ;
private String delFlag ;
private String typeId ;
private String areaId ;
private String revision ;
private String createBy ;
private String updateBy ;
private String ifUseWarehouseArea ;
private String ifUseWarehouseLocation;
private String parentId ;
private String canteenId ;
private String fetchUserId ;
}

View File

@ -0,0 +1,55 @@
package com.bonus.canteen.core.warehouse.mapper;
import com.bonus.canteen.core.warehouse.domain.WareHouseInfo;
import java.util.List;
/**
* 仓库Mapper接口
*
* @author xsheng
* @date 2025-04-05
*/
public interface WareHouseInfoMapper {
/**
* 查询仓库列表
*
* @param wareHouseInfo 仓库
* @return 仓库集合
*/
public List<WareHouseInfo> selectWareHouseInfoList(WareHouseInfo wareHouseInfo);
/**
* 新增仓库
*
* @param wareHouseInfo 仓库
* @return 结果
*/
public int insertWareHouseInfo(WareHouseInfo wareHouseInfo);
/**
* 修改仓库
*
* @param wareHouseInfo 仓库
* @return 结果
*/
public int updateWareHouseInfo(WareHouseInfo wareHouseInfo);
/**
* 删除仓库
*
* @param wareHouseId 仓库主键
* @return 结果
*/
public int deleteWareHouseInfoByWareHouseId(Long wareHouseId);
/**
* 批量删除仓库
*
* @param wareHouseIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteWareHouseInfoByWareHouseIds(Long[] wareHouseIds);
}

View File

@ -0,0 +1,54 @@
package com.bonus.canteen.core.warehouse.service;
import com.bonus.canteen.core.warehouse.domain.WareHouseInfo;
import java.util.List;
/**
* 仓库Service接口
*
* @author xsheng
* @date 2025-04-05
*/
public interface WareHouseInfoService {
/**
* 查询仓库列表
*
* @param wareHouseInfo 仓库
* @return 仓库集合
*/
public List<WareHouseInfo> selectWareHouseInfoList(WareHouseInfo wareHouseInfo);
/**
* 新增仓库
*
* @param wareHouseInfo 仓库
* @return 结果
*/
public int insertWareHouseInfo(WareHouseInfo wareHouseInfo);
/**
* 修改仓库
*
* @param wareHouseInfo 仓库
* @return 结果
*/
public int updateWareHouseInfo(WareHouseInfo wareHouseInfo);
/**
* 批量删除仓库
*
* @param wareHouseIds 需要删除的仓库主键集合
* @return 结果
*/
public int deleteWareHouseInfoByWareHouseIds(Long[] wareHouseIds);
/**
* 删除仓库信息
*
* @param wareHouseId 仓库主键
* @return 结果
*/
public int deleteWareHouseInfoByWareHouseId(Long wareHouseId);
}

View File

@ -0,0 +1,88 @@
package com.bonus.canteen.core.warehouse.service.impl;
import com.bonus.canteen.core.warehouse.domain.WareHouseInfo;
import com.bonus.canteen.core.warehouse.mapper.WareHouseInfoMapper;
import com.bonus.canteen.core.warehouse.service.WareHouseInfoService;
import com.bonus.common.core.exception.ServiceException;
import com.bonus.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 仓库Service业务层处理
*
* @author xsheng
* @date 2025-04-05
*/
@Service
public class WareHouseInfoServiceImpl implements WareHouseInfoService {
@Autowired
private WareHouseInfoMapper wareHouseInfoMapper;
/**
* 查询仓库列表
*
* @param WareHouseInfo 仓库
* @return 仓库
*/
@Override
public List<WareHouseInfo> selectWareHouseInfoList(WareHouseInfo WareHouseInfo) {
return wareHouseInfoMapper.selectWareHouseInfoList(WareHouseInfo);
}
/**
* 新增仓库
*
* @param WareHouseInfo 仓库
* @return 结果
*/
@Override
public int insertWareHouseInfo(WareHouseInfo WareHouseInfo) {
WareHouseInfo.setCreateTime(DateUtils.getNowDate());
try {
return wareHouseInfoMapper.insertWareHouseInfo(WareHouseInfo);
} catch (Exception e) {
throw new ServiceException("错误信息描述");
}
}
/**
* 修改仓库
*
* @param WareHouseInfo 仓库
* @return 结果
*/
@Override
public int updateWareHouseInfo(WareHouseInfo WareHouseInfo) {
WareHouseInfo.setUpdateTime(DateUtils.getNowDate());
try {
return wareHouseInfoMapper.updateWareHouseInfo(WareHouseInfo);
} catch (Exception e) {
throw new ServiceException("错误信息描述");
}
}
/**
* 批量删除仓库
*
* @param WareHouseIds 需要删除的仓库主键
* @return 结果
*/
@Override
public int deleteWareHouseInfoByWareHouseIds(Long[] WareHouseIds) {
return wareHouseInfoMapper.deleteWareHouseInfoByWareHouseIds(WareHouseIds);
}
/**
* 删除仓库信息
*
* @param WareHouseId 仓库主键
* @return 结果
*/
@Override
public int deleteWareHouseInfoByWareHouseId(Long WareHouseId) {
return wareHouseInfoMapper.deleteWareHouseInfoByWareHouseId(WareHouseId);
}
}

View File

@ -0,0 +1,156 @@
<?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.bonus.canteen.core.supermarket.mapper.SupermarketInfoMapper">
<resultMap type="com.bonus.canteen.core.supermarket.domain.SupermarketInfo" id="SupermarketInfoResult">
<result property="supermarketId" column="supermarket_id" />
<result property="supermarketName" column="supermarket_name" />
<result property="userId" column="user_id" />
<result property="mobile" column="mobile" />
<result property="warehouseId" column="warehouse_id" />
<result property="address" column="address" />
<result property="imgUrl" column="img_url" />
<result property="ifPrintNow" column="if_print_now" />
<result property="appSaleMode" column="app_sale_mode" />
<result property="minDeliveryTime" column="min_delivery_time" />
<result property="selectTimeInterval" column="select_time_interval" />
<result property="deliveryCost" column="delivery_cost" />
<result property="autoVerifyDay" column="auto_verify_day" />
<result property="deliveryWay" column="delivery_way" />
<result property="refundLimitTime" column="refund_limit_time" />
<result property="ifRelateDrp" column="if_relate_drp" />
<result property="effId" column="eff_id" />
<result property="mealCode" column="meal_code" />
<result property="areaId" column="area_id" />
<result property="delFlag" column="del_flag" />
<result property="revision" column="revision" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="ifEnablePayCode" column="if_enable_pay_code" />
<result property="payCodeUrl" column="pay_code_url" />
</resultMap>
<sql id="selectSupermarketInfoVo">
select supermarket_id,supermarket_name,user_id,mobile,warehouse_id,address,img_url,if_print_now,app_sale_mode,min_delivery_time,select_time_interval,delivery_cost,auto_verify_day,delivery_way,refund_limit_time,if_relate_drp,eff_id,meal_code,area_id,del_flag,revision,create_by,create_time,update_by,update_time,if_enable_pay_code,pay_code_url from supermarket_info
</sql>
<select id="selectSupermarketInfoList" parameterType="com.bonus.canteen.core.supermarket.domain.SupermarketInfo" resultType="com.bonus.canteen.core.supermarket.domain.SupermarketInfo">
select aa.area_name as areaname,whi.warehouse_name as warehousename,super.warehouse_id as warehouseid,super.supermarket_name as supermarketname,super.app_sale_mode as appsalemode
,super.address,super.img_url,super.mobile,super.user_id as userid,su.user_name as username,super.update_time as updatetime
from supermarket_info super
left join alloc_area aa on super.area_id=aa.area_id
left join warehouse_info whi on super.warehouse_id=whi.warehouse_id
left join sys_user su on super.user_id=su.user_id
<where>
<if test="areaId != null and areaId != ''"> and super.area_id = #{areaId}</if>
<if test="warehouseId != null and warehouseId != ''"> and super.warehouse_id = #{warehouseId}</if>
</where>
</select>
<insert id="insertSupermarketInfo" parameterType="com.bonus.canteen.core.supermarket.domain.SupermarketInfo">
insert into supermarket_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="supermarketName !=null and supermarketName != '' " >supermarket_name, </if>
<if test="userId !=null and userId != '' " >user_id, </if>
<if test="mobile !=null and mobile != '' " >mobile, </if>
<if test="warehouseId !=null and warehouseId != '' " >warehouse_id, </if>
<if test="address !=null and address != '' " >address, </if>
<if test="imgUrl !=null and imgUrl != '' " >img_url, </if>
<if test="ifPrintNow !=null and ifPrintNow != '' " >if_print_now, </if>
<if test="appSaleMode !=null and appSaleMode != '' " >app_sale_mode, </if>
<if test="minDeliveryTime !=null and minDeliveryTime != '' " >min_delivery_time, </if>
<if test="selectTimeInterval !=null and selectTimeInterval != '' " >select_time_interval, </if>
<if test="deliveryCost !=null and deliveryCost != '' " >delivery_cost, </if>
<if test="autoVerifyDay !=null and autoVerifyDay != '' " >auto_verify_day, </if>
<if test="deliveryWay !=null and deliveryWay != '' " >delivery_way, </if>
<if test="refundLimitTime !=null and refundLimitTime != '' " >refund_limit_time, </if>
<if test="ifRelateDrp !=null and ifRelateDrp != '' " >if_relate_drp, </if>
<if test="effId !=null and effId != '' " >eff_id, </if>
<if test="mealCode !=null and mealCode != '' " >meal_code, </if>
<if test="areaId !=null and areaId != '' " >area_id, </if>
<if test="delFlag !=null and delFlag != '' " >del_flag, </if>
<if test="revision !=null and revision != '' " >revision, </if>
<if test="createBy !=null and createBy != '' " >create_by, </if>
<if test="createTime !=null and createTime != '' " >create_time, </if>
<if test="updateBy !=null and updateBy != '' " >update_by, </if>
<if test="updateTime !=null and updateTime != '' " >update_time, </if>
<if test="ifEnablePayCode !=null and ifEnablePayCode != '' " >if_enable_pay_code, </if>
<if test="payCodeUrl !=null and payCodeUrl != '' " >pay_code_url, </if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="supermarketName !=null and supermarketName != '' " >#{supermarketName },</if>
<if test="userId !=null and userId != '' " >#{userId },</if>
<if test="mobile !=null and mobile != '' " >#{mobile },</if>
<if test="warehouseId !=null and warehouseId != '' " >#{warehouseId },</if>
<if test="address !=null and address != '' " >#{address },</if>
<if test="imgUrl !=null and imgUrl != '' " >#{imgUrl },</if>
<if test="ifPrintNow !=null and ifPrintNow != '' " >#{ifPrintNow },</if>
<if test="appSaleMode !=null and appSaleMode != '' " >#{appSaleMode },</if>
<if test="minDeliveryTime !=null and minDeliveryTime != '' " >#{minDeliveryTime },</if>
<if test="selectTimeInterval !=null and selectTimeInterval != '' " >#{selectTimeInterval},</if>
<if test="deliveryCost !=null and deliveryCost != '' " >#{deliveryCost },</if>
<if test="autoVerifyDay !=null and autoVerifyDay != '' " >#{autoVerifyDay },</if>
<if test="deliveryWay !=null and deliveryWay != '' " >#{deliveryWay },</if>
<if test="refundLimitTime !=null and refundLimitTime != '' " >#{refundLimitTime },</if>
<if test="ifRelateDrp !=null and ifRelateDrp != '' " >#{ifRelateDrp },</if>
<if test="effId !=null and effId != '' " >#{effId },</if>
<if test="mealCode !=null and mealCode != '' " >#{mealCode },</if>
<if test="areaId !=null and areaId != '' " >#{areaId },</if>
<if test="delFlag !=null and delFlag != '' " >#{delFlag },</if>
<if test="revision !=null and revision != '' " >#{revision },</if>
<if test="createBy !=null and createBy != '' " >#{createBy },</if>
<if test="createTime !=null and createTime != '' " >#{createTime },</if>
<if test="updateBy !=null and updateBy != '' " >#{updateBy },</if>
<if test="updateTime !=null and updateTime != '' " >#{updateTime },</if>
<if test="ifEnablePayCode !=null and ifEnablePayCode != '' " >#{ifEnablePayCode },</if>
<if test="payCodeUrl !=null and payCodeUrl != '' " >#{payCodeUrl },</if>
</trim>
</insert>
<update id="updateSupermarketInfo" parameterType="com.bonus.canteen.core.supermarket.domain.SupermarketInfo">
update supermarket_info
<trim prefix="SET" suffixOverrides=",">
<if test="supermarketName !=null and supermarketName != '' " >supermarket_name =#{supermarketName },</if>
<if test="userId !=null and userId != '' " >user_id =#{userId },</if>
<if test="mobile !=null and mobile != '' " >mobile =#{mobile },</if>
<if test="warehouseId !=null and warehouseId != '' " >warehouse_id =#{warehouseId },</if>
<if test="address !=null and address != '' " >address =#{address },</if>
<if test="imgUrl !=null and imgUrl != '' " >img_url =#{imgUrl },</if>
<if test="ifPrintNow !=null and ifPrintNow != '' " >if_print_now =#{ifPrintNow },</if>
<if test="appSaleMode !=null and appSaleMode != '' " >app_sale_mode =#{appSaleMode },</if>
<if test="minDeliveryTime !=null and minDeliveryTime != '' " >min_delivery_time =#{minDeliveryTime },</if>
<if test="selectTimeInterval !=null and selectTimeInterval != '' " >select_time_interval=#{selectTimeInterval},</if>
<if test="deliveryCost !=null and deliveryCost != '' " >delivery_cost =#{deliveryCost },</if>
<if test="autoVerifyDay !=null and autoVerifyDay != '' " >auto_verify_day =#{autoVerifyDay },</if>
<if test="deliveryWay !=null and deliveryWay != '' " >delivery_way =#{deliveryWay },</if>
<if test="refundLimitTime !=null and refundLimitTime != '' " >refund_limit_time =#{refundLimitTime },</if>
<if test="ifRelateDrp !=null and ifRelateDrp != '' " >if_relate_drp =#{ifRelateDrp },</if>
<if test="effId !=null and effId != '' " >eff_id =#{effId },</if>
<if test="mealCode !=null and mealCode != '' " >meal_code =#{mealCode },</if>
<if test="areaId !=null and areaId != '' " >area_id =#{areaId },</if>
<if test="delFlag !=null and delFlag != '' " >del_flag =#{delFlag },</if>
<if test="revision !=null and revision != '' " >revision =#{revision },</if>
<if test="createBy !=null and createBy != '' " >create_by =#{createBy },</if>
<if test="createTime !=null and createTime != '' " >create_time =#{createTime },</if>
<if test="updateBy !=null and updateBy != '' " >update_by =#{updateBy },</if>
<if test="updateTime !=null and updateTime != '' " >update_time =#{updateTime },</if>
<if test="ifEnablePayCode !=null and ifEnablePayCode != '' " >if_enable_pay_code =#{ifEnablePayCode },</if>
<if test="payCodeUrl !=null and payCodeUrl != '' " >pay_code_url =#{payCodeUrl },</if>
</trim>
where supermarket_id = #{supermarketId}
</update>
<delete id="deleteSupermarketInfoBySupermarketId" parameterType="com.bonus.canteen.core.supermarket.domain.SupermarketInfo">
delete from supermarket_info where supermarket_id = #{supermarketId}
</delete>
<delete id="deleteSupermarketInfoBySupermarketIds" parameterType="String">
delete from supermarket_info where supermarket_id in
<foreach item="orderId" collection="array" open="(" separator="," close=")">
#{supermarketId}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,160 @@
<?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.bonus.canteen.core.supermarket.mapper.SupermarketProductMapper">
<resultMap type="com.bonus.canteen.core.supermarket.domain.SupermarketProduct" id="SupermarketProductResult">
<result property="productId" column="product_id" />
<result property="supermarketId" column="supermarket_id" />
<result property="productName" column="product_name" />
<result property="barCode" column="bar_code" />
<result property="salePrice" column="sale_price" />
<result property="salesMode" column="sales_mode" />
<result property="areaId" column="area_id" />
<result property="unitId" column="unit_id" />
<result property="materialId" column="material_id" />
<result property="prefPrice" column="pref_price" />
<result property="qualityType" column="quality_type" />
<result property="qualityNum" column="quality_num" />
<result property="supplyCertificate" column="supply_certificate" />
<result property="productRemark" column="product_remark" />
<result property="putawayState" column="putaway_state" />
<result property="ifOnline" column="if_online" />
<result property="personLimit" column="person_limit" />
<result property="oneDayLimit" column="one_day_limit" />
<result property="imgUrl" column="img_url" />
<result property="inventoryNum" column="inventory_num" />
<result property="revision" column="revision" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="productCode" column="product_code" />
</resultMap>
<sql id="selectSupermarketProductVo">
select id,supermarket_id,product_name,bar_code,sale_price,sales_mode,area_id,unit_id,material_id,pref_price,quality_type,quality_num,supply_certificate,product_remark,putaway_state,if_online,person_limit,one_day_limit,img_url,inventory_num,revision,create_by,create_time,update_by,update_time from supermarket_product
</sql>
<select id="selectSupermarketProductList" parameterType="com.bonus.canteen.core.supermarket.domain.SupermarketProduct" resultType="com.bonus.canteen.core.supermarket.domain.SupermarketProduct">
select sp.product_id as productId,sp.supermarket_id as supermarketid,sp.product_name as productname,sp.bar_code as barcode,sp.sale_price as saleprice,sp.sales_mode as salesmode,
sp.area_id as areaid,aa.area_name as areaname,sp.unit_id as unitid,sp.product_type as producttype,sp.pref_price as prefprice,sp.quality_type as qualitytype,sp.quality_num as qualitynum,
sp.supply_certificate as supplycertificate,sp.product_remark as productremark,sp.putaway_state as putawaystate,sp.if_online as ifonline,sp.person_limit as personlimit,sp.one_day_limit as onedaylimit,sp.img_url as imgurl,sp.inventory_num as inventorynum,sp.revision,sp.create_by as createby,sp.create_time as createtime,sp.update_by as updateby,sp.update_time as updatetime,sp.product_code as productcode
from supermarket_product sp
left join alloc_area aa on sp.area_id=aa.area_id
<where>
<if test="productType != null and productType != ''"> and sp.product_type = #{productType}</if>
<if test="areaId != null and areaId != ''"> and sp.area_id = #{areaId}</if>
<if test="productName != null and productName != ''"> and sp.product_name like concat('%', #{productName}, '%')</if>
<if test="barCode != null and barCode != ''"> and sp.bar_code like concat('%', #{barCode}, '%')</if>
<if test="productCode != null and productCode != ''"> and sp.product_code like concat('%', #{productCode}, '%')</if>
</where>
</select>
<insert id="insertSupermarketProduct" parameterType="com.bonus.canteen.core.supermarket.domain.SupermarketProduct">
insert into supermarket_product
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="supermarketId !=null and supermarketId != '' " >supermarket_id , </if>
<if test="productName !=null and productName != '' " >product_name , </if>
<if test="barCode !=null and barCode != '' " >bar_code , </if>
<if test="salePrice !=null and salePrice != '' " >sale_price , </if>
<if test="salesMode !=null and salesMode != '' " >sales_mode , </if>
<if test="areaId !=null and areaId != '' " >area_id , </if>
<if test="unitId !=null and unitId != '' " >unit_id , </if>
<if test="productType !=null and productType != '' " >product_type , </if>
<if test="prefPrice !=null and prefPrice != '' " >pref_price , </if>
<if test="qualityType !=null and qualityType != '' " >quality_type , </if>
<if test="qualityNum !=null and qualityNum != '' " >quality_num , </if>
<if test="supplyCertificate!=null and supplyCertificate != '' " >supply_certificate, </if>
<if test="productRemark !=null and productRemark != '' " >product_remark , </if>
<if test="putawayState !=null and putawayState != '' " >putaway_state , </if>
<if test="ifOnline !=null and ifOnline != '' " >if_online , </if>
<if test="personLimit !=null and personLimit != '' " >person_limit , </if>
<if test="oneDayLimit !=null and oneDayLimit != '' " >one_day_limit , </if>
<if test="imgUrl !=null and imgUrl != '' " >img_url , </if>
<if test="inventoryNum !=null and inventoryNum != '' " >inventory_num , </if>
<if test="revision !=null and revision != '' " >revision , </if>
<if test="createBy !=null and createBy != '' " >create_by , </if>
<if test="createTime !=null and createTime != '' " >create_time , </if>
<if test="updateBy !=null and updateBy != '' " >update_by , </if>
<if test="updateTime !=null and updateTime != '' " >update_time , </if>
<if test="productCode !=null and productCode != '' " >product_code , </if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="supermarketId !=null and supermarketId != '' " >#{supermarketId },</if>
<if test="productName !=null and productName != '' " >#{productName },</if>
<if test="barCode !=null and barCode != '' " >#{barCode },</if>
<if test="salePrice !=null and salePrice != '' " >#{salePrice },</if>
<if test="salesMode !=null and salesMode != '' " >#{salesMode },</if>
<if test="areaId !=null and areaId != '' " >#{areaId },</if>
<if test="unitId !=null and unitId != '' " >#{unitId },</if>
<if test="productType !=null and productType != '' " >#{productType },</if>
<if test="prefPrice !=null and prefPrice != '' " >#{prefPrice },</if>
<if test="qualityType !=null and qualityType != '' " >#{qualityType },</if>
<if test="qualityNum !=null and qualityNum != '' " >#{qualityNum },</if>
<if test="supplyCertificate!=null and supplyCertificate != '' " >#{supplyCertificate},</if>
<if test="productRemark !=null and productRemark != '' " >#{productRemark },</if>
<if test="putawayState !=null and putawayState != '' " >#{putawayState },</if>
<if test="ifOnline !=null and ifOnline != '' " >#{ifOnline },</if>
<if test="personLimit !=null and personLimit != '' " >#{personLimit },</if>
<if test="oneDayLimit !=null and oneDayLimit != '' " >#{oneDayLimit },</if>
<if test="imgUrl !=null and imgUrl != '' " >#{imgUrl },</if>
<if test="inventoryNum !=null and inventoryNum != '' " >#{inventoryNum },</if>
<if test="revision !=null and revision != '' " >#{revision },</if>
<if test="createBy !=null and createBy != '' " >#{createBy },</if>
<if test="createTime !=null and createTime != '' " >#{createTime },</if>
<if test="updateBy !=null and updateBy != '' " >#{updateBy },</if>
<if test="updateTime !=null and updateTime != '' " >#{updateTime },</if>
<if test="productCode !=null and productCode != '' " >#{productCode },</if>
</trim>
</insert>
<update id="updateSupermarketProduct" parameterType="com.bonus.canteen.core.supermarket.domain.SupermarketProduct">
update supermarket_product
<trim prefix="SET" suffixOverrides=",">
<if test="supermarketId !=null and supermarketId != '' " >supermarket_id =#{supermarketId },</if>
<if test="productName !=null and productName != '' " >product_name =#{productName },</if>
<if test="barCode !=null and barCode != '' " >bar_code =#{barCode },</if>
<if test="salePrice !=null and salePrice != '' " >sale_price =#{salePrice },</if>
<if test="salesMode !=null and salesMode != '' " >sales_mode =#{salesMode },</if>
<if test="areaId !=null and areaId != '' " >area_id =#{areaId },</if>
<if test="unitId !=null and unitId != '' " >unit_id =#{unitId },</if>
<if test="productType !=null and productType != '' " >product_type =#{productType },</if>
<if test="prefPrice !=null and prefPrice != '' " >pref_price =#{prefPrice },</if>
<if test="qualityType !=null and qualityType != '' " >quality_type =#{qualityType },</if>
<if test="qualityNum !=null and qualityNum != '' " >quality_num =#{qualityNum },</if>
<if test="supplyCertificate!=null and supplyCertificate != '' " >supply_certificate=#{supplyCertificate},</if>
<if test="productRemark !=null and productRemark != '' " >product_remark =#{productRemark },</if>
<if test="putawayState !=null and putawayState != '' " >putaway_state =#{putawayState },</if>
<if test="ifOnline !=null and ifOnline != '' " >if_online =#{ifOnline },</if>
<if test="personLimit !=null and personLimit != '' " >person_limit =#{personLimit },</if>
<if test="oneDayLimit !=null and oneDayLimit != '' " >one_day_limit =#{oneDayLimit },</if>
<if test="imgUrl !=null and imgUrl != '' " >img_url =#{imgUrl },</if>
<if test="inventoryNum !=null and inventoryNum != '' " >inventory_num =#{inventoryNum },</if>
<if test="revision !=null and revision != '' " >revision =#{revision },</if>
<if test="createBy !=null and createBy != '' " >create_by =#{createBy },</if>
<if test="createTime !=null and createTime != '' " >create_time =#{createTime },</if>
<if test="updateBy !=null and updateBy != '' " >update_by =#{updateBy },</if>
<if test="updateTime !=null and updateTime != '' " >update_time =#{updateTime },</if>
<if test="productCode !=null and productCode != '' " >product_code =#{productCode },</if>
</trim>
where product_id = #{productId}
</update>
<update id="updateSupermarketProductState" parameterType="com.bonus.canteen.core.supermarket.domain.SupermarketProduct">
update supermarket_product
<trim prefix="SET" suffixOverrides=",">
<if test="state !=null and state != '' " >state =#{state},</if>
</trim>
where product_id = #{productId}
</update>
<delete id="deleteSupermarketProductBySupermarketId" parameterType="Long">
delete from supermarket_product where product_id = #{productId}
</delete>
<delete id="deleteSupermarketProductBySupermarketIds" parameterType="String">
delete from supermarket_product where product_id in
<foreach item="productId" collection="array" open="(" separator="," close=")">
#{productId}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,91 @@
<?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.bonus.canteen.core.supermarket.mapper.SupermarketUnitMapper">
<resultMap type="com.bonus.canteen.core.supermarket.domain.SupermarketUnit" id="SupermarketUnitResult">
<result property="id" column="id" />
<result property="areaId" column="area_id" />
<result property="unitId" column="unit_id" />
<result property="unitName" column="unit_name" />
<result property="rate" column="rate" />
<result property="weighType" column="weigh_type" />
<result property="delFlag" column="del_flag" />
<result property="revision" column="revision" />
<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="selectSupermarketUnitVo">
select area_id,unit_id,unit_name,rate,weigh_type,del_flag,revision,create_by,create_time,update_by,update_time from supermarket_unit
</sql>
<select id="selectSupermarketUnitList" parameterType="com.bonus.canteen.core.supermarket.domain.SupermarketUnit" resultMap="SupermarketUnitResult">
select su.unit_id as unitid,su.area_id as areaid,aa.area_name as areaname,su.unit_name as unitname,su.rate,su.weigh_type as weightype,su.del_flag as delflag,
su.revision,su.create_by as createby,su.create_time as createtime,su.update_by as updateby,su.update_time as updatetime
from supermarket_unit su
left join alloc_area aa on su.area_id=aa.area_id
<where>
<if test="areaId != null and areaId != ''"> and su.area_id = #{areaId}</if>
<if test="unitName != null and unitName != ''"> and aa.unit_name like concat('%', #{unitName}, '%')</if>
</where>
</select>
<insert id="insertSupermarketUnit" parameterType="com.bonus.canteen.core.supermarket.domain.SupermarketUnit">
insert into supermarket_unit
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="areaId !=null" >area_id , </if>
<if test="unitName !=null" >unit_name , </if>
<if test="rate !=null" >rate , </if>
<if test="weighType !=null" >weigh_type , </if>
<if test="delFlag !=null" >del_flag , </if>
<if test="revision !=null" >revision , </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="areaId !=null" >#{areaId },</if>
<if test="unitName !=null" >#{unitName },</if>
<if test="rate !=null" >#{rate },</if>
<if test="weighType !=null" >#{weighType },</if>
<if test="delFlag !=null" >#{delFlag },</if>
<if test="revision !=null" >#{revision },</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="updateSupermarketUnit" parameterType="com.bonus.canteen.core.supermarket.domain.SupermarketUnit">
update supermarket_unit
<trim prefix="SET" suffixOverrides=",">
<if test="areaId !=null" >area_id =#{areaId },</if>
<if test="unitName !=null" >unit_name =#{unitName },</if>
<if test="rate !=null" >rate =#{rate },</if>
<if test="weighType !=null" >weigh_type =#{weighType },</if>
<if test="delFlag !=null" >del_flag =#{delFlag },</if>
<if test="revision !=null" >revision =#{revision },</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" >updateTime =#{updateTime},</if>
</trim>
where unit_id = #{unitId}
</update>
<delete id="deleteSupermarketUnitBySupermarketId" parameterType="Long">
delete from supermarket_unit where unit_id = #{unitId}
</delete>
<delete id="deleteSupermarketUnitBySupermarketIds" parameterType="String">
delete from supermarket_unit where unit_id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,145 @@
<?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.bonus.canteen.core.warehouse.mapper.WareHouseInfoMapper">
<resultMap type="com.bonus.canteen.core.warehouse.domain.WareHouseInfo" id="WareHouseInfoResult">
<result property="warehouseId" column="warehouse_id" />
<result property="warehouseNum" column="warehouse_num" />
<result property="warehouseName" column="warehouse_name" />
<result property="userId" column="user_id" />
<result property="regionProvince" column="region_province" />
<result property="regionCity" column="region_city" />
<result property="regionDistrict" column="region_district" />
<result property="address" column="address" />
<result property="warehouseType" column="warehouse_type" />
<result property="status" column="status" />
<result property="delFlag" column="del_flag" />
<result property="typeId" column="type_id" />
<result property="areaId" column="area_id" />
<result property="revision" column="revision" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="ifUseWarehouseArea" column="if_use_warehouse_area" />
<result property="ifUseWarehouseLocation" column="if_use_warehouse_location" />
<result property="parentId" column="parent_id" />
<result property="canteenId" column="canteen_id" />
<result property="fetchUserId" column="fetch_user_id" />
</resultMap>
<sql id="selectWareHouseInfoVo">
select warehouse_id,warehouse_num,warehouse_name,user_id,region_province,region_city,region_district,address,warehouse_type,status,del_flag,type_id,area_id,revision,create_by,create_time,update_by,update_time,if_use_warehouse_area,if_use_warehouse_location,parent_id,canteen_id,fetch_user_id from warehouse_info
</sql>
<select id="selectWareHouseInfoList" parameterType="com.bonus.canteen.core.warehouse.domain.WareHouseInfo" resultType="com.bonus.canteen.core.warehouse.domain.WareHouseInfo">
select wh.warehouse_id as warehouseid,wh.warehouse_num as warehousenum,wh.warehouse_name as warehousename,wh.user_id as userid,wh.region_province as regionprovince,
wh.region_city as regioncity,wh.region_district as regiondistrict,wh.address,wh.warehouse_type as warehousetype,wh.status,wh.del_flag as delflag,
wh.type_id as typeid,wh.area_id as areaid,aa.area_name as areaname,wh.revision,wh.create_by as createby,wh.create_time as createtime,wh.update_by as updateby,wh.update_time as updatetime,
wh.if_use_warehouse_area as ifusewarehousearea,wh.if_use_warehouse_location as ifusewarehouselocation
,wh.parent_id as parentid,wh.canteen_id as canteenid,ac.canteen_name as canteenname,wh.fetch_user_id,su.user_name as username
from warehouse_info wh
left join alloc_area aa on wh.area_id=aa.area_id
left join alloc_canteen ac on wh.canteen_id=ac.canteen_id
left join sys_user su on wh.fetch_user_id=su.user_id
<where>
<if test="areaId != null and areaId != ''"> and wh.area_id = #{areaId}</if>
<if test="warehouseName != null and warehouseName != ''"> and wh.warehouse_name like concat('%', #{warehouseName}, '%')</if>
<if test="userName != null and userName != ''"> and su.user_name like concat('%', #{userName}, '%')</if>
</where>
</select>
<insert id="insertWareHouseInfo" parameterType="com.bonus.canteen.core.warehouse.domain.WareHouseInfo">
insert into warehouse_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="warehouseNum !=null" >warehouse_num , </if>
<if test="warehouseName !=null" >warehouse_name , </if>
<if test="userId !=null" >user_id , </if>
<if test="userType !=null" >user_type , </if>
<if test="regionProvince !=null" >region_province , </if>
<if test="regionCity !=null" >region_city , </if>
<if test="regionDistrict !=null" >region_district , </if>
<if test="address !=null" >address , </if>
<if test="warehouseType !=null" >warehouse_type , </if>
<if test="status !=null" >status , </if>
<if test="delFlag !=null" >del_flag , </if>
<if test="typeId !=null" >type_id , </if>
<if test="areaId !=null" >area_id , </if>
<if test="revision !=null" >revision , </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>
<if test="ifUseWarehouseArea !=null" >if_use_warehouse_area , </if>
<if test="ifUseWarehouseLocation!=null" >if_use_warehouse_location, </if>
<if test="parentId !=null" >parent_id , </if>
<if test="canteenId !=null" >canteen_id , </if>
<if test="fetchUserId !=null" >fetch_user_id , </if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="warehouseNum !=null" >#{warehouseNum },</if>
<if test="warehouseName !=null" >#{warehouseName },</if>
<if test="userId !=null" >#{userId },</if>
<if test="userType !=null" >#{userType },</if>
<if test="regionProvince !=null" >#{regionProvince },</if>
<if test="regionCity !=null" >#{regionCity },</if>
<if test="regionDistrict !=null" >#{regionDistrict },</if>
<if test="address !=null" >#{address },</if>
<if test="warehouseType !=null" >#{warehouseType },</if>
<if test="status !=null" >#{status },</if>
<if test="delFlag !=null" >#{delFlag },</if>
<if test="typeId !=null" >#{typeId },</if>
<if test="areaId !=null" >#{areaId },</if>
<if test="revision !=null" >#{revision },</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>
<if test="ifUseWarehouseArea !=null" >#{ifUseWarehouseArea },</if>
<if test="ifUseWarehouseLocation!=null" >#{ifUseWarehouseLocation},</if>
<if test="parentId !=null" >#{parentId },</if>
<if test="canteenId !=null" >#{canteenId },</if>
<if test="fetchUserId !=null" >#{fetchUserId },</if>
</trim>
</insert>
<update id="updateWareHouseInfo" parameterType="com.bonus.canteen.core.warehouse.domain.WareHouseInfo">
update warehouse_info
<trim prefix="SET" suffixOverrides=",">
<if test="warehouseNum !=null" >warehouse_num =#{warehouseNum },</if>
<if test="warehouseName !=null" >warehouse_name =#{warehouseName },</if>
<if test="userId !=null" >user_id =#{userId },</if>
<if test="userType !=null" >user_type =#{userType },</if>
<if test="regionProvince !=null" >region_province =#{regionProvince },</if>
<if test="regionCity !=null" >region_city =#{regionCity },</if>
<if test="regionDistrict !=null" >region_district =#{regionDistrict },</if>
<if test="address !=null" >address =#{address },</if>
<if test="warehouseType !=null" >warehouse_type =#{warehouseType },</if>
<if test="status !=null" >status =#{status },</if>
<if test="delFlag !=null" >del_flag =#{delFlag },</if>
<if test="typeId !=null" >type_id =#{typeId },</if>
<if test="areaId !=null" >area_id =#{areaId },</if>
<if test="revision !=null" >revision =#{revision },</if>
<if test="updateBy !=null" >create_by =#{updateBy },</if>
<if test="updateTime !=null" >create_time =#{updateTime },</if>
<if test="ifUseWarehouseArea !=null" >update_by =#{ifUseWarehouseArea },</if>
<if test="ifUseWarehouseLocation!=null" >update_time =#{ifUseWarehouseLocation },</if>
<if test="parentId !=null" >if_use_warehouse_area =#{parentId },</if>
<if test="canteenId !=null" >if_use_warehouse_location=#{canteenId },</if>
<if test="fetchUserId !=null" >parent_id =#{fetchUserId },</if>
</trim>
where warehouse_id = #{warehouseId}
</update>
<delete id="deleteWareHouseInfoByWareHouseId" parameterType="Long">
delete from warehouse_info where warehouse_id = #{warehouseId}
</delete>
<delete id="deleteWareHouseInfoByWareHouseIds" parameterType="String">
delete from warehouse_info where warehouse_id in
<foreach item="orderId" collection="array" open="(" separator="," close=")">
#{warehouseId}
</foreach>
</delete>
</mapper>