## 加购升级功能,报单赠送功能
This commit is contained in:
		
							parent
							
								
									7794df7df5
								
							
						
					
					
						commit
						cec21f424a
					
				|  | @ -90,24 +90,5 @@ public class AcAddUpgradeConfigController extends BaseController { | |||
|         ExcelUtil<BaseConfigVo> util = new ExcelUtil<>(BaseConfigVo.class); | ||||
|         util.exportExcel(response, resultList, "加购升级导出"); | ||||
|     } | ||||
|     /** | ||||
|      * | ||||
|      * @param param | ||||
|      * @return | ||||
|      */ | ||||
|     @Log(module = EOperationModule.AC_ADD_UPGRADE_LIST, business = EOperationBusiness.AC_ADD_UPGRADE_LIST, method = EOperationMethod.SELECT) | ||||
|     @GetMapping("/list") | ||||
|     public TableDataInfo directPushUpgradeList(AcAddUpgradeListParam param) { | ||||
|         startPage(); | ||||
|         return getDataTable(iAcAddUpgradeConfigService.queryList(param)); | ||||
|     } | ||||
| 
 | ||||
|     @Log(module = EOperationModule.AC_ADD_UPGRADE_LIST_EXPORT, business = EOperationBusiness.AC_ADD_UPGRADE_LIST_EXPORT, method = EOperationMethod.SELECT) | ||||
|     @PostMapping("/listExport") | ||||
|     public void export(AcAddUpgradeListParam param, HttpServletResponse response) { | ||||
|         startPage(); | ||||
|         List<AcAddUpgradeListVO> list = iAcAddUpgradeConfigService.queryList(param); | ||||
|         ExcelUtil<AcAddUpgradeListVO> util = new ExcelUtil<>(AcAddUpgradeListVO.class); | ||||
|         util.exportExcel(response, list, "加购升级数据导出"); | ||||
|     } | ||||
| } | ||||
|  |  | |||
|  | @ -1,10 +1,27 @@ | |||
| package com.hzs.activity.add.controller.manage; | ||||
| 
 | ||||
| 
 | ||||
| import com.hzs.activity.add.param.AcAddUpgradeListParam; | ||||
| import com.hzs.activity.add.service.IAcAddUpgradeConfigService; | ||||
| import com.hzs.activity.add.service.IAcAddUpgradeRecordService; | ||||
| import com.hzs.activity.add.vo.AcAddUpgradeListVO; | ||||
| import com.hzs.common.core.annotation.Log; | ||||
| import com.hzs.common.core.enums.EOperationBusiness; | ||||
| import com.hzs.common.core.enums.EOperationMethod; | ||||
| import com.hzs.common.core.enums.EOperationModule; | ||||
| import com.hzs.common.core.utils.poi.ExcelUtil; | ||||
| import com.hzs.common.core.web.controller.BaseController; | ||||
| import com.hzs.common.core.web.page.TableDataInfo; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.GetMapping; | ||||
| import org.springframework.web.bind.annotation.PostMapping; | ||||
| import org.springframework.web.bind.annotation.RequestMapping; | ||||
| 
 | ||||
| import org.springframework.web.bind.annotation.RestController; | ||||
| 
 | ||||
| import javax.servlet.http.HttpServletResponse; | ||||
| import java.util.List; | ||||
| 
 | ||||
| /** | ||||
|  * <p> | ||||
|  * 加购活动明细表 前端控制器 | ||||
|  | @ -15,6 +32,29 @@ import org.springframework.web.bind.annotation.RestController; | |||
|  */ | ||||
| @RestController | ||||
| @RequestMapping("/manage/addUpgradeRecord") | ||||
| public class AcAddUpgradeRecordController { | ||||
| public class AcAddUpgradeRecordController extends BaseController { | ||||
| 
 | ||||
|     @Autowired | ||||
|     private IAcAddUpgradeRecordService acAddUpgradeRecordService; | ||||
|     /** | ||||
|      * | ||||
|      * @param param | ||||
|      * @return | ||||
|      */ | ||||
|     @Log(module = EOperationModule.AC_ADD_UPGRADE_LIST, business = EOperationBusiness.AC_ADD_UPGRADE_LIST, method = EOperationMethod.SELECT) | ||||
|     @GetMapping("/list") | ||||
|     public TableDataInfo directPushUpgradeList(AcAddUpgradeListParam param) { | ||||
|         startPage(); | ||||
|         return getDataTable(acAddUpgradeRecordService.queryList(param)); | ||||
|     } | ||||
| 
 | ||||
|     @Log(module = EOperationModule.AC_ADD_UPGRADE_LIST_EXPORT, business = EOperationBusiness.AC_ADD_UPGRADE_LIST_EXPORT, method = EOperationMethod.SELECT) | ||||
|     @PostMapping("/listExport") | ||||
|     public void export(AcAddUpgradeListParam param, HttpServletResponse response) { | ||||
|         startPage(); | ||||
|         List<AcAddUpgradeListVO> list = acAddUpgradeRecordService.queryList(param); | ||||
|         ExcelUtil<AcAddUpgradeListVO> util = new ExcelUtil<>(AcAddUpgradeListVO.class); | ||||
|         util.exportExcel(response, list, "加购升级数据导出"); | ||||
|     } | ||||
| 
 | ||||
| } | ||||
|  |  | |||
|  | @ -1,8 +1,12 @@ | |||
| package com.hzs.activity.add.mapper; | ||||
| 
 | ||||
| import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||||
| import com.hzs.activity.add.param.AcAddUpgradeListParam; | ||||
| import com.hzs.activity.add.vo.AcAddUpgradeListVO; | ||||
| import com.hzs.activity.add.vo.AcAddUpgradeRecord; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| /** | ||||
|  * <p> | ||||
|  * 加购活动明细表 Mapper 接口 | ||||
|  | @ -13,4 +17,5 @@ import com.hzs.activity.add.vo.AcAddUpgradeRecord; | |||
|  */ | ||||
| public interface AcAddUpgradeRecordMapper extends BaseMapper<AcAddUpgradeRecord> { | ||||
| 
 | ||||
|     List<AcAddUpgradeListVO> queryList(AcAddUpgradeListParam param); | ||||
| } | ||||
|  |  | |||
|  | @ -54,10 +54,5 @@ public class AcAddUpgradeParam implements Serializable { | |||
|      */ | ||||
|     private List<AcAddUpgradeConfigParam> acAddUpgradeConfigParam; | ||||
| 
 | ||||
|     /** | ||||
|      * 权限配置列表 | ||||
|      */ | ||||
|     private List<AcBaseAuthority> authorityList; | ||||
| 
 | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -22,6 +22,4 @@ public interface IAcAddUpgradeConfigService extends IService<AcAddUpgradeConfig> | |||
|     String onLinePetition(AcAddUpgradeParam acAddUpgradeParam); | ||||
| 
 | ||||
|     AjaxResult getDetail(Integer pkId); | ||||
| 
 | ||||
|     List<AcAddUpgradeListVO> queryList(AcAddUpgradeListParam param); | ||||
| } | ||||
|  |  | |||
|  | @ -1,8 +1,12 @@ | |||
| package com.hzs.activity.add.service; | ||||
| 
 | ||||
| import com.baomidou.mybatisplus.extension.service.IService; | ||||
| import com.hzs.activity.add.param.AcAddUpgradeListParam; | ||||
| import com.hzs.activity.add.vo.AcAddUpgradeListVO; | ||||
| import com.hzs.activity.add.vo.AcAddUpgradeRecord; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| /** | ||||
|  * <p> | ||||
|  * 加购活动明细表 服务类 | ||||
|  | @ -13,4 +17,5 @@ import com.hzs.activity.add.vo.AcAddUpgradeRecord; | |||
|  */ | ||||
| public interface IAcAddUpgradeRecordService extends IService<AcAddUpgradeRecord> { | ||||
| 
 | ||||
|     List<AcAddUpgradeListVO> queryList(AcAddUpgradeListParam param); | ||||
| } | ||||
|  |  | |||
|  | @ -74,8 +74,6 @@ public class AcAddUpgradeConfigServiceImpl extends ServiceImpl<AcAddUpgradeConfi | |||
|             activityParam.setActType(EActType.ADD_UPGRADE.getValue()); | ||||
|             // 新增活动基本配置 | ||||
|             AcBaseConfig acBaseConfig = iActivityService.saveBaseConfig(activityParam); | ||||
|             // 新增活动目标权限 | ||||
|             iActivityService.saveGoalMemberConfig(activityParam, acBaseConfig); | ||||
|             // 新增加购活动配置 | ||||
|             saveAddUpgradeConfig(acAddUpgradeParam.getAcAddUpgradeConfigParam(),acBaseConfig); | ||||
|         } else if (acAddUpgradeParam.getControlType().equals(EControlType.MODIFY.getValue())) { | ||||
|  | @ -121,10 +119,6 @@ public class AcAddUpgradeConfigServiceImpl extends ServiceImpl<AcAddUpgradeConfi | |||
|         return AjaxResult.success(activityParam); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public List<AcAddUpgradeListVO> queryList(AcAddUpgradeListParam param) { | ||||
|         return baseMapper.queryList(param); | ||||
|     } | ||||
| 
 | ||||
|     private void removeAddUpgradeConfig(Long pkId) { | ||||
|         // 删除活动基本配置 | ||||
|  | @ -132,9 +126,6 @@ public class AcAddUpgradeConfigServiceImpl extends ServiceImpl<AcAddUpgradeConfi | |||
|         // 删除加购活动配置 | ||||
|         baseMapper.delete(new LambdaQueryWrapper<AcAddUpgradeConfig>() | ||||
|                 .eq(AcAddUpgradeConfig::getPkBaseId, pkId)); | ||||
|         // 删除用户权限配置 | ||||
|         iAcGoalMemberConfigService.remove(new LambdaQueryWrapper<AcGoalMemberConfig>() | ||||
|                 .eq(AcGoalMemberConfig::getPkBaseId, pkId)); | ||||
|     } | ||||
| 
 | ||||
|     private void updateAddUpgradeConfig(ActivityParam activityParam, List<AcAddUpgradeConfigParam> acAddUpgradeConfigParam) { | ||||
|  | @ -148,13 +139,8 @@ public class AcAddUpgradeConfigServiceImpl extends ServiceImpl<AcAddUpgradeConfi | |||
|             // 删除活动配置 | ||||
|             baseMapper.delete(new LambdaQueryWrapper<AcAddUpgradeConfig>() | ||||
|                     .eq(AcAddUpgradeConfig::getPkBaseId, pkId)); | ||||
|             // 删除用户权限配置 | ||||
|             iAcGoalMemberConfigService.remove(new LambdaQueryWrapper<AcGoalMemberConfig>() | ||||
|                     .eq(AcGoalMemberConfig::getPkBaseId, pkId)); | ||||
|             // 添加加购活动配置 | ||||
|             saveAddUpgradeConfig(acAddUpgradeConfigParam,baseConfig); | ||||
|             // 添加用户权限配置 | ||||
|             iActivityService.saveGoalMemberConfig(activityParam, baseConfig); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|  |  | |||
|  | @ -2,10 +2,15 @@ package com.hzs.activity.add.service.impl; | |||
| 
 | ||||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||||
| import com.hzs.activity.add.mapper.AcAddUpgradeRecordMapper; | ||||
| import com.hzs.activity.add.param.AcAddUpgradeListParam; | ||||
| import com.hzs.activity.add.service.IAcAddUpgradeRecordService; | ||||
| import com.hzs.activity.add.vo.AcAddUpgradeListVO; | ||||
| import com.hzs.activity.add.vo.AcAddUpgradeRecord; | ||||
| import org.springframework.stereotype.Service; | ||||
| 
 | ||||
| import java.util.Collections; | ||||
| import java.util.List; | ||||
| 
 | ||||
| /** | ||||
|  * <p> | ||||
|  * 加购活动明细表 服务实现类 | ||||
|  | @ -17,4 +22,8 @@ import org.springframework.stereotype.Service; | |||
| @Service | ||||
| public class AcAddUpgradeRecordServiceImpl extends ServiceImpl<AcAddUpgradeRecordMapper, AcAddUpgradeRecord> implements IAcAddUpgradeRecordService { | ||||
| 
 | ||||
|     @Override | ||||
|     public List<AcAddUpgradeListVO> queryList(AcAddUpgradeListParam param) { | ||||
|         return baseMapper.queryList(param); | ||||
|     } | ||||
| } | ||||
|  |  | |||
|  | @ -62,10 +62,5 @@ public class AcAddUpgradeListVO { | |||
|     @JsonFormat(pattern = "yyyy-MM-dd") | ||||
|     private Date creationTime; | ||||
| 
 | ||||
|     /** | ||||
|      * 升级年月 | ||||
|      */ | ||||
|     @Excel(name = "升级年月", dateFormat = "yyyy-MM-dd") | ||||
|     private String upgradeTime; | ||||
| 
 | ||||
| } | ||||
|  |  | |||
|  | @ -48,13 +48,48 @@ public class AcDeclarationGiftConfigController extends BaseController { | |||
|      * @param acDeclarationParam 报单赠送活动 | ||||
|      * @return AjaxResult | ||||
|      */ | ||||
|     @Log(module = EOperationModule.AC_DECLARATION_GIFT_SUBMIT, business = EOperationBusiness.AC_DECLARATION_GIFT_SUBMIT, method = EOperationMethod.INSERT, remark = "加购活动") | ||||
|     @PostMapping("/submit") | ||||
|     public AjaxResult onLinePetition(@RequestBody AcDeclarationParam acDeclarationParam) { | ||||
|     @Log(module = EOperationModule.AC_DECLARATION_GIFT_SAVE, business = EOperationBusiness.AC_DECLARATION_GIFT_SAVE, method = EOperationMethod.INSERT, remark = "报单赠送添加") | ||||
|     @PostMapping("/save") | ||||
|     public AjaxResult declarationConfigSave(@RequestBody AcDeclarationParam acDeclarationParam) { | ||||
|         acDeclarationParam.setPkCountry(SecurityUtils.getPkCountry()); | ||||
|         acDeclarationParam.setPkMember(SecurityUtils.getUserId()); | ||||
|         acDeclarationParam.setLoginUser(userTokenService.getLoginUser()); | ||||
|         String str = iAcDeclarationGiftConfigService.onLinePetition(acDeclarationParam); | ||||
|         String str = iAcDeclarationGiftConfigService.saveConfig(acDeclarationParam); | ||||
|         if (str != null) { | ||||
|             return AjaxResult.error(str); | ||||
|         } | ||||
|         return AjaxResult.success(); | ||||
|     } | ||||
|     /** | ||||
|      * | ||||
|      * 报单赠送活动更新 | ||||
|      * @param acDeclarationParam 报单赠送更新 | ||||
|      * @return AjaxResult | ||||
|      */ | ||||
|     @Log(module = EOperationModule.AC_DECLARATION_GIFT_UPDATE, business = EOperationBusiness.AC_DECLARATION_GIFT_UPDATE, method = EOperationMethod.UPDATE, remark = "报单赠送修改") | ||||
|     @PostMapping("/update") | ||||
|     public AjaxResult declarationConfigUpdate(@RequestBody AcDeclarationParam acDeclarationParam) { | ||||
|         acDeclarationParam.setPkCountry(SecurityUtils.getPkCountry()); | ||||
|         acDeclarationParam.setPkMember(SecurityUtils.getUserId()); | ||||
|         acDeclarationParam.setLoginUser(userTokenService.getLoginUser()); | ||||
|         String str = iAcDeclarationGiftConfigService.updateConfig(acDeclarationParam); | ||||
|         if (str != null) { | ||||
|             return AjaxResult.error(str); | ||||
|         } | ||||
|         return AjaxResult.success(); | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     /** | ||||
|      * | ||||
|      * 报单赠送活动删除 | ||||
|      * @param  pkId 报单赠送删除 | ||||
|      * @return AjaxResult | ||||
|      */ | ||||
|     @Log(module = EOperationModule.AC_DECLARATION_GIFT_DELETE, business = EOperationBusiness.AC_DECLARATION_GIFT_DELETE, method = EOperationMethod.DELETE, remark = "报单赠送删除") | ||||
|     @PostMapping("/delete") | ||||
|     public AjaxResult declarationConfigDelete(@RequestBody Long pkId) { | ||||
|         String str = iAcDeclarationGiftConfigService.deleteConfig(pkId); | ||||
|         if (str != null) { | ||||
|             return AjaxResult.error(str); | ||||
|         } | ||||
|  | @ -86,24 +121,4 @@ public class AcDeclarationGiftConfigController extends BaseController { | |||
|         util.exportExcel(response, resultList, "报单赠送导出"); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * | ||||
|      * @param param | ||||
|      * @return | ||||
|      */ | ||||
| //    @Log(module = EOperationModule.AC_DECLARATION_GIFT_LIST, business = EOperationBusiness.AC_DECLARATION_GIFT_LIST, method = EOperationMethod.SELECT) | ||||
| //    @GetMapping("/list") | ||||
| //    public TableDataInfo directPushUpgradeList(AcAddUpgradeListParam param) { | ||||
| //        startPage(); | ||||
| //        return getDataTable(iAcDeclarationGiftConfigService.queryList(param)); | ||||
| //    } | ||||
| // | ||||
| //    @Log(module = EOperationModule.AC_DECLARATION_GIFT_LIST_EXPORT, business = EOperationBusiness.AC_DECLARATION_GIFT_LIST_EXPORT, method = EOperationMethod.SELECT) | ||||
| //    @PostMapping("/listExport") | ||||
| //    public void export(AcAddUpgradeListParam param, HttpServletResponse response) { | ||||
| //        startPage(); | ||||
| //        List<AcAddUpgradeListVO> list = iAcDeclarationGiftConfigService.queryList(param); | ||||
| //        ExcelUtil<AcAddUpgradeListVO> util = new ExcelUtil<>(AcAddUpgradeListVO.class); | ||||
| //        util.exportExcel(response, list, "加购升级数据导出"); | ||||
| //    } | ||||
| } | ||||
|  |  | |||
|  | @ -1,10 +1,27 @@ | |||
| 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.service.IAcDeclarationGiftRecordService; | ||||
| import com.hzs.activity.declaration.vo.AcDeclarationListVO; | ||||
| import com.hzs.common.core.annotation.Log; | ||||
| import com.hzs.common.core.enums.EOperationBusiness; | ||||
| import com.hzs.common.core.enums.EOperationMethod; | ||||
| import com.hzs.common.core.enums.EOperationModule; | ||||
| import com.hzs.common.core.utils.poi.ExcelUtil; | ||||
| import com.hzs.common.core.web.controller.BaseController; | ||||
| import com.hzs.common.core.web.page.TableDataInfo; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.GetMapping; | ||||
| import org.springframework.web.bind.annotation.PostMapping; | ||||
| import org.springframework.web.bind.annotation.RequestMapping; | ||||
| 
 | ||||
| import org.springframework.web.bind.annotation.RestController; | ||||
| 
 | ||||
| import javax.servlet.http.HttpServletResponse; | ||||
| import java.util.List; | ||||
| 
 | ||||
| /** | ||||
|  * <p> | ||||
|  * 报单赠品明细表 前端控制器 | ||||
|  | @ -15,6 +32,28 @@ import org.springframework.web.bind.annotation.RestController; | |||
|  */ | ||||
| @RestController | ||||
| @RequestMapping("/manage/acDeclarationRecord") | ||||
| public class AcDeclarationGiftRecordController { | ||||
| public class AcDeclarationGiftRecordController extends BaseController { | ||||
| 
 | ||||
|     @Autowired | ||||
|     private IAcDeclarationGiftRecordService acDeclarationGiftRecordService; | ||||
|     /** | ||||
|      * | ||||
|      * @param param | ||||
|      * @return | ||||
|      */ | ||||
|     @Log(module = EOperationModule.AC_DECLARATION_GIFT_LIST, business = EOperationBusiness.AC_DECLARATION_GIFT_LIST, method = EOperationMethod.SELECT) | ||||
|     @GetMapping("/list") | ||||
|     public TableDataInfo directPushUpgradeList(AcDeclarationListParam param) { | ||||
|         startPage(); | ||||
|         return getDataTable(acDeclarationGiftRecordService.queryList(param)); | ||||
|     } | ||||
| 
 | ||||
|     @Log(module = EOperationModule.AC_DECLARATION_GIFT_LIST_EXPORT, business = EOperationBusiness.AC_DECLARATION_GIFT_LIST_EXPORT, method = EOperationMethod.SELECT) | ||||
|     @PostMapping("/listExport") | ||||
|     public void export(AcDeclarationListParam param, HttpServletResponse response) { | ||||
|         startPage(); | ||||
|         List<AcDeclarationListVO> list = acDeclarationGiftRecordService.queryList(param); | ||||
|         ExcelUtil<AcDeclarationListVO> util = new ExcelUtil<>(AcDeclarationListVO.class); | ||||
|         util.exportExcel(response, list, "报单赠送数据导出"); | ||||
|     } | ||||
| } | ||||
|  |  | |||
|  | @ -1,7 +1,12 @@ | |||
| package com.hzs.activity.declaration.mapper; | ||||
| 
 | ||||
| import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||||
| import com.hzs.activity.add.param.AcAddUpgradeListParam; | ||||
| import com.hzs.activity.declaration.param.AcDeclarationListParam; | ||||
| import com.hzs.activity.declaration.vo.AcDeclarationGiftRecord; | ||||
| import com.hzs.activity.declaration.vo.AcDeclarationListVO; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| /** | ||||
|  * <p> | ||||
|  | @ -13,4 +18,5 @@ import com.hzs.activity.declaration.vo.AcDeclarationGiftRecord; | |||
|  */ | ||||
| public interface AcDeclarationGiftRecordMapper extends BaseMapper<AcDeclarationGiftRecord> { | ||||
| 
 | ||||
|     List<AcDeclarationListVO> queryList(AcDeclarationListParam param); | ||||
| } | ||||
|  |  | |||
|  | @ -0,0 +1,42 @@ | |||
| package com.hzs.activity.declaration.param; | ||||
| 
 | ||||
| import lombok.AllArgsConstructor; | ||||
| import lombok.Data; | ||||
| import lombok.NoArgsConstructor; | ||||
| 
 | ||||
| @Data | ||||
| @AllArgsConstructor | ||||
| @NoArgsConstructor | ||||
| public class AcDeclarationListParam { | ||||
| 
 | ||||
|     /** | ||||
|      * 活动名称 | ||||
|      */ | ||||
|     private String actName; | ||||
| 
 | ||||
|     /** | ||||
|      * 会员编号 | ||||
|      */ | ||||
|     private String memberCode; | ||||
| 
 | ||||
| 
 | ||||
|     /** | ||||
|      * 开始活动开始时间 | ||||
|      */ | ||||
|     private String startActStartDate; | ||||
| 
 | ||||
|     /** | ||||
|      * 开始活动结束时间 | ||||
|      */ | ||||
|     private String startActEndDate; | ||||
| 
 | ||||
|     /** | ||||
|      * 结束活动开始时间 | ||||
|      */ | ||||
|     private String endActStartDate; | ||||
| 
 | ||||
|     /** | ||||
|      * 结束活动结束时间 | ||||
|      */ | ||||
|     private String endActEndDate; | ||||
| } | ||||
|  | @ -50,9 +50,5 @@ public class AcDeclarationParam { | |||
|      */ | ||||
|     private List<AcDeclarationConfigParam> acDeclarationConfigParams; | ||||
| 
 | ||||
|     /** | ||||
|      * 权限配置列表 | ||||
|      */ | ||||
|     private List<AcBaseAuthority> authorityList; | ||||
| 
 | ||||
| } | ||||
|  |  | |||
|  | @ -17,7 +17,11 @@ import com.hzs.common.core.web.domain.AjaxResult; | |||
| public interface IAcDeclarationGiftConfigService extends IService<AcDeclarationGiftConfig> { | ||||
| 
 | ||||
| 
 | ||||
|     String onLinePetition(AcDeclarationParam acDeclarationParam); | ||||
| 
 | ||||
|     AjaxResult getDetail(Integer pkId); | ||||
| 
 | ||||
|     String saveConfig(AcDeclarationParam acDeclarationParam); | ||||
| 
 | ||||
|     String updateConfig(AcDeclarationParam acDeclarationParam); | ||||
| 
 | ||||
|     String deleteConfig(Long pkId); | ||||
| } | ||||
|  |  | |||
|  | @ -1,7 +1,12 @@ | |||
| package com.hzs.activity.declaration.service; | ||||
| 
 | ||||
| import com.baomidou.mybatisplus.extension.service.IService; | ||||
| import com.hzs.activity.add.param.AcAddUpgradeListParam; | ||||
| import com.hzs.activity.declaration.param.AcDeclarationListParam; | ||||
| import com.hzs.activity.declaration.vo.AcDeclarationGiftRecord; | ||||
| import com.hzs.activity.declaration.vo.AcDeclarationListVO; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| /** | ||||
|  * <p> | ||||
|  | @ -13,4 +18,5 @@ import com.hzs.activity.declaration.vo.AcDeclarationGiftRecord; | |||
|  */ | ||||
| public interface IAcDeclarationGiftRecordService extends IService<AcDeclarationGiftRecord> { | ||||
| 
 | ||||
|     List<AcDeclarationListVO> queryList(AcDeclarationListParam param); | ||||
| } | ||||
|  |  | |||
|  | @ -57,56 +57,6 @@ public class AcDeclarationGiftConfigServiceImpl extends ServiceImpl<AcDeclaratio | |||
|     @Autowired | ||||
|     private IAcGoalMemberConfigService iAcGoalMemberConfigService; | ||||
| 
 | ||||
|     @Override | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public String onLinePetition(AcDeclarationParam acDeclarationParam) { | ||||
|         log.info("加购升级入参{}", acDeclarationParam); | ||||
|         EApprovalBusiness approvalBusiness = null; | ||||
|         if (acDeclarationParam.getControlType() == EControlType.SAVE.getValue()) { | ||||
|             approvalBusiness = EApprovalBusiness.AC_DECLARATION_GIFT_ADD; | ||||
|         } else if (acDeclarationParam.getControlType() == EControlType.MODIFY.getValue()) { | ||||
|             approvalBusiness = EApprovalBusiness.AC_DECLARATION_GIFT_UPDATE; | ||||
|         } else if (acDeclarationParam.getControlType() == EControlType.DELETE.getValue()) { | ||||
|             approvalBusiness = EApprovalBusiness.AC_DECLARATION_GIFT_REMOVE; | ||||
|         } | ||||
| 
 | ||||
|         LoginUser loginUser = acDeclarationParam.getLoginUser(); | ||||
|         if (loginUser == null) { | ||||
|             log.error("登录用户信息为空"); | ||||
|             return "登录用户信息为空"; | ||||
|         } | ||||
|         if (acDeclarationParam.getControlType().equals(EControlType.SAVE.getValue())) { | ||||
|             ActivityParam activityParam = acDeclarationParam.getActivityParam(); | ||||
|             activityParam.setPkCountry(loginUser.getDataCountry()); | ||||
|             activityParam.setPkCreator(loginUser.getUserId()); | ||||
|             activityParam.setActType(EActType.DECLARATION_GIFT.getValue()); | ||||
|             // 新增活动基本配置 | ||||
|             AcBaseConfig acBaseConfig = iActivityService.saveBaseConfig(activityParam); | ||||
|             // 新增活动目标权限 | ||||
|             iActivityService.saveGoalMemberConfig(activityParam, acBaseConfig); | ||||
|             // 新增加购活动配置 | ||||
|             saveDeclarationConfig(acDeclarationParam.getAcDeclarationConfigParams(), acBaseConfig); | ||||
|         } else if (acDeclarationParam.getControlType().equals(EControlType.MODIFY.getValue())) { | ||||
|             ActivityParam activityParam = acDeclarationParam.getActivityParam(); | ||||
|             activityParam.setPkCountry(loginUser.getDataCountry()); | ||||
|             activityParam.setPkCreator(loginUser.getUserId()); | ||||
|             activityParam.setActType(EActType.DECLARATION_GIFT.getValue()); | ||||
|             updateDeclarationConfig(activityParam, acDeclarationParam.getAcDeclarationConfigParams()); | ||||
|         } else if (acDeclarationParam.getControlType().equals(EControlType.DELETE.getValue())) { | ||||
|             ActivityParam activityParam = acDeclarationParam.getActivityParam(); | ||||
|             Long pkId = activityParam.getPkId(); | ||||
|             removeDeclarationConfig(pkId); | ||||
|         } | ||||
|         //日志 | ||||
|         ActivityParam activityParam = acDeclarationParam.getActivityParam(); | ||||
|         activityParam.setPkCountry(SecurityUtils.getPkCountry()); | ||||
|         activityParam.setPkCreator(SecurityUtils.getUserId()); | ||||
|         activityParam.setActType(EActType.PRODUCT_GIFT.getValue()); | ||||
|         activityParam.setBusinessCode(acDeclarationParam.getActivityParam().getBusinessCode()); | ||||
|         iActivityService.createBaseConfigLog(activityParam, new StringBuffer(), null, approvalBusiness.getValue(), false); | ||||
|         return null; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public AjaxResult getDetail(Integer pkId) { | ||||
|         AcBaseConfig baseConfig = baseConfigService.getById(pkId); | ||||
|  | @ -127,15 +77,63 @@ public class AcDeclarationGiftConfigServiceImpl extends ServiceImpl<AcDeclaratio | |||
|         return AjaxResult.success(activityParam); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public String saveConfig(AcDeclarationParam acDeclarationParam) { | ||||
|         LoginUser loginUser = acDeclarationParam.getLoginUser(); | ||||
|         if (loginUser == null) { | ||||
|             log.error("登录用户信息为空"); | ||||
|             return "登录用户信息为空"; | ||||
|         } | ||||
|         ActivityParam activityParam = acDeclarationParam.getActivityParam(); | ||||
|         activityParam.setPkCountry(loginUser.getDataCountry()); | ||||
|         activityParam.setPkCreator(loginUser.getUserId()); | ||||
|         activityParam.setActType(EActType.DECLARATION_GIFT.getValue()); | ||||
|         // 新增活动基本配置 | ||||
|         AcBaseConfig acBaseConfig = iActivityService.saveBaseConfig(activityParam); | ||||
|         // 新增加购活动配置 | ||||
|         saveDeclarationConfig(acDeclarationParam.getAcDeclarationConfigParams(), acBaseConfig); | ||||
|         //日志 | ||||
|         activityParam.setBusinessCode(acDeclarationParam.getActivityParam().getBusinessCode()); | ||||
|         iActivityService.createBaseConfigLog(activityParam, new StringBuffer(), null, EApprovalBusiness.AC_DECLARATION_GIFT_ADD.getValue(), false); | ||||
|         return null; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public String updateConfig(AcDeclarationParam acDeclarationParam) { | ||||
|         LoginUser loginUser = acDeclarationParam.getLoginUser(); | ||||
|         if (loginUser == null) { | ||||
|             log.error("登录用户信息为空"); | ||||
|             return "登录用户信息为空"; | ||||
|         } | ||||
|         ActivityParam activityParam = acDeclarationParam.getActivityParam(); | ||||
|         activityParam.setPkCountry(loginUser.getDataCountry()); | ||||
|         activityParam.setPkCreator(loginUser.getUserId()); | ||||
|         activityParam.setActType(EActType.DECLARATION_GIFT.getValue()); | ||||
|         updateDeclarationConfig(activityParam, acDeclarationParam.getAcDeclarationConfigParams()); | ||||
|         iActivityService.createBaseConfigLog(activityParam, new StringBuffer(), null, EApprovalBusiness.AC_DECLARATION_GIFT_UPDATE.getValue(), false); | ||||
|         return null; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public String deleteConfig(Long pkId) { | ||||
|         Long userId = SecurityUtils.getUserId(); | ||||
|         if (userId == null) { | ||||
|             log.error("登录用户信息为空"); | ||||
|             return "登录信息用户为空"; | ||||
|         } | ||||
|         AcBaseConfig baseConfig = baseConfigService.getById(pkId); | ||||
|         ActivityParam activityParam = BeanUtil.copyProperties(baseConfig, ActivityParam.class); | ||||
|         removeDeclarationConfig(pkId); | ||||
|         iActivityService.createBaseConfigLog(activityParam, new StringBuffer(), null, EApprovalBusiness.AC_DECLARATION_GIFT_UPDATE.getValue(), false); | ||||
|         return null; | ||||
|     } | ||||
| 
 | ||||
|     private void removeDeclarationConfig(Long pkId) { | ||||
|         // 删除活动基本配置 | ||||
|         baseConfigService.removeById(pkId); | ||||
|         // 删除加购活动配置 | ||||
|         baseMapper.delete(new LambdaQueryWrapper<AcDeclarationGiftConfig>() | ||||
|                 .eq(AcDeclarationGiftConfig::getPkBaseId, pkId)); | ||||
|         // 删除用户权限配置 | ||||
|         iAcGoalMemberConfigService.remove(new LambdaQueryWrapper<AcGoalMemberConfig>() | ||||
|                 .eq(AcGoalMemberConfig::getPkBaseId, pkId)); | ||||
|     } | ||||
| 
 | ||||
|     private void updateDeclarationConfig(ActivityParam activityParam, List<AcDeclarationConfigParam> acDeclarationConfigParams) { | ||||
|  | @ -149,13 +147,8 @@ public class AcDeclarationGiftConfigServiceImpl extends ServiceImpl<AcDeclaratio | |||
|             // 删除活动配置 | ||||
|             baseMapper.delete(new LambdaQueryWrapper<AcDeclarationGiftConfig>() | ||||
|                     .eq(AcDeclarationGiftConfig::getPkBaseId, pkId)); | ||||
|             // 删除用户权限配置 | ||||
|             iAcGoalMemberConfigService.remove(new LambdaQueryWrapper<AcGoalMemberConfig>() | ||||
|                     .eq(AcGoalMemberConfig::getPkBaseId, pkId)); | ||||
|             // 添加加购活动配置 | ||||
|             saveDeclarationConfig(acDeclarationConfigParams,baseConfig); | ||||
|             // 添加用户权限配置 | ||||
|             iActivityService.saveGoalMemberConfig(activityParam, baseConfig); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|  |  | |||
|  | @ -1,11 +1,17 @@ | |||
| package com.hzs.activity.declaration.service.impl; | ||||
| 
 | ||||
| import com.hzs.activity.add.param.AcAddUpgradeListParam; | ||||
| import com.hzs.activity.declaration.mapper.AcDeclarationGiftRecordMapper; | ||||
| import com.hzs.activity.declaration.param.AcDeclarationListParam; | ||||
| import com.hzs.activity.declaration.service.IAcDeclarationGiftRecordService; | ||||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||||
| import com.hzs.activity.declaration.vo.AcDeclarationGiftRecord; | ||||
| import com.hzs.activity.declaration.vo.AcDeclarationListVO; | ||||
| import org.springframework.stereotype.Service; | ||||
| 
 | ||||
| import java.util.Collections; | ||||
| import java.util.List; | ||||
| 
 | ||||
| /** | ||||
|  * <p> | ||||
|  * 报单赠品明细表 服务实现类 | ||||
|  | @ -17,4 +23,8 @@ import org.springframework.stereotype.Service; | |||
| @Service | ||||
| public class AcDeclarationGiftRecordServiceImpl extends ServiceImpl<AcDeclarationGiftRecordMapper, AcDeclarationGiftRecord> implements IAcDeclarationGiftRecordService { | ||||
| 
 | ||||
|     @Override | ||||
|     public List<AcDeclarationListVO> queryList(AcDeclarationListParam param) { | ||||
|         return baseMapper.queryList(param); | ||||
|     } | ||||
| } | ||||
|  |  | |||
|  | @ -0,0 +1,65 @@ | |||
| package com.hzs.activity.declaration.vo; | ||||
| 
 | ||||
| import com.fasterxml.jackson.annotation.JsonFormat; | ||||
| import com.hzs.common.core.annotation.Excel; | ||||
| import lombok.AllArgsConstructor; | ||||
| import lombok.Data; | ||||
| import lombok.NoArgsConstructor; | ||||
| 
 | ||||
| import java.util.Date; | ||||
| 
 | ||||
| @Data | ||||
| @AllArgsConstructor | ||||
| @NoArgsConstructor | ||||
| public class AcDeclarationListVO { | ||||
| 
 | ||||
|     /** | ||||
|      * 活动名称 | ||||
|      */ | ||||
|     @Excel(name = "活动名称") | ||||
|     private String actName; | ||||
|     /** | ||||
|      * 会员编号 | ||||
|      */ | ||||
|     @Excel(name = "会员编号") | ||||
|     private String memberCode; | ||||
|     /** | ||||
|      * 会员名称 | ||||
|      */ | ||||
|     @Excel(name = "会员名称") | ||||
|     private String memberName; | ||||
| 
 | ||||
| 
 | ||||
|     /** | ||||
|      * 活动开始时间 | ||||
|      */ | ||||
|     @Excel(name = "活动开始时间", dateFormat = "yyyy-MM-dd") | ||||
|     @JsonFormat(pattern = "yyyy-MM-dd") | ||||
|     private Date actStartDate; | ||||
| 
 | ||||
|     /** | ||||
|      * 活动结束时间 | ||||
|      */ | ||||
|     @Excel(name = "活动结束时间", dateFormat = "yyyy-MM-dd") | ||||
|     @JsonFormat(pattern = "yyyy-MM-dd") | ||||
|     private Date actEndDate; | ||||
| 
 | ||||
|     /** | ||||
|      * 创建时间 | ||||
|      */ | ||||
|     @Excel(name = "创建时间", dateFormat = "yyyy-MM-dd") | ||||
|     @JsonFormat(pattern = "yyyy-MM-dd") | ||||
|     private Date creationTime; | ||||
| 
 | ||||
|     /** | ||||
|      * 产品名称 | ||||
|      */ | ||||
|     @Excel(name = "产品名称") | ||||
|     private String productName; | ||||
| 
 | ||||
|     @Excel(name = "数量") | ||||
|     private Integer quantity; | ||||
| 
 | ||||
|     @Excel(name = "指定等级") | ||||
|     private String levelVal; | ||||
| } | ||||
|  | @ -29,5 +29,42 @@ | |||
|         PK_COUNTRY, | ||||
|         PK_ID, PK_BASE_ID, PK_RULE_ID, PK_MEMBER, PK_ORIGIN_GRADE, PK_UPGRADE_GRADE, PK_ORDER_ID | ||||
|     </sql> | ||||
|     <select id="queryList" resultType="com.hzs.activity.add.vo.AcAddUpgradeListVO"> | ||||
|         SELECT | ||||
|         abc.ACT_NAME, | ||||
|         cm.member_code, | ||||
|         cm.member_name, | ||||
|         BG.GRADE_NAME AS originalLevelVal, | ||||
|         BGG.GRADE_NAME AS upgradeLevelVal, | ||||
|         abc.ACT_START_DATE, | ||||
|         abc.ACT_END_DATE, | ||||
|         aaur.* | ||||
|         FROM | ||||
|         AC_ADD_UPGRADE_RECORD aaur | ||||
|         LEFT JOIN AC_BASE_CONFIG abc ON aaur.PK_BASE_ID = abc.PK_ID | ||||
|         LEFT JOIN CU_MEMBER cm ON aaur.PK_MEMBER = cm.PK_ID | ||||
|         LEFT JOIN BD_GRADE BG ON aaur.PK_ORIGIN_GRADE = BG.PK_ID | ||||
|         LEFT JOIN BD_GRADE BGG ON aaur.PK_UPGRADE_GRADE = BGG.PK_ID | ||||
|         WHERE | ||||
|         aaur.DEL_FLAG = 0 | ||||
|         <if test="actName != null and actName != ''"> | ||||
|             AND abc.ACT_NAME = #{actName} | ||||
|         </if> | ||||
|         <if test="memberCode != null and memberCode != ''"> | ||||
|             AND cm.member_code = #{memberCode} | ||||
|         </if> | ||||
|         <if test="startActStartDate != null and startActStartDate != ''"> | ||||
|             AND abc.ACT_START_DATE >= TO_DATE(SUBSTR(#{startActStartDate},1,10), 'YYYY-MM-DD') | ||||
|         </if> | ||||
|         <if test="startActEndDate != null and startActEndDate != ''"> | ||||
|             AND abc.ACT_START_DATE <= TO_DATE(SUBSTR(#{startActEndDate},1,10), 'YYYY-MM-DD') | ||||
|         </if> | ||||
|         <if test="endActStartDate != null and endActStartDate != ''"> | ||||
|             AND abc.ACT_END_DATE >= TO_DATE(SUBSTR(#{endActStartDate},1,10), 'YYYY-MM-DD') | ||||
|         </if> | ||||
|         <if test="endActEndDate != null and endActEndDate != ''"> | ||||
|             AND abc.ACT_END_DATE <= TO_DATE(SUBSTR(#{endActEndDate},1,10), 'YYYY-MM-DD') | ||||
|         </if> | ||||
|     </select> | ||||
| 
 | ||||
| </mapper> | ||||
|  |  | |||
|  | @ -28,5 +28,42 @@ | |||
|         PK_COUNTRY, | ||||
|         PK_ID, PK_BASE_ID, PK_RULE_ID, PK_MEMBER, PK_PRODUCT, QUANTITY | ||||
|     </sql> | ||||
|     <select id="queryList" resultType="com.hzs.activity.declaration.param.AcDeclarationListParam"> | ||||
|         SELECT | ||||
|         abc.ACT_NAME, | ||||
|         cm.member_code, | ||||
|         cm.member_name, | ||||
|         BG.GRADE_NAME AS levelVal, | ||||
|         abc.ACT_START_DATE, | ||||
|         abc.ACT_END_DATE, | ||||
|         bp.PRODUCT_NAME, | ||||
|         adgr.* | ||||
|         FROM | ||||
|         AC_DECLARATION_GIFT_RECORD adgr | ||||
|         LEFT JOIN BD_PRODUCT bp ON adgr.PK_PRODUCT = bp.PK_ID | ||||
|         LEFT JOIN AC_BASE_CONFIG abc ON adgr.PK_BASE_ID = abc.PK_ID | ||||
|         LEFT JOIN CU_MEMBER cm ON adgr.PK_MEMBER = cm.PK_ID | ||||
|         LEFT JOIN BD_GRADE BG ON adgr.LEVEL = BG.PK_ID | ||||
|         WHERE | ||||
|         adgr.DEL_FLAG = 0 | ||||
|         <if test="actName != null and actName != ''"> | ||||
|             AND abc.ACT_NAME = #{actName} | ||||
|         </if> | ||||
|         <if test="memberCode != null and memberCode != ''"> | ||||
|             AND cm.member_code = #{memberCode} | ||||
|         </if> | ||||
|         <if test="startActStartDate != null and startActStartDate != ''"> | ||||
|             AND abc.ACT_START_DATE >= TO_DATE(SUBSTR(#{startActStartDate},1,10), 'YYYY-MM-DD') | ||||
|         </if> | ||||
|         <if test="startActEndDate != null and startActEndDate != ''"> | ||||
|             AND abc.ACT_START_DATE <= TO_DATE(SUBSTR(#{startActEndDate},1,10), 'YYYY-MM-DD') | ||||
|         </if> | ||||
|         <if test="endActStartDate != null and endActStartDate != ''"> | ||||
|             AND abc.ACT_END_DATE >= TO_DATE(SUBSTR(#{endActStartDate},1,10), 'YYYY-MM-DD') | ||||
|         </if> | ||||
|         <if test="endActEndDate != null and endActEndDate != ''"> | ||||
|             AND abc.ACT_END_DATE <= TO_DATE(SUBSTR(#{endActEndDate},1,10), 'YYYY-MM-DD') | ||||
|         </if> | ||||
|     </select> | ||||
| 
 | ||||
| </mapper> | ||||
|  |  | |||
|  | @ -267,7 +267,10 @@ public enum EOperationBusiness { | |||
| 
 | ||||
|     AC_ADD_UPGRADE_LIST_EXPORT("加购升级数据"), | ||||
| 
 | ||||
|     AC_DECLARATION_GIFT_SUBMIT("报单赠送"), | ||||
| 
 | ||||
|     AC_DECLARATION_GIFT_SAVE("报单赠送新增"), | ||||
|     AC_DECLARATION_GIFT_UPDATE("报单修改"), | ||||
|     AC_DECLARATION_GIFT_DELETE("报单删除"), | ||||
| 
 | ||||
|     AC_DECLARATION_GIFT_DETAIL("报单赠送详情"), | ||||
| 
 | ||||
|  |  | |||
|  | @ -377,7 +377,9 @@ public enum EOperationModule { | |||
| 
 | ||||
|     AC_ADD_UPGRADE_LIST_EXPORT("加购升级数据导出"), | ||||
| 
 | ||||
|     AC_DECLARATION_GIFT_SUBMIT("报单赠送"), | ||||
|     AC_DECLARATION_GIFT_SAVE("报单赠送新增"), | ||||
|     AC_DECLARATION_GIFT_UPDATE("报单修改"), | ||||
|     AC_DECLARATION_GIFT_DELETE("报单删除"), | ||||
| 
 | ||||
|     AC_DECLARATION_GIFT_DETAIL("报单赠送详情"), | ||||
| 
 | ||||
|  | @ -388,7 +390,6 @@ public enum EOperationModule { | |||
|     AC_DECLARATION_GIFT_LIST_EXPORT("报单赠送数据导出"), | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|     ///////////////////////////统计分析//////////////////////////// | ||||
| 
 | ||||
|     STATISTIC_ANALYSIS("统计分析"), | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue