| | |
| | | LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | | Long tenantId = loginUser.getTenantId(); |
| | | customer.setTenantId(tenantId); |
| | | customer.setType(2); |
| | | return customerMapper.insert(customer); |
| | | } |
| | | |
| | |
| | | |
| | | String searchFieldJson = searchConditions.toJSONString(); |
| | | |
| | | JSONArray dataArr = AliDingUtils.getFormDataList(aliDingConfig, aliDingConfig.getCustomerCodeFormUuid(), searchFieldJson, this, Customer::getFormModifiedTime); |
| | | LambdaQueryWrapper<Customer> countWrapper = new LambdaQueryWrapper<>(); |
| | | countWrapper.eq(Customer::getType, 1); |
| | | |
| | | if (dataArr.isEmpty()) { |
| | | JSONArray dataArr = AliDingUtils.getFormDataList(aliDingConfig, aliDingConfig.getCustomerCodeFormUuid(), searchFieldJson, this, Customer::getFormModifiedTime, countWrapper); |
| | | |
| | | if (dataArr == null || dataArr.isEmpty()) { |
| | | log.info("没有更多新数据需要同步"); |
| | | return; |
| | | } |
| | |
| | | customer.setMaintenanceTime(date); |
| | | customer.setFormInstanceId(formInstanceId); |
| | | customer.setFormModifiedTime(dateTime); |
| | | customer.setType(1); |
| | | list.add(customer); |
| | | } |
| | | return list; |