Commit 06ca9274 by jinxin

是否显示弹窗

parent dcf8b068
...@@ -145,11 +145,11 @@ public interface LicenceOrderApiService { ...@@ -145,11 +145,11 @@ public interface LicenceOrderApiService {
ServiceResponse<Boolean> cancelQywxOrder(Long orderId); ServiceResponse<Boolean> cancelQywxOrder(Long orderId);
/** /**
* 查询企业是否有历史订单 * 是否显示弹窗 true 显示 false 不显示
* @param wxEnterpriseId * @param wxEnterpriseId
* @return * @return
*/ */
ServiceResponse<Boolean> isOrder(String wxEnterpriseId); ServiceResponse<HashMap<String, Integer>> hasPopup(String wxEnterpriseId);
} }
...@@ -130,7 +130,7 @@ public interface TabHaobanLicenceOrderMapper { ...@@ -130,7 +130,7 @@ 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查询企业订单数量 * 根据wxEnterpriseId查询企业订单已支付数量
* *
* @param wxEnterpriseId * @param wxEnterpriseId
*/ */
......
...@@ -141,7 +141,7 @@ public interface LicenceOrderService { ...@@ -141,7 +141,7 @@ public interface LicenceOrderService {
*/ */
Boolean saveCallBackTime(Long orderId,Integer type,Date time); Boolean saveCallBackTime(Long orderId,Integer type,Date time);
/** /**
* 根据wxEnterpriseId查询企业订单数量 * 根据wxEnterpriseId查询企业订单已支付数量
* *
* @param wxEnterpriseId * @param wxEnterpriseId
*/ */
......
...@@ -11,6 +11,7 @@ import com.gic.commons.util.DateUtil; ...@@ -11,6 +11,7 @@ import com.gic.commons.util.DateUtil;
import com.gic.commons.util.EntityUtil; import com.gic.commons.util.EntityUtil;
import com.gic.enterprise.api.dto.EnterpriseDTO; import com.gic.enterprise.api.dto.EnterpriseDTO;
import com.gic.enterprise.api.service.EnterpriseService; import com.gic.enterprise.api.service.EnterpriseService;
import com.gic.haoban.manage.api.dto.StaffActiveDataDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseDTO; import com.gic.haoban.manage.api.dto.WxEnterpriseDTO;
import com.gic.haoban.manage.api.dto.licence.LicenceOrderDTO; import com.gic.haoban.manage.api.dto.licence.LicenceOrderDTO;
import com.gic.haoban.manage.api.dto.licence.LicenceOrderPageDTO; import com.gic.haoban.manage.api.dto.licence.LicenceOrderPageDTO;
...@@ -23,6 +24,8 @@ import com.gic.haoban.manage.service.config.Config; ...@@ -23,6 +24,8 @@ import com.gic.haoban.manage.service.config.Config;
import com.gic.haoban.manage.service.entity.fee.TabHaobanQywxFeeOrder; 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.StaffClerkRelationService;
import com.gic.haoban.manage.service.service.WxEnterpriseActiveDataService;
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.fee.HaobanQywxFeeOrderService;
import com.gic.haoban.manage.service.service.licence.LicenceOrderProgressService; import com.gic.haoban.manage.service.service.licence.LicenceOrderProgressService;
...@@ -82,7 +85,9 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService { ...@@ -82,7 +85,9 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
@Autowired @Autowired
private QywxUserApiService qywxUserApiService; private QywxUserApiService qywxUserApiService;
@Autowired @Autowired
private HaobanQywxFeeOrderService haobanQywxFeeOrderService; private StaffClerkRelationService staffClerkRelationService;
@Autowired
private WxEnterpriseActiveDataService wxEnterpriseActiveDataService;
@Override @Override
public ServiceResponse<LicenceOrderDTO> getLicenceOrderDetail(Long orderId, Integer type) { public ServiceResponse<LicenceOrderDTO> getLicenceOrderDetail(Long orderId, Integer type) {
...@@ -421,15 +426,25 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService { ...@@ -421,15 +426,25 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
} }
@Override @Override
public ServiceResponse<Boolean> isOrder(String wxEnterpriseId) { public ServiceResponse<HashMap<String, Integer>> hasPopup(String wxEnterpriseId) {
HashMap<String, Integer> map = new HashMap<>();
map.put("hasPopup",0);
map.put("count",0);
List<String> list = staffClerkRelationService.listByWxEnterpriseId(wxEnterpriseId);
if (CollUtil.isEmpty(list)){
return ServiceResponse.success(map);
}
Integer count = licenceOrderService.selectCountByWxEnterpriseId(wxEnterpriseId); Integer count = licenceOrderService.selectCountByWxEnterpriseId(wxEnterpriseId);
if (count==0){ if (count==0){
List<TabHaobanQywxFeeOrder> qywxFeeOrderList = haobanQywxFeeOrderService.listOrder(wxEnterpriseId); StaffActiveDataDTO dto = wxEnterpriseActiveDataService.getWxEnterpriseActiveDataByWxEnterpriseId(wxEnterpriseId);
if (CollUtil.isEmpty(qywxFeeOrderList)){ if (null != dto && dto.getPurchased() > 0){
return ServiceResponse.success(false); return ServiceResponse.success(map);
} }
map.put("hasPopup",1);
map.put("count",list.size());
return ServiceResponse.success(map);
} }
return ServiceResponse.success(true); return ServiceResponse.success(map);
} }
} }
...@@ -349,7 +349,7 @@ ...@@ -349,7 +349,7 @@
SELECT count(*) SELECT count(*)
FROM tab_haoban_licence_order FROM tab_haoban_licence_order
WHERE wx_enterprise_id = #{wxEnterpriseId} WHERE wx_enterprise_id = #{wxEnterpriseId}
and delete_flag = 0 and delete_flag = 0 and order_status = 1
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -66,6 +66,6 @@ public class LicenceOrderServiceTest { ...@@ -66,6 +66,6 @@ public class LicenceOrderServiceTest {
} }
@Test @Test
public void test7(){ public void test7(){
ServiceResponse<Boolean> response = licenceOrderApiService.isOrder("ca66a01b79474c40b3e7c7f93daf1a3b"); licenceOrderApiService.hasPopup("ca66a01b79474c40b3e7c7f93daf1a3b");
} }
} }
...@@ -350,15 +350,16 @@ public class LicenceOrderController { ...@@ -350,15 +350,16 @@ public class LicenceOrderController {
} }
/** /**
* 查询企业是否存在历史订单 * 是否显示弹窗 hasPopup 0不弹出 1弹出
* count 关联数量
*/ */
@RequestMapping("licence-order-hasOrder") @RequestMapping("licence-order-hasPopup")
public RestResponse<Boolean> hasOrder() { public RestResponse<HashMap<String, Integer>> hasPopup() {
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser(); WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
if (loginUser == null || StringUtils.isBlank(loginUser.getEnterpriseId())) { if (loginUser == null || StringUtils.isBlank(loginUser.getEnterpriseId())) {
return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_4.getCode()), HaoBanErrCode.ERR_4.getMsg()); return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_4.getCode()), HaoBanErrCode.ERR_4.getMsg());
} }
ServiceResponse<Boolean> response = licenceOrderApiService.isOrder(loginUser.getWxEnterpriseId()); ServiceResponse<HashMap<String, Integer>> response = licenceOrderApiService.hasPopup(loginUser.getWxEnterpriseId());
return RestResponse.successResult(response.getResult()); 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