7 changed files with 235 additions and 0 deletions
@ -0,0 +1,105 @@ |
|||||
|
package cc.hiver.core.shopprint.controller; |
||||
|
|
||||
|
import cc.hiver.core.common.utils.ResultUtil; |
||||
|
import cc.hiver.core.common.vo.Result; |
||||
|
import cc.hiver.core.logisticsroute.entity.LogisticsRoute; |
||||
|
import cc.hiver.core.logisticsroute.service.LogisticsRouteService; |
||||
|
import cc.hiver.core.logisticsroute.vo.LogisticsRouteQueryVo; |
||||
|
import cc.hiver.core.shopprint.entity.ShopPrint; |
||||
|
import cc.hiver.core.shopprint.service.ShopPrintService; |
||||
|
import cc.hiver.core.shopprint.vo.ShopPrintQueryVo; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import io.swagger.annotations.Api; |
||||
|
import io.swagger.annotations.ApiOperation; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @ClassName:ShopPrintController |
||||
|
* @Author: qiaohui |
||||
|
* @Date: 2024/10/22 22:07 |
||||
|
* @Description: 必须描述类做什么事情, 实现什么功能 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@RestController |
||||
|
@Api(tags = "店铺打印内容接口") |
||||
|
@RequestMapping("/hiver/app/shopprint") |
||||
|
@Transactional |
||||
|
public class ShopPrintController { |
||||
|
|
||||
|
@Autowired |
||||
|
private ShopPrintService shopPrintService; |
||||
|
|
||||
|
@PostMapping(value = "/add") |
||||
|
@ApiOperation("新增店铺打印内容") |
||||
|
public Result addLogisticsRoute(@RequestBody ShopPrint shopPrint) { |
||||
|
|
||||
|
final boolean b = shopPrintService.saveOrUpdate(shopPrint); |
||||
|
if (b) { |
||||
|
return ResultUtil.success("保存成功!"); |
||||
|
} else { |
||||
|
return ResultUtil.error("保存失败!"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 更新 |
||||
|
* @param shopPrint |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping(value = "/update") |
||||
|
@ApiOperation("更新店铺打印内容") |
||||
|
public Result updateLogisticsRoute(@RequestBody ShopPrint shopPrint) { |
||||
|
if (StringUtils.isEmpty(shopPrint.getId())) { |
||||
|
return ResultUtil.error("id不能为空!"); |
||||
|
} |
||||
|
final boolean b = shopPrintService.saveOrUpdate(shopPrint); |
||||
|
if (b) { |
||||
|
return ResultUtil.success("保存成功!"); |
||||
|
} else { |
||||
|
return ResultUtil.error("保存失败!"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除物流线路 |
||||
|
* |
||||
|
* @param id |
||||
|
* @return Result |
||||
|
* @author 王富康 |
||||
|
* @date 2024/8/24 |
||||
|
*/ |
||||
|
@PostMapping(value = "/delete") |
||||
|
@ApiOperation("删除店铺打印内容") |
||||
|
public Result deleteLogisticsRoute(String id) { |
||||
|
if (StringUtils.isEmpty(id)) { |
||||
|
return ResultUtil.error("线路id不能为空!"); |
||||
|
} |
||||
|
final boolean b = shopPrintService.removeById(id); |
||||
|
if (b) { |
||||
|
return ResultUtil.success("删除成功!"); |
||||
|
} else { |
||||
|
return ResultUtil.error("删除失败!"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 分页查询物流线路 |
||||
|
* |
||||
|
* @param logisticsRouteQueryVo |
||||
|
* @return Result<IPage < LogisticsRoute>> |
||||
|
* @author 王富康 |
||||
|
* @date 2024/8/24 |
||||
|
*/ |
||||
|
@RequestMapping(value = "/getList", method = RequestMethod.POST) |
||||
|
@ApiOperation(value = "查询打印内容") |
||||
|
public Result<List<ShopPrint>> getLogisticsRoutePageList(@RequestBody(required = false) ShopPrintQueryVo logisticsRouteQueryVo) { |
||||
|
final List<ShopPrint> result = shopPrintService.getShopPrintList(logisticsRouteQueryVo); |
||||
|
return new ResultUtil<List<ShopPrint>>().setData(result); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,39 @@ |
|||||
|
package cc.hiver.core.shopprint.entity; |
||||
|
|
||||
|
import cc.hiver.core.base.HiverBaseEntity; |
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
import org.hibernate.annotations.DynamicInsert; |
||||
|
import org.hibernate.annotations.DynamicUpdate; |
||||
|
|
||||
|
import javax.persistence.Entity; |
||||
|
import javax.persistence.Table; |
||||
|
|
||||
|
/** |
||||
|
* @ClassName:ShopPrint |
||||
|
* @Author: qiaohui |
||||
|
* @Date: 2024/10/22 21:50 |
||||
|
* @Description: 必须描述类做什么事情, 实现什么功能 |
||||
|
*/ |
||||
|
@Data |
||||
|
@Entity |
||||
|
@DynamicInsert |
||||
|
@DynamicUpdate |
||||
|
@Table(name = "t_shop_print") |
||||
|
@TableName("t_department") |
||||
|
@ApiModel(value = "部门") |
||||
|
public class ShopPrint extends HiverBaseEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
@ApiModelProperty(value = "打印名称") |
||||
|
private String printName; |
||||
|
|
||||
|
@ApiModelProperty(value = "商铺ID") |
||||
|
private String shopId; |
||||
|
|
||||
|
@ApiModelProperty(value = "打印具体内容") |
||||
|
private String content; |
||||
|
} |
||||
@ -0,0 +1,25 @@ |
|||||
|
package cc.hiver.core.shopprint.mapper; |
||||
|
|
||||
|
import cc.hiver.core.logisticsaddressbook.entity.LogisticsAddressBook; |
||||
|
import cc.hiver.core.logisticsaddressbook.vo.LogisticsAddressBookQueryVo; |
||||
|
import cc.hiver.core.logisticscompanyroute.entity.LogisticsCompanyRoute; |
||||
|
import cc.hiver.core.logisticscompanyroute.vo.LogisticsCompanyRouteQueryVo; |
||||
|
import cc.hiver.core.logisticsroute.entity.LogisticsRoute; |
||||
|
import cc.hiver.core.logisticsroute.vo.LogisticsRouteQueryVo; |
||||
|
import cc.hiver.core.shopprint.entity.ShopPrint; |
||||
|
import cc.hiver.core.shopprint.vo.ShopPrintQueryVo; |
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.List; |
||||
|
@Mapper |
||||
|
public interface ShopPrintMapper extends BaseMapper<ShopPrint> { |
||||
|
|
||||
|
|
||||
|
|
||||
|
List<ShopPrint> getShopPrintList(@Param("queryParams") ShopPrintQueryVo shopPrintQueryVo); |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,13 @@ |
|||||
|
package cc.hiver.core.shopprint.service; |
||||
|
|
||||
|
import cc.hiver.core.shopprint.entity.ShopPrint; |
||||
|
import cc.hiver.core.shopprint.vo.ShopPrintQueryVo; |
||||
|
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
public interface ShopPrintService extends IService<ShopPrint> { |
||||
|
|
||||
|
|
||||
|
List<ShopPrint> getShopPrintList(ShopPrintQueryVo shopPrintQueryVo); |
||||
|
} |
||||
@ -0,0 +1,36 @@ |
|||||
|
package cc.hiver.core.shopprint.service.impl; |
||||
|
|
||||
|
import cc.hiver.core.logisticsroute.mapper.LogisticsRouteMapper; |
||||
|
import cc.hiver.core.logisticsroute.service.LogisticsRouteService; |
||||
|
import cc.hiver.core.logisticsuser.entity.LogisticsUser; |
||||
|
import cc.hiver.core.logisticsuser.mapper.LogisticsUserMapper; |
||||
|
import cc.hiver.core.logisticsuser.service.LogisticsUserService; |
||||
|
import cc.hiver.core.shopprint.entity.ShopPrint; |
||||
|
import cc.hiver.core.shopprint.mapper.ShopPrintMapper; |
||||
|
import cc.hiver.core.shopprint.service.ShopPrintService; |
||||
|
import cc.hiver.core.shopprint.vo.ShopPrintQueryVo; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @ClassName:ShopPrintServiceImpl |
||||
|
* @Author: qiaohui |
||||
|
* @Date: 2024/10/22 22:01 |
||||
|
* @Description: |
||||
|
*/ |
||||
|
@Service |
||||
|
public class ShopPrintServiceImpl extends ServiceImpl<ShopPrintMapper, ShopPrint> implements ShopPrintService { |
||||
|
|
||||
|
@Autowired |
||||
|
private ShopPrintMapper shopPrintMapper; |
||||
|
|
||||
|
@Override |
||||
|
public List<ShopPrint> getShopPrintList(ShopPrintQueryVo shopPrintQueryVo){ |
||||
|
return shopPrintMapper.getShopPrintList(shopPrintQueryVo); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,10 @@ |
|||||
|
package cc.hiver.core.shopprint.vo; |
||||
|
|
||||
|
/** |
||||
|
* @ClassName:ShopPrintQueryVo |
||||
|
* @Author: qiaohui |
||||
|
* @Date: 2024/10/22 21:59 |
||||
|
* @Description: 必须描述类做什么事情, 实现什么功能 |
||||
|
*/ |
||||
|
public class ShopPrintQueryVo { |
||||
|
} |
||||
@ -0,0 +1,7 @@ |
|||||
|
<?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="cc.hiver.core.shopprint.mapper.ShopPrintMapper"> |
||||
|
<select id="getShopPrintList" resultType="cc.hiver.core.shopprint.entity.ShopPrint"> |
||||
|
select * from t_shop_print where shop_id = #{queryParams.shopId} |
||||
|
</select> |
||||
|
</mapper> |
||||
Loading…
Reference in new issue