mirror of
https://github.com/weizhiqiang1995/erp-pro.git
synced 2025-03-03 19:03:11 +08:00
feat: 增加shop_address_label包及基础接口
This commit is contained in:
parent
a99a2f8e63
commit
3b35a0e7d4
5 changed files with 156 additions and 0 deletions
|
@ -0,0 +1,58 @@
|
||||||
|
package com.skyeye.store.controller;
|
||||||
|
|
||||||
|
import com.skyeye.annotation.api.Api;
|
||||||
|
import com.skyeye.annotation.api.ApiImplicitParam;
|
||||||
|
import com.skyeye.annotation.api.ApiImplicitParams;
|
||||||
|
import com.skyeye.annotation.api.ApiOperation;
|
||||||
|
import com.skyeye.common.entity.search.CommonPageInfo;
|
||||||
|
import com.skyeye.common.object.InputObject;
|
||||||
|
import com.skyeye.common.object.OutputObject;
|
||||||
|
import com.skyeye.store.entity.ShopAddressLabel;
|
||||||
|
import com.skyeye.store.service.ShopAddressLabelService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@Api(value = "收件地址标签管理", tags = "收件地址标签管理", modelName = "收件地址标签管理")
|
||||||
|
public class ShopAddressLabelController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ShopAddressLabelService shopAddressLabelService;
|
||||||
|
|
||||||
|
@ApiOperation(id = "writeShopAddressLabel", value = "新增/编辑收件地址标签信息", method = "POST", allUse = "2")
|
||||||
|
@ApiImplicitParams(classBean = ShopAddressLabel.class)
|
||||||
|
@RequestMapping("/post/ShopAddressLabelController/writeShopAddressLabel")
|
||||||
|
public void writeShopAddressLabel(InputObject inputObject, OutputObject outputObject) {
|
||||||
|
shopAddressLabelService.saveOrUpdateEntity(inputObject, outputObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(id = "deleteShopAddressLabelByIds", value = "批量删除收件地址标签信息", method = "DELETE", allUse = "2")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(id = "ids", name = "ids", value = "主键id列表,多个id用逗号分隔", required = "required")})
|
||||||
|
@RequestMapping("/post/ShopAddressLabelController/deleteShopAddressLabelByIds")
|
||||||
|
public void deleteShopAddressLabelByIds(InputObject inputObject, OutputObject outputObject) {
|
||||||
|
shopAddressLabelService.deleteById(inputObject, outputObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(id = "queryShopAddressLabelList", value = "获取自己的收件地址标签信息", method = "POST", allUse = "2")
|
||||||
|
@RequestMapping("/post/ShopAddressLabelController/queryShopAddressLabelList")
|
||||||
|
public void queryShopAddressLabelList(InputObject inputObject, OutputObject outputObject) {
|
||||||
|
shopAddressLabelService.queryList(inputObject, outputObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(id = "queryShopAddressLabelPageList", value = "分页获取收件地址标签信息", method = "POST", allUse = "2")
|
||||||
|
@ApiImplicitParams(classBean = CommonPageInfo.class)
|
||||||
|
@RequestMapping("/post/ShopAddressLabelController/queryShopAddressLabelPageList")
|
||||||
|
public void queryShopAddressLabelPageList(InputObject inputObject, OutputObject outputObject) {
|
||||||
|
shopAddressLabelService.queryPageList(inputObject, outputObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(id = "selectShopAddressLabelById", value = "根据id查询收件地址标签信息", method = "POST", allUse = "2")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(id = "id", name = "id", value = "主键id", required = "required")})
|
||||||
|
@RequestMapping("/post/ShopAddressLabelController/selectShopAddressLabelById")
|
||||||
|
public void selectShopAddressLabelById(InputObject inputObject, OutputObject outputObject) {
|
||||||
|
shopAddressLabelService.selectById(inputObject, outputObject);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
package com.skyeye.store.dao;
|
||||||
|
|
||||||
|
import com.skyeye.eve.dao.SkyeyeBaseMapper;
|
||||||
|
import com.skyeye.store.entity.ShopAddressLabel;
|
||||||
|
|
||||||
|
public interface ShopAddressLabelDao extends SkyeyeBaseMapper<ShopAddressLabel> {
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
package com.skyeye.store.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.skyeye.annotation.api.ApiModel;
|
||||||
|
import com.skyeye.annotation.api.ApiModelProperty;
|
||||||
|
import com.skyeye.common.entity.features.OperatorUserInfo;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@TableName(value = "shop_address_label")
|
||||||
|
@ApiModel("收件地址标签管理实体类")
|
||||||
|
public class ShopAddressLabel extends OperatorUserInfo {
|
||||||
|
|
||||||
|
@TableId("id")
|
||||||
|
@ApiModelProperty("主键id。为空时新增,不为空时编辑")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@TableField("content")
|
||||||
|
@ApiModelProperty(value = "标签内容", required = "required", fuzzyLike = true)
|
||||||
|
private String content;
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
package com.skyeye.store.service;
|
||||||
|
|
||||||
|
import com.skyeye.base.business.service.SkyeyeBusinessService;
|
||||||
|
import com.skyeye.store.entity.ShopAddressLabel;
|
||||||
|
|
||||||
|
public interface ShopAddressLabelService extends SkyeyeBusinessService<ShopAddressLabel> {
|
||||||
|
}
|
|
@ -0,0 +1,61 @@
|
||||||
|
package com.skyeye.store.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.skyeye.annotation.service.SkyeyeService;
|
||||||
|
import com.skyeye.base.business.service.impl.SkyeyeBusinessServiceImpl;
|
||||||
|
import com.skyeye.common.constans.CommonCharConstants;
|
||||||
|
import com.skyeye.common.constans.CommonConstants;
|
||||||
|
import com.skyeye.common.entity.search.CommonPageInfo;
|
||||||
|
import com.skyeye.common.object.InputObject;
|
||||||
|
import com.skyeye.common.object.OutputObject;
|
||||||
|
import com.skyeye.common.util.mybatisplus.MybatisPlusUtil;
|
||||||
|
import com.skyeye.store.dao.ShopAddressLabelDao;
|
||||||
|
import com.skyeye.store.entity.ShopAddressLabel;
|
||||||
|
import com.skyeye.store.service.ShopAddressLabelService;
|
||||||
|
import org.apache.poi.ss.formula.functions.T;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@SkyeyeService(name = "收件地址标签管理", groupName = "收件地址标签管理")
|
||||||
|
public class ShopAddressLabelServiceImpl extends SkyeyeBusinessServiceImpl<ShopAddressLabelDao, ShopAddressLabel> implements ShopAddressLabelService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void validatorEntity(ShopAddressLabel shopAddressLabel) {
|
||||||
|
super.validatorEntity(shopAddressLabel);
|
||||||
|
String userId = InputObject.getLogParamsStatic().get("id").toString();
|
||||||
|
QueryWrapper<ShopAddressLabel> queryWrapper = new QueryWrapper<>();
|
||||||
|
//更新时排除本身
|
||||||
|
if (StrUtil.isNotEmpty(shopAddressLabel.getId())) {
|
||||||
|
queryWrapper.ne(CommonConstants.ID, shopAddressLabel.getId());
|
||||||
|
}
|
||||||
|
queryWrapper.eq(MybatisPlusUtil.toColumns(ShopAddressLabel::getCreateId), userId);
|
||||||
|
List<ShopAddressLabel> list = list(queryWrapper);
|
||||||
|
//排除重复的标签
|
||||||
|
for (ShopAddressLabel addressLabel : list) {
|
||||||
|
if (addressLabel.getContent().equals(shopAddressLabel.getContent())) {
|
||||||
|
throw new RuntimeException("标签重复");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteById(InputObject inputObject, OutputObject outputObject) {
|
||||||
|
String ids = inputObject.getParams().get("ids").toString();
|
||||||
|
List<String> idList = Arrays.asList(ids.split(CommonCharConstants.COMMA_MARK));
|
||||||
|
super.deleteById(idList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Map<String, Object>> queryDataList(InputObject inputObject) {
|
||||||
|
QueryWrapper<ShopAddressLabel> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq(MybatisPlusUtil.toColumns(ShopAddressLabel::getCreateId), inputObject.getLogParams().get("id").toString());
|
||||||
|
List<ShopAddressLabel> list = list(queryWrapper);
|
||||||
|
return JSONUtil.toList(JSONUtil.toJsonStr(list), null);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue