Commit c60bcbd2a04c22811cdd7b4e479678e42f8a16b8
1 parent
722e35b6
添加店铺运费基础类
Showing
13 changed files
with
852 additions
and
17 deletions
etrade-shop/src/main/java/com/diligrp/etrade/shop/api/ShopApi.java
... | ... | @@ -44,7 +44,7 @@ public class ShopApi { |
44 | 44 | */ |
45 | 45 | @RequestMapping(value = "/update") |
46 | 46 | public Message<ShopApproveVo> appUpdate(@Validated({Default.class, UpdateShopApprove.class}) @RequestBody ShopApproveUpdate shopApproveCo) { |
47 | - log.warn("店铺更新-小程序:{}", JsonUtils.toJsonString(shopApproveCo)); | |
47 | + log.info("店铺更新-小程序:{}", JsonUtils.toJsonString(shopApproveCo)); | |
48 | 48 | return Message.success(shopCommonService.doUpdateShopApprove(shopApproveCo)); |
49 | 49 | } |
50 | 50 | |
... | ... | @@ -53,7 +53,7 @@ public class ShopApi { |
53 | 53 | */ |
54 | 54 | @RequestMapping(value = "/detail/snapshot") |
55 | 55 | public Message<ShopApproveVo> minDetailSnapshot(@RequestBody ShopApproveCo shopApproveCo) { |
56 | - log.warn("店铺详情快照-小程序:{}", JsonUtils.toJsonString(shopApproveCo)); | |
56 | + log.info("店铺详情快照-小程序:{}", JsonUtils.toJsonString(shopApproveCo)); | |
57 | 57 | return Message.success(shopCommonService.doDetailSnapshot(shopApproveCo)); |
58 | 58 | } |
59 | 59 | |
... | ... | @@ -62,7 +62,7 @@ public class ShopApi { |
62 | 62 | */ |
63 | 63 | @RequestMapping(value = "/detail") |
64 | 64 | public Message<ShopVo> minDetail(@RequestBody ShopApproveCo shopApproveCo) { |
65 | - log.warn("店铺详情-小程序:{}", JsonUtils.toJsonString(shopApproveCo)); | |
65 | + log.info("店铺详情-小程序:{}", JsonUtils.toJsonString(shopApproveCo)); | |
66 | 66 | return Message.success(shopCommonService.detail(shopApproveCo)); |
67 | 67 | } |
68 | 68 | |
... | ... | @@ -71,7 +71,7 @@ public class ShopApi { |
71 | 71 | */ |
72 | 72 | @RequestMapping(value = "/recommendation") |
73 | 73 | public Message<RecommendVo> recommendation(@RequestBody ShopApproveCo shopApproveCo) { |
74 | - log.warn("店铺推荐-小程序:{}", JsonUtils.toJsonString(shopApproveCo)); | |
74 | + log.info("店铺推荐-小程序:{}", JsonUtils.toJsonString(shopApproveCo)); | |
75 | 75 | return Message.success(shopCommonService.recommendation(shopApproveCo)); |
76 | 76 | } |
77 | 77 | |
... | ... | @@ -81,7 +81,7 @@ public class ShopApi { |
81 | 81 | */ |
82 | 82 | @RequestMapping(value = "/qrCode") |
83 | 83 | public Message<ShopQrCodeVo> qrCode(@RequestBody ShopApproveCo shopApproveCo) { |
84 | - log.warn("店铺二维码解析-小程序:{}", JsonUtils.toJsonString(shopApproveCo)); | |
84 | + log.info("店铺二维码解析-小程序:{}", JsonUtils.toJsonString(shopApproveCo)); | |
85 | 85 | return Message.success(shopCommonService.qrCode(shopApproveCo)); |
86 | 86 | } |
87 | 87 | |
... | ... | @@ -93,7 +93,7 @@ public class ShopApi { |
93 | 93 | */ |
94 | 94 | @RequestMapping(value = "/selectByCustomerIds") |
95 | 95 | public Message<List<ShopVo>> selectByCustomerIds(@RequestBody ShopCo shopCo) { |
96 | - log.warn("根据客户查询店铺-小程序:{}", JsonUtils.toJsonString(shopCo)); | |
96 | + log.info("根据客户查询店铺-小程序:{}", JsonUtils.toJsonString(shopCo)); | |
97 | 97 | return Message.success(shopCommonService.selectByCustomerIds(shopCo)); |
98 | 98 | } |
99 | 99 | |
... | ... | @@ -102,7 +102,7 @@ public class ShopApi { |
102 | 102 | */ |
103 | 103 | @RequestMapping(value = "/introduction/save") |
104 | 104 | public Message<ShopIntroductionTemp> saveShopIntroduction(@RequestBody ShopIntroductionTemp shopIntroductionTemp) { |
105 | - log.warn("保存店铺介绍-小程序:{}", JsonUtils.toJsonString(shopIntroductionTemp)); | |
105 | + log.info("保存店铺介绍-小程序:{}", JsonUtils.toJsonString(shopIntroductionTemp)); | |
106 | 106 | return Message.success(shopCommonService.saveShopIntroduction(shopIntroductionTemp)); |
107 | 107 | } |
108 | 108 | |
... | ... | @@ -111,7 +111,7 @@ public class ShopApi { |
111 | 111 | */ |
112 | 112 | @RequestMapping(value = "/introduction/query") |
113 | 113 | public Message<ShopIntroductionTemp> queryShopIntroduction(@RequestBody ShopIntroductionTemp shopIntroductionTemp) { |
114 | - log.warn("查询店铺介绍-小程序:{}", JsonUtils.toJsonString(shopIntroductionTemp)); | |
114 | + log.info("查询店铺介绍-小程序:{}", JsonUtils.toJsonString(shopIntroductionTemp)); | |
115 | 115 | return Message.success(shopCommonService.queryShopIntroduction(shopIntroductionTemp)); |
116 | 116 | } |
117 | 117 | |
... | ... | @@ -120,7 +120,7 @@ public class ShopApi { |
120 | 120 | */ |
121 | 121 | @RequestMapping(value = "/search") |
122 | 122 | public Message<PageMessage<ShopVo>> search(@RequestBody ShopSearchCo shopSearchCo) { |
123 | - log.warn("店铺搜索-小程序:{}", JsonUtils.toJsonString(shopSearchCo)); | |
123 | + log.info("店铺搜索-小程序:{}", JsonUtils.toJsonString(shopSearchCo)); | |
124 | 124 | return Message.success(shopCommonService.search(shopSearchCo)); |
125 | 125 | } |
126 | 126 | |
... | ... | @@ -179,7 +179,7 @@ public class ShopApi { |
179 | 179 | */ |
180 | 180 | @RequestMapping(value = "/recommendation/all") |
181 | 181 | public Message<List<ShopRecommendationVo>> recommendationAll(@RequestBody ShopRecommendationCo recommendationCo) { |
182 | - log.warn("店铺推荐全部-小程序:{}", JsonUtils.toJsonString(recommendationCo)); | |
182 | + log.info("店铺推荐全部-小程序:{}", JsonUtils.toJsonString(recommendationCo)); | |
183 | 183 | return Message.success(shopCommonService.recommendationAll(recommendationCo)); |
184 | 184 | } |
185 | 185 | } |
186 | 186 | \ No newline at end of file | ... | ... |
etrade-shop/src/main/java/com/diligrp/etrade/shop/api/ShopExpressSettingApi.java
0 → 100644
1 | +package com.diligrp.etrade.shop.api; | |
2 | + | |
3 | + | |
4 | +import com.diligrp.etrade.core.domain.Message; | |
5 | +import com.diligrp.etrade.core.util.JsonUtils; | |
6 | +import com.diligrp.etrade.shop.domain.request.ShopExpressCo; | |
7 | +import com.diligrp.etrade.shop.domain.request.ShopExpressQueryCo; | |
8 | +import com.diligrp.etrade.shop.domain.response.ShopExpressVo; | |
9 | +import com.diligrp.etrade.shop.service.ShopExpressSettingService; | |
10 | +import org.slf4j.Logger; | |
11 | +import org.slf4j.LoggerFactory; | |
12 | +import org.springframework.beans.factory.annotation.Autowired; | |
13 | +import org.springframework.web.bind.annotation.RequestBody; | |
14 | +import org.springframework.web.bind.annotation.RequestMapping; | |
15 | +import org.springframework.web.bind.annotation.RestController; | |
16 | + | |
17 | +/** | |
18 | + * 店铺运费设置小程序相关接口 | |
19 | + */ | |
20 | +@RestController | |
21 | +@RequestMapping("/api/shop/express/setting") | |
22 | +public class ShopExpressSettingApi { | |
23 | + private static final Logger log = LoggerFactory.getLogger(ShopExpressSettingApi.class); | |
24 | + @Autowired | |
25 | + private ShopExpressSettingService shopExpressSettingService; | |
26 | + | |
27 | + | |
28 | + /** | |
29 | + * 店铺运费设置详情-小程序 | |
30 | + */ | |
31 | + @RequestMapping(value = "/detail") | |
32 | + public Message<ShopExpressVo> detail(@RequestBody ShopExpressQueryCo shopExpressQueryCo) { | |
33 | + log.info("店铺运费设置详情-小程序:{}", JsonUtils.toJsonString(shopExpressQueryCo)); | |
34 | + return Message.success(shopExpressSettingService.detail(shopExpressQueryCo)); | |
35 | + } | |
36 | + | |
37 | + | |
38 | + /** | |
39 | + * 保存店铺运费设置-小程序 | |
40 | + */ | |
41 | + @RequestMapping(value = "/save") | |
42 | + public Message<Boolean> save(@RequestBody ShopExpressCo shopExpressCo) { | |
43 | + log.info("店铺运费保存设置-小程序:{}", JsonUtils.toJsonString(shopExpressCo)); | |
44 | + return Message.success(shopExpressSettingService.save(shopExpressCo)); | |
45 | + } | |
46 | + | |
47 | +} | |
0 | 48 | \ No newline at end of file | ... | ... |
etrade-shop/src/main/java/com/diligrp/etrade/shop/api/ShopManageApi.java
... | ... | @@ -40,7 +40,7 @@ public class ShopManageApi { |
40 | 40 | */ |
41 | 41 | @RequestMapping(value = "/update") |
42 | 42 | public Message<ShopApproveVo> appUpdate(@Validated({Default.class, UpdateShopApprove.class}) @RequestBody ShopApproveUpdate shopApproveCo) { |
43 | - log.warn("店铺更新-app:{}", JsonUtils.toJsonString(shopApproveCo)); | |
43 | + log.info("店铺更新-app:{}", JsonUtils.toJsonString(shopApproveCo)); | |
44 | 44 | return Message.success(shopCommonService.doUpdateShopApprove(shopApproveCo)); |
45 | 45 | } |
46 | 46 | |
... | ... | @@ -49,7 +49,7 @@ public class ShopManageApi { |
49 | 49 | */ |
50 | 50 | @RequestMapping(value = "/detail/snapshot") |
51 | 51 | public Message<ShopApproveVo> appDetailSnapshot(@RequestBody ShopApproveCo shopApproveCo) { |
52 | - log.warn("店铺详情快照-app:{}", JsonUtils.toJsonString(shopApproveCo)); | |
52 | + log.info("店铺详情快照-app:{}", JsonUtils.toJsonString(shopApproveCo)); | |
53 | 53 | return Message.success(shopCommonService.doDetailSnapshot(shopApproveCo)); |
54 | 54 | } |
55 | 55 | |
... | ... | @@ -58,7 +58,7 @@ public class ShopManageApi { |
58 | 58 | */ |
59 | 59 | @RequestMapping(value = "/detail") |
60 | 60 | public Message<ShopVo> minDetail(@RequestBody ShopApproveCo shopApproveCo) { |
61 | - log.warn("店铺详情-app:{}", JsonUtils.toJsonString(shopApproveCo)); | |
61 | + log.info("店铺详情-app:{}", JsonUtils.toJsonString(shopApproveCo)); | |
62 | 62 | return Message.success(shopCommonService.detail(shopApproveCo)); |
63 | 63 | } |
64 | 64 | |
... | ... | @@ -67,7 +67,7 @@ public class ShopManageApi { |
67 | 67 | */ |
68 | 68 | @RequestMapping(value = "/recommendation") |
69 | 69 | public Message<RecommendVo> recommendation(@RequestBody ShopApproveCo shopApproveCo) { |
70 | - log.warn("店铺推荐-app:{}", JsonUtils.toJsonString(shopApproveCo)); | |
70 | + log.info("店铺推荐-app:{}", JsonUtils.toJsonString(shopApproveCo)); | |
71 | 71 | return Message.success(shopCommonService.recommendation(shopApproveCo)); |
72 | 72 | } |
73 | 73 | |
... | ... | @@ -92,7 +92,7 @@ public class ShopManageApi { |
92 | 92 | */ |
93 | 93 | @RequestMapping(value = "/selectByCustomerIds") |
94 | 94 | public Message<List<ShopVo>> selectByCustomerIds(@RequestBody ShopCo shopCo) { |
95 | - log.warn("根据客户查询店铺-app:{}", JsonUtils.toJsonString(shopCo)); | |
95 | + log.info("根据客户查询店铺-app:{}", JsonUtils.toJsonString(shopCo)); | |
96 | 96 | return Message.success(shopCommonService.selectByCustomerIds(shopCo)); |
97 | 97 | } |
98 | 98 | |
... | ... | @@ -101,7 +101,7 @@ public class ShopManageApi { |
101 | 101 | */ |
102 | 102 | @RequestMapping(value = "/introduction/save") |
103 | 103 | public Message<ShopIntroductionTemp> saveShopIntroduction(@RequestBody ShopIntroductionTemp shopIntroductionTemp) { |
104 | - log.warn("保存店铺介绍-app:{}", JsonUtils.toJsonString(shopIntroductionTemp)); | |
104 | + log.info("保存店铺介绍-app:{}", JsonUtils.toJsonString(shopIntroductionTemp)); | |
105 | 105 | return Message.success(shopCommonService.saveShopIntroduction(shopIntroductionTemp)); |
106 | 106 | } |
107 | 107 | |
... | ... | @@ -110,7 +110,7 @@ public class ShopManageApi { |
110 | 110 | */ |
111 | 111 | @RequestMapping(value = "/introduction/query") |
112 | 112 | public Message<ShopIntroductionTemp> queryShopIntroduction(@RequestBody ShopIntroductionTemp shopIntroductionTemp) { |
113 | - log.warn("查询店铺介绍-app:{}", JsonUtils.toJsonString(shopIntroductionTemp)); | |
113 | + log.info("查询店铺介绍-app:{}", JsonUtils.toJsonString(shopIntroductionTemp)); | |
114 | 114 | return Message.success(shopCommonService.queryShopIntroduction(shopIntroductionTemp)); |
115 | 115 | } |
116 | 116 | ... | ... |
etrade-shop/src/main/java/com/diligrp/etrade/shop/dao/ShopExpressSettingDao.java
0 → 100644
1 | +package com.diligrp.etrade.shop.dao; | |
2 | + | |
3 | +import com.diligrp.etrade.core.mybatis.MybatisMapperSupport; | |
4 | +import com.diligrp.etrade.shop.domain.response.ShopExpressVo; | |
5 | +import com.diligrp.etrade.shop.model.ShopExpressSetting; | |
6 | +import org.springframework.stereotype.Repository; | |
7 | + | |
8 | +@Repository("shopExpressSettingDao") | |
9 | +public interface ShopExpressSettingDao extends MybatisMapperSupport { | |
10 | + | |
11 | + int insert(ShopExpressSetting record); | |
12 | + | |
13 | + ShopExpressVo selectByShopId(Long shopId); | |
14 | + | |
15 | + int update(ShopExpressSetting record); | |
16 | +} | |
0 | 17 | \ No newline at end of file | ... | ... |
etrade-shop/src/main/java/com/diligrp/etrade/shop/domain/request/ShopExpressCo.java
0 → 100644
1 | +package com.diligrp.etrade.shop.domain.request; | |
2 | + | |
3 | +import com.diligrp.etrade.core.util.JsonUtils; | |
4 | +import com.diligrp.etrade.shop.model.ShopExpressSetting; | |
5 | +import org.springframework.format.annotation.DateTimeFormat; | |
6 | + | |
7 | +import java.io.Serializable; | |
8 | +import java.math.BigDecimal; | |
9 | +import java.time.LocalTime; | |
10 | +import java.util.Date; | |
11 | +import java.util.List; | |
12 | + | |
13 | +/** | |
14 | + * 店铺运费设置 | |
15 | + * | |
16 | + * @author | |
17 | + */ | |
18 | +public class ShopExpressCo implements Serializable { | |
19 | + | |
20 | + | |
21 | + private Long id; | |
22 | + /** | |
23 | + * 店铺id | |
24 | + */ | |
25 | + private Long shopId; | |
26 | + /** | |
27 | + * 配送方式 | |
28 | + */ | |
29 | + private List<Integer> type; | |
30 | + /** | |
31 | + * 固定运费 | |
32 | + */ | |
33 | + private BigDecimal fee; | |
34 | + /** | |
35 | + * 包邮条件 | |
36 | + */ | |
37 | + private List<Integer> condition; | |
38 | + /** | |
39 | + * 包邮金额 | |
40 | + */ | |
41 | + private BigDecimal freeAmount; | |
42 | + /** | |
43 | + * 包邮时间 | |
44 | + */ | |
45 | + @DateTimeFormat(pattern = "HH:mm") | |
46 | + private LocalTime freeTime; | |
47 | + /** | |
48 | + * 创建时间 | |
49 | + */ | |
50 | + private Date createdTime; | |
51 | + /** | |
52 | + * 创建人名字 | |
53 | + */ | |
54 | + private String creater; | |
55 | + /** | |
56 | + * 创建人ID | |
57 | + */ | |
58 | + private Long createrId; | |
59 | + /** | |
60 | + * 更新时间 | |
61 | + */ | |
62 | + private Date modifiedTime; | |
63 | + /** | |
64 | + * 修改人名字 | |
65 | + */ | |
66 | + private String modifier; | |
67 | + /** | |
68 | + * 修改人ID | |
69 | + */ | |
70 | + private Long modifierId; | |
71 | + | |
72 | + public ShopExpressSetting toShopExpressSetting() { | |
73 | + ShopExpressSetting shopExpressSetting = new ShopExpressSetting(); | |
74 | + shopExpressSetting.setId(this.getId()); | |
75 | + shopExpressSetting.setShopId(this.getShopId()); | |
76 | + shopExpressSetting.setType(JsonUtils.toJsonString(this.getType()) ); | |
77 | + shopExpressSetting.setFee(this.getFee()); | |
78 | + shopExpressSetting.setCondition(JsonUtils.toJsonString(this.getCondition())); | |
79 | + shopExpressSetting.setFreeAmount(this.getFreeAmount()); | |
80 | + shopExpressSetting.setFreeTime(this.getFreeTime()); | |
81 | + return shopExpressSetting; | |
82 | + } | |
83 | + | |
84 | + public Long getId() { | |
85 | + return id; | |
86 | + } | |
87 | + | |
88 | + public void setId(Long id) { | |
89 | + this.id = id; | |
90 | + } | |
91 | + | |
92 | + public Long getShopId() { | |
93 | + return shopId; | |
94 | + } | |
95 | + | |
96 | + public void setShopId(Long shopId) { | |
97 | + this.shopId = shopId; | |
98 | + } | |
99 | + | |
100 | + public List<Integer> getType() { | |
101 | + return type; | |
102 | + } | |
103 | + | |
104 | + public void setType(List<Integer> type) { | |
105 | + this.type = type; | |
106 | + } | |
107 | + | |
108 | + public BigDecimal getFee() { | |
109 | + return fee; | |
110 | + } | |
111 | + | |
112 | + public void setFee(BigDecimal fee) { | |
113 | + this.fee = fee; | |
114 | + } | |
115 | + | |
116 | + public List<Integer> getCondition() { | |
117 | + return condition; | |
118 | + } | |
119 | + | |
120 | + public void setCondition(List<Integer> condition) { | |
121 | + this.condition = condition; | |
122 | + } | |
123 | + | |
124 | + public BigDecimal getFreeAmount() { | |
125 | + return freeAmount; | |
126 | + } | |
127 | + | |
128 | + public void setFreeAmount(BigDecimal freeAmount) { | |
129 | + this.freeAmount = freeAmount; | |
130 | + } | |
131 | + | |
132 | + public LocalTime getFreeTime() { | |
133 | + return freeTime; | |
134 | + } | |
135 | + | |
136 | + public void setFreeTime(LocalTime freeTime) { | |
137 | + this.freeTime = freeTime; | |
138 | + } | |
139 | + | |
140 | + public Date getCreatedTime() { | |
141 | + return createdTime; | |
142 | + } | |
143 | + | |
144 | + public void setCreatedTime(Date createdTime) { | |
145 | + this.createdTime = createdTime; | |
146 | + } | |
147 | + | |
148 | + public String getCreater() { | |
149 | + return creater; | |
150 | + } | |
151 | + | |
152 | + public void setCreater(String creater) { | |
153 | + this.creater = creater; | |
154 | + } | |
155 | + | |
156 | + public Long getCreaterId() { | |
157 | + return createrId; | |
158 | + } | |
159 | + | |
160 | + public void setCreaterId(Long createrId) { | |
161 | + this.createrId = createrId; | |
162 | + } | |
163 | + | |
164 | + public Date getModifiedTime() { | |
165 | + return modifiedTime; | |
166 | + } | |
167 | + | |
168 | + public void setModifiedTime(Date modifiedTime) { | |
169 | + this.modifiedTime = modifiedTime; | |
170 | + } | |
171 | + | |
172 | + public String getModifier() { | |
173 | + return modifier; | |
174 | + } | |
175 | + | |
176 | + public void setModifier(String modifier) { | |
177 | + this.modifier = modifier; | |
178 | + } | |
179 | + | |
180 | + public Long getModifierId() { | |
181 | + return modifierId; | |
182 | + } | |
183 | + | |
184 | + public void setModifierId(Long modifierId) { | |
185 | + this.modifierId = modifierId; | |
186 | + } | |
187 | +} | |
0 | 188 | \ No newline at end of file | ... | ... |
etrade-shop/src/main/java/com/diligrp/etrade/shop/domain/request/ShopExpressQueryCo.java
0 → 100644
1 | +package com.diligrp.etrade.shop.domain.request; | |
2 | + | |
3 | +import jakarta.validation.constraints.NotNull; | |
4 | + | |
5 | +import java.io.Serializable; | |
6 | + | |
7 | +/** | |
8 | + * 店铺运费设置查询 | |
9 | + * | |
10 | + * @author | |
11 | + */ | |
12 | +public class ShopExpressQueryCo implements Serializable { | |
13 | + | |
14 | + | |
15 | + /** | |
16 | + * 店铺id | |
17 | + */ | |
18 | + @NotNull(message = "shopId should not be null") | |
19 | + private Long shopId; | |
20 | + | |
21 | + | |
22 | + public Long getShopId() { | |
23 | + return shopId; | |
24 | + } | |
25 | + | |
26 | + public void setShopId(Long shopId) { | |
27 | + this.shopId = shopId; | |
28 | + } | |
29 | +} | |
0 | 30 | \ No newline at end of file | ... | ... |
etrade-shop/src/main/java/com/diligrp/etrade/shop/domain/response/ShopExpressVo.java
0 → 100644
1 | +package com.diligrp.etrade.shop.domain.response; | |
2 | + | |
3 | +import com.fasterxml.jackson.annotation.JsonFormat; | |
4 | + | |
5 | +import java.io.Serializable; | |
6 | +import java.math.BigDecimal; | |
7 | +import java.time.LocalTime; | |
8 | +import java.util.Date; | |
9 | +import java.util.List; | |
10 | + | |
11 | +/** | |
12 | + * 店铺运费设置 | |
13 | + * | |
14 | + * @author | |
15 | + */ | |
16 | +public class ShopExpressVo implements Serializable { | |
17 | + | |
18 | + private static final long serialVersionUID = 1L; | |
19 | + | |
20 | + private Long id; | |
21 | + /** | |
22 | + * 店铺id | |
23 | + */ | |
24 | + private Long shopId; | |
25 | + /** | |
26 | + * 配送方式 | |
27 | + */ | |
28 | + private List<Integer> type; | |
29 | + /** | |
30 | + * 固定运费 | |
31 | + */ | |
32 | + private BigDecimal fee; | |
33 | + /** | |
34 | + * 包邮条件 | |
35 | + */ | |
36 | + private List<Integer> condition; | |
37 | + /** | |
38 | + * 包邮金额 | |
39 | + */ | |
40 | + private BigDecimal freeAmount; | |
41 | + /** | |
42 | + * 包邮时间 | |
43 | + */ | |
44 | + @JsonFormat(pattern = "HH:mm") | |
45 | + private LocalTime freeTime; | |
46 | + | |
47 | + /** | |
48 | + * 包邮时间段 单位小时 | |
49 | + */ | |
50 | + private Integer period; | |
51 | + | |
52 | + /** | |
53 | + * 创建时间 | |
54 | + */ | |
55 | + private Date createdTime; | |
56 | + /** | |
57 | + * 创建人名字 | |
58 | + */ | |
59 | + private String creater; | |
60 | + /** | |
61 | + * 创建人ID | |
62 | + */ | |
63 | + private Long createrId; | |
64 | + /** | |
65 | + * 更新时间 | |
66 | + */ | |
67 | + private Date modifiedTime; | |
68 | + /** | |
69 | + * 修改人名字 | |
70 | + */ | |
71 | + private String modifier; | |
72 | + /** | |
73 | + * 修改人ID | |
74 | + */ | |
75 | + private Long modifierId; | |
76 | + | |
77 | + public Long getId() { | |
78 | + return id; | |
79 | + } | |
80 | + | |
81 | + public void setId(Long id) { | |
82 | + this.id = id; | |
83 | + } | |
84 | + | |
85 | + public Long getShopId() { | |
86 | + return shopId; | |
87 | + } | |
88 | + | |
89 | + public void setShopId(Long shopId) { | |
90 | + this.shopId = shopId; | |
91 | + } | |
92 | + | |
93 | + public List<Integer> getType() { | |
94 | + return type; | |
95 | + } | |
96 | + | |
97 | + public void setType(List<Integer> type) { | |
98 | + this.type = type; | |
99 | + } | |
100 | + | |
101 | + public BigDecimal getFee() { | |
102 | + return fee; | |
103 | + } | |
104 | + | |
105 | + public void setFee(BigDecimal fee) { | |
106 | + this.fee = fee; | |
107 | + } | |
108 | + | |
109 | + public List<Integer> getCondition() { | |
110 | + return condition; | |
111 | + } | |
112 | + | |
113 | + public void setCondition(List<Integer> condition) { | |
114 | + this.condition = condition; | |
115 | + } | |
116 | + | |
117 | + public BigDecimal getFreeAmount() { | |
118 | + return freeAmount; | |
119 | + } | |
120 | + | |
121 | + public void setFreeAmount(BigDecimal freeAmount) { | |
122 | + this.freeAmount = freeAmount; | |
123 | + } | |
124 | + | |
125 | + public LocalTime getFreeTime() { | |
126 | + return freeTime; | |
127 | + } | |
128 | + | |
129 | + public void setFreeTime(LocalTime freeTime) { | |
130 | + this.freeTime = freeTime; | |
131 | + } | |
132 | + | |
133 | + public Integer getPeriod() { | |
134 | + return period; | |
135 | + } | |
136 | + | |
137 | + public void setPeriod(Integer period) { | |
138 | + this.period = period; | |
139 | + } | |
140 | + | |
141 | + public Date getCreatedTime() { | |
142 | + return createdTime; | |
143 | + } | |
144 | + | |
145 | + public void setCreatedTime(Date createdTime) { | |
146 | + this.createdTime = createdTime; | |
147 | + } | |
148 | + | |
149 | + public String getCreater() { | |
150 | + return creater; | |
151 | + } | |
152 | + | |
153 | + public void setCreater(String creater) { | |
154 | + this.creater = creater; | |
155 | + } | |
156 | + | |
157 | + public Long getCreaterId() { | |
158 | + return createrId; | |
159 | + } | |
160 | + | |
161 | + public void setCreaterId(Long createrId) { | |
162 | + this.createrId = createrId; | |
163 | + } | |
164 | + | |
165 | + public Date getModifiedTime() { | |
166 | + return modifiedTime; | |
167 | + } | |
168 | + | |
169 | + public void setModifiedTime(Date modifiedTime) { | |
170 | + this.modifiedTime = modifiedTime; | |
171 | + } | |
172 | + | |
173 | + public String getModifier() { | |
174 | + return modifier; | |
175 | + } | |
176 | + | |
177 | + public void setModifier(String modifier) { | |
178 | + this.modifier = modifier; | |
179 | + } | |
180 | + | |
181 | + public Long getModifierId() { | |
182 | + return modifierId; | |
183 | + } | |
184 | + | |
185 | + public void setModifierId(Long modifierId) { | |
186 | + this.modifierId = modifierId; | |
187 | + } | |
188 | +} | |
0 | 189 | \ No newline at end of file | ... | ... |
etrade-shop/src/main/java/com/diligrp/etrade/shop/model/ShopExpressSetting.java
0 → 100644
1 | +package com.diligrp.etrade.shop.model; | |
2 | + | |
3 | +import java.io.Serializable; | |
4 | +import java.math.BigDecimal; | |
5 | +import java.time.LocalTime; | |
6 | +import java.util.Date; | |
7 | + | |
8 | +/** | |
9 | + * 店铺运费设置 | |
10 | + * shop_express_setting | |
11 | + */ | |
12 | + | |
13 | +public class ShopExpressSetting implements Serializable { | |
14 | + private static final long serialVersionUID = 1L; | |
15 | + private Long id; | |
16 | + /** | |
17 | + * 店铺id | |
18 | + */ | |
19 | + private Long shopId; | |
20 | + /** | |
21 | + * 配送方式 | |
22 | + */ | |
23 | + private String type; | |
24 | + /** | |
25 | + * 固定运费 | |
26 | + */ | |
27 | + private BigDecimal fee; | |
28 | + /** | |
29 | + * 包邮条件 | |
30 | + */ | |
31 | + private String condition; | |
32 | + /** | |
33 | + * 包邮金额 | |
34 | + */ | |
35 | + private BigDecimal freeAmount; | |
36 | + /** | |
37 | + * 包邮时间 | |
38 | + */ | |
39 | + private LocalTime freeTime; | |
40 | + /** | |
41 | + * 包邮时间段 单位小时 | |
42 | + */ | |
43 | + private Integer period; | |
44 | + /** | |
45 | + * 创建时间 | |
46 | + */ | |
47 | + private Date createdTime; | |
48 | + /** | |
49 | + * 创建人名字 | |
50 | + */ | |
51 | + private String creater; | |
52 | + /** | |
53 | + * 创建人ID | |
54 | + */ | |
55 | + private Long createrId; | |
56 | + /** | |
57 | + * 更新时间 | |
58 | + */ | |
59 | + private Date modifiedTime; | |
60 | + /** | |
61 | + * 修改人名字 | |
62 | + */ | |
63 | + private String modifier; | |
64 | + /** | |
65 | + * 修改人ID | |
66 | + */ | |
67 | + private Long modifierId; | |
68 | + | |
69 | + public Long getId() { | |
70 | + return id; | |
71 | + } | |
72 | + | |
73 | + public void setId(Long id) { | |
74 | + this.id = id; | |
75 | + } | |
76 | + | |
77 | + public Long getShopId() { | |
78 | + return shopId; | |
79 | + } | |
80 | + | |
81 | + public void setShopId(Long shopId) { | |
82 | + this.shopId = shopId; | |
83 | + } | |
84 | + | |
85 | + public String getType() { | |
86 | + return type; | |
87 | + } | |
88 | + | |
89 | + public void setType(String type) { | |
90 | + this.type = type; | |
91 | + } | |
92 | + | |
93 | + public BigDecimal getFee() { | |
94 | + return fee; | |
95 | + } | |
96 | + | |
97 | + public void setFee(BigDecimal fee) { | |
98 | + this.fee = fee; | |
99 | + } | |
100 | + | |
101 | + public String getCondition() { | |
102 | + return condition; | |
103 | + } | |
104 | + | |
105 | + public void setCondition(String condition) { | |
106 | + this.condition = condition; | |
107 | + } | |
108 | + | |
109 | + public BigDecimal getFreeAmount() { | |
110 | + return freeAmount; | |
111 | + } | |
112 | + | |
113 | + public void setFreeAmount(BigDecimal freeAmount) { | |
114 | + this.freeAmount = freeAmount; | |
115 | + } | |
116 | + | |
117 | + public LocalTime getFreeTime() { | |
118 | + return freeTime; | |
119 | + } | |
120 | + | |
121 | + public void setFreeTime(LocalTime freeTime) { | |
122 | + this.freeTime = freeTime; | |
123 | + } | |
124 | + | |
125 | + public Integer getPeriod() { | |
126 | + return period; | |
127 | + } | |
128 | + | |
129 | + public void setPeriod(Integer period) { | |
130 | + this.period = period; | |
131 | + } | |
132 | + | |
133 | + public Date getCreatedTime() { | |
134 | + return createdTime; | |
135 | + } | |
136 | + | |
137 | + public void setCreatedTime(Date createdTime) { | |
138 | + this.createdTime = createdTime; | |
139 | + } | |
140 | + | |
141 | + public String getCreater() { | |
142 | + return creater; | |
143 | + } | |
144 | + | |
145 | + public void setCreater(String creater) { | |
146 | + this.creater = creater; | |
147 | + } | |
148 | + | |
149 | + public Long getCreaterId() { | |
150 | + return createrId; | |
151 | + } | |
152 | + | |
153 | + public void setCreaterId(Long createrId) { | |
154 | + this.createrId = createrId; | |
155 | + } | |
156 | + | |
157 | + public Date getModifiedTime() { | |
158 | + return modifiedTime; | |
159 | + } | |
160 | + | |
161 | + public void setModifiedTime(Date modifiedTime) { | |
162 | + this.modifiedTime = modifiedTime; | |
163 | + } | |
164 | + | |
165 | + public String getModifier() { | |
166 | + return modifier; | |
167 | + } | |
168 | + | |
169 | + public void setModifier(String modifier) { | |
170 | + this.modifier = modifier; | |
171 | + } | |
172 | + | |
173 | + public Long getModifierId() { | |
174 | + return modifierId; | |
175 | + } | |
176 | + | |
177 | + public void setModifierId(Long modifierId) { | |
178 | + this.modifierId = modifierId; | |
179 | + } | |
180 | +} | |
0 | 181 | \ No newline at end of file | ... | ... |
etrade-shop/src/main/java/com/diligrp/etrade/shop/service/ShopExpressSettingService.java
0 → 100644
1 | +package com.diligrp.etrade.shop.service; | |
2 | + | |
3 | +import com.diligrp.etrade.shop.domain.request.ShopExpressCo; | |
4 | +import com.diligrp.etrade.shop.domain.request.ShopExpressQueryCo; | |
5 | +import com.diligrp.etrade.shop.domain.response.ShopExpressVo; | |
6 | + | |
7 | +public interface ShopExpressSettingService { | |
8 | + | |
9 | + | |
10 | + /** | |
11 | + * 查询店铺店铺运费设置详情 | |
12 | + */ | |
13 | + ShopExpressVo detail(ShopExpressQueryCo shopExpressQueryCo); | |
14 | + | |
15 | + /** | |
16 | + * 保存店铺运费设置 | |
17 | + */ | |
18 | + boolean save(ShopExpressCo shopExpressCo); | |
19 | +} | ... | ... |
etrade-shop/src/main/java/com/diligrp/etrade/shop/service/impl/ShopExpressSettingServiceImpl.java
0 → 100644
1 | +package com.diligrp.etrade.shop.service.impl; | |
2 | + | |
3 | +import com.diligrp.etrade.shop.dao.ShopExpressSettingDao; | |
4 | +import com.diligrp.etrade.shop.domain.request.ShopExpressCo; | |
5 | +import com.diligrp.etrade.shop.domain.request.ShopExpressQueryCo; | |
6 | +import com.diligrp.etrade.shop.domain.response.ShopExpressVo; | |
7 | +import com.diligrp.etrade.shop.model.ShopExpressSetting; | |
8 | +import com.diligrp.etrade.shop.service.ShopExpressSettingService; | |
9 | +import org.slf4j.Logger; | |
10 | +import org.slf4j.LoggerFactory; | |
11 | +import org.springframework.beans.factory.annotation.Autowired; | |
12 | +import org.springframework.stereotype.Service; | |
13 | + | |
14 | +@Service | |
15 | +public class ShopExpressSettingServiceImpl implements ShopExpressSettingService { | |
16 | + | |
17 | + private static final Logger log = LoggerFactory.getLogger(ShopExpressSettingServiceImpl.class); | |
18 | + | |
19 | + @Autowired | |
20 | + private ShopExpressSettingDao shopExpressSettingDao; | |
21 | + | |
22 | + @Override | |
23 | + public ShopExpressVo detail(ShopExpressQueryCo queryCo) { | |
24 | + | |
25 | + ShopExpressVo shopExpressVo = shopExpressSettingDao.selectByShopId(queryCo.getShopId()); | |
26 | + | |
27 | + return shopExpressVo; | |
28 | + } | |
29 | + | |
30 | + @Override | |
31 | + public boolean save(ShopExpressCo shopExpressCo) { | |
32 | + | |
33 | + ShopExpressVo shopExpressVo = shopExpressSettingDao.selectByShopId(shopExpressCo.getShopId()); | |
34 | + if (shopExpressVo == null) { | |
35 | + ShopExpressSetting shopExpressSetting = shopExpressCo.toShopExpressSetting(); | |
36 | + shopExpressSetting.setPeriod(24); | |
37 | + int insert = shopExpressSettingDao.insert(shopExpressSetting); | |
38 | + return insert > 0; | |
39 | + } else { | |
40 | + ShopExpressSetting shopExpressSetting = shopExpressCo.toShopExpressSetting(); | |
41 | + int update = shopExpressSettingDao.update(shopExpressSetting); | |
42 | + return update > 0; | |
43 | + } | |
44 | + | |
45 | + } | |
46 | +} | ... | ... |
etrade-shop/src/main/resources/com/diligrp/etrade/dao/mapper/ShopExpressSettingDao.xml
0 → 100644
1 | +<?xml version="1.0" encoding="UTF-8"?> | |
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
3 | +<mapper namespace="com.diligrp.etrade.shop.dao.ShopExpressSettingDao"> | |
4 | + | |
5 | + <resultMap id="BaseResultMap" type="com.diligrp.etrade.shop.domain.response.ShopExpressVo"> | |
6 | + <id column="id" jdbcType="BIGINT" property="id" /> | |
7 | + <result column="shop_id" jdbcType="BIGINT" property="shopId" /> | |
8 | + <result column="type" property="type" typeHandler="com.diligrp.etrade.core.mybatis.JsonArrayTypeHandler"/> | |
9 | + <result column="fee" jdbcType="DECIMAL" property="fee" /> | |
10 | + <result column="condition" property="condition" typeHandler="com.diligrp.etrade.core.mybatis.JsonArrayTypeHandler"/> | |
11 | + <result column="free_amount" jdbcType="DECIMAL" property="freeAmount" /> | |
12 | + <result column="free_time" jdbcType="VARCHAR" property="freeTime" /> | |
13 | + <result column="period" jdbcType="INTEGER" property="period" /> | |
14 | + <result column="created_time" jdbcType="TIMESTAMP" property="createdTime" /> | |
15 | + <result column="creater" jdbcType="VARCHAR" property="creater" /> | |
16 | + <result column="creater_id" jdbcType="BIGINT" property="createrId" /> | |
17 | + <result column="modified_time" jdbcType="TIMESTAMP" property="modifiedTime" /> | |
18 | + <result column="modifier" jdbcType="VARCHAR" property="modifier" /> | |
19 | + <result column="modifier_id" jdbcType="BIGINT" property="modifierId" /> | |
20 | + </resultMap> | |
21 | + | |
22 | + <sql id="Base_Column_List"> | |
23 | + id, shop_id, `type`, fee, `condition`, free_amount, free_time, `period`, created_time, creater, | |
24 | + creater_id, modified_time, modifier, modifier_id | |
25 | + </sql> | |
26 | + <select id="selectByShopId" parameterType="java.lang.Long" resultMap="BaseResultMap"> | |
27 | + select | |
28 | + <include refid="Base_Column_List" /> | |
29 | + from shop_express_setting | |
30 | + where shop_id = #{shopId,jdbcType=BIGINT} | |
31 | + </select> | |
32 | + | |
33 | + <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.diligrp.etrade.shop.model.ShopExpressSetting" useGeneratedKeys="true"> | |
34 | + insert into shop_express_setting (shop_id, `type`, fee, | |
35 | + `condition`, free_amount, free_time, period, | |
36 | + creater, creater_id, modifier, modifier_id | |
37 | + ) | |
38 | + values (#{shopId,jdbcType=BIGINT}, #{type,jdbcType=OTHER}, #{fee,jdbcType=DECIMAL}, | |
39 | + #{condition,jdbcType=OTHER}, #{freeAmount,jdbcType=DECIMAL}, #{freeTime,jdbcType=VARCHAR}, #{period,jdbcType=INTEGER}, | |
40 | + #{creater,jdbcType=VARCHAR}, #{createrId,jdbcType=BIGINT}, #{modifier,jdbcType=VARCHAR}, #{modifierId,jdbcType=BIGINT} | |
41 | + ) | |
42 | + </insert> | |
43 | + | |
44 | + <update id="update" parameterType="com.diligrp.etrade.shop.model.ShopExpressSetting"> | |
45 | + update shop_express_setting | |
46 | + <set> | |
47 | + <if test="shopId != null"> | |
48 | + shop_id = #{shopId,jdbcType=BIGINT}, | |
49 | + </if> | |
50 | + <if test="type != null"> | |
51 | + `type` = #{type,jdbcType=TINYINT}, | |
52 | + </if> | |
53 | + <if test="fee != null"> | |
54 | + fee = #{fee,jdbcType=DECIMAL}, | |
55 | + </if> | |
56 | + <if test="condition != null"> | |
57 | + `condition` = #{condition,jdbcType=OTHER}, | |
58 | + </if> | |
59 | + <if test="freeAmount != null"> | |
60 | + free_amount = #{freeAmount,jdbcType=DECIMAL}, | |
61 | + </if> | |
62 | + <if test="freeTime != null"> | |
63 | + free_time = #{freeTime,jdbcType=VARCHAR}, | |
64 | + </if> | |
65 | + <if test="period != null"> | |
66 | + period = #{period,jdbcType=INTEGER}, | |
67 | + </if> | |
68 | + <if test="creater != null"> | |
69 | + creater = #{creater,jdbcType=VARCHAR}, | |
70 | + </if> | |
71 | + <if test="createrId != null"> | |
72 | + creater_id = #{createrId,jdbcType=BIGINT}, | |
73 | + </if> | |
74 | + <if test="modifier != null"> | |
75 | + modifier = #{modifier,jdbcType=VARCHAR}, | |
76 | + </if> | |
77 | + <if test="modifierId != null"> | |
78 | + modifier_id = #{modifierId,jdbcType=BIGINT}, | |
79 | + </if> | |
80 | + </set> | |
81 | + where id = #{id,jdbcType=BIGINT} | |
82 | + </update> | |
83 | + | |
84 | +</mapper> | |
0 | 85 | \ No newline at end of file | ... | ... |
scripts/etrade-shop/etrade_shop.sql
... | ... | @@ -420,4 +420,23 @@ CREATE TABLE `shop` ( |
420 | 420 | UNIQUE INDEX `unq_market_customer`(`market_id` ASC, `customer_id` ASC, `name` ASC) USING BTREE COMMENT '同一市场同一客户只有一个店铺', |
421 | 421 | INDEX `idx_customer_id`(`customer_id` ASC) USING BTREE COMMENT '开店客户id索引' |
422 | 422 | ) ENGINE = InnoDB AUTO_INCREMENT = 1 COMMENT = '店铺信息表' ; |
423 | + | |
424 | +DROP TABLE IF EXISTS `shop_express_setting`; | |
425 | +CREATE TABLE `shop_express_setting` ( | |
426 | + `id` bigint NOT NULL AUTO_INCREMENT, | |
427 | + `shop_id` bigint NOT NULL COMMENT '店铺id', | |
428 | + `type` json NOT NULL COMMENT '配送方式', | |
429 | + `fee` DECIMAL(24,2) DEFAULT NULL COMMENT '固定运费', | |
430 | + `condition` json DEFAULT NULL COMMENT '包邮条件', | |
431 | + `free_amount` DECIMAL(24,2) DEFAULT NULL COMMENT '包邮金额', | |
432 | + `free_time` varchar(50) COMMENT '包邮时间', | |
433 | + `created_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', | |
434 | + `creater` varchar(50) NULL DEFAULT NULL COMMENT '创建人名字', | |
435 | + `creater_id` bigint NULL DEFAULT NULL COMMENT '创建人ID', | |
436 | + `modified_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', | |
437 | + `modifier` varchar(50) NULL DEFAULT NULL COMMENT '修改人名字', | |
438 | + `modifier_id` bigint NULL DEFAULT NULL COMMENT '修改人ID', | |
439 | + PRIMARY KEY (`id`) USING BTREE, | |
440 | + INDEX idx_shop_id(`shop_id`) USING BTREE COMMENT '店铺id' | |
441 | +) ENGINE = InnoDB AUTO_INCREMENT = 1 COMMENT = '店铺运费设置' ; | |
423 | 442 | -- 店铺部分end-- |
424 | 443 | \ No newline at end of file | ... | ... |
scripts/upgrade/v1.0.26/etrade_shop_1.0.24_data_kangtian.sql
0 → 100644
1 | +DROP TABLE IF EXISTS `shop_express_setting`; | |
2 | +CREATE TABLE `shop_express_setting` | |
3 | +( | |
4 | + `id` bigint NOT NULL AUTO_INCREMENT, | |
5 | + `shop_id` bigint NOT NULL COMMENT '店铺id', | |
6 | + `type` json NOT NULL COMMENT '配送方式', | |
7 | + `fee` DECIMAL(24, 2) DEFAULT NULL COMMENT '固定运费', | |
8 | + `condition` json DEFAULT NULL COMMENT '包邮条件', | |
9 | + `free_amount` DECIMAL(24, 2) DEFAULT NULL COMMENT '包邮金额', | |
10 | + `free_time` time COMMENT '包邮时间', | |
11 | + `period` int COMMENT '包邮时间段(如偏移24小时)', | |
12 | + `created_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', | |
13 | + `creater` varchar(50) NULL DEFAULT NULL COMMENT '创建人名字', | |
14 | + `creater_id` bigint NULL DEFAULT NULL COMMENT '创建人ID', | |
15 | + `modified_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', | |
16 | + `modifier` varchar(50) NULL DEFAULT NULL COMMENT '修改人名字', | |
17 | + `modifier_id` bigint NULL DEFAULT NULL COMMENT '修改人ID', | |
18 | + PRIMARY KEY (`id`) USING BTREE, | |
19 | + INDEX idx_shop_id(`shop_id`) USING BTREE COMMENT '店铺id' | |
20 | +) ENGINE = InnoDB AUTO_INCREMENT = 1 COMMENT = '店铺运费设置'; | |
0 | 21 | \ No newline at end of file | ... | ... |