Commit d1ed8cff by jinxin

新增远程搜索接口

parent b5fa3cf6
......@@ -8,6 +8,7 @@ import com.gic.haoban.manage.api.dto.qdto.licence.LicenceOrderPageQDTO;
import com.gic.haoban.manage.api.dto.qdto.licence.LicenceOrderQDTO;
import java.util.Date;
import java.util.List;
/**
* <p>
......@@ -104,5 +105,14 @@ public interface LicenceOrderApiService {
*/
ServiceResponse<Boolean> saveTransactionCode(Long orderId, String transactionCode, String prepayId, String wxOrderId, Date payTime);
/**
* 查询订单编号id
* @param param 查询参数
* @param type 0 微信订单编号 1 企业微信订单编号
* @param wxEnterpriseId
* @return
*/
ServiceResponse<List<String>> getOrderIdList(String param,Integer type,String wxEnterpriseId);
}
......@@ -29,6 +29,17 @@ public class Config {
@Value("${addDelFriendEvent}")
private String addDelFriendEvent;
@Value("${buyerUserid}")
private String buyerUserid;
public String getBuyerUserid() {
return buyerUserid;
}
public void setBuyerUserid(String buyerUserid) {
this.buyerUserid = buyerUserid;
}
public String getHmLinkUrl() {
return hmLinkUrl;
}
......
......@@ -114,4 +114,8 @@ public interface TabHaobanLicenceOrderMapper {
*/
Integer saveQywxOrderId(@Param("orderId") Long orderId, @Param("qywxOrderId") String qywxOrderId);
List<String> getTransactionIdList(@Param("transactionId") String transactionId,@Param("wxEnterpriseId") String wxEnterpriseId);
List<String> getQywxOrderId(@Param("qywxOrderId") String qywxOrderId,@Param("wxEnterpriseId") String wxEnterpriseId);
}
package com.gic.haoban.manage.service.service.licence;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.haoban.manage.api.dto.licence.LicenceOrderPageDTO;
import com.gic.haoban.manage.api.dto.qdto.licence.LicenceOrderPageQDTO;
import com.gic.haoban.manage.api.dto.qdto.licence.LicenceOrderQDTO;
......@@ -8,6 +9,7 @@ import com.gic.haoban.manage.service.entity.licence.TabHaobanLicenceOrder;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
/**
* <p>
......@@ -113,5 +115,14 @@ public interface LicenceOrderService {
*/
Integer saveQywxOrderId(Long orderId, String qywxOrderId);
/**
* 查询订单编号id
* @param param 查询参数
* @param type 0 微信订单编号 1 企业微信订单编号
* @param wxEnterpriseId
* @return
*/
List<String> getOrderIdList(String param, Integer type, String wxEnterpriseId);
}
......@@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.DateUtil;
import com.gic.commons.util.PageHelperUtils;
import com.gic.commons.util.UniqueIdUtils;
......@@ -22,10 +23,12 @@ import com.gic.haoban.manage.service.service.licence.LicenceOrderService;
import com.gic.haoban.manage.service.util.DingUtils;
import com.github.pagehelper.PageHelper;
import org.apache.commons.lang.StringUtils;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
......@@ -228,4 +231,15 @@ public class LicenceOrderServiceImpl implements LicenceOrderService {
public Integer saveQywxOrderId(Long orderId, String qywxOrderId) {
return tabHaobanLicenceOrderMapper.saveQywxOrderId(orderId,qywxOrderId);
}
@Override
public List<String> getOrderIdList(String param, Integer type, String wxEnterpriseId) {
List<String> result = new ArrayList<>();
if (type == 0){
result = tabHaobanLicenceOrderMapper.getTransactionIdList(param,wxEnterpriseId);
}else {
result = tabHaobanLicenceOrderMapper.getQywxOrderId(param,wxEnterpriseId);
}
return result;
}
}
......@@ -134,8 +134,7 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
CreateOrderQDTO orderQDTO = new CreateOrderQDTO();
orderQDTO.setBaseCount(0);
orderQDTO.setExternalCount(licenceOrderDetail.getExternalContactCount());
//todo 购买人userId,加密 先写死
orderQDTO.setBuyerUserid("wo59NLDQAA_8N2VFOP3qPubiCqxi0LGg");
orderQDTO.setBuyerUserid(config.getBuyerUserid());
if (licenceOrderDetail.getTimeType() == 1){
orderQDTO.setMonths(licenceOrderDetail.getTimeValue());
orderQDTO.setDays(0);
......@@ -245,4 +244,9 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
licenceOrderService.saveTransactionCode(orderId,transactionCode,prepayId,wxOrderId,payTime);
return ServiceResponse.success(true);
}
@Override
public ServiceResponse<List<String>> getOrderIdList(String param, Integer type, String wxEnterpriseId) {
return ServiceResponse.success(licenceOrderService.getOrderIdList(param,type,wxEnterpriseId));
}
}
......@@ -211,22 +211,22 @@
<include refid="Base_Column_List"/>
FROM tab_haoban_licence_order
WHERE delete_flag = 0
<if test="transactionId != null">
<if test="transactionId != nul and transactionId !='' ">
and transaction_id=#{transactionId}
</if>
<if test="orderStatus != null">
and order_status=#{orderStatus}
</if>
<if test="qywxOrderId != null">
<if test="qywxOrderId != null and qywxOrderId !=''">
and qywx_order_id=#{qywxOrderId}
</if>
<if test="qywxOrderStatus != null">
and qywx_order_status=#{qywxOrderStatus}
</if>
<if test="startTime != null">
<if test="startTime != null and startTime !='' ">
and create_time <![CDATA[ >= ]]> #{startTime}
</if>
<if test="endTime != null">
<if test="endTime != null and endTime !='' ">
and create_time <![CDATA[ <= ]]> #{endTime}
</if>
order by create_time desc
......@@ -271,4 +271,16 @@
and delete_flag = 0
</update>
<select id="getTransactionIdList" resultMap="BaseResultMap">
SELECT
transaction_id
FROM tab_haoban_licence_order WHERE transaction_id like concat (#{transactionId},'%') and delete_flag=0 and wx_enterprise_id = #{wxEnterpriseId}
</select>
<select id="getQywxOrderId" resultMap="BaseResultMap">
SELECT
qywx_order_id
FROM tab_haoban_licence_order WHERE qywx_order_id like concat (#{qywxOrderId},'%') and delete_flag=0 and wx_enterprise_id = #{wxEnterpriseId}
</select>
</mapper>
\ No newline at end of file
......@@ -100,7 +100,7 @@
<if test="type != null">
and type=#{type}
</if>
and delete_flag=0 order by create_time asc
and delete_flag=0 order by create_time desc
</select>
<update id="deleteByOrderId" parameterType="long">
......
......@@ -9,7 +9,7 @@ import org.springframework.context.annotation.Configuration;
*/
@Configuration
@EnableApolloConfig
public class Config {
public class Config {
@Value("${corpid}")
private String corpid;
@Value("${suiteid}")
......@@ -19,6 +19,40 @@ public class Config {
@Value("${wxSuiteid}")
private String wxSuiteid;
/**
* 企业微信许可账号购买信息
*/
@Value("${accountName}")
private String accountName;
@Value("${accountNumber}")
private String accountNumber;
@Value("${bankName}")
private String bankName;
public String getAccountName() {
return accountName;
}
public void setAccountName(String accountName) {
this.accountName = accountName;
}
public String getAccountNumber() {
return accountNumber;
}
public void setAccountNumber(String accountNumber) {
this.accountNumber = accountNumber;
}
public String getBankName() {
return bankName;
}
public void setBankName(String bankName) {
this.bankName = bankName;
}
public String getCorpid() {
return corpid;
}
......
......@@ -40,10 +40,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.*;
/**
* 企业微信许可账号购买
......@@ -276,6 +273,37 @@ public class LicenceOrderController {
ServiceResponse<String> payLicenceOrder = licenceOrderApiService.isPayLicenceOrder(loginUser.getWxEnterpriseId());
return RestResponse.successResult(payLicenceOrder.getResult());
}
/**
* 查询开户信息
*/
@RequestMapping("get-account-info")
public RestResponse<HashMap<String, String>> getAccountInfo() {
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
if (loginUser == null || StringUtils.isBlank(loginUser.getEnterpriseId())) {
return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_4.getCode()), HaoBanErrCode.ERR_4.getMsg());
}
HashMap<String, String> result = new HashMap<>(8);
result.put("accountName",config.getAccountName());
result.put("accountNumber",config.getAccountNumber());
result.put("bankName",config.getBankName());
return RestResponse.successResult(result);
}
/**
* 订单编号和企业微信订单编号模糊搜索
* @param param 模糊查询
* @param type 0 微信订单编号 1 企业微信订单编号
* @return
*/
@RequestMapping("get-order-id-list")
public RestResponse<List<String>> getOrderIdList(String param,Integer type) {
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
if (loginUser == null || StringUtils.isBlank(loginUser.getEnterpriseId())) {
return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_4.getCode()), HaoBanErrCode.ERR_4.getMsg());
}
ServiceResponse<List<String>> orderIdList = licenceOrderApiService.getOrderIdList(param, type, loginUser.getWxEnterpriseId());
return RestResponse.successResult(orderIdList.getResult());
}
}
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