Commit 78d31337 by 墨竹

fix:企微收费

parent 7d3b683b
...@@ -10,6 +10,7 @@ import java.util.Date; ...@@ -10,6 +10,7 @@ import java.util.Date;
* @since 2022-08-03 16:12:30 * @since 2022-08-03 16:12:30
*/ */
public class HaobanQywxFeeDTO implements Serializable { public class HaobanQywxFeeDTO implements Serializable {
private static final long serialVersionUID = -65108900619188163L; private static final long serialVersionUID = -65108900619188163L;
private Long qwFeeId; private Long qwFeeId;
...@@ -40,6 +41,9 @@ public class HaobanQywxFeeDTO implements Serializable { ...@@ -40,6 +41,9 @@ public class HaobanQywxFeeDTO implements Serializable {
*/ */
private Integer interceptFlag; private Integer interceptFlag;
private Integer detailNum;
private Integer autoActiveFlag;
public Long getQwFeeId() { public Long getQwFeeId() {
return qwFeeId; return qwFeeId;
...@@ -113,5 +117,20 @@ public class HaobanQywxFeeDTO implements Serializable { ...@@ -113,5 +117,20 @@ public class HaobanQywxFeeDTO implements Serializable {
this.interceptFlag = interceptFlag; this.interceptFlag = interceptFlag;
} }
public Integer getDetailNum() {
return detailNum;
}
public void setDetailNum(Integer detailNum) {
this.detailNum = detailNum;
}
public Integer getAutoActiveFlag() {
return autoActiveFlag;
}
public void setAutoActiveFlag(Integer autoActiveFlag) {
this.autoActiveFlag = autoActiveFlag;
}
} }
...@@ -3,12 +3,15 @@ package com.gic.haoban.manage.web.controller; ...@@ -3,12 +3,15 @@ package com.gic.haoban.manage.web.controller;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
import com.gic.commons.webapi.reponse.RestResponse; import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.haoban.manage.api.dto.QywxErrorLogDTO; import com.gic.haoban.manage.api.dto.QywxErrorLogDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseDTO;
import com.gic.haoban.manage.api.dto.fee.HaobanQywxFeeDTO; import com.gic.haoban.manage.api.dto.fee.HaobanQywxFeeDTO;
import com.gic.haoban.manage.api.dto.fee.HaobanQywxFeeDetailDTO; import com.gic.haoban.manage.api.dto.fee.HaobanQywxFeeDetailDTO;
import com.gic.haoban.manage.api.dto.qdto.QywxErrorLogListQDTO; import com.gic.haoban.manage.api.dto.qdto.QywxErrorLogListQDTO;
import com.gic.haoban.manage.api.dto.qdto.QywxFeeListQDTO; import com.gic.haoban.manage.api.dto.qdto.QywxFeeListQDTO;
import com.gic.haoban.manage.api.service.QywxErrorLogApiService; import com.gic.haoban.manage.api.service.QywxErrorLogApiService;
import com.gic.haoban.manage.api.service.WxEnterpriseApiService;
import com.gic.haoban.manage.api.service.fee.HaobanQywxFeeApiService; import com.gic.haoban.manage.api.service.fee.HaobanQywxFeeApiService;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -29,6 +32,8 @@ public class QywxManageController extends WebBaseController { ...@@ -29,6 +32,8 @@ public class QywxManageController extends WebBaseController {
private QywxErrorLogApiService qywxErrorLogApiService; private QywxErrorLogApiService qywxErrorLogApiService;
@Autowired @Autowired
private HaobanQywxFeeApiService haobanQywxFeeApiService; private HaobanQywxFeeApiService haobanQywxFeeApiService;
@Autowired
private WxEnterpriseApiService wxEnterpriseApiService;
/** /**
* 企微报错列表 * 企微报错列表
...@@ -51,12 +56,25 @@ public class QywxManageController extends WebBaseController { ...@@ -51,12 +56,25 @@ public class QywxManageController extends WebBaseController {
*/ */
@RequestMapping(value = "qywx-fee-list", method = RequestMethod.POST) @RequestMapping(value = "qywx-fee-list", method = RequestMethod.POST)
public RestResponse qywxFeeList(@RequestBody QywxFeeListQDTO qywxFeeListQDTO) { public RestResponse qywxFeeList(@RequestBody QywxFeeListQDTO qywxFeeListQDTO) {
Page<HaobanQywxFeeDTO> listPage = haobanQywxFeeApiService.listPage(qywxFeeListQDTO); Page<HaobanQywxFeeDTO> listPage = haobanQywxFeeApiService.listPage(qywxFeeListQDTO);
List<HaobanQywxFeeDTO> result = listPage.getResult();
if (CollectionUtils.isNotEmpty(result)) {
for (HaobanQywxFeeDTO haobanQywxFeeDTO : result) {
String wxEnterpriseId = haobanQywxFeeDTO.getWxEnterpriseId();
WxEnterpriseDTO wxEnterpriseDTO = wxEnterpriseApiService.getOne(wxEnterpriseId);
if (wxEnterpriseDTO != null) {
haobanQywxFeeDTO.setAutoActiveFlag(wxEnterpriseDTO.getAutoActiveFlag());
}
List<HaobanQywxFeeDetailDTO> haobanQywxFeeDetailDTOS = haobanQywxFeeApiService.feeDetail(wxEnterpriseId);
haobanQywxFeeDTO.setDetailNum(CollectionUtils.isEmpty(haobanQywxFeeDetailDTOS) ? 0 : haobanQywxFeeDetailDTOS.size());
}
}
return RestResponse.successResult(listPage); return RestResponse.successResult(listPage);
} }
/** /**
* 拦截查看详情 * 拦截查看详情
*
* @param wxEnterpriseId * @param wxEnterpriseId
* @return * @return
*/ */
......
...@@ -17,10 +17,10 @@ public interface TabHaobanQywxFeeAccountInterceptLogMapper { ...@@ -17,10 +17,10 @@ public interface TabHaobanQywxFeeAccountInterceptLogMapper {
/** /**
* 通过ID查询单条数据 * 通过ID查询单条数据
* *
* @param feeAccountId 主键 * @param feeAccountInterceptId 主键
* @return 实例对象 * @return 实例对象
*/ */
TabHaobanQywxFeeAccountInterceptLog queryById(Long feeAccountId); TabHaobanQywxFeeAccountInterceptLog queryById(Long feeAccountInterceptId);
/** /**
* 查询指定行数据 * 查询指定行数据
...@@ -58,10 +58,19 @@ public interface TabHaobanQywxFeeAccountInterceptLogMapper { ...@@ -58,10 +58,19 @@ public interface TabHaobanQywxFeeAccountInterceptLogMapper {
/** /**
* 通过主键删除数据 * 通过主键删除数据
* *
* @param feeAccountId 主键 * @param feeAccountInterceptId 主键
* @return 影响行数 * @return 影响行数
*/ */
int deleteById(Long feeAccountId); int deleteById(Long feeAccountInterceptId);
/**
* 查询天气企业服务id
*
* @param wxEnterpriseId wx企业标识
* @return {@link List }<{@link TabHaobanQywxFeeAccountInterceptLog }>
* @author mozhu
* @date 2022-08-10 14:55:59
*/
List<TabHaobanQywxFeeAccountInterceptLog> queryByWxEnterpriseId(@Param("wxEnterpriseId") String wxEnterpriseId);
} }
...@@ -2,6 +2,8 @@ package com.gic.haoban.manage.service.service.fee; ...@@ -2,6 +2,8 @@ package com.gic.haoban.manage.service.service.fee;
import com.gic.haoban.manage.service.entity.fee.TabHaobanQywxFeeAccountInterceptLog; import com.gic.haoban.manage.service.entity.fee.TabHaobanQywxFeeAccountInterceptLog;
import java.util.List;
/** /**
* 企业微信账号拦截日志(TabHaobanQywxFeeAccountInterceptLog)表服务接口 * 企业微信账号拦截日志(TabHaobanQywxFeeAccountInterceptLog)表服务接口
* *
...@@ -13,10 +15,10 @@ public interface HaobanQywxFeeAccountInterceptLogService { ...@@ -13,10 +15,10 @@ public interface HaobanQywxFeeAccountInterceptLogService {
/** /**
* 通过ID查询单条数据 * 通过ID查询单条数据
* *
* @param feeAccountId 主键 * @param feeAccountInterceptId 主键
* @return 实例对象 * @return 实例对象
*/ */
TabHaobanQywxFeeAccountInterceptLog queryById(Long feeAccountId); TabHaobanQywxFeeAccountInterceptLog queryById(Long feeAccountInterceptId);
/** /**
* 新增数据 * 新增数据
...@@ -34,12 +36,15 @@ public interface HaobanQywxFeeAccountInterceptLogService { ...@@ -34,12 +36,15 @@ public interface HaobanQywxFeeAccountInterceptLogService {
*/ */
TabHaobanQywxFeeAccountInterceptLog update(TabHaobanQywxFeeAccountInterceptLog tabHaobanQywxFeeAccountInterceptLog); TabHaobanQywxFeeAccountInterceptLog update(TabHaobanQywxFeeAccountInterceptLog tabHaobanQywxFeeAccountInterceptLog);
/** /**
* 通过主键删除数据 * 拦截日志
* *
* @param feeAccountId 主键 * @param wxEnterpriseId wx企业标识
* @return 是否成功 * @return {@link List }<{@link TabHaobanQywxFeeAccountInterceptLog }>
* @author mozhu
* @date 2022-08-10 14:52:32
*/ */
boolean deleteById(Long feeAccountId); List<TabHaobanQywxFeeAccountInterceptLog> queryByWxEnterpriseId(String wxEnterpriseId);
} }
...@@ -6,6 +6,8 @@ import com.gic.haoban.manage.service.service.fee.HaobanQywxFeeAccountInterceptLo ...@@ -6,6 +6,8 @@ import com.gic.haoban.manage.service.service.fee.HaobanQywxFeeAccountInterceptLo
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
/** /**
* 企业微信账号拦截日志(TabHaobanQywxFeeAccountInterceptLog)表服务实现类 * 企业微信账号拦截日志(TabHaobanQywxFeeAccountInterceptLog)表服务实现类
* *
...@@ -18,15 +20,10 @@ public class HaobanQywxFeeAccountInterceptLogServiceImpl implements HaobanQywxFe ...@@ -18,15 +20,10 @@ public class HaobanQywxFeeAccountInterceptLogServiceImpl implements HaobanQywxFe
@Autowired @Autowired
private TabHaobanQywxFeeAccountInterceptLogMapper tabHaobanQywxFeeAccountInterceptLogMapper; private TabHaobanQywxFeeAccountInterceptLogMapper tabHaobanQywxFeeAccountInterceptLogMapper;
/**
* 通过ID查询单条数据
*
* @param feeAccountId 主键
* @return 实例对象
*/
@Override @Override
public TabHaobanQywxFeeAccountInterceptLog queryById(Long feeAccountId) { public TabHaobanQywxFeeAccountInterceptLog queryById(Long feeAccountInterceptId) {
return this.tabHaobanQywxFeeAccountInterceptLogMapper.queryById(feeAccountId); return this.tabHaobanQywxFeeAccountInterceptLogMapper.queryById(feeAccountInterceptId);
} }
...@@ -54,14 +51,10 @@ public class HaobanQywxFeeAccountInterceptLogServiceImpl implements HaobanQywxFe ...@@ -54,14 +51,10 @@ public class HaobanQywxFeeAccountInterceptLogServiceImpl implements HaobanQywxFe
return this.queryById(tabHaobanQywxFeeAccountInterceptLog.getFeeAccountInterceptId()); return this.queryById(tabHaobanQywxFeeAccountInterceptLog.getFeeAccountInterceptId());
} }
/**
* 通过主键删除数据
*
* @param feeAccountId 主键
* @return 是否成功
*/
@Override @Override
public boolean deleteById(Long feeAccountId) { public List<TabHaobanQywxFeeAccountInterceptLog> queryByWxEnterpriseId(String wxEnterpriseId) {
return this.tabHaobanQywxFeeAccountInterceptLogMapper.deleteById(feeAccountId) > 0; return tabHaobanQywxFeeAccountInterceptLogMapper.queryByWxEnterpriseId(wxEnterpriseId);
} }
} }
...@@ -26,6 +26,7 @@ import com.gic.wechat.api.dto.qywx.fee.qdto.FeeOrderListQDTO; ...@@ -26,6 +26,7 @@ import com.gic.wechat.api.dto.qywx.fee.qdto.FeeOrderListQDTO;
import com.gic.wechat.api.service.qywx.QywxUserApiService; import com.gic.wechat.api.service.qywx.QywxUserApiService;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -33,6 +34,7 @@ import org.springframework.stereotype.Service; ...@@ -33,6 +34,7 @@ import org.springframework.stereotype.Service;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
@Service("haobanQywxFeeApiService") @Service("haobanQywxFeeApiService")
...@@ -233,6 +235,21 @@ public class HaobanQywxFeeApiServiceImpl implements HaobanQywxFeeApiService { ...@@ -233,6 +235,21 @@ public class HaobanQywxFeeApiServiceImpl implements HaobanQywxFeeApiService {
tabHaobanQywxFee.setInterceptFlag(0); tabHaobanQywxFee.setInterceptFlag(0);
haobanQywxFeeService.insert(tabHaobanQywxFee); haobanQywxFeeService.insert(tabHaobanQywxFee);
} }
List<TabHaobanQywxFeeAccountInterceptLog> tabHaobanQywxFeeAccountInterceptLogs = haobanQywxFeeAccountInterceptLogService.queryByWxEnterpriseId(wxEnterpriseId);
if (CollectionUtils.isNotEmpty(tabHaobanQywxFeeAccountInterceptLogs)) {
TabHaobanQywxFee tabHaobanQywxFee = new TabHaobanQywxFee();
tabHaobanQywxFee.setQwFeeId(UniqueIdUtils.uniqueLong());
tabHaobanQywxFee.setCorpName(wxEnterpriseDTO.getCorpName());
tabHaobanQywxFee.setCorpId(corpid);
tabHaobanQywxFee.setWxEnterpriseId(wxEnterpriseId);
tabHaobanQywxFee.setInterceptTime(DateUtil.offsetDay(new Date(),-1));
tabHaobanQywxFee.setInterceptUserNum(tabHaobanQywxFeeAccountInterceptLogs.size());
tabHaobanQywxFee.setPermissionUserNum(haobanQywxFeeOrderAccountService.countOrderAccountStatus(1,wxEnterpriseId));
tabHaobanQywxFee.setBuyPermissionUserNum(haobanQywxFeeOrderService.countExternalContactCount(wxEnterpriseId));
tabHaobanQywxFee.setInterceptFlag(1);
haobanQywxFeeService.insert(tabHaobanQywxFee);
}
} }
} }
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from tab_haoban_qywx_fee_account_intercept_log from tab_haoban_qywx_fee_account_intercept_log
where fee_account_id = #{feeAccountId} where fee_account_intercept_id = #{feeAccountInterceptId}
</select> </select>
<!--查询指定行数据--> <!--查询指定行数据-->
...@@ -98,8 +98,17 @@ ...@@ -98,8 +98,17 @@
<delete id="deleteById"> <delete id="deleteById">
delete delete
from tab_haoban_qywx_fee_account_intercept_log from tab_haoban_qywx_fee_account_intercept_log
where fee_account_id = #{feeAccountId} where fee_account_intercept_id = #{feeAccountInterceptId}
</delete> </delete>
<select id="queryByWxEnterpriseId" resultMap="TabHaobanQywxFeeAccountInterceptLogMap">
select
<include refid="Base_Column_List"/>
from tab_haoban_qywx_fee_account_intercept_log
where wx_enterprise_id = #{wxEnterpriseId}
and DATE_SUB(CURDATE(), INTERVAL 1 DAY) <![CDATA[ <= ]]> date(qw_create_time)
</select>
</mapper> </mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment