Commit a535ec9b by huluobin

update

parent cca5624b
......@@ -20,6 +20,7 @@ import com.gogirl.shared.market.command.SetUpOuterCouponCommand;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.Comparator;
......@@ -30,6 +31,7 @@ import java.util.stream.Collectors;
@Service
@AllArgsConstructor
@Slf4j
@Transactional
public class MarketServiceImpl implements MarketService {
......@@ -70,7 +72,9 @@ public class MarketServiceImpl implements MarketService {
couponCustomerRelevance.setState(null);
});
if (ListUtil.isNotEmpty(setterCouponCustomerRelevanceList)) {
couponCustomerRelevanceService.saveOrUpdateBatch(setterCouponCustomerRelevanceList);
}
couponOrderRelevanceService.remove(new LambdaQueryWrapper<CouponOrderRelevance>()
.eq(CouponOrderRelevance::getOrderId, cmd.getOrderId())
......
package com.gogirl.assembler;
import com.gogirl.domain.market.serve.CouponCustomerRelevance;
import com.gogirl.shared.market.query.dto.CouponCustomerRelevanceDTO;
import lombok.AllArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import java.util.function.Function;
@Component
@AllArgsConstructor
public class CouponCustomerRelevanceDTOAssembler implements Function<CouponCustomerRelevance, CouponCustomerRelevanceDTO> {
@Override
public CouponCustomerRelevanceDTO apply(CouponCustomerRelevance couponCustomerRelevance) {
CouponCustomerRelevanceDTO couponCustomerRelevanceDTO = new CouponCustomerRelevanceDTO();
BeanUtils.copyProperties(couponCustomerRelevance, couponCustomerRelevanceDTO);
return couponCustomerRelevanceDTO;
}
}
package com.gogirl.assembler;
import com.gogirl.domain.market.serve.Coupon;
import com.gogirl.shared.market.query.dto.CouponDTO;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import java.util.function.Function;
@Component
public class CouponDTOAssembler implements Function<Coupon, CouponDTO> {
@Override
public CouponDTO apply(Coupon coupon) {
CouponDTO couponDTO = new CouponDTO();
BeanUtils.copyProperties(coupon, couponDTO);
return couponDTO;
}
}
......@@ -19,6 +19,10 @@ public class OrderManageDTOAssembler implements Function<OrderManage, OrderManag
private final OrderServeDTOAssembler orderServeDTOAssembler;
private final ScheduleManageDTOAssembler scheduleManageDTOAssembler;
private final CouponCustomerRelevanceDTOAssembler couponCustomerRelevanceDTOAssembler;
private final TimesCardCustomerRelevanceDTOAssembler timesCardCustomerRelevanceDTOAssembler;
private final TimesCardUsedRecordDTOAssembler timesCardUsedRecordDTOAssembler;
@Override
public OrderManageDTO apply(OrderManage orderManage) {
OrderManageDTO orderManageDTO = new OrderManageDTO();
......@@ -33,6 +37,15 @@ public class OrderManageDTOAssembler implements Function<OrderManage, OrderManag
ScheduleManageDTO scheduleManageDTO = scheduleManageDTOAssembler.apply(orderManage.getScheduleManage());
orderManageDTO.setScheduleManageDTO(scheduleManageDTO);
}
if (ListUtil.isNotEmpty(orderManage.getListCouponOrderRelevance())) {
orderManageDTO.setCouponCustomerRelevanceDTOList(orderManage.getCouponCustomerRelevanceList()
.stream().map(couponCustomerRelevanceDTOAssembler).collect(Collectors.toList()));
}
if (ListUtil.isNotEmpty(orderManage.getListTimesCardRecord())) {
orderManageDTO.setTimesCardUsedRecordDTOList(orderManage.getListTimesCardRecord()
.stream().map(timesCardUsedRecordDTOAssembler).collect(Collectors.toList()));
}
return orderManageDTO;
}
......
package com.gogirl.assembler;
import com.gogirl.domain.market.serve.TimesCardCustomerRelevance;
import com.gogirl.shared.market.query.dto.TimesCardCustomerRelevanceDTO;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import java.util.function.Function;
@Component
public class TimesCardCustomerRelevanceDTOAssembler implements Function<TimesCardCustomerRelevance, TimesCardCustomerRelevanceDTO> {
@Override
public TimesCardCustomerRelevanceDTO apply(TimesCardCustomerRelevance timesCardCustomerRelevance) {
TimesCardCustomerRelevanceDTO timesCardCustomerRelevanceDTO = new TimesCardCustomerRelevanceDTO();
BeanUtils.copyProperties(timesCardCustomerRelevance, timesCardCustomerRelevanceDTO);
return timesCardCustomerRelevanceDTO;
}
}
package com.gogirl.assembler;
import com.gogirl.domain.market.serve.TimesCardUsedRecord;
import com.gogirl.shared.market.query.dto.TimesCardUsedRecordDTO;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import java.util.function.Function;
@Component
public class TimesCardUsedRecordDTOAssembler implements Function<TimesCardUsedRecord, TimesCardUsedRecordDTO> {
@Override
public TimesCardUsedRecordDTO apply(TimesCardUsedRecord timesCardUsedRecord) {
TimesCardUsedRecordDTO timesCardUsedRecordDTO = new TimesCardUsedRecordDTO();
BeanUtils.copyProperties(timesCardUsedRecord, timesCardUsedRecordDTO);
return timesCardUsedRecordDTO;
}
}
......@@ -34,7 +34,7 @@ public class StoreTechnician {
private Integer id;
//兼容旧版本字段
@Deprecated
// @Deprecated
@TableField(exist = false)
private Integer technicianId;
......
......@@ -4,6 +4,7 @@
<mapper namespace="com.gogirl.infrastructure.mapper.store.StoreTechnicianMapper">
<resultMap id="resultTechnician" type="com.gogirl.domain.store.store.StoreTechnician">
<result property="id" column="id"/>
<result property="technicianId" column="technician_id"/>
<result property="openid" column="openid"/>
<result property="picturePath" column="picture_path"/>
<result property="technicianNo" column="technician_no"/>
......@@ -32,16 +33,21 @@
</resultMap>
<sql id="baseSql">
id,openid, name, department_id departmentId, create_time createTime, mobile, user_authority userAuthority, grade, picture_path picturePath, status tech_status,score,st.user_id
id,openid, name, department_id departmentId, create_time createTime, mobile, user_authority userAuthority,
grade, picture_path picturePath, status tech_status,score,st.user_id
</sql>
<sql id="technicianSql">
tech.id id ,tech.openid openid ,tech.picture_path picture_path ,tech.technician_no technician_no ,tech.name name ,tech.department_id department_id,tech.create_time create_time ,tech.mobile mobile ,tech.user_authority user_authority ,tech.grade grade ,tech.status status ,tech.score score ,tech.user_id user_id
tech.id technician_id ,tech.openid openid ,tech.picture_path picture_path ,tech.technician_no technician_no
,tech.name name ,tech.department_id department_id,tech.create_time create_time ,tech.mobile mobile
,tech.user_authority user_authority ,tech.grade grade ,tech.status status ,tech.score score ,tech.user_id
user_id
</sql>
<sql id="classestechnician">
ct.id ct_id, ct.user_id ct_user_id, ct.days ct_days, ct.classes ct_classes, ct.status ct_status
</sql>
<sql id="classes">
cls.id cla_id, cls.name cls_name, cls.start_time cls_start_time, cls.end_time cls_end_time, cls.use_number cls_use_number, cls.department_id cls_department_id
cls.id cla_id, cls.name cls_name, cls.start_time cls_start_time, cls.end_time cls_end_time, cls.use_number
cls_use_number, cls.department_id cls_department_id
</sql>
<update id="updateTechnicianManageById">
......
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