|
|
|
@ -34,6 +34,7 @@ import org.springframework.stereotype.Service; |
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
|
import java.util.*; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
@ -66,6 +67,8 @@ public class BuyerServiceImpl implements BuyerService { |
|
|
|
|
@Autowired |
|
|
|
|
private UserInfoService userInfoService; |
|
|
|
|
|
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("MMdd"); |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public PageUtils queryBuyerList(Map<String, Object> paramMap, List<String> shList) { |
|
|
|
|
int pageSize = Integer.parseInt(String.valueOf(paramMap.get(ConfigureConstant.STRING_PAGE_SIZE))); |
|
|
|
@ -455,6 +458,10 @@ public class BuyerServiceImpl implements BuyerService { |
|
|
|
|
return r.put("message", "客户编码已存在").put(OrderManagementConstant.CODE, ConfigureConstant.STRING_9999); |
|
|
|
|
} |
|
|
|
|
String buyerId = baseService.getGenerateShotKey(); |
|
|
|
|
if(StringUtils.isBlank(buyerEntity.getBuyerCode())||"0000000000".equals(buyerEntity.getBuyerCode())){ |
|
|
|
|
String format = String.format("%s%s", sdf.format(new Date()), String.format("%6s", String.valueOf(new Random().nextInt(1000000))).replace(' ', '0')); |
|
|
|
|
buyerEntity.setBuyerCode(format); |
|
|
|
|
} |
|
|
|
|
if (CollectionUtil.isNotEmpty(buyerEntity.getBuyerEntityDetail())) { |
|
|
|
|
Map<String, BuyerEntityDetail> collect = buyerEntity.getBuyerEntityDetail().stream().sorted((t1,t2)->Integer.valueOf(t2.getDefaultMark()) - Integer.valueOf(t1.getDefaultMark())).collect(Collectors.toMap(t -> t.getAddress() + t.getPhone() + t.getBankName() + t.getBankAccount(), t -> t,(t1, t2) -> t2)); |
|
|
|
|
List<BuyerEntityDetail> collect1 = collect.values().stream().collect(Collectors.toList()); |
|
|
|
|