22 changed files with 366 additions and 37 deletions
@ -0,0 +1,31 @@ |
|||
package com.yxt.yyth.api.customerstore; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import io.swagger.annotations.ApiModel; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
import java.util.UUID; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/11/21 15:06 |
|||
*/ |
|||
@ApiModel(value = "礼包包含商品信息", description = "礼包包含商品信息") |
|||
@TableName("customer_store") |
|||
@Data |
|||
public class CustomerStore { |
|||
private String id; |
|||
private String sid = UUID.randomUUID().toString(); |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
|||
private Date createTime; |
|||
private String remarks; |
|||
private String isEnable; |
|||
private String customerSid; |
|||
private String storeSid; |
|||
// private String isGrounding;
|
|||
private String phone; |
|||
private String name; |
|||
|
|||
} |
@ -0,0 +1,29 @@ |
|||
package com.yxt.yyth.api.customerstore; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.yxt.common.core.dto.Dto; |
|||
import io.swagger.annotations.ApiModel; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
import java.util.UUID; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/11/21 15:13 |
|||
*/ |
|||
@ApiModel(value = "礼包包含商品信息 数据传输对象", description = "礼包包含商品信息 数据传输对象") |
|||
@Data |
|||
public class CustomerStoreDto implements Dto { |
|||
private String id; |
|||
private String sid ; |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
|||
private Date createTime; |
|||
private String remarks; |
|||
private String isEnable; |
|||
private String customerSid; |
|||
private String storeSid; |
|||
// private String isGrounding;
|
|||
private String phone; |
|||
private String name; |
|||
} |
@ -0,0 +1,15 @@ |
|||
package com.yxt.yyth.api.customerstore; |
|||
|
|||
import com.yxt.common.core.query.Query; |
|||
import io.swagger.annotations.ApiModel; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/11/21 15:31 |
|||
*/ |
|||
@ApiModel(value = "礼包包含商品信息 查询条件", description = "礼包包含商品信息 查询条件") |
|||
@Data |
|||
public class CustomerStoreQuery implements Query { |
|||
|
|||
} |
@ -0,0 +1,34 @@ |
|||
package com.yxt.yyth.api.customerstore; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.yxt.common.core.vo.Vo; |
|||
import io.swagger.annotations.ApiModel; |
|||
import lombok.Data; |
|||
import lombok.NoArgsConstructor; |
|||
|
|||
import java.util.Date; |
|||
import java.util.UUID; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/11/21 15:12 |
|||
*/ |
|||
@Data |
|||
@ApiModel(value = "礼包包含商品信息 视图数据对象", description = "礼包包含商品信息 视图数据对象") |
|||
@NoArgsConstructor |
|||
public class CustomerStoreVo implements Vo { |
|||
private String id; |
|||
private String sid ; |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
|||
private Date createTime; |
|||
private String remarks; |
|||
private String isEnable; |
|||
private String customerSid; |
|||
private String storeSid; |
|||
private String storeName; |
|||
private String businessHours; |
|||
private String address; |
|||
// private String isGrounding;
|
|||
private String phone; |
|||
private String name; |
|||
} |
@ -0,0 +1,21 @@ |
|||
package com.yxt.yyth.biz.customerstore; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.yxt.yyth.api.appletgiftbag.AppletGiftBagVo; |
|||
import com.yxt.yyth.api.appletgiftbag.GiftBagGoods; |
|||
import com.yxt.yyth.api.customerstore.CustomerStore; |
|||
import com.yxt.yyth.api.customerstore.CustomerStoreVo; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
import org.apache.ibatis.annotations.Select; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/11/21 15:03 |
|||
*/ |
|||
@Mapper |
|||
public interface CustomerStoreMapper extends BaseMapper<CustomerStore> { |
|||
CustomerStoreVo getStoreBySid(@Param("customerSid") String customerSid); |
|||
} |
@ -0,0 +1,11 @@ |
|||
<?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.yxt.yyth.biz.customerstore.CustomerStoreMapper"> |
|||
<!-- <where> ${ew.sqlSegment} </where>--> |
|||
<!-- ${ew.customSqlSegment} --> |
|||
|
|||
<select id="getStoreBySid" resultType="com.yxt.yyth.api.customerstore.CustomerStoreVo"> |
|||
select s.name ,s.phone,t.name as storeName,t.address ,t.businessHours from customer_store s left join lpk_store t on s.storeSid=t.sid |
|||
where customerSid=#{customerSid} |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,30 @@ |
|||
package com.yxt.yyth.biz.customerstore; |
|||
|
|||
import com.yxt.common.core.result.ResultBean; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.PathVariable; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/11/21 15:03 |
|||
*/ |
|||
|
|||
@Api(tags = "客户网点关联") |
|||
@RestController |
|||
@RequestMapping("customerstore") |
|||
public class CustomerStoreRest { |
|||
|
|||
@Autowired |
|||
CustomerStoreService customerStoreService; |
|||
|
|||
@ApiOperation("我的默认提货地点") |
|||
@GetMapping("/getStoreBySid/{sid}") |
|||
public ResultBean getStoreBySid(@PathVariable String sid) { |
|||
return customerStoreService.getStoreBySid(sid); |
|||
} |
|||
} |
@ -0,0 +1,38 @@ |
|||
package com.yxt.yyth.biz.customerstore; |
|||
|
|||
import cn.hutool.core.bean.BeanUtil; |
|||
import com.alibaba.nacos.common.model.RestResult; |
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.yxt.common.base.service.MybatisBaseService; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
|
|||
import com.yxt.yyth.api.appletgiftbag.GiftBagGoods; |
|||
import com.yxt.yyth.api.customerstore.CustomerStore; |
|||
import com.yxt.yyth.api.customerstore.CustomerStoreDto; |
|||
import com.yxt.yyth.api.customerstore.CustomerStoreVo; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/11/21 15:03 |
|||
*/ |
|||
@Service |
|||
public class CustomerStoreService extends MybatisBaseService<CustomerStoreMapper, CustomerStore> { |
|||
|
|||
public ResultBean<CustomerStoreVo> getStoreBySid(String customerSid) { |
|||
ResultBean rb=new ResultBean().fail(); |
|||
CustomerStoreVo vo=baseMapper.getStoreBySid(customerSid); |
|||
return rb.success().setData(vo); |
|||
} |
|||
public ResultBean saveStore(CustomerStoreDto dto){ |
|||
ResultBean rb=new ResultBean(); |
|||
baseMapper.delete(new QueryWrapper<CustomerStore>().eq("sid",dto.getCustomerSid())); |
|||
CustomerStore customerStore=new CustomerStore(); |
|||
BeanUtil.copyProperties(dto, customerStore, "id", "sid"); |
|||
baseMapper.insert(customerStore); |
|||
return rb.success().setMsg("成功"); |
|||
} |
|||
} |
Loading…
Reference in new issue