Commit f24e91b7 by huluobin

Merge branch '3.8' into 3.9

# Conflicts:
#	src/main/java/com/gogirl/application/order/serve/impl/ScheduleManageServiceImpl.java
#	src/main/java/com/gogirl/infrastructure/mapper/market/discount/LeisureDiscountConfigLimitMapper.java
#	src/main/resources/mapper/LeisureDiscountConfigLimitMapper.xml
parents 4e82f2ee dc26aa0e
......@@ -178,7 +178,7 @@ public class OrderManageServiceImpl extends ServiceImpl<OrderManageMapper, Order
.payPrice(baseServe.getPrice())
.isOwnProduce(baseServe.getIsOwnProduce())
.achievement(baseServe.getPrice());
// .leisureDiscountPrice(BigDecimal.ZERO);
//款式信息
if (orderServeParam.getProduceId() != null) {
......@@ -250,10 +250,6 @@ public class OrderManageServiceImpl extends ServiceImpl<OrderManageMapper, Order
}
orderServe.setOwnProduce(ownProduceMapper.selectById(orderServe.getOwnProduceId()));
}
// else {
// orderServe.setIsOwnProduce(2);
// orderServe.setOwnProduceId(null);
// }
orderServe.calcPriceAndTimeLength();
orderServeMapper.insert(orderServe);
......@@ -265,6 +261,15 @@ public class OrderManageServiceImpl extends ServiceImpl<OrderManageMapper, Order
OrderServe orderServe = orderServeMapper.selectById(orderServeParam.getId());
//如果修改的订单服务 闲时折扣作废
if (!orderServe.getServeId().equals(orderServeParam.getServeId())) {
//设置折扣属性
orderServe.setLeisureDiscountConfigId(null);
orderServe.setDiscountRate(null);
orderServe.setLeisurePrice(null);
}
//服务改价
orderServe.setServeChangePrice(orderServeParam.getServeChangePrice());
//服务id
......@@ -348,9 +353,7 @@ public class OrderManageServiceImpl extends ServiceImpl<OrderManageMapper, Order
orderServe.setServeChangePrice(orderServeParam.getServeChangePrice());
}
List<StoreTechnician> storeTechnicianList = storeTechnicianMapper.selectList(
new LambdaQueryWrapper<StoreTechnician>().in(StoreTechnician::getId, Lists.newArrayList(orderServeParam.getTechnicianId().split(",")))
);
List<StoreTechnician> storeTechnicianList = storeTechnicianMapper.selectList(new LambdaQueryWrapper<StoreTechnician>().in(StoreTechnician::getId, Lists.newArrayList(orderServeParam.getTechnicianId().split(","))));
//美甲师id
orderServe.setTechnicianId(orderServeParam.getTechnicianId());
//美甲师姓名
......@@ -369,6 +372,7 @@ public class OrderManageServiceImpl extends ServiceImpl<OrderManageMapper, Order
orderServe.setOwnProduce(ownProduceMapper.selectById(orderServe.getOwnProduceId()));
}
orderServe.calcPriceAndTimeLength();
orderServeMapper.updateById(orderServe);
}
......
package com.gogirl.application.product.serve.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gogirl.application.product.serve.BaseServeService;
import com.gogirl.domain.market.discount.LeisureDiscountConfig;
import com.gogirl.domain.product.serve.BaseProduce;
import com.gogirl.domain.product.serve.BaseServe;
import com.gogirl.infrastructure.mapper.market.discount.LeisureDiscountConfigMapper;
import com.gogirl.infrastructure.mapper.product.serve.BaseProduceMapper;
import com.gogirl.infrastructure.mapper.product.serve.BaseServeMapper;
import com.gogirl.infrastructure.util.SessionUtils;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
......@@ -20,6 +23,7 @@ public class BaseServeServiceImpl extends ServiceImpl<BaseServeMapper, BaseServe
private final BaseServeMapper baseServeMapper;
private final LeisureDiscountConfigMapper leisureDiscountConfigMapper;
private final BaseProduceMapper baseProduceMapper;
@Override
......@@ -30,15 +34,12 @@ public class BaseServeServiceImpl extends ServiceImpl<BaseServeMapper, BaseServe
@Override
public BaseServe getAggregate(Integer id, LocalDateTime date, Integer departmentId) {
BaseServe baseServe = baseServeMapper.selectById(id);
if (date != null) {
LeisureDiscountConfig leisureDiscountConfig = leisureDiscountConfigMapper.selectLeisureDiscount(id,
date.toLocalTime().toString(),
date.getDayOfWeek().getValue(),
departmentId);
if (leisureDiscountConfig != null)
baseServe.setDiscountRate(leisureDiscountConfig.getDiscountRate());
BaseServe baseServe = baseServeMapper.selectById(id);
if (SessionUtils.getSourceFrom().equals(SessionUtils.technician)) {
List<BaseProduce> baseProduceList = baseProduceMapper.selectList(new LambdaQueryWrapper<BaseProduce>().eq(BaseProduce::getServiceId, id));
baseServe.setListProduce(baseProduceList);
}
return baseServe;
}
......
......@@ -211,4 +211,5 @@ public class CareerCmdServiceImpl implements CareerCmdService {
return baseProducePage;
}
}
......@@ -111,6 +111,7 @@ public class StoreTechnicianServiceImpl extends ServiceImpl<StoreTechnicianMappe
if (storeTechnician.getDepartmentId() != null) {
wrapper.eq(StoreTechnician::getDepartmentId, storeTechnician.getDepartmentId());
}
wrapper.eq(StoreTechnician::getIsAdmin, false);
return this.list(wrapper);
}
}
......@@ -44,5 +44,5 @@ public class LeisureDiscountConfig implements Serializable {
@TableField("`limit`")
private Integer limit;
private Integer leftTimes;
}
package com.gogirl.domain.market.discount;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -20,17 +23,21 @@ import java.time.LocalDateTime;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="LeisureDiscountConfigLimit对象", description="")
@ApiModel(value = "LeisureDiscountConfigLimit对象", description = "")
public class LeisureDiscountConfigLimit implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "日期")
private LocalDateTime date;
@ApiModelProperty(value = "闲时折扣id")
private Integer leisureDiscountConfigId;
@TableField("`limit`")
@ApiModelProperty(value = "限制数量")
private Integer limit;
......
......@@ -81,14 +81,19 @@ public class OrderServe implements Serializable {
*/
@ApiModelProperty("服务数量")
private Integer serveNumber;
@ApiModelProperty("预约服务id")
private Integer serveId;
@ApiModelProperty("服务名称")
private String serveName;
@ApiModelProperty("图片名称")
private String servePicturePath;
@ApiModelProperty("服务价格")
private BigDecimal servePrice;
@ApiModelProperty("服务分类")
private String serveType;
......@@ -148,6 +153,7 @@ public class OrderServe implements Serializable {
private Integer removeCouponId;
@TableField(strategy = FieldStrategy.IGNORED)
@ApiModelProperty("闲时折扣配置id")
private Integer leisureDiscountConfigId;
......@@ -237,9 +243,11 @@ public class OrderServe implements Serializable {
@TableField(strategy = FieldStrategy.IGNORED)
private Integer producePromotionTimeId;
@TableField(strategy = FieldStrategy.IGNORED)
@ApiModelProperty("折扣")
private BigDecimal discountRate;
@TableField(strategy = FieldStrategy.IGNORED)
@ApiModelProperty("闲时价格")
private BigDecimal leisurePrice;
......
......@@ -175,10 +175,6 @@ public class ScheduleManage implements Serializable {
@ApiModelProperty("预约用户信息")
private Customer customer;
public void setRemark(String remark) {
this.remark = this.remark + "," + remark;
}
public void addScheduleServeList(Collection<ScheduleServe> scheduleServes) {
listScheduleServer.addAll(scheduleServes);
}
......
......@@ -82,6 +82,7 @@ public class ScheduleServe implements Serializable {
* 款式
*/
@TableField(strategy = FieldStrategy.IGNORED)
private BigDecimal discountRate;
......@@ -132,6 +133,7 @@ public class ScheduleServe implements Serializable {
@ApiModelProperty("售后说明")
private String explain;
@TableField(strategy = FieldStrategy.IGNORED)
private Integer leisureDiscountConfigId;
......@@ -185,6 +187,7 @@ public class ScheduleServe implements Serializable {
private Integer producePromotionTimeId;
@TableField(strategy = FieldStrategy.IGNORED)
private BigDecimal leisurePrice;
@ApiModelProperty("是否自带款式 1-是 2-否")
......
......@@ -121,5 +121,6 @@ public class StoreTechnician implements Serializable {
@TableField(exist = false)
private StoreTechnicianDTO applyStoreTechnicianDTO;
@ApiModelProperty("是否管理员")
private Boolean isAdmin;
}
......@@ -3,6 +3,10 @@ package com.gogirl.infrastructure.mapper.market.discount;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gogirl.domain.market.discount.LeisureDiscountConfigLimit;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Param;
import java.time.LocalDate;
import java.time.LocalTime;
/**
* <p>
......@@ -22,5 +26,12 @@ public interface LeisureDiscountConfigLimitMapper extends BaseMapper<LeisureDisc
* @param leisureDiscountConfigId
* @return
*/
LeisureDiscountConfigLimit selectConfigLimit(@Param("date") String date, @Param("leisureDiscountConfigId") Integer leisureDiscountConfigId);
LeisureDiscountConfigLimit selectConfigLimit(String date, Integer leisureDiscountConfigId);
LeisureDiscountConfigLimit selectOneLeisureDiscountConfig(@Param("leisureDiscountConfigId") Integer leisureDiscountConfigId,
@Param("serveId") Integer serveId,
@Param("time") LocalTime time,
@Param("date") LocalDate date);
}
......@@ -2,71 +2,17 @@ package com.gogirl.infrastructure.mapper.market.discount;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gogirl.domain.market.discount.LeisureDiscountConfig;
import com.gogirl.domain.product.serve.BaseServe;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface LeisureDiscountConfigMapper extends BaseMapper<LeisureDiscountConfig> {
/**
* 获取店铺对应星期数的打折服务列表
*
* @param departmentId 店铺id
* @param week 周几
* @return 服务列表
*/
List<BaseServe> selectByDepartmentId(@Param("departmentId") Integer departmentId, @Param("week") int week);
/**
* 获取折扣最低的闲时折扣
*
* @return discount
*/
LeisureDiscountConfig queryMinDiscount();
/**
* 获取时间,服务,周几对应的折扣
*
* @param time 时间形如'10:00'
* @param serviceId 服务id
* @param weekday 周几
* @return 折扣列表
*/
LeisureDiscountConfig selectLeisureDiscount(@Param("serviceId") Integer serviceId,
@Param("time") String time,
@Param("weekday") int weekday,
@Param("departmentId") int departmentId);
/**
* 获取店铺id,星期数,时间段形如'10:00'对应的折扣列表 忽略剩余次数条件
*
* @param departmentId 店铺Id
* @param finalWeekday 星期几
* @param time 时间形如
* @return list
*/
List<BaseServe> selectByDepartmentIdAndWeekAndDateTime(@Param("departmentId") Integer departmentId, @Param("week") int finalWeekday, @Param("time") String time);
/**
* 获取店铺id,星期数对应的折扣列表 忽略剩余次数条件
*
* @param departmentId 店铺Id
* @param weekday 星期几
* @return list
*/
List<LeisureDiscountConfig> selectByDepartmentIdAndWeekIgnoreLimit(@Param("departmentId") Integer departmentId, @Param("week") int weekday);
/**
* 获取时间,服务,周几对应的折扣列表
*
* @param time 时间形如'10:00'
* @param serveId 服务id
* @param weekday 周几
* @return 折扣列表
*/
List<LeisureDiscountConfig> selectIsLeisureTime(@Param("time") String time, @Param("serveId") Integer serveId, @Param("week") int weekday);
}
......@@ -29,6 +29,7 @@ import com.gogirl.infrastructure.common.util.JsonUtilByJackson;
import com.gogirl.infrastructure.common.util.ListUtil;
import com.gogirl.infrastructure.config.property.GogirlProperties;
import com.gogirl.infrastructure.mapper.market.coupon.CouponCustomerRelevanceMapper;
import com.gogirl.infrastructure.mapper.market.discount.LeisureDiscountConfigLimitMapper;
import com.gogirl.infrastructure.mapper.market.timescard.TimesCardCustomerRelevanceMapper;
import com.gogirl.infrastructure.mapper.order.mall.MallOrderMapper;
import com.gogirl.infrastructure.mapper.order.serve.OrderManageMapper;
......@@ -122,6 +123,7 @@ public class Schedule {
private final GogirlProperties gogirlProperties;
private final TechnicianPushService technicianPushService;
private final LeisureDiscountConfigLimitMapper leisureDiscountConfigLimitMapper;
private final TimesCardCustomerRelevanceMapper timesCardCustomerRelevanceMapper;
private final RestTemplate restTemplate;
......@@ -384,6 +386,16 @@ public class Schedule {
localDate = localDate.plusDays(1);
}
log.debug("同步闲时折扣周 结束");
log.debug("同步最新闲时间折扣限制开始");
try {
leisureDiscountConfigLimitMapper.syncWeekConfigLimit();
} catch (Exception e) {
log.error("同步最新闲时间折扣限制失败");
}
log.debug("同步最新闲时间折扣限制结束");
}
/**
......
......@@ -68,7 +68,6 @@ public class ScheduleManageController {
}
@ApiOperation("提交预约")
@PostMapping("/customer/schedule/submitSchedule")
public JsonResult<Void> submitSchedule(@RequestBody SubmitScheduleCommand cmd) throws ParseException, ExecutionException, InterruptedException {
......@@ -208,11 +207,11 @@ public class ScheduleManageController {
public JsonResult<Void> updateSchedule(@RequestBody SubmitScheduleCommand cmd) throws ParseException, ExecutionException, InterruptedException {
ScheduledLock scheduledLock = ScheduledLock.getInstance();
if (cmd.getScheduleManageDTO().getId() == null) {
throw new InvalidParameterException();
}
try {
log.info("店员更新预约:{}", cmd);
if (cmd.getScheduleManageDTO().getId() == null) {
throw new InvalidParameterException();
}
scheduledLock.lock(cmd.getScheduleManageDTO().getId());
cmd.getScheduleManageDTO().setDepartmentId(SessionUtils.getTechnicianToken().getDepartmentId());
......@@ -225,6 +224,7 @@ public class ScheduleManageController {
return JsonResult.success();
}
@Deprecated
@ApiOperation("更新前检查预约")
@PostMapping("/technician/schedule/checkBeforeUpdate")
public JsonResult<Void> checkBeforeUpdate(@RequestBody UpdateScheduleCommand cmd) {
......@@ -232,6 +232,12 @@ public class ScheduleManageController {
}
/**
* @param scheduleServeId
* @param status
* @param forceLeisureConfig 强制使用闲时预约次数 1-是 2-否
* @return
*/
@ApiOperation("更新预约服务状态")
@GetMapping("/technician/schedule/updateScheduledServeStatus")
public JsonResult<Void> updateScheduledServeStatus(@RequestParam Integer scheduleServeId,
......@@ -253,7 +259,7 @@ public class ScheduleManageController {
}
@ApiOperation("当前服务是否在闲时间范围内 1-是 2-否")
@ApiOperation("当前服务是否在闲时间范围内 1-是 2-否 3-不存在")
@GetMapping("/technician/schedule/getScheduledServeLeisure")
public JsonResult<Integer> getScheduledServeLeisure(@RequestParam Integer scheduleServeId) {
Integer result = scheduleManageService.getScheduledServeLeisure(scheduleServeId);
......
-----BEGIN CERTIFICATE-----
MIIFsTCCBJmgAwIBAgIQCKySqqQm3xoNyG7XLDT9ZzANBgkqhkiG9w0BAQsFADBy
MQswCQYDVQQGEwJDTjElMCMGA1UEChMcVHJ1c3RBc2lhIFRlY2hub2xvZ2llcywg
SW5jLjEdMBsGA1UECxMURG9tYWluIFZhbGlkYXRlZCBTU0wxHTAbBgNVBAMTFFRy
dXN0QXNpYSBUTFMgUlNBIENBMB4XDTIwMDcxMTAwMDAwMFoXDTIxMDcxMjEyMDAw
MFowHDEaMBgGA1UEAxMRd3d3LmJlZ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5kgATWRVD/D9zmG51/6EGL8fojKw29x9M0iQkHyzTpKbXQ3tAoGBAOKFGt2j
7L60nRUTFymXHjsn0e6CqDn0kn+afe5XcgUV8yB27pWik6vjw+fOYJSw8654dEgB
WI2vnjwk1fC4gzsaWHuW4WpcSnx5XI58QNddAUQ0dA/45b/Oy/EYbW0k72S20WcJ
kvVDcNGxg1ZmJlbwbz61P6TF0C+tgNSurUAJAoGBAJn77a6E4avmraYCW0k84KzW
jW9fewntmEx0b4op6jYoXkHWEvEzevgtZRac6BEQoGF4fG4I5eaRStTtUYCKTteL
IGgpi9Ocf4IOXJzImccfzRlV8Hfqqvs6GNJvuToMuG1P7W3Im+qxQ2cE0P8WqrtV
DpDoN6KEZzht2jlUi4ShAoGBAKN8dbtpyECLkqPXN2xpCQSg5L9Dxa6ued1m32TZ
8A0DnonbzK5qvDHfHVF8ffBTFkzh2urtLcB087tsyowGX5CUny/z4ZUmLwxPeyHL
Q/EryvIy+WFdvlQFKORFQRT5B16lI9U977bcidyORcBh0WIF/gRARELkEjGXA9h8
icYhAoGBAJJ85K12hYyt//to0TUcC1yzf1dnZotfO3tbVEkTglPTPwNSmRa6JvNT
sz2XwDSTmo3YzQcIyHfoZmQ1CkBi4lLh3wIHcOSBtYsvfBmvWpZc1lim6N3rpODZ
DE4qCzRqoXb+izfyScmXf13db3ups48QM9zkIokND8Avu2eUR6aW
-----END RSA PRIVATE KEY-----
\ No newline at end of file
......@@ -14,8 +14,8 @@ spring:
mybatis-plus:
mapper-locations:
- classpath:mapper/**/*.xml
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
# configuration:
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
server:
undertow:
......
......@@ -16,4 +16,29 @@
where t1.date = #{date}
and t1.leisure_discount_config_id = #{leisureDiscountConfigId}
</select>
<select id="selectOneLeisureDiscountConfig"
resultType="com.gogirl.domain.market.discount.LeisureDiscountConfigLimit">
SELECT t9.*
from leisure_discount_config t1
LEFT JOIN leisure_discount_config_week t2 on t1.id = t2.leisure_discount_config_id
LEFT JOIN leisure_discount_config_service t3 on t1.id = t3.leisure_discount_config_id
LEFT JOIN time_node t5 on t1.start_time &lt;= t5.time_node and t1.end_time &gt;= t5.time_node
LEFT JOIN base_serve t6 on t3.service_id = t6.id
LEFT JOIN week_config t7 on t2.`week` = t7.`week`
LEFT JOIN store_manage t8 on t1.department_id = t8.id
LEFT JOIN leisure_discount_config_limit t9
on t1.id = t9.leisure_discount_config_id and t9.left_times > 0 and
t7.week_date = t9.date
where t1.is_enabled = 1
and t2.id is not null
and t3.id is not null
and t9.id is not null
and t1.id = #{leisureDiscountConfigId}
and t3.service_id = #{serveId}
and t5.time_node = #{time}
and t7.week_date = #{date}
limit 1
</select>
</mapper>
......@@ -2,31 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.gogirl.infrastructure.mapper.market.discount.LeisureDiscountConfigMapper">
<select id="selectIsLeisureTime" resultType="com.gogirl.domain.market.discount.LeisureDiscountConfig">
select *
from leisure_discount_config t1
left join leisure_discount_config_service t2 on t1.id = t2.leisure_discount_config_id
left join leisure_discount_config_week t4 on t1.id = t4.leisure_discount_config_id
where t1.start_time &lt;= #{time}
and t1.end_time &gt;= #{time}
and t2.service_id = #{serveId}
and t1.is_enabled = 1
and t1.left_times &gt; 0
and t4.week = #{week}
</select>
<select id="selectByDepartmentId" resultType="com.gogirl.domain.product.serve.BaseServe">
select t3.*
from leisure_discount_config t1
left join leisure_discount_config_service t2 on t1.id = t2.leisure_discount_config_id
left join leisure_discount_config_week t4 on t1.id = t4.leisure_discount_config_id
left join base_serve t3 on t2.service_id = t3.id
where t1.department_id = #{departmentId}
and t1.left_times &gt; 0
and t1.is_enabled = 1
and t3.id is not null
and t4.week = #{week}
</select>
<select id="queryMinDiscount" resultType="com.gogirl.domain.market.discount.LeisureDiscountConfig">
select *
......@@ -37,44 +13,5 @@
limit 1
</select>
<select id="selectLeisureDiscount" resultType="com.gogirl.domain.market.discount.LeisureDiscountConfig">
SELECT *
from leisure_discount_config t1
LEFT JOIN leisure_discount_config_service t2 on t1.id = t2.leisure_discount_config_id
LEFT JOIN leisure_discount_config_week t3 on t1.id = t3.leisure_discount_config_id
where t2.service_id = #{serviceId}
and t1.start_time &lt;= #{time}
and t1.end_time &gt;= #{time}
and t1.is_enabled = 1
and t3.week = #{weekday}
and t1.left_times &gt; 0
and t1.department_id = #{departmentId}
limit 1
</select>
<select id="selectByDepartmentIdAndWeekAndDateTime" resultType="com.gogirl.domain.product.serve.BaseServe">
select t3.*
from leisure_discount_config t1
left join leisure_discount_config_service t2 on t1.id = t2.leisure_discount_config_id
left join leisure_discount_config_week t4 on t1.id = t4.leisure_discount_config_id
left join base_serve t3 on t2.service_id = t3.id
where t1.department_id = #{departmentId}
and t1.is_enabled = 1
and t3.id is not null
and t4.week = #{week}
and t1.start_time &lt;= #{time}
and t1.end_time &gt;= #{time}
and t1.left_times &gt; 0
</select>
<select id="selectByDepartmentIdAndWeekIgnoreLimit"
resultType="com.gogirl.domain.market.discount.LeisureDiscountConfig">
select *
from leisure_discount_config t1
left join leisure_discount_config_week t2 on t1.id = t2.leisure_discount_config_id
where t1.department_id
and t2.week = #{week}
and t1.is_enabled = 1
</select>
</mapper>
\ No newline at end of file
</mapper>
......@@ -245,7 +245,7 @@
LEFT JOIN base_serve t6 on t3.service_id =t6.id
LEFT JOIN week_config t7 on t2.`week` =t7.`week`
LEFT JOIN store_manage t8 on t1.department_id =t8.id
LEFT JOIN leisure_discount_config_limit t9 on t1.id =t9.leisure_discount_config_id and t9.left_times > 0
LEFT JOIN leisure_discount_config_limit t9 on t1.id =t9.leisure_discount_config_id and t9.left_times > 0 and t7.week_date = t9.date
where t1.is_enabled =1
and t2.id is not null
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment