## 添加报单赠送总计
This commit is contained in:
		
							parent
							
								
									412a26adf9
								
							
						
					
					
						commit
						c936497f13
					
				|  | @ -3,8 +3,10 @@ package com.hzs.activity.declaration.controller.manage; | |||
| 
 | ||||
| import com.hzs.activity.add.param.AcAddUpgradeListParam; | ||||
| import com.hzs.activity.declaration.param.AcDeclarationListParam; | ||||
| import com.hzs.activity.declaration.param.AcDeclarationListTotalParam; | ||||
| import com.hzs.activity.declaration.service.IAcDeclarationGiftRecordService; | ||||
| import com.hzs.activity.declaration.vo.AcDeclarationListVO; | ||||
| import com.hzs.activity.declaration.vo.AcDeclarationTotalListVO; | ||||
| import com.hzs.common.core.annotation.Log; | ||||
| import com.hzs.common.core.enums.EOperationBusiness; | ||||
| import com.hzs.common.core.enums.EOperationMethod; | ||||
|  | @ -54,6 +56,33 @@ public class AcDeclarationGiftRecordController extends BaseController { | |||
|         startPage(); | ||||
|         List<AcDeclarationListVO> list = acDeclarationGiftRecordService.selectDeclarationList(param); | ||||
|         ExcelUtil<AcDeclarationListVO> util = new ExcelUtil<>(AcDeclarationListVO.class); | ||||
|         util.exportExcel(response, list, "报单赠送数据导出"); | ||||
|         util.exportExcel(response, list, "报单赠送明细数据导出"); | ||||
|     } | ||||
|     /** | ||||
|      * | ||||
|      * @param param | ||||
|      * @return | ||||
|      */ | ||||
|     @Log(module = EOperationModule.AC_DECLARATION_GIFT_LIST_TOTAL, business = EOperationBusiness.AC_DECLARATION_GIFT_LIST_TOTAL, method = EOperationMethod.SELECT) | ||||
|     @GetMapping("/list-total") | ||||
|     public TableDataInfo directPushUpgradeListTotal(AcDeclarationListTotalParam param) { | ||||
|         startPage(); | ||||
|         return getDataTable(acDeclarationGiftRecordService.selectDeclarationListTotal(param)); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * | ||||
|      * @param param | ||||
|      * @return | ||||
|      */ | ||||
|     @Log(module = EOperationModule.AC_DECLARATION_GIFT_LIST_TOTAL_EXPORT, business = EOperationBusiness.AC_DECLARATION_GIFT_LIST_TOTAL_EXPORT, method = EOperationMethod.SELECT) | ||||
|     @PostMapping("/list-total-export") | ||||
|     public void directPushUpgradeListTotalExport(AcDeclarationListTotalParam param, HttpServletResponse response) { | ||||
|         startPage(); | ||||
|         List<AcDeclarationTotalListVO> list = acDeclarationGiftRecordService.selectDeclarationListTotal(param); | ||||
|         ExcelUtil<AcDeclarationTotalListVO> util = new ExcelUtil<>(AcDeclarationTotalListVO.class); | ||||
|         util.exportExcel(response, list, "报单赠送总计数据导出"); | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
| } | ||||
|  |  | |||
|  | @ -2,6 +2,8 @@ package com.hzs.activity.declaration.mapper; | |||
| 
 | ||||
| import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||||
| import com.hzs.activity.declaration.param.AcDeclarationListParam; | ||||
| import com.hzs.activity.declaration.param.AcDeclarationListTotalParam; | ||||
| import com.hzs.activity.declaration.vo.AcDeclarationTotalListVO; | ||||
| import com.hzs.common.domain.activity.declaration.AcDeclarationGiftRecord; | ||||
| import com.hzs.activity.declaration.vo.AcDeclarationListVO; | ||||
| import com.hzs.common.domain.activity.base.ext.AcGiftConfigExt; | ||||
|  | @ -26,4 +28,6 @@ public interface AcDeclarationGiftRecordMapper extends BaseMapper<AcDeclarationG | |||
|     AcDeclarationGiftRecord selectLastRecord(); | ||||
| 
 | ||||
|     List<AcGiftConfigExt> queryListByRuleList(@Param("pkDataId") List<Long> pkDataId,@Param("pkCountry") Integer pkCountry); | ||||
| 
 | ||||
|     List<AcDeclarationTotalListVO> selectDeclarationListTotal(AcDeclarationListTotalParam param); | ||||
| } | ||||
|  |  | |||
|  | @ -0,0 +1,19 @@ | |||
| package com.hzs.activity.declaration.param; | ||||
| 
 | ||||
| import lombok.AllArgsConstructor; | ||||
| import lombok.Data; | ||||
| import lombok.NoArgsConstructor; | ||||
| 
 | ||||
| @Data | ||||
| @AllArgsConstructor | ||||
| @NoArgsConstructor | ||||
| public class AcDeclarationListTotalParam { | ||||
|     /** | ||||
|      * 活动名称 | ||||
|      */ | ||||
|     private String actName; | ||||
|     /** | ||||
|      * 产品编号 | ||||
|      */ | ||||
|     private String productCode; | ||||
| } | ||||
|  | @ -2,6 +2,8 @@ package com.hzs.activity.declaration.service; | |||
| 
 | ||||
| import com.baomidou.mybatisplus.extension.service.IService; | ||||
| import com.hzs.activity.declaration.param.AcDeclarationListParam; | ||||
| import com.hzs.activity.declaration.param.AcDeclarationListTotalParam; | ||||
| import com.hzs.activity.declaration.vo.AcDeclarationTotalListVO; | ||||
| import com.hzs.common.domain.activity.declaration.AcDeclarationGiftRecord; | ||||
| import com.hzs.activity.declaration.vo.AcDeclarationListVO; | ||||
| import com.hzs.common.domain.activity.base.ext.AcGiftConfigExt; | ||||
|  | @ -24,4 +26,6 @@ public interface IAcDeclarationGiftRecordService extends IService<AcDeclarationG | |||
|     AcDeclarationGiftRecord selectLastRecord(); | ||||
| 
 | ||||
|     List<AcGiftConfigExt> queryListByRuleIdList(List<Long> pkDataId, Integer pkCountry); | ||||
| 
 | ||||
|     List<AcDeclarationTotalListVO> selectDeclarationListTotal(AcDeclarationListTotalParam param); | ||||
| } | ||||
|  |  | |||
|  | @ -2,10 +2,12 @@ package com.hzs.activity.declaration.service.impl; | |||
| 
 | ||||
| import com.hzs.activity.declaration.mapper.AcDeclarationGiftRecordMapper; | ||||
| import com.hzs.activity.declaration.param.AcDeclarationListParam; | ||||
| import com.hzs.activity.declaration.param.AcDeclarationListTotalParam; | ||||
| import com.hzs.activity.declaration.param.AcDeclarationProductParam; | ||||
| import com.hzs.activity.declaration.service.IAcDeclarationGiftDetailService; | ||||
| import com.hzs.activity.declaration.service.IAcDeclarationGiftRecordService; | ||||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||||
| import com.hzs.activity.declaration.vo.AcDeclarationTotalListVO; | ||||
| import com.hzs.common.domain.activity.declaration.AcDeclarationGiftRecord; | ||||
| import com.hzs.activity.declaration.vo.AcDeclarationListVO; | ||||
| import com.hzs.common.core.enums.ERegistrationAuthority; | ||||
|  | @ -94,4 +96,9 @@ public class AcDeclarationGiftRecordServiceImpl extends ServiceImpl<AcDeclaratio | |||
|         return baseMapper.queryListByRuleList(pkDataId,pkCountry); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public List<AcDeclarationTotalListVO> selectDeclarationListTotal(AcDeclarationListTotalParam param) { | ||||
|         return baseMapper.selectDeclarationListTotal(param); | ||||
|     } | ||||
| 
 | ||||
| } | ||||
|  |  | |||
|  | @ -0,0 +1,42 @@ | |||
| package com.hzs.activity.declaration.vo; | ||||
| 
 | ||||
| import com.hzs.common.core.annotation.Excel; | ||||
| import lombok.AllArgsConstructor; | ||||
| import lombok.Data; | ||||
| import lombok.NoArgsConstructor; | ||||
| 
 | ||||
| @Data | ||||
| @AllArgsConstructor | ||||
| @NoArgsConstructor | ||||
| public class AcDeclarationTotalListVO { | ||||
| 
 | ||||
|     /** | ||||
|      * 活动名称 | ||||
|      */ | ||||
|     @Excel(name = "活动名称") | ||||
|     private String actName; | ||||
| 
 | ||||
|     /** | ||||
|      * 产品名称 | ||||
|      */ | ||||
|     @Excel(name = "产品名称") | ||||
|     private String productName; | ||||
| 
 | ||||
|     /** | ||||
|      * 产品编号 | ||||
|      */ | ||||
|     @Excel(name = "产品编号") | ||||
|     private String productCode; | ||||
| 
 | ||||
|     /** | ||||
|      * 产品规格 | ||||
|      */ | ||||
|     @Excel(name = "产品规格") | ||||
|     private String specsName; | ||||
| 
 | ||||
|     /** | ||||
|      * 数量 | ||||
|      */ | ||||
|     @Excel(name = "数量") | ||||
|     private Integer quantity; | ||||
| } | ||||
|  | @ -112,9 +112,9 @@ public class AcTourismServiceProvider implements IAcTourismServiceApi { | |||
| 
 | ||||
|         // 查询订单 | ||||
|         List<SaOrder> orderList = iSaOrderService.list(new LambdaQueryWrapper<SaOrder>() | ||||
|                 .nested(w -> w.in(SaOrder::getOrderType, EOrderType.REGISTER_ORDER, EOrderType.UPGRADE_ORDER) | ||||
|                 .nested(w -> w.in(SaOrder::getOrderType, EOrderType.REGISTER_ORDER.getValue(), EOrderType.UPGRADE_ORDER.getValue()) | ||||
|                         .or() | ||||
|                         .nested(x -> x.eq(SaOrder::getOrderType, EOrderType.REPURCHASE_ORDER) | ||||
|                         .nested(x -> x.eq(SaOrder::getOrderType, EOrderType.REPURCHASE_ORDER.getValue()) | ||||
|                                 .eq(SaOrder::getOrderTypeExtend, 1))) | ||||
|                 .apply("TRUNC(PAY_TIME) = TRUNC(SYSDATE - {0})", daysAgo) | ||||
|                 .eq(SaOrder::getOrderStatus, 1) | ||||
|  |  | |||
|  | @ -70,6 +70,7 @@ | |||
|                 AND tgt.SPECS_NAME = src.SPECS_NAME | ||||
|                 AND tgt.SPECS_NAME_ID = src.SPECS_NAME_ID | ||||
|                 AND tgt.PK_BASE_ID = src.PK_BASE_ID | ||||
|                 AND tgt.DEL_FLAG = src.DEL_FLAG | ||||
|             ) | ||||
|             WHEN MATCHED THEN | ||||
|                 UPDATE | ||||
|  |  | |||
|  | @ -20,7 +20,8 @@ | |||
| 
 | ||||
|     <!-- 通用查询结果列 --> | ||||
|     <sql id="Base_Column_List"> | ||||
|         DEL_FLAG, | ||||
|         DEL_FLAG | ||||
|         , | ||||
|         CREATION_TIME, | ||||
|         PK_CREATOR, | ||||
|         MODIFIED_TIME, | ||||
|  | @ -118,12 +119,9 @@ | |||
|         </if> | ||||
|     </select> | ||||
|     <select id="selectLastRecord" resultType="com.hzs.common.domain.activity.declaration.AcDeclarationGiftRecord"> | ||||
|         SELECT | ||||
|             * | ||||
|         FROM | ||||
|             (SELECT * FROM AC_DECLARATION_GIFT_RECORD WHERE DEL_FLAG = 0 ORDER BY CREATION_TIME DESC) | ||||
|         WHERE | ||||
|             ROWNUM = 1 | ||||
|         SELECT * | ||||
|         FROM (SELECT * FROM AC_DECLARATION_GIFT_RECORD WHERE DEL_FLAG = 0 ORDER BY CREATION_TIME DESC) | ||||
|         WHERE ROWNUM = 1 | ||||
|     </select> | ||||
|     <select id="queryListByRuleList" resultType="com.hzs.common.domain.activity.base.ext.AcGiftConfigExt"> | ||||
|         select adgd.*, | ||||
|  | @ -148,5 +146,42 @@ | |||
|         and adgd.pk_country = #{pkCountry} | ||||
|         order by adgd.PK_RULE_ID, adgd.pk_id | ||||
|     </select> | ||||
|     <select id="selectDeclarationListTotal" | ||||
|             resultType="com.hzs.activity.declaration.vo.AcDeclarationTotalListVO"> | ||||
|         SELECT | ||||
|         base.PK_ID AS PK_BASE_ID, | ||||
|         base.ACT_NAME AS actName, | ||||
|         adgd.PK_PRODUCT AS PRODUCT_ID, | ||||
|         bp.PRODUCT_NAME AS productName, | ||||
|         bp.PRODUCT_CODE AS productCode, | ||||
|         adgd.SPECS_NAME as specsName, | ||||
|         SUM(adgd.QUANTITY) AS quantity | ||||
|         FROM | ||||
|         AC_BASE_CONFIG base | ||||
|         JOIN AC_DECLARATION_GIFT_RECORD adgr ON adgr.PK_BASE_ID = base.PK_ID | ||||
|         JOIN AC_DECLARATION_GIFT_DETAIL adgd ON adgr.PK_RULE_ID = adgd.PK_RULE_ID | ||||
|         JOIN BD_PRODUCT bp ON adgd.PK_PRODUCT = bp.PK_ID | ||||
|         WHERE | ||||
|         base.ACT_TYPE = 32 | ||||
|         AND base.DEL_FLAG = 0 | ||||
|         AND adgr.DEL_FLAG = 0 | ||||
|         AND adgd.DEL_FLAG = 0 | ||||
|         <if test="productCode!= null and productCode != ''"> | ||||
|             AND bp.PRODUCT_CODE LIKE #{productCode} || '%' | ||||
|         </if> | ||||
|         <if test="actName!= null and productCode != ''"> | ||||
|             AND base.ACT_NAME = #{actName} | ||||
|         </if> | ||||
|         GROUP BY | ||||
|         base.PK_ID, | ||||
|         base.ACT_NAME, | ||||
|         adgd.PK_PRODUCT, | ||||
|         bp.PRODUCT_NAME, | ||||
|         bp.PRODUCT_CODE, | ||||
|         adgd.SPECS_NAME | ||||
|         ORDER BY | ||||
|         base.PK_ID, | ||||
|         adgd.PK_PRODUCT | ||||
|     </select> | ||||
| 
 | ||||
| </mapper> | ||||
|  |  | |||
|  | @ -280,6 +280,10 @@ public enum EOperationBusiness { | |||
| 
 | ||||
|     AC_DECLARATION_GIFT_LIST_EXPORT("报单赠送数据导出"), | ||||
| 
 | ||||
|     AC_DECLARATION_GIFT_LIST_TOTAL("报单赠送总计数据"), | ||||
| 
 | ||||
|     AC_DECLARATION_GIFT_LIST_TOTAL_EXPORT("报单赠送总计数据导出"), | ||||
| 
 | ||||
|     AC_TOURISM_CONFIG("旅游活动"), | ||||
| 
 | ||||
|     TICKET_GIVE("门票活动"), | ||||
|  |  | |||
|  | @ -385,9 +385,12 @@ public enum EOperationModule { | |||
| 
 | ||||
|     AC_DECLARATION_GIFT_EXPORT("报单赠送导出"), | ||||
| 
 | ||||
|     AC_DECLARATION_GIFT_LIST("报单赠送数据"), | ||||
|     AC_DECLARATION_GIFT_LIST("报单赠送明细数据"), | ||||
| 
 | ||||
|     AC_DECLARATION_GIFT_LIST_EXPORT("报单赠送数据导出"), | ||||
|     AC_DECLARATION_GIFT_LIST_TOTAL("报单赠送总计数据"), | ||||
| 
 | ||||
|     AC_DECLARATION_GIFT_LIST_TOTAL_EXPORT("报单赠送总计数据导出"), | ||||
| 
 | ||||
| 
 | ||||
|     ///////////////////////////统计分析//////////////////////////// | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue