取货门店代码
This commit is contained in:
@@ -23,11 +23,8 @@ public class LpkStore {
|
|||||||
private String remarks;
|
private String remarks;
|
||||||
private String isEnable;
|
private String isEnable;
|
||||||
private String code;
|
private String code;
|
||||||
private String barcode;
|
|
||||||
private String name;
|
private String name;
|
||||||
private String unitName;
|
private String address;
|
||||||
private String typeCode;
|
private String phone;
|
||||||
private String price;
|
private String businessHours;
|
||||||
private String picUrl;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.yxt.yyth.api.lpkstore;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Administrator
|
||||||
|
* @description
|
||||||
|
* @date 2023/11/22 13:39
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class LpkStoreDetailsVo {
|
||||||
|
private String sid;
|
||||||
|
private String remarks;
|
||||||
|
private String code;
|
||||||
|
private String name;
|
||||||
|
private String address;
|
||||||
|
private String phone;
|
||||||
|
private String businessHours;
|
||||||
|
private String createTime;
|
||||||
|
}
|
||||||
@@ -1,9 +1,13 @@
|
|||||||
package com.yxt.yyth.api.lpkstore;
|
package com.yxt.yyth.api.lpkstore;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.yxt.common.core.dto.Dto;
|
import com.yxt.common.core.dto.Dto;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author wangpengfei
|
* @author wangpengfei
|
||||||
* @date 2023/11/21 15:13
|
* @date 2023/11/21 15:13
|
||||||
@@ -11,4 +15,11 @@ import lombok.Data;
|
|||||||
@ApiModel(value = "取货点(门店)信息 数据传输对象", description = "取货点(门店)信息 数据传输对象")
|
@ApiModel(value = "取货点(门店)信息 数据传输对象", description = "取货点(门店)信息 数据传输对象")
|
||||||
@Data
|
@Data
|
||||||
public class LpkStoreDto implements Dto {
|
public class LpkStoreDto implements Dto {
|
||||||
|
private String sid;
|
||||||
|
private String remarks;
|
||||||
|
private String code;
|
||||||
|
private String name;
|
||||||
|
private String address;
|
||||||
|
private String phone;
|
||||||
|
private String businessHours;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,5 +11,5 @@ import lombok.Data;
|
|||||||
@ApiModel(value = "取货点(门店)信息 查询条件", description = "取货点(门店)信息 查询条件")
|
@ApiModel(value = "取货点(门店)信息 查询条件", description = "取货点(门店)信息 查询条件")
|
||||||
@Data
|
@Data
|
||||||
public class LpkStoreQuery implements Query {
|
public class LpkStoreQuery implements Query {
|
||||||
|
private String name;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,14 @@
|
|||||||
package com.yxt.yyth.api.lpkstore;
|
package com.yxt.yyth.api.lpkstore;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.yxt.common.core.vo.Vo;
|
import com.yxt.common.core.vo.Vo;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author wangpengfei
|
* @author wangpengfei
|
||||||
* @date 2023/11/21 15:12
|
* @date 2023/11/21 15:12
|
||||||
@@ -13,5 +17,12 @@ import lombok.NoArgsConstructor;
|
|||||||
@ApiModel(value = "取货点(门店)信息 视图数据对象", description = "取货点(门店)信息 视图数据对象")
|
@ApiModel(value = "取货点(门店)信息 视图数据对象", description = "取货点(门店)信息 视图数据对象")
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class LpkStoreVo implements Vo {
|
public class LpkStoreVo implements Vo {
|
||||||
|
private String sid;
|
||||||
|
private String createTime;
|
||||||
|
private String remarks;
|
||||||
|
private String code;
|
||||||
|
private String name;
|
||||||
|
private String address;
|
||||||
|
private String phone;
|
||||||
|
private String businessHours;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,14 @@
|
|||||||
package com.yxt.yyth.biz.lpkstore;
|
package com.yxt.yyth.biz.lpkstore;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||||
import com.yxt.yyth.api.lpkgoods.LpkGoods;
|
import com.yxt.yyth.api.lpkgoods.LpkGoods;
|
||||||
import com.yxt.yyth.api.lpkstore.LpkStore;
|
import com.yxt.yyth.api.lpkstore.LpkStore;
|
||||||
|
import com.yxt.yyth.api.lpkstore.LpkStoreVo;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author wangpengfei
|
* @author wangpengfei
|
||||||
@@ -13,4 +18,5 @@ import org.apache.ibatis.annotations.Mapper;
|
|||||||
public interface LpkStoreMapper extends BaseMapper<LpkStore> {
|
public interface LpkStoreMapper extends BaseMapper<LpkStore> {
|
||||||
|
|
||||||
|
|
||||||
|
IPage<LpkStoreVo> storeListPage(IPage<LpkStore> page, @Param(Constants.WRAPPER) QueryWrapper<LpkStore> qw);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,4 +4,18 @@
|
|||||||
<!-- <where> ${ew.sqlSegment} </where>-->
|
<!-- <where> ${ew.sqlSegment} </where>-->
|
||||||
<!-- ${ew.customSqlSegment} -->
|
<!-- ${ew.customSqlSegment} -->
|
||||||
|
|
||||||
|
<select id="storeListPage" resultType="com.yxt.yyth.api.lpkstore.LpkStoreVo">
|
||||||
|
select
|
||||||
|
sid,
|
||||||
|
date_format(createTime, '%Y-%m-%d') as createTime,
|
||||||
|
code,
|
||||||
|
`name`,
|
||||||
|
address,
|
||||||
|
phone,
|
||||||
|
businessHours
|
||||||
|
from lpk_store
|
||||||
|
<where>
|
||||||
|
${ew.sqlSegment}
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -1,9 +1,20 @@
|
|||||||
package com.yxt.yyth.biz.lpkstore;
|
package com.yxt.yyth.biz.lpkstore;
|
||||||
|
|
||||||
|
import com.yxt.common.core.query.PagerQuery;
|
||||||
|
import com.yxt.common.core.result.ResultBean;
|
||||||
|
import com.yxt.common.core.vo.PagerVo;
|
||||||
|
import com.yxt.yyth.api.lpkgoods.LpkGoodsDetailsVo;
|
||||||
|
import com.yxt.yyth.api.lpkgoods.LpkGoodsDto;
|
||||||
|
import com.yxt.yyth.api.lpkgoods.LpkGoodsQuery;
|
||||||
|
import com.yxt.yyth.api.lpkgoods.LpkGoodsVo;
|
||||||
|
import com.yxt.yyth.api.lpkstore.LpkStoreDetailsVo;
|
||||||
|
import com.yxt.yyth.api.lpkstore.LpkStoreDto;
|
||||||
|
import com.yxt.yyth.api.lpkstore.LpkStoreQuery;
|
||||||
|
import com.yxt.yyth.api.lpkstore.LpkStoreVo;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author wangpengfei
|
* @author wangpengfei
|
||||||
@@ -18,7 +29,29 @@ public class LpkStoreRest {
|
|||||||
@Autowired
|
@Autowired
|
||||||
LpkStoreService lpkStoreService;
|
LpkStoreService lpkStoreService;
|
||||||
|
|
||||||
|
@ApiOperation("取货点(门店)信息列表")
|
||||||
|
@PostMapping("/storeListPage")
|
||||||
|
public ResultBean<PagerVo<LpkStoreVo>> storeListPage(@RequestBody PagerQuery<LpkStoreQuery> pq) {
|
||||||
|
return lpkStoreService.storeListPage(pq);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("保存修改")
|
||||||
|
@PostMapping("/saveStore")
|
||||||
|
public ResultBean saveStore(@RequestBody LpkStoreDto dto) {
|
||||||
|
return lpkStoreService.saveStore(dto);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("初始化取货点信息")
|
||||||
|
@GetMapping("/storeInit/{sid}")
|
||||||
|
public ResultBean<LpkStoreDetailsVo> storeInit(@PathVariable("sid") String sid) {
|
||||||
|
return lpkStoreService.storeInit(sid);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除取货点")
|
||||||
|
@DeleteMapping("/deleteStore/{sid}")
|
||||||
|
public ResultBean deleteStore(@PathVariable("sid") String sid) {
|
||||||
|
return lpkStoreService.deleteStore(sid);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,26 @@
|
|||||||
package com.yxt.yyth.biz.lpkstore;
|
package com.yxt.yyth.biz.lpkstore;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.hutool.core.date.DateTime;
|
||||||
|
import cn.hutool.core.date.DateUnit;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.yxt.common.base.service.MybatisBaseService;
|
import com.yxt.common.base.service.MybatisBaseService;
|
||||||
|
import com.yxt.common.base.utils.PagerUtil;
|
||||||
|
import com.yxt.common.base.utils.StringUtils;
|
||||||
|
import com.yxt.common.core.query.PagerQuery;
|
||||||
|
import com.yxt.common.core.result.ResultBean;
|
||||||
|
import com.yxt.common.core.vo.PagerVo;
|
||||||
import com.yxt.yyth.api.lpkgoods.LpkGoods;
|
import com.yxt.yyth.api.lpkgoods.LpkGoods;
|
||||||
import com.yxt.yyth.api.lpkstore.LpkStore;
|
import com.yxt.yyth.api.lpkgoods.LpkGoodsQuery;
|
||||||
|
import com.yxt.yyth.api.lpkgoods.LpkGoodsVo;
|
||||||
|
import com.yxt.yyth.api.lpkstore.*;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author wangpengfei
|
* @author wangpengfei
|
||||||
* @date 2023/11/21 15:03
|
* @date 2023/11/21 15:03
|
||||||
@@ -12,4 +28,52 @@ import org.springframework.stereotype.Service;
|
|||||||
@Service
|
@Service
|
||||||
public class LpkStoreService extends MybatisBaseService<LpkStoreMapper, LpkStore> {
|
public class LpkStoreService extends MybatisBaseService<LpkStoreMapper, LpkStore> {
|
||||||
|
|
||||||
|
public ResultBean<PagerVo<LpkStoreVo>> storeListPage(PagerQuery<LpkStoreQuery> pq) {
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
LpkStoreQuery query = pq.getParams();
|
||||||
|
QueryWrapper<LpkStore> qw = new QueryWrapper<>();
|
||||||
|
if (StringUtils.isNotBlank(query.getName())) {
|
||||||
|
qw.like("name", query.getName());
|
||||||
|
}
|
||||||
|
IPage<LpkStore> page = PagerUtil.queryToPage(pq);
|
||||||
|
IPage<LpkStoreVo> pagging = baseMapper.storeListPage(page, qw);
|
||||||
|
PagerVo<LpkStoreVo> p = PagerUtil.pageToVo(pagging, null);
|
||||||
|
return rb.success().setData(p);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ResultBean saveStore(LpkStoreDto dto) {
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
if (StringUtils.isNotBlank(dto.getSid())) {
|
||||||
|
LpkStore entity = fetchBySid(dto.getSid());
|
||||||
|
BeanUtil.copyProperties(dto, entity, "id", "sid");
|
||||||
|
baseMapper.updateById(entity);
|
||||||
|
} else {
|
||||||
|
LpkStore entity = new LpkStore();
|
||||||
|
BeanUtil.copyProperties(dto, entity, "id", "sid");
|
||||||
|
entity.setCreateTime(new DateTime());
|
||||||
|
baseMapper.insert(entity);
|
||||||
|
}
|
||||||
|
return rb.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ResultBean<LpkStoreDetailsVo> storeInit(String sid) {
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
LpkStoreDetailsVo vo = new LpkStoreDetailsVo();
|
||||||
|
LpkStore lpkStore = fetchBySid(sid);
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
if (null != lpkStore) {
|
||||||
|
BeanUtil.copyProperties(lpkStore, vo);
|
||||||
|
vo.setCreateTime(sdf.format(lpkStore.getCreateTime()));
|
||||||
|
}
|
||||||
|
return rb.success().setData(vo);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ResultBean deleteStore(String sid) {
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
LpkStore lpkStore = fetchBySid(sid);
|
||||||
|
if (null != lpkStore) {
|
||||||
|
baseMapper.deleteById(lpkStore.getId());
|
||||||
|
}
|
||||||
|
return rb.success();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user