Commit d1ed8cff by jinxin

新增远程搜索接口

parent b5fa3cf6
...@@ -8,6 +8,7 @@ import com.gic.haoban.manage.api.dto.qdto.licence.LicenceOrderPageQDTO; ...@@ -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 com.gic.haoban.manage.api.dto.qdto.licence.LicenceOrderQDTO;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* <p> * <p>
...@@ -104,5 +105,14 @@ public interface LicenceOrderApiService { ...@@ -104,5 +105,14 @@ public interface LicenceOrderApiService {
*/ */
ServiceResponse<Boolean> saveTransactionCode(Long orderId, String transactionCode, String prepayId, String wxOrderId, Date payTime); 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 { ...@@ -29,6 +29,17 @@ public class Config {
@Value("${addDelFriendEvent}") @Value("${addDelFriendEvent}")
private String 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() { public String getHmLinkUrl() {
return hmLinkUrl; return hmLinkUrl;
} }
......
...@@ -114,4 +114,8 @@ public interface TabHaobanLicenceOrderMapper { ...@@ -114,4 +114,8 @@ public interface TabHaobanLicenceOrderMapper {
*/ */
Integer saveQywxOrderId(@Param("orderId") Long orderId, @Param("qywxOrderId") String qywxOrderId); 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; package com.gic.haoban.manage.service.service.licence;
import com.gic.api.base.commons.Page; 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.licence.LicenceOrderPageDTO;
import com.gic.haoban.manage.api.dto.qdto.licence.LicenceOrderPageQDTO; import com.gic.haoban.manage.api.dto.qdto.licence.LicenceOrderPageQDTO;
import com.gic.haoban.manage.api.dto.qdto.licence.LicenceOrderQDTO; import com.gic.haoban.manage.api.dto.qdto.licence.LicenceOrderQDTO;
...@@ -8,6 +9,7 @@ import com.gic.haoban.manage.service.entity.licence.TabHaobanLicenceOrder; ...@@ -8,6 +9,7 @@ import com.gic.haoban.manage.service.entity.licence.TabHaobanLicenceOrder;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* <p> * <p>
...@@ -113,5 +115,14 @@ public interface LicenceOrderService { ...@@ -113,5 +115,14 @@ public interface LicenceOrderService {
*/ */
Integer saveQywxOrderId(Long orderId, String qywxOrderId); 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; ...@@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.Page; 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.DateUtil;
import com.gic.commons.util.PageHelperUtils; import com.gic.commons.util.PageHelperUtils;
import com.gic.commons.util.UniqueIdUtils; import com.gic.commons.util.UniqueIdUtils;
...@@ -22,10 +23,12 @@ import com.gic.haoban.manage.service.service.licence.LicenceOrderService; ...@@ -22,10 +23,12 @@ import com.gic.haoban.manage.service.service.licence.LicenceOrderService;
import com.gic.haoban.manage.service.util.DingUtils; import com.gic.haoban.manage.service.util.DingUtils;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.checkerframework.checker.units.qual.A;
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 org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -228,4 +231,15 @@ public class LicenceOrderServiceImpl implements LicenceOrderService { ...@@ -228,4 +231,15 @@ public class LicenceOrderServiceImpl implements LicenceOrderService {
public Integer saveQywxOrderId(Long orderId, String qywxOrderId) { public Integer saveQywxOrderId(Long orderId, String qywxOrderId) {
return tabHaobanLicenceOrderMapper.saveQywxOrderId(orderId,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 { ...@@ -134,8 +134,7 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
CreateOrderQDTO orderQDTO = new CreateOrderQDTO(); CreateOrderQDTO orderQDTO = new CreateOrderQDTO();
orderQDTO.setBaseCount(0); orderQDTO.setBaseCount(0);
orderQDTO.setExternalCount(licenceOrderDetail.getExternalContactCount()); orderQDTO.setExternalCount(licenceOrderDetail.getExternalContactCount());
//todo 购买人userId,加密 先写死 orderQDTO.setBuyerUserid(config.getBuyerUserid());
orderQDTO.setBuyerUserid("wo59NLDQAA_8N2VFOP3qPubiCqxi0LGg");
if (licenceOrderDetail.getTimeType() == 1){ if (licenceOrderDetail.getTimeType() == 1){
orderQDTO.setMonths(licenceOrderDetail.getTimeValue()); orderQDTO.setMonths(licenceOrderDetail.getTimeValue());
orderQDTO.setDays(0); orderQDTO.setDays(0);
...@@ -245,4 +244,9 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService { ...@@ -245,4 +244,9 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
licenceOrderService.saveTransactionCode(orderId,transactionCode,prepayId,wxOrderId,payTime); licenceOrderService.saveTransactionCode(orderId,transactionCode,prepayId,wxOrderId,payTime);
return ServiceResponse.success(true); 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 @@ ...@@ -211,22 +211,22 @@
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
FROM tab_haoban_licence_order FROM tab_haoban_licence_order
WHERE delete_flag = 0 WHERE delete_flag = 0
<if test="transactionId != null"> <if test="transactionId != nul and transactionId !='' ">
and transaction_id=#{transactionId} and transaction_id=#{transactionId}
</if> </if>
<if test="orderStatus != null"> <if test="orderStatus != null">
and order_status=#{orderStatus} and order_status=#{orderStatus}
</if> </if>
<if test="qywxOrderId != null"> <if test="qywxOrderId != null and qywxOrderId !=''">
and qywx_order_id=#{qywxOrderId} and qywx_order_id=#{qywxOrderId}
</if> </if>
<if test="qywxOrderStatus != null"> <if test="qywxOrderStatus != null">
and qywx_order_status=#{qywxOrderStatus} and qywx_order_status=#{qywxOrderStatus}
</if> </if>
<if test="startTime != null"> <if test="startTime != null and startTime !='' ">
and create_time <![CDATA[ >= ]]> #{startTime} and create_time <![CDATA[ >= ]]> #{startTime}
</if> </if>
<if test="endTime != null"> <if test="endTime != null and endTime !='' ">
and create_time <![CDATA[ <= ]]> #{endTime} and create_time <![CDATA[ <= ]]> #{endTime}
</if> </if>
order by create_time desc order by create_time desc
...@@ -271,4 +271,16 @@ ...@@ -271,4 +271,16 @@
and delete_flag = 0 and delete_flag = 0
</update> </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> </mapper>
\ No newline at end of file
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
<if test="type != null"> <if test="type != null">
and type=#{type} and type=#{type}
</if> </if>
and delete_flag=0 order by create_time asc and delete_flag=0 order by create_time desc
</select> </select>
<update id="deleteByOrderId" parameterType="long"> <update id="deleteByOrderId" parameterType="long">
......
...@@ -9,7 +9,7 @@ import org.springframework.context.annotation.Configuration; ...@@ -9,7 +9,7 @@ import org.springframework.context.annotation.Configuration;
*/ */
@Configuration @Configuration
@EnableApolloConfig @EnableApolloConfig
public class Config { public class Config {
@Value("${corpid}") @Value("${corpid}")
private String corpid; private String corpid;
@Value("${suiteid}") @Value("${suiteid}")
...@@ -19,6 +19,40 @@ public class Config { ...@@ -19,6 +19,40 @@ public class Config {
@Value("${wxSuiteid}") @Value("${wxSuiteid}")
private String 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() { public String getCorpid() {
return corpid; return corpid;
} }
......
...@@ -40,10 +40,7 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -40,10 +40,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.Arrays; import java.util.*;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/** /**
* 企业微信许可账号购买 * 企业微信许可账号购买
...@@ -276,6 +273,37 @@ public class LicenceOrderController { ...@@ -276,6 +273,37 @@ public class LicenceOrderController {
ServiceResponse<String> payLicenceOrder = licenceOrderApiService.isPayLicenceOrder(loginUser.getWxEnterpriseId()); ServiceResponse<String> payLicenceOrder = licenceOrderApiService.isPayLicenceOrder(loginUser.getWxEnterpriseId());
return RestResponse.successResult(payLicenceOrder.getResult()); 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