feat: yxfy

scpwxyy
chenhc 7 months ago
parent 0b380675c8
commit b33018134d

@ -1361,22 +1361,44 @@ public class YxfyyyClient extends CommonHttpClient {
String startTime = udiwmsBasicSkPrescribeRequest.getStartTime();
String endTime = udiwmsBasicSkPrescribeRequest.getEndTime();
// wrapper.ge(StrUtil.isNotEmpty(startTime),VInsurNationGoodsPhysic::getSEL_RETN_TIME,startTime+" 00:00:00");
// wrapper.le(StrUtil.isNotEmpty(endTime),VInsurNationGoodsPhysic::getSEL_RETN_TIME,endTime+" 23:59:59");
wrapper.apply(StrUtil.isNotEmpty(startTime),"TO_DATE(SEL_RETN_TIME, 'YYYY-MM-DD HH24:MI:SS') >= TO_DATE({0}, 'YYYY-MM-DD HH24:MI:SS')",startTime+" 00:00:00");
wrapper.apply(StrUtil.isNotEmpty(endTime),"TO_DATE(SEL_RETN_TIME, 'YYYY-MM-DD HH24:MI:SS') <= TO_DATE({0}, 'YYYY-MM-DD HH24:MI:SS')",endTime+" 23:59:59");
wrapper.ge(StrUtil.isNotEmpty(startTime), VInsurNationGoodsPhysic::getSEL_RETN_TIME, startTime);
wrapper.le(StrUtil.isNotEmpty(endTime), VInsurNationGoodsPhysic::getSEL_RETN_TIME, endTime);
String code = udiwmsBasicSkPrescribeRequest.getCode();
String fromCorpName = udiwmsBasicSkPrescribeRequest.getFromCorpName();
String key = udiwmsBasicSkPrescribeRequest.getKey();
wrapper.and(StrUtil.isNotEmpty(code), t -> t.eq(VInsurNationGoodsPhysic::getSTOOUT_NO, code).or().eq(VInsurNationGoodsPhysic::getRXNO, code));
IPage<VInsurNationGoodsPhysic> page = goodsPhysicMapper
.selectPage(new Page<VInsurNationGoodsPhysic>(udiwmsBasicSkPrescribeRequest.getPage(), udiwmsBasicSkPrescribeRequest.getLimit()), wrapper);
wrapper.and(StrUtil.isNotEmpty(key), t -> t.like(VInsurNationGoodsPhysic::getSTOOUT_NO, key)
.or().like(VInsurNationGoodsPhysic::getRXNO, key)
.or().like(VInsurNationGoodsPhysic::getPSN_NAME, key)
.or().like(VInsurNationGoodsPhysic::getPSN_NO, key)
);
wrapper.and(StrUtil.isNotEmpty(fromCorpName), t -> t.eq(VInsurNationGoodsPhysic::getPSN_NAME, fromCorpName));
IPage<VInsurNationGoodsPhysic> page =goodsPhysicMapper.selectGroupedWithPagination(new Page<VInsurNationGoodsPhysic>(udiwmsBasicSkPrescribeRequest.getPage(), udiwmsBasicSkPrescribeRequest.getLimit()),
udiwmsBasicSkPrescribeRequest);
return this.covertSellOrder(udiwmsBasicSkPrescribeRequest, page);
} else {
LambdaQueryWrapper<VInsurNationGoodsReturn> wrapper = new LambdaQueryWrapper<>();
String startTime = udiwmsBasicSkPrescribeRequest.getStartTime();
String endTime = udiwmsBasicSkPrescribeRequest.getEndTime();
wrapper.ge(StrUtil.isNotEmpty(startTime), VInsurNationGoodsReturn::getSEL_RETN_TIME, startTime);
wrapper.le(StrUtil.isNotEmpty(endTime), VInsurNationGoodsReturn::getSEL_RETN_TIME, endTime);
String code = udiwmsBasicSkPrescribeRequest.getCode();
String fromCorpName = udiwmsBasicSkPrescribeRequest.getFromCorpName();
String key = udiwmsBasicSkPrescribeRequest.getKey();
wrapper.and(StrUtil.isNotEmpty(key), t -> t.like(VInsurNationGoodsReturn::getAPPLY_NO, key)
.or().like(VInsurNationGoodsReturn::getPSN_NAME, key)
.or().like(VInsurNationGoodsReturn::getPSN_NO, key)
);
wrapper.and(StrUtil.isNotEmpty(code), t -> t.eq(VInsurNationGoodsReturn::getAPPLY_NO, code));
IPage<VInsurNationGoodsReturn> page = vInsurNationGoodsReturnMapper
.selectPage(new Page<VInsurNationGoodsReturn>(udiwmsBasicSkPrescribeRequest.getPage(), udiwmsBasicSkPrescribeRequest.getLimit()), wrapper);
wrapper.and(StrUtil.isNotEmpty(fromCorpName), t -> t.eq(VInsurNationGoodsReturn::getPSN_NAME, fromCorpName));
IPage<VInsurNationGoodsReturn> page =vInsurNationGoodsReturnMapper.selectGroupedWithPagination(new Page<VInsurNationGoodsReturn>(udiwmsBasicSkPrescribeRequest.getPage(), udiwmsBasicSkPrescribeRequest.getLimit()),
udiwmsBasicSkPrescribeRequest);
return this.covertReturnOrder(udiwmsBasicSkPrescribeRequest, page);
}
@ -1392,7 +1414,7 @@ public class YxfyyyClient extends CommonHttpClient {
@Override
public BaseResponse getThrOrders(UdiwmsThrOrderRequest udiwmsThrOrderRequest) {
PageSimpleResponse<IoCollectOrder> pageSimpleResponse = new PageSimpleResponse<>();
if (udiwmsThrOrderRequest.getBusType().equals(BusTypeConstant.CGJH001.getBusType())) {
if (BusTypeConstant.CGJH001.getBusType().equals(udiwmsThrOrderRequest.getBusType())) {
LambdaQueryWrapper<VYpzsPlanInfo> wrapper = new LambdaQueryWrapper<>();
// String startTime = udiwmsThrOrderRequest.getStartTime();
@ -1401,11 +1423,24 @@ public class YxfyyyClient extends CommonHttpClient {
// wrapper.le(StrUtil.isNotEmpty(endTime),VYpzsPlanInfo::getKEEP_BOOK_TIME,endTime+" 23:59:59");
wrapper.eq(StrUtil.isNotBlank(udiwmsThrOrderRequest.getBillNo()), VYpzsPlanInfo::getCGDBH, udiwmsThrOrderRequest.getBillNo());
IPage<VYpzsPlanInfo> page = vYpzsPlanInfoMapper.selectPage(new Page<VYpzsPlanInfo>(udiwmsThrOrderRequest.getPage(), udiwmsThrOrderRequest.getLimit()), wrapper);
//关键字模糊处理
String keywords = udiwmsThrOrderRequest.getKeyWords();
wrapper.and(StrUtil.isNotEmpty(keywords), t -> t.like(VYpzsPlanInfo::getCGDBH, keywords)//单据号
);
wrapper.like(StrUtil.isNotEmpty(udiwmsThrOrderRequest.getFromCorpName()), VYpzsPlanInfo::getSCQYMC, udiwmsThrOrderRequest.getFromCorpName());
Page<VYpzsPlanInfo> page = vYpzsPlanInfoMapper.selectGroupedWithPagination(new Page<VYpzsPlanInfo>(udiwmsThrOrderRequest.getPage(), udiwmsThrOrderRequest.getLimit()), udiwmsThrOrderRequest);
List<VYpzsPlanInfo> planInfos = page.getRecords();
List<IoCollectOrder> ioCollectOrders = new ArrayList<>();
if (CollUtil.isNotEmpty(planInfos)) {
Map<String, List<VYpzsPlanInfo>> groupedByBz = planInfos.stream()
List<String> collect = planInfos.stream().map(VYpzsPlanInfo::getCGDBH).collect(Collectors.toList());
LambdaQueryWrapper<VYpzsPlanInfo> wrapper1 = new LambdaQueryWrapper<>();
wrapper1.in(VYpzsPlanInfo::getCGDBH, collect);
List<VYpzsPlanInfo> vYpzsPlanInfos = vYpzsPlanInfoMapper.selectList(wrapper1);
Map<String, List<VYpzsPlanInfo>> groupedByBz = vYpzsPlanInfos.stream()
.collect(Collectors.groupingBy(VYpzsPlanInfo::getCGDBH));
groupedByBz.forEach((key, value) -> {
VYpzsPlanInfo planInfo = value.get(0);
@ -1454,16 +1489,35 @@ public class YxfyyyClient extends CommonHttpClient {
String startTime = udiwmsThrOrderRequest.getStartTime();
String endTime = udiwmsThrOrderRequest.getEndTime();
wrapper.ge(StrUtil.isNotEmpty(startTime),VYpzsIoInfo::getKEEP_BOOK_TIME,startTime+" 00:00:00");
wrapper.le(StrUtil.isNotEmpty(endTime),VYpzsIoInfo::getKEEP_BOOK_TIME,endTime+" 23:59:59");
wrapper.ge(StrUtil.isNotEmpty(startTime), VYpzsIoInfo::getKEEP_BOOK_TIME, startTime);
wrapper.le(StrUtil.isNotEmpty(endTime), VYpzsIoInfo::getKEEP_BOOK_TIME, endTime);
wrapper.and(StrUtil.isNotEmpty(udiwmsThrOrderRequest.getCorpName()), t -> t.like(VYpzsIoInfo::getCONSIGNEE_NAME, udiwmsThrOrderRequest.getCorpName()).or().eq(VYpzsIoInfo::getCONSIGNOR_NAME, udiwmsThrOrderRequest.getCorpName()));
wrapper.eq(StrUtil.isNotBlank(udiwmsThrOrderRequest.getBillNo()), VYpzsIoInfo::getPHYSIC_CODE, udiwmsThrOrderRequest.getBillNo());
wrapper.eq(StrUtil.isNotBlank(udiwmsThrOrderRequest.getBusType()), VYpzsIoInfo::getIO_SORT, udiwmsThrOrderRequest.getBusType());
Page<VYpzsIoInfo> page = vYpzsIoInfoMapper.selectPage(new Page<VYpzsIoInfo>(udiwmsThrOrderRequest.getPage(), udiwmsThrOrderRequest.getLimit()), wrapper);
wrapper.like(StrUtil.isNotEmpty(udiwmsThrOrderRequest.getFromCorpName()), VYpzsIoInfo::getCONSIGNEE_NAME, udiwmsThrOrderRequest.getFromCorpName());
wrapper.like(StrUtil.isNotEmpty(udiwmsThrOrderRequest.getShipperName()), VYpzsIoInfo::getCONSIGNOR_NAME, udiwmsThrOrderRequest.getShipperName());
//关键字模糊处理
String keywords = udiwmsThrOrderRequest.getKeyWords();
wrapper.and(StrUtil.isNotEmpty(keywords), t -> t.like(VYpzsIoInfo::getPHYSIC_CODE, keywords)//单据号
.or().like(VYpzsIoInfo::getCONSIGNOR_NAME, keywords)//发货方
.or().like(VYpzsIoInfo::getCONSIGNEE_NAME, keywords)//收货方
.or().like(VYpzsIoInfo::getKEEP_BOOK_TIME, keywords)//收货方
.or().like(VYpzsIoInfo::getIO_SORT, keywords)//收货方
);
Page<VYpzsIoInfo> page = vYpzsIoInfoMapper.selectGroupedWithPagination(new Page<VYpzsIoInfo>(udiwmsThrOrderRequest.getPage(), udiwmsThrOrderRequest.getLimit()), udiwmsThrOrderRequest);
List<VYpzsIoInfo> ioInfos = page.getRecords();
List<IoCollectOrder> ioCollectOrders = new ArrayList<>();
if (CollUtil.isNotEmpty(ioInfos)) {
Map<String, List<VYpzsIoInfo>> groupedByPhysicCode = ioInfos.stream()
List<String> collect = ioInfos.stream().map(VYpzsIoInfo::getRECEIPT_NUMBER).collect(Collectors.toList());
LambdaQueryWrapper<VYpzsIoInfo> vYpzsIoInfoLambdaQueryWrapper = new LambdaQueryWrapper<>();
vYpzsIoInfoLambdaQueryWrapper.in(VYpzsIoInfo::getRECEIPT_NUMBER, collect);
List<VYpzsIoInfo> vYpzsIoInfos = vYpzsIoInfoMapper.selectList(vYpzsIoInfoLambdaQueryWrapper);
Map<String, List<VYpzsIoInfo>> groupedByPhysicCode = vYpzsIoInfos.stream()
.collect(Collectors.groupingBy(VYpzsIoInfo::getRECEIPT_NUMBER));
groupedByPhysicCode.forEach((key, value) -> {
VYpzsIoInfo info = value.get(0);
@ -1472,8 +1526,12 @@ public class YxfyyyClient extends CommonHttpClient {
ioCollectOrder.setBillNo(info.getPHYSIC_CODE());
ioCollectOrder.setFromType("HIS系统");
ioCollectOrder.setBillTime(DateUtil.parseDate(info.getKEEP_BOOK_TIME()));
ioCollectOrder.setFromCorp(info.getCONSIGNOR());
ioCollectOrder.setFromCorpName(info.getCONSIGNOR_NAME());
ioCollectOrder.setFromCorp(info.getCONSIGNEE());
ioCollectOrder.setFromCorpName(info.getCONSIGNEE_NAME());
ioCollectOrder.setShipper(info.getCONSIGNOR());
ioCollectOrder.setShipperName(info.getCONSIGNOR_NAME());
ioCollectOrder.setBusType(udiwmsThrOrderRequest.getBusType());
ioCollectOrder.setWorkPlaceCode(udiwmsThrOrderRequest.getWorkPlaceCode());
ioCollectOrder.setCreateTime(new Date());
@ -1483,7 +1541,7 @@ public class YxfyyyClient extends CommonHttpClient {
List<IoCollectOrderBiz> bizList = new ArrayList<>();
value.forEach(entity -> {
IoCollectOrderBiz collectOrderBiz = new IoCollectOrderBiz();
BasicUdirelEntity basicUdirelEntity = basicUdirelDao.selectOne(new LambdaQueryWrapper<BasicUdirelEntity>().eq(BasicUdirelEntity::getMainId, entity.getPHYSIC_CODE()));
BasicUdirelEntity basicUdirelEntity = basicUdirelDao.selectOne(new LambdaQueryWrapper<BasicUdirelEntity>().eq(BasicUdirelEntity::getMainId, entity.getPHYSIC_CODE()).last("limit 1"));
if (basicUdirelEntity != null) {
collectOrderBiz.setRelId(basicUdirelEntity.getId());
} else {

Loading…
Cancel
Save