|
|
|
@ -108,70 +108,6 @@ public class BasicdataClientController extends BladeController {
|
|
|
|
|
@ApiOperationSupport(order = 2) |
|
|
|
|
@ApiOperation(value = "分页", notes = "传入basicdataClient") |
|
|
|
|
public R<IPage<BasicdataClientVO>> list(@ApiIgnore @RequestParam Map<String, Object> basicdataClient, Query query) { |
|
|
|
|
|
|
|
|
|
Object o = basicdataClient.get("contractStartTime"); |
|
|
|
|
Object o1 = basicdataClient.get("contractEntTime"); |
|
|
|
|
Object o2 = basicdataClient.get("pid"); |
|
|
|
|
basicdataClient.put("contractStartTime", null); |
|
|
|
|
basicdataClient.put("contractEntTime", null); |
|
|
|
|
QueryWrapper<BasicdataClientEntity> queryWrapper = Condition.getQueryWrapper(basicdataClient, BasicdataClientEntity.class); |
|
|
|
|
/* queryWrapper.apply(o != null, |
|
|
|
|
"date_format (contract_start_time,'%Y-%m-%d') >= date_format ({0},'%Y-%m-%d')", o) |
|
|
|
|
.apply(o1 != null, |
|
|
|
|
"date_format (contract_ent_time,'%Y-%m-%d') <= date_format ({0},'%Y-%m-%d')", o1);*/ |
|
|
|
|
if (ObjectUtils.isNotNull(o)) { |
|
|
|
|
queryWrapper.between("contract_start_time", o, o1); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
if (ObjectUtils.isNotNull(o2)) { |
|
|
|
|
queryWrapper.eq("pid", o2); |
|
|
|
|
} else { |
|
|
|
|
queryWrapper.eq("pid", "0"); |
|
|
|
|
} |
|
|
|
|
queryWrapper.orderByDesc("create_time"); |
|
|
|
|
IPage<BasicdataClientEntity> pages = basicdataClientService.page(Condition.getPage(query), queryWrapper); |
|
|
|
|
pages.getRecords().forEach(i -> { |
|
|
|
|
List<BasicdataStoreBusinessEntity> list = basicdataStoreBusinessService.list(Wrappers.<BasicdataStoreBusinessEntity>query().lambda() |
|
|
|
|
.eq(BasicdataStoreBusinessEntity::getClientId, i.getId())); |
|
|
|
|
i.setTypeServiceBusiness(list); |
|
|
|
|
//查询客户绑定第一位联系人
|
|
|
|
|
List<BasicdataStoreContactEntity> listed = basicdataStoreContactService.list(Wrappers.<BasicdataStoreContactEntity>query().lambda() |
|
|
|
|
.eq(BasicdataStoreContactEntity::getShopId, i.getId()) |
|
|
|
|
.eq(BasicdataStoreContactEntity::getDefaultType, true)); |
|
|
|
|
if (Func.isNotEmpty(listed)) { |
|
|
|
|
List<BasicdataStoreContactEntity> collect = listed.stream().filter(f -> Func.isEmpty(f.getCreateTime())).collect(Collectors.toList()); |
|
|
|
|
if (Func.isNotEmpty(collect)){ |
|
|
|
|
System.out.println("客户无创建时间"+collect); |
|
|
|
|
} |
|
|
|
|
String string = listed.stream().sorted(Comparator.comparing(BasicdataStoreContactEntity::getCreateTime)).findFirst().map(BasicdataStoreContactEntity::getLinkman).get(); |
|
|
|
|
String phone = listed.stream().sorted(Comparator.comparing(BasicdataStoreContactEntity::getCreateTime)).findFirst().map(BasicdataStoreContactEntity::getPhone).get(); |
|
|
|
|
i.setLinkman(string); |
|
|
|
|
i.setPhone(phone); |
|
|
|
|
} |
|
|
|
|
List<String> collect = list.stream().filter(f -> Func.isNotEmpty(f.getMold())).map(BasicdataStoreBusinessEntity::getMold).collect(Collectors.toList()); |
|
|
|
|
if (collect.size() > 0) { |
|
|
|
|
//进行
|
|
|
|
|
String s = collect.get(0); |
|
|
|
|
switch (s) { |
|
|
|
|
case "1": |
|
|
|
|
i.setTypeServiceName("商配"); |
|
|
|
|
break; |
|
|
|
|
case "2": |
|
|
|
|
i.setTypeServiceName("市配"); |
|
|
|
|
break; |
|
|
|
|
case "3": |
|
|
|
|
i.setTypeServiceName("自提"); |
|
|
|
|
break; |
|
|
|
|
case "4": |
|
|
|
|
i.setTypeServiceName("三方中转"); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//处理客户的配送类型
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IPage<BasicdataClientVO> basicdataClientVOIPage = basicdataClientService.pageList(Condition.getPage(query), basicdataClient); |
|
|
|
|
if (!basicdataClientVOIPage.getRecords().isEmpty()) { |
|
|
|
|
for (BasicdataClientVO record : basicdataClientVOIPage.getRecords()) { |
|
|
|
@ -194,6 +130,18 @@ public class BasicdataClientController extends BladeController {
|
|
|
|
|
return R.data(pages); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 查询最后一位客户编码 |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@GetMapping("/getFinallyClientCode") |
|
|
|
|
@ApiOperationSupport(order = 3) |
|
|
|
|
@ApiOperation(value = "查询最后一位客户编码", notes = "传入basicdataClient") |
|
|
|
|
public R<String> getFinallyClientCode() { |
|
|
|
|
String code = basicdataClientService.getFinallyClientCode(); |
|
|
|
|
return R.data(code); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 基础客户表查询 |
|
|
|
|
*/ |
|
|
|
|