|
@@ -15,6 +15,7 @@ import com.fjhx.mapper.customer.CustomerMapper;
|
|
|
import com.fjhx.params.customer.CustomerVo;
|
|
|
import com.fjhx.service.customer.CustomerLinkService;
|
|
|
import com.fjhx.service.customer.CustomerService;
|
|
|
+import com.fjhx.utils.RegionClientUtil;
|
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -47,6 +48,7 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
|
|
|
.like(Customer::getCode, keyword)
|
|
|
.like(Customer::getName, keyword)
|
|
|
)
|
|
|
+ .eq(BaseEntity::getTenantId, AuthUtil.getTenantId())
|
|
|
.orderByDesc(BaseEntity::getId);
|
|
|
|
|
|
Page<Map<String, Object>> page = pageMaps(condition.getPage(), wrapper);
|
|
@@ -55,7 +57,7 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
|
|
|
return page;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ RegionClientUtil.setRegionName(records);
|
|
|
|
|
|
return page;
|
|
|
}
|
|
@@ -125,6 +127,19 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
|
|
|
}
|
|
|
String code = customer.getCode();
|
|
|
int num = Convert.toInt(code.replace("C", "")) + 1;
|
|
|
+
|
|
|
+ if (num < 10) {
|
|
|
+ return "C0000" + num;
|
|
|
+ }
|
|
|
+ if (num < 100) {
|
|
|
+ return "C000" + num;
|
|
|
+ }
|
|
|
+ if (num < 1000) {
|
|
|
+ return "C00" + num;
|
|
|
+ }
|
|
|
+ if (num < 10000) {
|
|
|
+ return "C0" + num;
|
|
|
+ }
|
|
|
return "C" + num;
|
|
|
}
|
|
|
|