Browse Source

增加在库订单 超时字段 和搜索

增加暂存单超时字段和搜素
fix-sign
pref_mail@163.com 4 months ago
parent
commit
2aab504a66
  1. 5
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockArticleVO.java
  2. 4
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/AdvanceDTO.java
  3. 5
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineAdvanceVO.java
  4. 13
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java
  5. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionStockArticleOweDTO.java
  6. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java
  7. 161
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml
  8. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java
  9. 175
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java
  10. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/wrapper/DistributionStockArticleWrapper.java
  11. 58
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.xml
  12. 1
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml
  13. 15
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java

5
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockArticleVO.java

@ -184,6 +184,11 @@ public class DistributionStockArticleVO extends DistributionStockArticleEntity {
private Integer unreceivedQuantity;
/**
* 是否超时
*/
private Integer isTimeOut;
public Map<String, Object> toMap() throws IllegalAccessException {

4
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/AdvanceDTO.java

@ -53,4 +53,8 @@ public class AdvanceDTO implements Serializable {
private Date startCreateTime;
private Date endCreateTime;
private Integer isTimeOut;
}

5
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineAdvanceVO.java

@ -16,4 +16,9 @@ public class TrunklineAdvanceVO extends TrunklineAdvanceEntity {
private Integer isIncoming;
/**
* 是否超时
*/
private Integer isTimeOut;
}

13
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java

@ -79,14 +79,6 @@ public class DistributionStockArticleController extends BladeController {
private final IDistributionStockArticleService distributionStockArticleService;
private IBasicdataWarehouseClient warehouseClient;
private final IDictBizClient dictBizClient;
private final IUserClient userClient;
// private final IBasicdataWarehouseClient warehouseClient;
private final IBasicdataClientClient basicdataClientClient;
private final IDistributionOrderCustomerLogService distributionOrderCustomerLogService;
@ -109,8 +101,9 @@ public class DistributionStockArticleController extends BladeController {
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入distributionStockArticle")
public R<IPage<DistributionStockArticleVO>> list(@ApiIgnore @RequestParam Map<String, Object> distributionStockArticle, Query query) {
IPage<DistributionStockArticleEntity> pages = distributionStockArticleService.pageListOwe(Condition.getPage(query), distributionStockArticle);
return R.data(DistributionStockArticleWrapper.build().pageVO(pages));
// IPage<DistributionStockArticleEntity> pages = distributionStockArticleService.pageListOwe(Condition.getPage(query), distributionStockArticle);
IPage<DistributionStockArticleVO> pages = distributionStockArticleService.pageListOweNew(Condition.getPage(query), distributionStockArticle);
return R.data(pages);
}
@ResponseBody

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionStockArticleOweDTO.java

@ -83,4 +83,9 @@ public class DistributionStockArticleOweDTO extends DistributionStockArticleEnti
@ApiModelProperty(value = "入库时间结束")
private Date warehouseEntryTimeEnd;
private List<Long> warehouseIdList;
/**
* 是否超时
*/
private Integer isTimeOut;
}

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java

@ -240,4 +240,6 @@ public interface DistributionStockArticleMapper extends BaseMapper<DistributionS
List<Long> findStockArticleIds(@Param("orderCodes") Set<String> orderCodes);
IPage<DistributionStockArticleEntity> selectClentAllDistributionOrder(IPage<DistributionStockArticleVO> page,@Param("par") DistributionStockArticleOweDTO stockArticleEntity);
IPage<DistributionStockArticleVO> pageListOweNew(IPage page,@Param("param")DistributionStockArticleOweDTO stockArticleEntity,@Param("warehouseIds")List<Long> warehouseIds);
}

161
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml

@ -2385,5 +2385,166 @@
ORDER BY
ldsa.warehouse_entry_time DESC
</select>
<select id="pageListOweNew" resultType="com.logpm.distribution.vo.DistributionStockArticleVO">
select ldsa.id, ldsa.tenant_id,
ldsa.create_user,
ldsa.create_time,
ldsa.update_user,
ldsa.update_time,
ldsa.incoming_num AS incomingNum,
ldsa.status, ldsa.is_deleted, ldsa.create_dept,
ldsa.reserve1, ldsa.reserve2, ldsa.reserve3, ldsa.reserve4, ldsa.reserve5,
ldsa.service_number, ldsa.order_code,
ldsa.mall_id, ldsa.mall_code, ldsa.mall_name, ldsa.store_name,
ldsa.store_code, ldsa.store_id, ldsa.description_goods, ldsa.warehouse_id,
ldsa.warehouse, ldsa.warehouse_entry_time, ldsa.store_time, ldsa.total_number, ldsa.hand_quantity,
ldsa.complete_set, ldsa.brand, ldsa.type_service, ldsa.customer_name, ldsa.customer_telephone,
ldsa.customer_address, ldsa.genre,
ldsa.stockup_status, ldsa.reservation_status, ldsa.order_status, ldsa.grounding_status,
ldsa.order_receive_status,
ldsa.freeze_status, ldsa.notification, ldsa.fee, ldsa.rate, ldsa.advance_id, ldsa.waybill_id,
group_concat( DISTINCT ldpl.waybill_number ) AS waybillNumber,
ldsa.consignee_unit, ldsa.collect_fee, ldsa.storage_fee, ldsa.consignee_person, ldsa.consignee_address,
ldsa.consignee_mobile, ldsa.warehouse_entry_time_end,
ldsa.sorting_quantity, ldsa.delivery_quantity, ldsa.transfer_quantity,
ldsa.signin_quantity, ldsa.resource, ldsa.is_opai,
ldsa.inventory_date, ldsa.inventory_person, ldsa.inventory_person_id,
ldsa.available_quantity, ldsa.is_have_data, ldsa.stock_article_code, GROUP_CONCAT( DISTINCT ldpl.dealer_name )
dealerName, ldsa.dealer_code,
ldsa.train_number, ldsa.factory_train, ldsa.sending, ldsa.send_warehouse_id, ldsa.send_warehouse_name,
ldsa.is_zero, ldsa.accept_warehouse_id, ldsa.accept_warehouse_name, ldsa.order_delivery_status,
ldsa.trays trays,
ldsa.allocation allocation,
if( NOW() > DATE_ADD(ldsa.warehouse_entry_time, INTERVAL 48 HOUR), 1,0) isTimeOut
from logpm_distribution_stock_article ldsa
LEFT JOIN logpm_distribution_parcel_list ldpl on ldsa.id = ldpl.stock_article_id
<where>
ldsa.is_deleted = 0 and ldsa.order_status in ('10','20','30','40','50','60','70')
and ldsa.hand_quantity > 0
<if test="param.orderCodeNumList != null">
and ldsa.order_code in
<foreach collection="param.orderCodeNumList" separator="," close=")" item="a" open="(">
#{a}
</foreach>
</if>
<if test="warehouseIds != null">
and ldsa.warehouse_id in
<foreach collection="warehouseIds" item="s" open="(" close=")" separator=",">
#{s}
</foreach>
</if>
<if test=" param.orderCodeNumLike != '' and param.orderCodeNumLike != null ">and ldsa.order_code like
concat('%',#{param.orderCodeNumLike},'%')
</if>
<if test=" param.brand != '' and param.brand != null ">and ldsa.brand like
concat(#{param.brand},'%')
</if>
<if test=" param.reservation != '' and param.reservation != null ">
and ldsa.reservation_status in (10,20) and ldpl.order_package_reservation_status = 10
</if>
<if test=" param.waybillNumList != null ">
and ldpl.waybill_number in
<foreach collection="param.waybillNumList" open="(" item="a" close=")" separator=",">
#{a}
</foreach>
</if>
<if test="param.consigneeUnit != null and param.consigneeUnit != '' ">
and ldsa.consignee_unit like concat('%',#{param.consigneeUnit},'%')
</if>
<if test=" param.waybillNumLike != '' and param.waybillNumLike != null ">and ldsa.waybill_number like
concat('%',#{param.waybillNumLike},'%')
</if>
<if test=" param.typeService != '' and param.typeService != null ">
and ldsa.type_service =#{param.typeService}
</if>
<if test=" param.idsList != null ">and ldsa.id in
<foreach collection="param.idsList" open="(" item="a" close=")" separator=",">
#{a}
</foreach>
</if>
<if test=" param.idsLike != '' and param.idsLike != null ">and ldsa.id = #{param.idsLike}</if>
<if test=" param.reservationStatus != '' and param.reservationStatus != null ">and ldsa.reservation_status
= #{param.reservationStatus}
</if>
<if test=" param.startDate != null ">and ldsa.warehouse_entry_time between #{param.startDate} and
#{param.entDate}
</if>
<if test=" param.warehouseEntryTime != null ">and DATE(ldsa.warehouse_entry_time) =
#{param.warehouseEntryTime}
</if>
<if test=" param.warehouseEntryTimeEnd != null ">and DATE(ldsa.warehouse_entry_time) =
#{param.warehouseEntryTimeEnd}
</if>
<if test=" param.inventoryDate != null ">and DATE(ldsa.inventory_date) = #{param.inventoryDate}</if>
<if test=" param.serviceNumber != null and param.serviceNumber != '' ">and ldsa.service_number like
concat('%',#{param.serviceNumber},'%')
</if>
<if test=" param.orderCode != null and param.orderCode != '' ">and ldsa.order_code like
concat('%',#{param.orderCode},'%')
</if>
<if test=" param.waybillNumber != null and param.waybillNumber != '' ">and ldpl.waybill_number like
concat('%',#{param.waybillNumber},'%')
</if>
<if test=" param.mallName != null and param.mallName != '' ">and ldsa.mall_name like
concat('%',#{param.mallName},'%')
</if>
<if test=" param.descriptionGoods != null and param.descriptionGoods != '' ">and ldsa.description_goods
like concat('%',#{param.descriptionGoods},'%')
</if>
<if test=" param.warehouse != null and param.warehouse != '' ">and ldsa.warehouse like
concat('%',#{param.warehouse},'%')
</if>
<if test=" param.consigneePerson != null and param.consigneePerson != '' ">and ldsa.consignee_person like
concat('%',#{param.consigneePerson},'%')
</if>
<if test=" param.availableQuantity != null ">
and ldsa.available_quantity like concat('%',#{param.availableQuantity},'%')
</if>
<if test=" param.groundingStatus != null and param.groundingStatus != '' ">
and ldsa.grounding_status = #{param.groundingStatus}
</if>
<if test=" param.genre != null and param.genre != '' ">and ldsa.genre=#{param.genre}</if>
<if test=" param.freezeStatus != null and param.freezeStatus != '' ">
and ldsa.freeze_status = #{param.freezeStatus}
</if>
<if test=" param.orderStatus != null and param.orderStatus != '' ">
and ldsa.order_status = #{param.orderStatus}
</if>
<if test=" param.reservationStatus != null and param.reservationStatus != '' ">and ldsa.reservation_status = #{param.reservationStatus}
</if>
<if test=" param.stockupStatus != null and param.stockupStatus != '' ">and ldsa.stockup_status = #{param.stockupStatus}
</if>
<if test=" param.notification != null and param.notification != '' "> and ldsa.notification = #{param.notification}
</if>
<if test=" param.orderReceiveStatus != null and param.orderReceiveStatus != '' ">
and ldsa.order_receive_status = #{param.orderReceiveStatus}
</if>
<if test=" param.completeSet != null ">and ldsa.complete_set =#{param.completeSet}
</if>
<if test=" param.customerName != null and param.customerName != '' ">and ldsa.customer_name like
concat('%',#{param.customerName},'%')
</if>
<if test="param.isZero != null and param.isZero != '' ">
and ldsa.is_zero = #{param.isZero}
</if>
<if test=" param.customerTelephone != null and param.customerTelephone != '' ">and
ldsa.customer_telephone like concat('%',#{param.customerTelephone},'%')
</if>
<if test=" param.customerAddress != null and param.customerAddress != '' ">and ldsa.customer_address like
concat('%',#{param.customerAddress},'%')
</if>
<if test=" param.trays != null and param.trays != '' ">
and ldsa.trays like concat('%',#{param.trays},'%')
</if>
<if test=" param.allocation != null and param.allocation != '' ">
and ldsa.allocation like concat('%',#{param.allocation},'%')
</if>
<if test=" param.isTimeOut != null ">
and (NOW() > DATE_ADD(ldsa.warehouse_entry_time, INTERVAL 48 HOUR))= ${param.isTimeOut}
</if>
</where>
group by ldsa.id order by ldsa.warehouse_entry_time desc
</select>
</mapper>

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java

@ -331,4 +331,5 @@ public interface IDistributionStockArticleService extends BaseService<Distributi
*/
R getOrderWarehouseDetail(String orderCode);
IPage<DistributionStockArticleVO> pageListOweNew(IPage<Object> page, Map<String, Object> distributionStockArticle);
}

175
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java

@ -116,34 +116,16 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
private final IDistributionStockListService distributionStockListService;
private final IDistributionStockListInfoService distributionStockListInfoService;
private final DistributionStockArticleMapper distributionStockArticleMapper;
private final DistributionDeliveryListMapper distributionDeliveryListMapper;
private final IWarehouseWaybillDetailClient iWarehouseWaybillDetailClient;
// private final IDistributionStockService distributionStockService;
private IBasicPrintTemplateClient basicPrintTemplateClient;
private final IDistributionAddvalueService distributionAddvalueService;
private final DistributionAddvalueMapper distributionAddvalueMapper;
private final IDistributionParcelListService distributionParcelListService;
private final DistributionParcelListMapper distributionParcelListMapper;
private final IDistributionParcelDetailsService distributionParcelDetailsService;
private final IBasicMaterialClient basicMaterialClient;
private IBasicdataWarehouseClient warehouseClient;
private final IDictBizClient dictBizClient;
private final IDistributionParcelNumberService parcelNumberService;
private final DistributionParcelNumberMapper distributionParcelNumberMapper;
private final DistributionParcelNumberServiceImpl distributionParcelNumberService;
private final IWarehouseTrayGoodsClient warehouseTrayGoodsClient;
private final IWarehouseUpdownGoodsClient warehouseUpdownGoodsClient;
private final IDistributionReservationPackageService distributionReservationPackageService;
private final IDistributionReservationStockarticleService distributionReservationStockarticleService;
private final IDistributionReservationZeroPackageService distributionReservationZeroPackageService;
@ -1014,11 +996,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
}
}
// if(Func.isNotEmpty(stockArticleEntity.getReservation())){
// stockArticleEntity.setReservationStatus("10");
// }
// }
List<Long> warehouseIdList = warehouseClient.getWarehouseIds();
@ -1027,6 +1005,86 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
return distributionStockArticleEntityIPage;
}
@Override
public IPage<DistributionStockArticleVO> pageListOweNew(IPage<Object> page, Map<String, Object> distributionStockArticle) {
DistributionStockArticleOweDTO stockArticleEntity = JSONObject.parseObject(JSONObject.toJSONString(distributionStockArticle), DistributionStockArticleOweDTO.class);
if (Func.isNotEmpty(distributionStockArticle.get("typeServer"))) {
stockArticleEntity.setTypeService((String) distributionStockArticle.get("typeServer"));
}
if (Func.isNotEmpty(stockArticleEntity.getOrderCodeNum())) {
String anumbering = stockArticleEntity.getOrderCodeNum().trim();
List<String> list = CommonUtil.stringNum(anumbering);
if (list.size() > 1) {
stockArticleEntity.setOrderCodeNumList(list);
} else {
stockArticleEntity.setOrderCodeNumLike(anumbering);
}
}
if (Func.isNotEmpty(stockArticleEntity.getWaybillNum())) {
String waybill = stockArticleEntity.getWaybillNum().trim();
List<String> list = CommonUtil.stringNum(waybill);
if (list.size() > 1) {
stockArticleEntity.setWaybillNumList(list);
} else {
stockArticleEntity.setWaybillNumLike(waybill);
}
}
if (ObjectUtil.isNotEmpty(stockArticleEntity.getIds())) {
String ids = stockArticleEntity.getIds().trim();
List<String> list = CommonUtil.stringNum(ids);
if (list.size() > 1) {
stockArticleEntity.setIdsList(list);
} else {
stockArticleEntity.setIdsLike(ids);
}
}
List<Long> warehouseIdList = warehouseClient.getWarehouseIds();
IPage<DistributionStockArticleVO> distributionStockArticleEntityIPage = baseMapper.pageListOweNew(page, stockArticleEntity, warehouseIdList);
List<DistributionStockArticleVO> records = distributionStockArticleEntityIPage.getRecords();
records.forEach(record -> {
if (ObjectUtils.isNotNull(record.getWarehouseEntryTime())) {
long time1 = record.getWarehouseEntryTime().getTime(); //入库
long time2 = System.currentTimeMillis(); // 现在
int days = (int) ((time2 - time1) / (1000 * 60 * 60 * 24));
if (days == 0) {
days = 1;
}
record.setStoreTime(days + "天");
}
if (ObjectUtils.isNotNull(record.getCompleteSet())) {
switch (record.getCompleteSet()) {
case 1:
record.setCompleteSetName("否");
break;
case 2:
record.setCompleteSetName("是");
break;
}
}
record.setTypeServerName(DictBizCache.getValue(DictBizConstant.DISTRIBUTION_TYPE, record.getTypeService()));
record.setOrderStatusName(DictBizCache.getValue(DictBizConstant.DELIVERY_ORDER_STATUS, record.getOrderStatus()));
record.setGroundingStatusName(DictBizCache.getValue(DictBizConstant.BASIC_GROUNDING, record.getGroundingStatus()));
record.setFreezeStatusName(DictBizCache.getValue(DictBizConstant.FREEZE_STATUS, record.getFreezeStatus()));
record.setReservationStatusName(DictBizCache.getValue(DictBizConstant.ORDER_RESERVATION_STATUS, record.getReservationStatus()));
record.setStockupStatusName(DictBizCache.getValue(DictBizConstant.ORDER_STOCKUP_STATUS, record.getStockupStatus()));
if (ObjectUtils.isNotNull(record.getCreateUser())) {
R<User> userR = userClient.userInfoById(record.getCreateUser());
if (userR.isSuccess() && userR.getData() != null) {
record.setCreateUserName(userR.getData().getName());
}
}
record.setOrderReceiveStatusName(DictBizCache.getValue(DictBizConstant.ORDER_RECEIVE_STATUS, record.getOrderReceiveStatus()));
});
return distributionStockArticleEntityIPage;
}
@Override
public R selectStockArticleInfoList(Map<String, Object> distributionStockArticle, Query query) {
// IPage<Object> page = Condition.getPage(query);
@ -1237,12 +1295,12 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
if (tenant.isSuccess() && !Objects.isNull(tenant.getData())) {
Tenant data = tenant.getData();
Integer tenantType = data.getTenantType();
switch (tenantType){
switch (tenantType) {
case 2:
stockArticleEntityList = baseMapper.selectClentAllDistributionOrder(page, stockArticleEntity);
break;
stockArticleEntityList = baseMapper.selectClentAllDistributionOrder(page, stockArticleEntity);
break;
default:
stockArticleEntityList = baseMapper.selectAllDistributionOrder(page, stockArticleEntity);
stockArticleEntityList = baseMapper.selectAllDistributionOrder(page, stockArticleEntity);
}
@ -1619,7 +1677,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
public void updateOrderInfo(String orderCode, Long warehouseId) {
DistributionStockArticleEntity stockArticleEntity = findStockArticleByOrderCodeAndWarehouseId(orderCode, warehouseId);
if(Objects.isNull(stockArticleEntity)){
if (Objects.isNull(stockArticleEntity)) {
return;
}
updateOrderInfoByDistributionStockArticleEntity(stockArticleEntity);
@ -2050,7 +2108,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
// 这里在和原始对象进行比较
t = check2ObjSome(t, stockArticleEntity);
log.info("维护订单信息,t:{}",t);
log.info("维护订单信息,t:{}", t);
if (!cn.hutool.core.util.ObjectUtil.isAllEmpty(t.getGenre(), t.getReservationStatus(),
t.getHandQuantity(), t.getDeliveryQuantity(), t.getOrderStatus(), t.getSigninQuantity())) {
baseMapper.updateDistributionStockArticleEntityById(t);
@ -2574,7 +2632,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
wayBillDetailList.forEach(wayBillDetail -> {
productsNumList.add(wayBillDetail.getProductName() + "(" + wayBillDetail.getNum() + ")");
});
map.put("product", String.join(",",productsNumList));
map.put("product", String.join(",", productsNumList));
data.add(map);
}
@ -2638,7 +2696,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
wayBillDetailList.forEach(wayBillDetail -> {
productsNumList.add(wayBillDetail.getProductName() + "(" + wayBillDetail.getNum() + ")");
});
map.put("product", String.join(",",productsNumList));
map.put("product", String.join(",", productsNumList));
map.put("remark", StringUtil.isBlank(remark) ? "" : remark);
}
@ -2680,17 +2738,17 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
@Override
public Integer findIncomingNumByWaybillNo(String waybillNo, Long destinationWarehouseId) {
return baseMapper.findIncomingNumByWaybillNo(waybillNo,destinationWarehouseId);
return baseMapper.findIncomingNumByWaybillNo(waybillNo, destinationWarehouseId);
}
@Override
public Integer findStockNumByWaybillNo(String waybillNo, Long departureWarehouseId) {
return baseMapper.findStockNumByWaybillNo(waybillNo,departureWarehouseId);
return baseMapper.findStockNumByWaybillNo(waybillNo, departureWarehouseId);
}
@Override
public Integer findSignNumByWaybillNo(String waybillNo, Long destinationWarehouseId) {
return baseMapper.findSignNumByWaybillNo(waybillNo,destinationWarehouseId);
return baseMapper.findSignNumByWaybillNo(waybillNo, destinationWarehouseId);
}
@Override
@ -2773,7 +2831,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
distributionStockArticleVO.setStoreTime(days + "天");
}
if(ObjectUtils.isNotNull(distributionStockArticleVO.getCompleteSet())){
if (ObjectUtils.isNotNull(distributionStockArticleVO.getCompleteSet())) {
switch (distributionStockArticleVO.getCompleteSet()) {
case 1:
distributionStockArticleVO.setCompleteSetName("否");
@ -2802,7 +2860,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
if (ObjectUtils.isNotNull(distributionStockupVO.getCreateUser())) {
R<User> userR = userClient.userInfoById(distributionStockupVO.getCreateUser());
if(userR.isSuccess() && userR.getData()!=null){
if (userR.isSuccess() && userR.getData() != null) {
distributionStockupVO.setCreateUserName(userR.getData().getName());
}
@ -2813,7 +2871,6 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
}
@Override
public R findZeroOrderInfo(Long orderId) {
DistributionStockArticleEntity stockArticle = baseMapper.selectById(orderId);
@ -2821,9 +2878,9 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
BeanUtil.copy(stockArticle, stockArticleVO);
String isZero = stockArticle.getIsZero();
if("0".equals(isZero)){
if ("0".equals(isZero)) {
log.warn("###########findZeroOrderInfo: 该订单不是零担订单 ");
return R.fail(405,"该订单不是零担订单");
return R.fail(405, "该订单不是零担订单");
}
Long waybillId = stockArticle.getWaybillId();
@ -2835,10 +2892,10 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
queryWrapper.eq("stock_article_id", orderId);
List<DistributionParcelListEntity> list = distributionParcelListService.list(queryWrapper);
Map<String,Object> map = new HashMap<>();
map.put("orderInfo",stockArticle);
map.put("waybillEntity",waybillEntity);
map.put("parcelList",list);
Map<String, Object> map = new HashMap<>();
map.put("orderInfo", stockArticle);
map.put("waybillEntity", waybillEntity);
map.put("parcelList", list);
return R.data(map);
}
@ -2847,47 +2904,47 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
public R getOrderWarehouseDetail(String orderCode) {
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
List<Long> warehouseIdList = new ArrayList<>();
if (Objects.isNull(myCurrentWarehouse)){
if (Objects.isNull(myCurrentWarehouse)) {
//查询当前人的仓库列表
// List<BasicdataWarehouseEntity> warehouseList = warehouseClient.getMyWarehouseList();
// if (!warehouseList.isEmpty()) {
// warehouseIdList.addAll(warehouseList.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList()));
// }
return R.fail("多仓库权限人员请选择仓库后查看");
}else {
} else {
warehouseIdList.add(myCurrentWarehouse.getId());
}
if (warehouseIdList.isEmpty()){
if (warehouseIdList.isEmpty()) {
return R.fail("当前登录人仓库信息错误");
}
Map<String,List<DistributionParcelListVO>> info = new HashMap<>();
Map<String, List<DistributionParcelListVO>> info = new HashMap<>();
//查询此暂存单数据在仓库的情况
List<TrunklineAdvanceDetailEntity> list = trunklineAdvanceDetailClient.selectByOrderCodeAndWarehouseId(orderCode);
if (!list.isEmpty()) {
List<String> orderPackageCodes = list.stream().map(TrunklineAdvanceDetailEntity::getOrderPackageCode).collect(Collectors.toList());
info = handlePackageGroupByWarehouse(list,warehouseIdList,orderPackageCodes,Objects.isNull(myCurrentWarehouse),orderCode);
info = handlePackageGroupByWarehouse(list, warehouseIdList, orderPackageCodes, Objects.isNull(myCurrentWarehouse), orderCode);
return R.data(info);
}
return R.data(info,"未查询到相关出入库信息");
return R.data(info, "未查询到相关出入库信息");
}
private Map<String, List<DistributionParcelListVO>> handlePackageGroupByWarehouse(List<TrunklineAdvanceDetailEntity> list, List<Long> warehouseIdList, List<String> orderPackageCodes, boolean aNull,String orderCode) {
Map<String,List<DistributionParcelListVO>> info = new HashMap<>();
private Map<String, List<DistributionParcelListVO>> handlePackageGroupByWarehouse(List<TrunklineAdvanceDetailEntity> list, List<Long> warehouseIdList, List<String> orderPackageCodes, boolean aNull, String orderCode) {
Map<String, List<DistributionParcelListVO>> info = new HashMap<>();
List<DistributionParcelListEntity> parcelListEntities = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda()
.eq(DistributionParcelListEntity::getOrderCode, orderCode)
.in(DistributionParcelListEntity::getOrderPackageCode, orderPackageCodes)
.eq(DistributionParcelListEntity::getOrderCode, orderCode)
.in(DistributionParcelListEntity::getOrderPackageCode, orderPackageCodes)
// .eq(DistributionParcelListEntity::getIsTransfer, 0)
.in(!aNull,DistributionParcelListEntity::getWarehouseId,warehouseIdList)
.in(!aNull, DistributionParcelListEntity::getWarehouseId, warehouseIdList)
);
if (!parcelListEntities.isEmpty()) {
List<DistributionParcelListVO> distributionParcelListVOS = DistributionParcelListWrapper.build().listVO(parcelListEntities);
info.put("warehouse",distributionParcelListVOS);
info.put("warehouse", distributionParcelListVOS);
List<String> collect = parcelListEntities.stream().map(DistributionParcelListEntity::getOrderPackageCode).collect(Collectors.toList());
Iterator<String> iterator = collect.iterator();
while (iterator.hasNext()){
while (iterator.hasNext()) {
String next = iterator.next();
orderPackageCodes.remove(next);
iterator.remove();
@ -2897,9 +2954,9 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
//存在未入库的包件
//进行数据组装
List<TrunklineAdvanceDetailEntity> collect = list.stream().filter(f -> orderPackageCodes.contains(f.getOrderPackageCode())).collect(Collectors.toList());
List<DistributionParcelListVO> unWarehousePackage= handleUnWarehousePackage(collect);
List<DistributionParcelListVO> unWarehousePackage = handleUnWarehousePackage(collect);
if (!unWarehousePackage.isEmpty()) {
info.put("unWarehouse",unWarehousePackage);
info.put("unWarehouse", unWarehousePackage);
}
}
@ -2914,7 +2971,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
if (!waybillNos.isEmpty()) {
List<WarehouseWaybillEntity> listByWaybillIds = warehouseWaybillClient.findListByWaybillIds(waybillNos);
if (!listByWaybillIds.isEmpty()) {
waybillMap = listByWaybillIds.stream().collect(Collectors.groupingBy(WarehouseWaybillEntity::getId));
waybillMap = listByWaybillIds.stream().collect(Collectors.groupingBy(WarehouseWaybillEntity::getId));
}
}
for (TrunklineAdvanceDetailEntity trunklineAdvanceDetailEntity : collect) {
@ -2931,7 +2988,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
distributionParcelListVO.setMaterialCode(trunklineAdvanceDetailEntity.getMaterialCode());
distributionParcelListVO.setQuantity(trunklineAdvanceDetailEntity.getQuantity());
distributionParcelListVO.setTrainNumber(trunklineAdvanceDetailEntity.getTrainNumber());
if (!Objects.isNull(waybillMap) && !Objects.isNull(trunklineAdvanceDetailEntity.getWaybillId())){
if (!Objects.isNull(waybillMap) && !Objects.isNull(trunklineAdvanceDetailEntity.getWaybillId())) {
WarehouseWaybillEntity warehouseWaybillEntities = waybillMap.get(trunklineAdvanceDetailEntity.getWaybillId()).get(0);
distributionParcelListVO.setSendWarehouseName(warehouseWaybillEntities.getDepartureWarehouseName());
distributionParcelListVO.setAcceptWarehouseName(warehouseWaybillEntities.getDestinationWarehouseName());

10
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/wrapper/DistributionStockArticleWrapper.java

@ -44,11 +44,11 @@ public class DistributionStockArticleWrapper extends BaseEntityWrapper<Distribut
// distributionStockupVO.setOrderPackageCode(orderPackageCode);
}
if ("80".equals(entity.getOrderStatus())) {
//查询配送完毕的所有司机
String driverName = distributionLoadscanService.selectDriverNameByOrderId(entity.getId());
distributionStockupVO.setDriverName(driverName);
}
// if ("80".equals(entity.getOrderStatus())) {
// //查询配送完毕的所有司机
// String driverName = distributionLoadscanService.selectDriverNameByOrderId(entity.getId());
// distributionStockupVO.setDriverName(driverName);
// }
//计算在库天数
if (ObjectUtils.isNotNull(entity.getWarehouseEntryTime())) {

58
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.xml

@ -11,21 +11,23 @@
</select>
<select id="advancePageList" resultType="com.logpm.trunkline.vo.TrunklineAdvanceVO">
<select id="advancePageList" resultType="com.logpm.trunkline.vo.TrunklineAdvanceVO">
select lta.*,
lbc.client_name htMallName
if( NOW() > DATE_ADD(lta.create_time, INTERVAL 24 HOUR), 1,0) isTimeOut,
lbc.client_name htMallName
from logpm_trunkline_advance lta
left join logpm_basicdata_tripartite_mall lbtm on lbtm.tripartite_mall = lta.dealer_name and lbtm.brand_name = lta.brand and IFNULL(lta.dealer_code,'') = IFNULL(lbtm.tripartite_coding,'') and lbtm.is_deleted = 0
left join logpm_basicdata_tripartite_mall lbtm on lbtm.tripartite_mall = lta.dealer_name
and lbtm.brand_name =lta.brand and IFNULL(lta.dealer_code,'') = IFNULL(lbtm.tripartite_coding,'') and lbtm.is_deleted = 0
left join logpm_basicdata_client lbc on lbc.id = lbtm.client_id
where lta.is_deleted = 0
and lta.waybill_status = 0
and lta.freeze_status = #{param.freezeStatus}
<if test="param.warehouseIds != null and param.warehouseIds.size() > 0">
and lta.warehouse_id in
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
and lta.waybill_status = 0
and lta.freeze_status = #{param.freezeStatus}
<if test="param.warehouseIds != null and param.warehouseIds.size() > 0">
and lta.warehouse_id in
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.hasPackage != null">
and lta.has_package = #{param.hasPackage}
</if>
@ -71,6 +73,9 @@
<if test="param.htMallName != null and param.htMallName != ''">
and Locate(#{param.htMallName},lbc.client_name) &gt; 0
</if>
<if test="param.isTimeOut != null ">
and (NOW() > DATE_ADD(lta.create_time, INTERVAL 24 HOUR))= #{param.isTimeOut}
</if>
order by lta.create_time desc
</select>
@ -86,10 +91,10 @@
<select id="selectInfoByIds" resultType="com.logpm.trunkline.vo.OpenOrderVO">
select GROUP_CONCAT(DISTINCT brand) brand,
GROUP_CONCAT(DISTINCT train_number) trainNumber,
GROUP_CONCAT(DISTINCT order_code) orderCode,
GROUP_CONCAT(DISTINCT dealer_code) dealerCode,
GROUP_CONCAT(DISTINCT dealer_name) dealerName
GROUP_CONCAT(DISTINCT train_number) trainNumber,
GROUP_CONCAT(DISTINCT order_code) orderCode,
GROUP_CONCAT(DISTINCT dealer_code) dealerCode,
GROUP_CONCAT(DISTINCT dealer_name) dealerName
from logpm_trunkline_advance
where is_deleted = 0
and id in
@ -101,9 +106,9 @@
<select id="findCustomerInfoList" resultType="com.logpm.trunkline.vo.CustomerInfoVO">
select id advanceId,
customer_name customerName,
customer_phone customerPhone,
customer_address customerAddress
customer_name customerName,
customer_phone customerPhone,
customer_address customerAddress
from logpm_trunkline_advance
where is_deleted = 0
and id in
@ -118,7 +123,7 @@
where id = #{id}
</update>
<delete id="deletedAdvance" >
<delete id="deletedAdvance">
delete from logpm_trunkline_advance
<where>
<if test="advanceIds != null and advanceIds.size() != 0">
@ -134,13 +139,13 @@
where waybill_no = #{waybillNo}
</delete>
<update id="subTotalNumByAdvanceId" >
<update id="subTotalNumByAdvanceId">
update logpm_trunkline_advance
set total_num = total_num - 1
where id = #{advanceId}
</update>
<update id="updateIncomingWarehouseName" >
<update id="updateIncomingWarehouseName">
update logpm_trunkline_advance
set incoming_warehouse_name = #{incomingWarehouseName}
where id = #{advanceId}
@ -154,11 +159,11 @@
logpm_trunkline_advance lta
left join logpm_trunkline_advance_detail ltad on ltad.advance_id = lta.id and ltad.package_status = '0'
WHERE 1=1
and lta.warehouse_id = #{param.warehouseId}
<if test="param.incomingType == 4" >
and lta.warehouse_id = #{param.warehouseId}
<if test="param.incomingType == 4">
and lta.train_number = #{param.incomingCode}
</if>
<if test="param.incomingType == 5" >
<if test="param.incomingType == 5">
and lta.order_code in
<foreach collection="param.orderCodes" item="item" open="(" separator="," close=")">
#{item}
@ -195,7 +200,8 @@
select lta.*
from logpm_trunkline_advance lta
LEFT JOIN logpm_trunkline_advance_detail ltad on ltad.advance_id = lta.id
left join logpm_basicdata_tripartite_mall lbtm on lbtm.tripartite_mall = lta.dealer_name and lbtm.brand_name = lta.brand and IFNULL(lta.dealer_code,'') = IFNULL(lbtm.tripartite_coding,'') and lbtm.is_deleted = 0
left join logpm_basicdata_tripartite_mall lbtm on lbtm.tripartite_mall = lta.dealer_name and lbtm.brand_name =
lta.brand and IFNULL(lta.dealer_code,'') = IFNULL(lbtm.tripartite_coding,'') and lbtm.is_deleted = 0
where lta.is_deleted = 0
and ltad.package_status=0
and lta.freeze_status = #{param.freezeStatus}
@ -257,7 +263,7 @@
<update id="clearWaybillInfoByWaybillNo">
update logpm_trunkline_advance
set waybill_no = null,
waybill_status = '0'
waybill_status = '0'
where waybill_no = #{waybillNo}
</update>

1
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml

@ -383,6 +383,7 @@
<if test="param.trayName != null and param.trayName != ''">
and t.tray_name like concat('%',#{param.trayName},'%')
</if>
order by t.entry_time_end asc
</select>

15
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java

@ -345,21 +345,6 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
advanceDTO.setStartCreateTime(CommonUtil.getStartByDateStr(advanceDTO.getStartCreateTimeStr()));
advanceDTO.setEndCreateTime(CommonUtil.getEndByDateStr(advanceDTO.getEndCreateTimeStr()));
IPage<TrunklineAdvanceVO> trunklineAdvanceVOIPage = baseMapper.advancePageList(page, advanceDTO);
// List<TrunklineAdvanceVO> records = trunklineAdvanceVOIPage.getRecords();
// for (TrunklineAdvanceVO trunklineAdvanceVO:records){
//
//
//
// String dealerName = trunklineAdvanceVO.getDealerName();
// String brand = trunklineAdvanceVO.getBrand();
// Long clientId = tripartiteMallClient.getClientIdByNameAndBrand(dealerName, brand);
// BasicdataClientEntity basicdataClientEntity = basicdataClientClient.findEntityById(clientId);
// if(!Objects.isNull(basicdataClientEntity)){
// trunklineAdvanceVO.setHtMallName(basicdataClientEntity.getClientName());
// }
// }
// trunklineAdvanceVOIPage.setRecords(records);
return trunklineAdvanceVOIPage;
}

Loading…
Cancel
Save