| | |
| | | registration.excludePathPatterns("/api/news/**");
|
| | | registration.excludePathPatterns("/api/member/cashOutSetting");
|
| | | registration.excludePathPatterns("/api/member/agentDetail");
|
| | | registration.excludePathPatterns("/api/member/activityInfo");
|
| | | registration.excludePathPatterns("/api/leader/leaderList");
|
| | | registration.excludePathPatterns("/api/leader/leaderListInFence");
|
| | | registration.excludePathPatterns("/api/leader/noLoginLeaderTitle");
|
| | |
| | | //微信订阅模板ID, |
| | | // 微信订单通知 |
| | | // WX_TEMPLATE_ID_ONE("WX_TEMPLATE", "WX_TEMPLATE_ID_ONE"), |
| | | // 合伙人权益 |
| | | AGENT_DETAILS("AGENT_DETAILS", "AGENT_DETAILS"), |
| | | // 赠送金额 |
| | | GIVE_AMOUNT("CHARGE_SET", "GIVE_AMOUNT"), |
| | | // 活动公告内容 |
| | | ACTIVITY_BULLETIN("CHARGE_SET", "ACTIVITY_BULLETIN"), |
| | | // 充值送金额开关 |
| | | GIVE_STATE("CHARGE_SET", "GIVE_STATE"), |
| | | // 成为合伙人的充值金额 |
| | | PRICE_AMOUNT("AGENT_PRICE", "PRICE_AMOUNT"), |
| | | // 合伙人权益 |
| | | AGENT_DETAILS("AGENT_DETAILS", "AGENT_DETAILS"), |
| | | // 充值到账通知 |
| | | WX_TEMPLATE_ID_TWO("WX_TEMPLATE", "WX_TEMPLATE_ID_TWO"), |
| | | // 提货通知 |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Map; |
| | | |
| | | @Slf4j |
| | |
| | | DataDictionaryCustom dic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.PRICE_AMOUNT.getType(), DataDictionaryEnum.PRICE_AMOUNT.getCode() |
| | | ); |
| | | |
| | | if(ObjectUtil.isEmpty(dic)){ |
| | | return new FebsResponse().fail().message("请刷新页面重试"); |
| | | } |
| | | |
| | | DataDictionaryCustom giveStateDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.GIVE_STATE.getType(), |
| | | DataDictionaryEnum.GIVE_STATE.getCode()); |
| | | if(ObjectUtil.isEmpty(giveStateDic)){ |
| | | return new FebsResponse().fail().message("请刷新页面重试"); |
| | | } |
| | | |
| | | DataDictionaryCustom activityBulletinDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.ACTIVITY_BULLETIN.getType(), |
| | | DataDictionaryEnum.ACTIVITY_BULLETIN.getCode()); |
| | | if(ObjectUtil.isEmpty(activityBulletinDic)){ |
| | | return new FebsResponse().fail().message("请刷新页面重试"); |
| | | } |
| | | |
| | | DataDictionaryCustom giveAmountDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.GIVE_AMOUNT.getType(), |
| | | DataDictionaryEnum.GIVE_AMOUNT.getCode()); |
| | | if(ObjectUtil.isEmpty(giveAmountDic)){ |
| | | return new FebsResponse().fail().message("请刷新页面重试"); |
| | | } |
| | | |
| | | String giveState = adminAgentAmountDto.getGiveState(); |
| | | if(1 == Integer.parseInt(giveState)){ |
| | | if(ObjectUtil.isEmpty(adminAgentAmountDto.getActivityBulletin())){ |
| | | return new FebsResponse().fail().message("活动公告不能为空"); |
| | | } |
| | | if(ObjectUtil.isEmpty(adminAgentAmountDto.getActivityBulletin()) |
| | | || BigDecimal.ZERO.compareTo(new BigDecimal(adminAgentAmountDto.getActivityBulletin())) > 0){ |
| | | return new FebsResponse().fail().message("请输入正确的赠送金额"); |
| | | } |
| | | } |
| | | |
| | | dic.setValue(adminAgentAmountDto.getAgentAmountValue()); |
| | | dataDictionaryCustomMapper.updateById(dic); |
| | | |
| | | giveStateDic.setValue(adminAgentAmountDto.getGiveState()); |
| | | dataDictionaryCustomMapper.updateById(giveStateDic); |
| | | |
| | | activityBulletinDic.setValue(adminAgentAmountDto.getActivityBulletin()); |
| | | dataDictionaryCustomMapper.updateById(activityBulletinDic); |
| | | |
| | | giveAmountDic.setValue(adminAgentAmountDto.getGiveAmount()); |
| | | dataDictionaryCustomMapper.updateById(giveAmountDic); |
| | | |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | |
| | | return memberService.agentDetail(); |
| | | } |
| | | |
| | | @ApiOperation(value = "活动公告") |
| | | @GetMapping(value = "/activityInfo") |
| | | public FebsResponse activityInfo() { |
| | | return memberService.activityInfo(); |
| | | } |
| | | |
| | | } |
| | |
| | | public String agentAmountSet(Model model) { |
| | | DataDictionaryCustom dic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.PRICE_AMOUNT.getType(), |
| | | DataDictionaryEnum.PRICE_AMOUNT.getCode()); |
| | | DataDictionaryCustom giveStateDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.GIVE_STATE.getType(), |
| | | DataDictionaryEnum.GIVE_STATE.getCode()); |
| | | DataDictionaryCustom activityBulletinDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.ACTIVITY_BULLETIN.getType(), |
| | | DataDictionaryEnum.ACTIVITY_BULLETIN.getCode()); |
| | | DataDictionaryCustom giveAmountDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.GIVE_AMOUNT.getType(), |
| | | DataDictionaryEnum.GIVE_AMOUNT.getCode()); |
| | | AdminAgentAmountDto adminAgentAmountDto = new AdminAgentAmountDto(); |
| | | if (dic != null) { |
| | | adminAgentAmountDto.setAgentAmountValue(dic.getValue()); |
| | | model.addAttribute("agentAmountSet", adminAgentAmountDto); |
| | | } |
| | | if (giveStateDic != null) { |
| | | adminAgentAmountDto.setGiveState(giveStateDic.getValue()); |
| | | } |
| | | if (activityBulletinDic != null) { |
| | | adminAgentAmountDto.setActivityBulletin(activityBulletinDic.getValue()); |
| | | } |
| | | if (giveAmountDic != null) { |
| | | adminAgentAmountDto.setGiveAmount(giveAmountDic.getValue()); |
| | | } |
| | | model.addAttribute("agentAmountSet", adminAgentAmountDto); |
| | | return FebsUtil.view("modules/system/agentAmountSet"); |
| | | } |
| | | |
| | |
| | | public class AdminAgentAmountDto { |
| | | |
| | | private String agentAmountValue; |
| | | private String giveState; |
| | | private String activityBulletin; |
| | | private String giveAmount; |
| | | } |
| | |
| | | void updateMemberAgent(Long memberId); |
| | | |
| | | FebsResponse agentDetail(); |
| | | |
| | | FebsResponse activityInfo(); |
| | | } |
| | |
| | | return new FebsResponse().success().data(map); |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse activityInfo() { |
| | | DataDictionaryCustom activityBulletinDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.ACTIVITY_BULLETIN.getType(), DataDictionaryEnum.ACTIVITY_BULLETIN.getCode()); |
| | | DataDictionaryCustom giveAmountDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.GIVE_AMOUNT.getType(), DataDictionaryEnum.GIVE_AMOUNT.getCode()); |
| | | DataDictionaryCustom giveStateDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.GIVE_STATE.getType(), DataDictionaryEnum.GIVE_STATE.getCode()); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if(ObjectUtil.isNotEmpty(activityBulletinDic)){ |
| | | map.put("activityBulletin", |
| | | ObjectUtil.isEmpty(activityBulletinDic.getValue()) ? "暂无活动" : activityBulletinDic.getValue()); |
| | | } |
| | | if(ObjectUtil.isNotEmpty(giveAmountDic)){ |
| | | map.put("giveAmount", |
| | | ObjectUtil.isEmpty(giveAmountDic.getValue()) ? 0 : giveAmountDic.getValue()); |
| | | } |
| | | map.put("giveState",giveStateDic.getValue()); |
| | | return new FebsResponse().success().data(map); |
| | | } |
| | | |
| | | private String getXcxLoginUrl(String code) { |
| | | String wechatLoginUrl =xcxProperties.getWecharLoginUrl(); |
| | | return String.format(wechatLoginUrl, xcxProperties.getXcxAppid(), xcxProperties.getXcxSecret(), code); |
| | |
| | | package cc.mrbird.febs.pay.controller; |
| | | |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.enumerates.DataDictionaryEnum; |
| | | import cc.mrbird.febs.common.enumerates.OrderDeliveryStateEnum; |
| | | import cc.mrbird.febs.common.enumerates.OrderStatusEnum; |
| | | import cc.mrbird.febs.common.enumerates.*; |
| | | import cc.mrbird.febs.common.properties.XcxProperties; |
| | | import cc.mrbird.febs.common.utils.RedisUtils; |
| | | import cc.mrbird.febs.common.utils.SpringContextHolder; |
| | |
| | | import cc.mrbird.febs.mall.mapper.*; |
| | | import cc.mrbird.febs.mall.service.IApiMallMemberService; |
| | | import cc.mrbird.febs.mall.service.IApiMallMemberWalletService; |
| | | import cc.mrbird.febs.mall.service.IMallMoneyFlowService; |
| | | import cc.mrbird.febs.pay.model.NotifyData; |
| | | import cc.mrbird.febs.pay.model.OrderStateDto; |
| | | import cc.mrbird.febs.pay.model.OrderStateMsgVo; |
| | |
| | | MallMemberMapper mallMemberMapper; |
| | | @Autowired |
| | | DataDictionaryCustomMapper dataDictionaryCustomMapper; |
| | | @Autowired |
| | | IMallMoneyFlowService mallMoneyFlowService; |
| | | @Autowired |
| | | RedisUtils redisUtils; |
| | | @Autowired |
| | |
| | | mallMoneyFlow.setStatus(2); |
| | | mallMoneyFlowMapper.updateById(mallMoneyFlow); |
| | | |
| | | /** |
| | | * 充值赠送金额 |
| | | */ |
| | | DataDictionaryCustom giveStateDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.GIVE_STATE.getType(), |
| | | DataDictionaryEnum.GIVE_STATE.getCode()); |
| | | |
| | | DataDictionaryCustom giveAmountDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.GIVE_AMOUNT.getType(), |
| | | DataDictionaryEnum.GIVE_AMOUNT.getCode()); |
| | | if(ObjectUtil.isNotEmpty(giveStateDic) |
| | | && "1" == giveStateDic.getValue() |
| | | && ObjectUtil.isNotEmpty(giveAmountDic)){ |
| | | BigDecimal giveAmount = ObjectUtil.isEmpty(giveAmountDic.getValue()) ? |
| | | BigDecimal.ZERO : |
| | | new BigDecimal(giveAmountDic.getValue()).abs().setScale(2,BigDecimal.ROUND_DOWN); |
| | | |
| | | mallMoneyFlowService.addMoneyFlow( |
| | | memberId, |
| | | giveAmount, |
| | | MoneyFlowTypeEnum.RECHARGE.getValue(), |
| | | rechargeNo+"ZS", |
| | | FlowTypeEnum.BALANCE.getValue()); |
| | | |
| | | memberWalletService.addBalance(giveAmount,memberId); |
| | | } |
| | | |
| | | RechargeWalletMessageSendDto rechargeWalletMessageSendDto = new RechargeWalletMessageSendDto(); |
| | | rechargeWalletMessageSendDto.setRechargeNo(rechargeNo); |
| | | rechargeWalletMessageSendDto.setRechargeAmount(payMoney.toString()); |
| | |
| | | </div> |
| | | <div class="layui-word-aux" style="margin-left: 150px;">申请成为合伙人需要充值的金额数目</div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">充值送金额:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="radio" name="giveState" value="1" title="开启" lay-filter="giveStateOpen" /> |
| | | <input type="radio" name="giveState" value="2" title="关闭" lay-filter="giveStateOpen" checked/> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item activityBulletin-input febs-hide"> |
| | | <label class="layui-form-label">活动公告:</label> |
| | | <div class="layui-input-block"> |
| | | <input id="activityBulletin" type="text" name="activityBulletin" placeholder="" autocomplete="off" class="layui-input"> |
| | | <div class="layui-form-mid layui-word-aux">活动公告为一句话,在首页滚动。</div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item giveAmount-input febs-hide"> |
| | | <label class="layui-form-label ">赠送金额:</label> |
| | | <div class="layui-input-block"> |
| | | <input id="giveAmount" type="text" name="giveAmount" |
| | | lay-verify="" autocomplete="off" class="layui-input" > |
| | | </div> |
| | | <div class="layui-word-aux" style="margin-left: 150px;">赠送的金额数目</div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-card-footer"> |
| | |
| | | form.render(); |
| | | |
| | | function initagentAmountSetValue() { |
| | | alert(agentAmountSet.giveState); |
| | | form.val("agent-amount-set-form", { |
| | | "agentAmountValue": agentAmountSet.agentAmountValue |
| | | "agentAmountValue": agentAmountSet.agentAmountValue, |
| | | "giveState": agentAmountSet.giveState, |
| | | "activityBulletin": agentAmountSet.activityBulletin, |
| | | "giveAmount": agentAmountSet.giveAmount, |
| | | }); |
| | | |
| | | if (agentAmountSet.giveState == 1) { |
| | | $('.activityBulletin-input').show(); |
| | | $('.giveAmount-input').show(); |
| | | } else { |
| | | $('.activityBulletin-input').hide(); |
| | | $('.giveAmount-input').hide(); |
| | | } |
| | | } |
| | | //页面radio切换显示隐藏 |
| | | form.on('radio(giveStateOpen)', function(data){ |
| | | if (data.value == 1) { |
| | | $('.activityBulletin-input').show(); |
| | | $('.giveAmount-input').show(); |
| | | } else { |
| | | $('.activityBulletin-input').hide(); |
| | | $('.giveAmount-input').hide(); |
| | | document.getElementById('activityBulletin').value = ""; |
| | | document.getElementById('giveAmount').value = ""; |
| | | } |
| | | }); |
| | | |
| | | form.on('submit(agent-amount-set-form-submit)', function (data) { |
| | | console.log(data); |