|
|
|
@@ -1,5 +1,6 @@ |
|
|
|
package com.iformall.service.impl; |
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
@@ -11,6 +12,7 @@ import com.iformall.domain.po.*; |
|
|
|
import com.iformall.domain.po.base.TenantEntity; |
|
|
|
import com.iformall.enums.*; |
|
|
|
import com.iformall.mapper.WxProfitSharingReceiverApplyMapper; |
|
|
|
import com.iformall.service.WxAppinfoService; |
|
|
|
import com.iformall.service.WxProfitSharingReceiverApplyService; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.slf4j.Logger; |
|
|
|
@@ -19,7 +21,9 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import java.util.Date; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
|
|
|
@Service |
|
|
|
@@ -30,6 +34,9 @@ public class WxProfitSharingReceiverApplyServiceImpl implements WxProfitSharingR |
|
|
|
@Autowired |
|
|
|
WxProfitSharingReceiverApplyMapper wxProfitSharingReceiverApplyMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
WxAppinfoService wxAppinfoService; |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageInfo<WxProfitSharingReceiverApply> listAsPage(WxProfitSharingReceiverApply record, Integer pageIndex, Integer pageSize) { |
|
|
|
return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxProfitSharingReceiverApplyMapper.findList(record)); |
|
|
|
@@ -74,6 +81,7 @@ public class WxProfitSharingReceiverApplyServiceImpl implements WxProfitSharingR |
|
|
|
receiverAdd.setUpdateTime(now); |
|
|
|
wxProfitSharingReceiverApplyMapper.insert(receiverAdd); |
|
|
|
}else{ |
|
|
|
handleReceiverAddDeFault(receiverAdd); |
|
|
|
receiverAdd.setUpdateTime(now); |
|
|
|
wxProfitSharingReceiverApplyMapper.updateById(receiverAdd); |
|
|
|
} |
|
|
|
@@ -83,6 +91,25 @@ public class WxProfitSharingReceiverApplyServiceImpl implements WxProfitSharingR |
|
|
|
|
|
|
|
//------------------------------------------------------------------------------------------------------------------ |
|
|
|
|
|
|
|
private void handleReceiverAddDeFault(WxProfitSharingReceiverApply receiverAdd){ |
|
|
|
WxProfitSharingReceiverApply record = wxProfitSharingReceiverApplyMapper.selectById(receiverAdd.getId()); |
|
|
|
if(record == null){ |
|
|
|
return; |
|
|
|
} |
|
|
|
if(StringUtils.isNotBlank(receiverAdd.getMerchantShortname()) |
|
|
|
&& StringUtils.isBlank(record.getSalesInfo())){ |
|
|
|
Map<String,Object> salesInfoMap = new HashMap<>(); |
|
|
|
salesInfoMap.put("sales_scenes_type",EnumSharingReceiverSalesScenesType.getDefCode()); |
|
|
|
Map<String,Object> miniProgramInfoMap = new HashMap<>(); |
|
|
|
WxAppinfo cAppInfo = wxAppinfoService.getCAppInfo(receiverAdd, EnumAppPlat.getByCode(receiverAdd.getPlat())); |
|
|
|
miniProgramInfoMap.put("mini_program_sub_appid",cAppInfo.getAppId()); |
|
|
|
salesInfoMap.put("mini_program_info",miniProgramInfoMap); |
|
|
|
receiverAdd.setSalesInfo(JSON.toJSONString(salesInfoMap)); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
private boolean isFinishMain(WxProfitSharingReceiverApply record){ |
|
|
|
if(record == null){ |
|
|
|
logger.info("申请单为null"); |
|
|
|
|