开店管理导出加字段
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.dto.FranchiseFeeDTO;
|
||||
import com.cool.store.entity.FranchiseFeeDO;
|
||||
import org.apache.ibatis.annotations.MapKey;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@@ -11,6 +12,6 @@ import java.util.Map;
|
||||
|
||||
public interface FranchiseFeeMapper extends Mapper<FranchiseFeeDO> {
|
||||
FranchiseFeeDO selectByShopId(@Param("shopId") Long shopId);
|
||||
@MapKey("shopId")
|
||||
Map<Long, Date> getPayTimeByShopIds(@Param("shopIds") List<Long> shopIds);
|
||||
|
||||
List<FranchiseFeeDTO> getPayTimeByShopIds(@Param("shopIds") List<Long> shopIds);
|
||||
}
|
||||
|
||||
@@ -9,14 +9,15 @@
|
||||
order by create_time desc
|
||||
limit 1
|
||||
</select>
|
||||
<select id="getPayTimeByShopIds" resultType="java.util.HashMap">
|
||||
<select id="getPayTimeByShopIds" resultType="com.cool.store.dto.FranchiseFeeDTO">
|
||||
select a.shop_id AS shopId ,
|
||||
b.pay_time as payTime
|
||||
from xfsg_franchise_fee a
|
||||
LEFT JOIN xfsg_line_pay b ON b.id = a.pay_id;
|
||||
LEFT JOIN xfsg_line_pay b ON b.id = a.pay_id
|
||||
where a.shop_id in
|
||||
<foreach collection="shopIds" item="shopId" open="(" separator="," close=")">
|
||||
#{shopId}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.cool.store.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author: WangShuo
|
||||
* @Date: 2025/02/07/14:34
|
||||
* @Version 1.0
|
||||
* @注释:
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
public class FranchiseFeeDTO {
|
||||
private Long shopId;
|
||||
|
||||
private Date payTime;
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.dao.*;
|
||||
|
||||
import com.cool.store.dto.ExportBranchShopDTO;
|
||||
import com.cool.store.dto.FranchiseFeeDTO;
|
||||
import com.cool.store.dto.Preparation.PreparationDTO;
|
||||
import com.cool.store.dto.Preparation.ScheduleDTO;
|
||||
import com.cool.store.dto.PreparationScheduleDTO;
|
||||
@@ -101,7 +102,10 @@ public class ExportRealizeServiceImpl implements ExportRealizeService {
|
||||
List<ExportBranchShopDTO> exportList = new ArrayList<>();
|
||||
List<Long> shopIds = list.stream().map(BranchShopResponse::getShopId).collect(Collectors.toList());
|
||||
List<SignFranchiseDO> signFranchises = signFranchiseMapper.selectByShopIds(shopIds);
|
||||
Map<Long, Date> payTimeByShopIds = franchiseFeeMapper.getPayTimeByShopIds(shopIds);
|
||||
List<FranchiseFeeDTO> payTimeByShopIds = franchiseFeeMapper.getPayTimeByShopIds(shopIds);
|
||||
Map<Long, Date> payTimeMap = payTimeByShopIds.stream().filter(o -> o.getPayTime() != null)
|
||||
.filter(o -> o.getShopId() != null)
|
||||
.collect(Collectors.toMap(FranchiseFeeDTO::getShopId, FranchiseFeeDTO::getPayTime));
|
||||
Map<Long, SignFranchiseDO> signFranchiseMap = new HashMap<>();
|
||||
if (signFranchises != null) {
|
||||
signFranchiseMap = signFranchises.stream().collect(Collectors.toMap(SignFranchiseDO::getShopId, Function.identity()));
|
||||
@@ -127,8 +131,11 @@ public class ExportRealizeServiceImpl implements ExportRealizeService {
|
||||
dto.setContractStartTime(DateUtils.parseDateToStr(SPECIAL_DATE_START_1, signFranchiseDO.getContractStartTime()));
|
||||
dto.setContractEndTime(DateUtils.parseDateToStr(SPECIAL_DATE_START_1, signFranchiseDO.getContractEndTime()));
|
||||
}
|
||||
dto.setPayTime(DateUtils.parseDateToStr(SPECIAL_DATE_START_1, payTimeByShopIds.get(response.getShopId())));
|
||||
InvoicingDO invoicingDO = InvoicingMap.get(response.getShopId());
|
||||
Date payTime = payTimeMap.get(response.getShopId());
|
||||
if (Objects.nonNull(payTime)){
|
||||
dto.setPayTime(DateUtils.parseDateToStr(SPECIAL_DATE_START_1,payTime));
|
||||
}
|
||||
InvoicingDO invoicingDO = InvoicingMap.get(response.getShopId());
|
||||
if (invoicingDO != null) {
|
||||
dto.setInvoicingTime(invoicingDO.getInvoiceDate());
|
||||
dto.setManagementFeeTax(invoicingDO.getManagementFeeTax().toString());
|
||||
|
||||
Reference in New Issue
Block a user