Commit ffdee020 by jinxin

查询企业是否存在历史订单

parent c32807bc
...@@ -144,5 +144,12 @@ public interface LicenceOrderApiService { ...@@ -144,5 +144,12 @@ public interface LicenceOrderApiService {
*/ */
ServiceResponse<Boolean> cancelQywxOrder(Long orderId); ServiceResponse<Boolean> cancelQywxOrder(Long orderId);
/**
* 查询企业是否有历史订单
* @param wxEnterpriseId
* @return
*/
ServiceResponse<Boolean> isOrder(String wxEnterpriseId);
} }
...@@ -129,4 +129,11 @@ public interface TabHaobanLicenceOrderMapper { ...@@ -129,4 +129,11 @@ public interface TabHaobanLicenceOrderMapper {
*/ */
Integer saveCallBackTime(@Param("orderId") Long orderId, @Param("type") Integer type, @Param("time") Date time); Integer saveCallBackTime(@Param("orderId") Long orderId, @Param("type") Integer type, @Param("time") Date time);
/**
* 根据wxEnterpriseId查询企业订单数量
*
* @param wxEnterpriseId
*/
Integer selectCountByWxEnterpriseId(@Param("wxEnterpriseId") String wxEnterpriseId);
} }
...@@ -140,6 +140,12 @@ public interface LicenceOrderService { ...@@ -140,6 +140,12 @@ public interface LicenceOrderService {
* @return * @return
*/ */
Boolean saveCallBackTime(Long orderId,Integer type,Date time); Boolean saveCallBackTime(Long orderId,Integer type,Date time);
/**
* 根据wxEnterpriseId查询企业订单数量
*
* @param wxEnterpriseId
*/
Integer selectCountByWxEnterpriseId(String wxEnterpriseId);
} }
...@@ -307,4 +307,9 @@ public class LicenceOrderServiceImpl implements LicenceOrderService { ...@@ -307,4 +307,9 @@ public class LicenceOrderServiceImpl implements LicenceOrderService {
tabHaobanLicenceOrderMapper.saveCallBackTime(orderId,type,time); tabHaobanLicenceOrderMapper.saveCallBackTime(orderId,type,time);
return true; return true;
} }
@Override
public Integer selectCountByWxEnterpriseId(String wxEnterpriseId) {
return tabHaobanLicenceOrderMapper.selectCountByWxEnterpriseId(wxEnterpriseId);
}
} }
package com.gic.haoban.manage.service.service.out.impl.licence; package com.gic.haoban.manage.service.service.out.impl.licence;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
...@@ -19,9 +20,11 @@ import com.gic.haoban.manage.api.dto.qdto.licence.LicenceOrderQDTO; ...@@ -19,9 +20,11 @@ import com.gic.haoban.manage.api.dto.qdto.licence.LicenceOrderQDTO;
import com.gic.haoban.manage.api.service.WxEnterpriseApiService; import com.gic.haoban.manage.api.service.WxEnterpriseApiService;
import com.gic.haoban.manage.api.service.licence.LicenceOrderApiService; import com.gic.haoban.manage.api.service.licence.LicenceOrderApiService;
import com.gic.haoban.manage.service.config.Config; import com.gic.haoban.manage.service.config.Config;
import com.gic.haoban.manage.service.entity.fee.TabHaobanQywxFeeOrder;
import com.gic.haoban.manage.service.entity.licence.TabHaobanLicenceOrder; import com.gic.haoban.manage.service.entity.licence.TabHaobanLicenceOrder;
import com.gic.haoban.manage.service.entity.licence.TabHaobanLicenceOrderProgress; import com.gic.haoban.manage.service.entity.licence.TabHaobanLicenceOrderProgress;
import com.gic.haoban.manage.service.service.WxEnterpriseService; import com.gic.haoban.manage.service.service.WxEnterpriseService;
import com.gic.haoban.manage.service.service.fee.HaobanQywxFeeOrderService;
import com.gic.haoban.manage.service.service.licence.LicenceOrderProgressService; import com.gic.haoban.manage.service.service.licence.LicenceOrderProgressService;
import com.gic.haoban.manage.service.service.licence.LicenceOrderService; 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;
...@@ -78,6 +81,8 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService { ...@@ -78,6 +81,8 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
private Pay4WXService pay4WXService; private Pay4WXService pay4WXService;
@Autowired @Autowired
private QywxUserApiService qywxUserApiService; private QywxUserApiService qywxUserApiService;
@Autowired
private HaobanQywxFeeOrderService haobanQywxFeeOrderService;
@Override @Override
public ServiceResponse<LicenceOrderDTO> getLicenceOrderDetail(Long orderId, Integer type) { public ServiceResponse<LicenceOrderDTO> getLicenceOrderDetail(Long orderId, Integer type) {
...@@ -411,4 +416,16 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService { ...@@ -411,4 +416,16 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
return ServiceResponse.failure(response.getCode(),response.getMessage()); return ServiceResponse.failure(response.getCode(),response.getMessage());
} }
@Override
public ServiceResponse<Boolean> isOrder(String wxEnterpriseId) {
Integer count = licenceOrderService.selectCountByWxEnterpriseId(wxEnterpriseId);
if (count==0){
List<TabHaobanQywxFeeOrder> qywxFeeOrderList = haobanQywxFeeOrderService.listOrder(wxEnterpriseId);
if (CollUtil.isEmpty(qywxFeeOrderList)){
return ServiceResponse.success(false);
}
}
return ServiceResponse.success(true);
}
} }
...@@ -345,4 +345,11 @@ ...@@ -345,4 +345,11 @@
and delete_flag = 0 and delete_flag = 0
</update> </update>
<select id="selectCountByWxEnterpriseId" resultType="java.lang.Integer">
SELECT count(*)
FROM tab_haoban_licence_order
WHERE wx_enterprise_id = #{wxEnterpriseId}
and delete_flag = 0
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -64,4 +64,8 @@ public class LicenceOrderServiceTest { ...@@ -64,4 +64,8 @@ public class LicenceOrderServiceTest {
licenceOrderApiService.qywxCallBack(JSON.toJSONString(json)); licenceOrderApiService.qywxCallBack(JSON.toJSONString(json));
} }
@Test
public void test7(){
ServiceResponse<Boolean> response = licenceOrderApiService.isOrder("ca66a01b79474c40b3e7c7f93daf1a3b");
}
} }
...@@ -349,5 +349,18 @@ public class LicenceOrderController { ...@@ -349,5 +349,18 @@ public class LicenceOrderController {
return RestResponse.successResult(orderIdList.getResult()); return RestResponse.successResult(orderIdList.getResult());
} }
/**
* 查询企业是否存在历史订单
*/
@RequestMapping("licence-order-hasOrder")
public RestResponse<Boolean> hasOrder() {
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<Boolean> response = licenceOrderApiService.isOrder(loginUser.getWxEnterpriseId());
return RestResponse.successResult(response.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