Browse Source

1.对接数据看板

2.增加首页公告
master
pref_mail@163.com 1 month ago
parent
commit
1925cd5b94
  1. 5
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionSignforVO.java
  2. 5
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/LoadCarsDTO.java
  3. 5
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/CarsLoadAllOrderVO.java
  4. 22
      blade-service/logpm-basic/src/main/java/com/logpm/basic/controller/BasicNoticeController.java
  5. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml
  6. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml
  7. 41
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  8. 4
      blade-service/logpm-report/src/main/java/com/logpm/report/controller/WarehouseIndexController.java
  9. 4
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/WarehouseIndexMapper.java
  10. 10
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/WarehouseIndexMapper.xml
  11. 2
      blade-service/logpm-report/src/main/java/com/logpm/report/service/IWarehouseIndexService.java
  12. 68
      blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/WarehouseIndexServiceImpl.java
  13. 24
      blade-service/logpm-report/src/main/java/com/logpm/report/vo/IndexTrunklineHandOrderDataVO.java
  14. 6
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml
  15. 10
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mq/waybil/StatusLogListener.java

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

@ -352,6 +352,11 @@ public class DistributionSignforVO extends DistributionSignforEntity {
@ApiModelProperty(value = "客户订单列表")
private List<DistributionStockArticleVO> orderInfo;
/**
* 是否超时
*/
private Integer isTimeOut;
}

5
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/LoadCarsDTO.java

@ -215,6 +215,11 @@ public class LoadCarsDTO implements Serializable {
private String createTime;
private String ids;
/**
* 是否超时
*/
private Integer isTimeOut;
/**
* 商场联系人
*/

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

@ -44,4 +44,9 @@ public class CarsLoadAllOrderVO implements Serializable {
private Date warehouseEntryTimeEnd;//入库时间
private Date warehouseEntryTimeStart;//入库时间
/**
* 是否超时
*/
private Integer isTimeOut;
}

22
blade-service/logpm-basic/src/main/java/com/logpm/basic/controller/BasicNoticeController.java

@ -37,6 +37,8 @@ import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
@ -80,21 +82,29 @@ public class BasicNoticeController extends BladeController {
return R.data(BasicNoticeWrapper.build().pageVO(pages));
}
/**
* 多表联合查询自定义分页
* 分页
*/
@GetMapping("/page")
@GetMapping("/homeList")
@ApiImplicitParams({
@ApiImplicitParam(name = "category", value = "公告类型", paramType = "query", dataType = "integer"),
@ApiImplicitParam(name = "title", value = "公告标题", paramType = "query", dataType = "string")
})
@ApiOperationSupport(order = 3)
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入notice")
public R<IPage<BasicNoticeVO>> page(@ApiIgnore BasicNoticeVO notice, Query query) {
IPage<BasicNoticeVO> pages = noticeService.selectNoticePage(Condition.getPage(query), notice);
return R.data(pages);
public R<List<BasicNoticeVO>> list() {
List<BasicNotice> list = noticeService.list();
List<BasicNoticeVO> data = new ArrayList<>();
for (BasicNotice notice : list) {
BasicNoticeVO vo = BasicNoticeWrapper.build().entityVO(notice);
data.add(vo);
}
return R.data(data);
}
/**
* 新增
*/

6
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml

@ -410,7 +410,8 @@
lddl.id AND lddt.is_deleted = 0)
ELSE
''
END driverPhone
END driverPhone,
if( NOW() > DATE_ADD(lds.create_time, INTERVAL 24 HOUR), 1,0) isTimeOut
FROM
logpm_distribution_signfor lds
JOIN logpm_distribution_delivery_list lddl ON lddl.id = lds.delivery_id AND lddl.is_deleted = 0 AND lddl.customers_number > 0
@ -503,6 +504,9 @@
<if test="param.signingTimeSection != null and param.signingTimeSection!=''">
and lds.signing_time between #{param.signingTimeSection[0]} and #{param.signingTimeSection[1]}
</if>
<if test="param.isTimeOut != null ">
and (NOW() > DATE_ADD(lds.create_time, INTERVAL 24 HOUR))= ${param.isTimeOut}
</if>
<if test="param.clientIds != null">
and ldr.mall_id in

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

@ -2095,7 +2095,8 @@
GROUP_CONCAT( DISTINCT ldpl.dealer_name ),
lww.create_time openTime,
IFNULL(sum(ldpl.weight),0) weight,
IFNULL(sum(ldpl.volume),0) volume
IFNULL(sum(ldpl.volume),0) volume,
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
left join logpm_warehouse_waybill lww on lww.waybill_no = ldpl.waybill_number
@ -2239,6 +2240,10 @@
<if test=" param.openTimeEnd != null ">
and lww.create_time &lt;= #{param.openTimeEnd}
</if>
<if test=" param.isTimeOut != null ">
and (NOW() > DATE_ADD(ldsa.warehouse_entry_time, INTERVAL 48 HOUR))= ${param.isTimeOut}
</if>
</where>
group by ldpl.order_code,ldpl.waybill_number
HAVING sum(ldpl.is_transfer) > 0

41
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

@ -293,17 +293,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionSignfor.setCreateTime_query(DateUtil.format(distributionSignfor.getCreateTime(), "yyyy:MM:dd HH:mm:ss"));
}
// 获取当前登录人仓库
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if (null == myCurrentWarehouse) {
List<BasicdataWarehouseEntity> myWatchWarehouse = basicdataWarehouseClient.getMyWatchWarehouse();
List<Long> collect = myWatchWarehouse.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList());
distributionSignfor.setWarehouseIdList(collect);
} else {
List<Long> collect = new ArrayList<>();
collect.add(myCurrentWarehouse.getId());
distributionSignfor.setWarehouseIdList(collect);
}
List<Long> collect = basicdataWarehouseClient.getWarehouseIds();
distributionSignfor.setWarehouseIdList(collect);
List<DistributionSignforVO> distributionSignforVOS;
@ -326,26 +317,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
private void processReservationIds(List<DistributionSignforVO> distributionSignforVOS, List<Long> reservationIds) {
// List<DistributionParcelListVO> distributionParcelListEntities = distributionReservationMapper.selectPackageListByReservationIds(reservationIds);
//// List<DisStockListDetailEntity> list = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda()
//// .in(DisStockListDetailEntity::getReservationId, reservationIds)
//// .ne(DisStockListDetailEntity::getStockPackageStatus, ReservationPackageStatusConstant.quxiao.getValue())
//// );
// List<DistributionReservationZeroPackageEntity> reservationZeroPackageEntities = distributionReservationZeroPackageService.list(Wrappers.<DistributionReservationZeroPackageEntity>query().lambda()
// .in(DistributionReservationZeroPackageEntity::getReservationId, reservationIds)
// .ne(DistributionReservationZeroPackageEntity::getZeroPackageStatus, ReservationPackageStatusConstant.quxiao.getValue())
// );
//
// List<DisStockListDetailEntity> inventoryList = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda()
// .in(DisStockListDetailEntity::getReservationId,reservationIds)
// .ne(DisStockListDetailEntity::getStockPackageStatus,ReservationPackageStatusConstant.quxiao.getValue())
// );
// Map<Long, List<DistributionParcelListVO>> packageMap = distributionParcelListEntities.stream().collect(Collectors.groupingBy(DistributionParcelListVO::getReservationId));
// Map<Long, List<DisStockListDetailEntity>> inventoryMap = list.stream().collect(Collectors.groupingBy(DisStockListDetailEntity::getReservationId));
// Map<Long, List<DistributionReservationZeroPackageEntity>> zeroPackageMap = reservationZeroPackageEntities.stream().collect(Collectors.groupingBy(DistributionReservationZeroPackageEntity::getReservationId));
distributionSignforVOS.forEach(d -> {
d.setDeliveryTypeName(getDeliveryTypeName(d.getDeliveryType()));
@ -363,14 +334,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
});
}
// private int getWeiqianshoujianshu(Map<Long, List<DistributionParcelListVO>> packageMap, Map<Long, List<DistributionReservationZeroPackageEntity>> zeroPackageMap, DistributionSignforVO d) {
//
// int fromParcelList = packageMap.getOrDefault(d.getReservationId(), Collections.emptyList()).stream().filter(f -> !f.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())).mapToInt(DistributionParcelListVO::getQuantity).sum();
// int fromZeroPackage = calculateWeiqianshouFromZeroPackage(zeroPackageMap, d);
//
// return fromParcelList + fromZeroPackage;
// }
private int calculateWeiqianshouFromZeroPackage(Map<Long, List<DistributionReservationZeroPackageEntity>> zeroPackageMap, DistributionSignforVO d) {
if (!zeroPackageMap.containsKey(d.getReservationId())) {
return 0;

4
blade-service/logpm-report/src/main/java/com/logpm/report/controller/WarehouseIndexController.java

@ -213,8 +213,8 @@ public class WarehouseIndexController {
indexDTO.setWarehouseIds(warehouseIds);
//查询订制品打托列表
IndexTrunklineHandOrderDataVO indexTrunklineHandOrderDataVO = warehouseIndexService.trunklineHandOrderData(indexDTO);
return R.data(indexTrunklineHandOrderDataVO);
List<IndexTrunklineHandOrderDataVO> indexTrunklineHandOrderDataVOs = warehouseIndexService.trunklineHandOrderData(indexDTO);
return R.data(indexTrunklineHandOrderDataVOs);
} catch (CustomerException e) {
log.warn(e.message);
return R.fail(e.code, e.message);

4
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/WarehouseIndexMapper.java

@ -40,9 +40,9 @@ public interface WarehouseIndexMapper {
Integer findUpshelfNum(@Param("param") IndexDTO indexDTO);
JSONObject findPackageTrunklineHandOrderData(@Param("param") IndexDTO indexDTO);
JSONObject findPackageTrunklineHandOrderData(@Param("warehouseId") Long warehouseId);
JSONObject findZeroTrunklineHandOrderData(@Param("param") IndexDTO indexDTO);
JSONObject findZeroTrunklineHandOrderData(@Param("warehouseId") Long warehouseId);
IndexTrunklineCarsDataVO trunklineCarsData(@Param("param") IndexDTO indexDTO);

10
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/WarehouseIndexMapper.xml

@ -147,10 +147,7 @@
where 1=1
and ldpl.order_package_code != null
and ldpl.order_package_status = '20'
and ldpl.warehouse_id in
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
and ldpl.warehouse_id =#{warehouseId}
</select>
<select id="findZeroTrunklineHandOrderData" resultType="com.alibaba.fastjson.JSONObject">
@ -164,10 +161,7 @@
where 1=1
and ldsa.hand_quantity > 0
and ldsa.is_zero = 1
and ldsa.warehouse_id in
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
and ldsa.warehouse_id =#{warehouseId}
</select>
<select id="trunklineCarsData" resultType="com.logpm.report.vo.IndexTrunklineCarsDataVO">

2
blade-service/logpm-report/src/main/java/com/logpm/report/service/IWarehouseIndexService.java

@ -17,7 +17,7 @@ public interface IWarehouseIndexService {
IndexAllocationDataVO allocationData(IndexDTO indexDTO);
IndexTrunklineHandOrderDataVO trunklineHandOrderData(IndexDTO indexDTO);
List<IndexTrunklineHandOrderDataVO> trunklineHandOrderData(IndexDTO indexDTO);
IndexTrunklineCarsDataVO trunklineCarsData(IndexDTO indexDTO);

68
blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/WarehouseIndexServiceImpl.java

@ -16,6 +16,7 @@ import com.logpm.report.vo.indexCount.IndexSignforDataVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.checkerframework.checker.units.qual.A;
import org.jetbrains.annotations.NotNull;
import org.springblade.common.cache.CacheNames;
import org.springblade.common.utils.CommonUtil;
import org.springblade.core.redis.cache.BladeRedis;
@ -463,40 +464,47 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService {
}
@Override
public IndexTrunklineHandOrderDataVO trunklineHandOrderData(IndexDTO indexDTO) {
public List<IndexTrunklineHandOrderDataVO> trunklineHandOrderData(IndexDTO indexDTO) {
BladeUser user = AuthUtil.getUser();
String key = CacheNames.tenantKey(user.getTenantId(), user.getUserId() + "", "trunklineHandOrderData:" + indexDTO.toString());
IndexTrunklineHandOrderDataVO indexTrunklineHandOrderDataVO = bladeRedis.get(key);
List<IndexTrunklineHandOrderDataVO> data = getIndexTrunklineHandOrderDataVOS(indexDTO);
return data;
if (Objects.isNull(indexTrunklineHandOrderDataVO)) {
List<Long> warehouseIds = indexDTO.getWarehouseIds();
indexTrunklineHandOrderDataVO = new IndexTrunklineHandOrderDataVO();
if (warehouseIds.isEmpty()) {
return indexTrunklineHandOrderDataVO;
}
@NotNull
private List<IndexTrunklineHandOrderDataVO> getIndexTrunklineHandOrderDataVOS(IndexDTO indexDTO) {
List<IndexTrunklineHandOrderDataVO> data = new ArrayList<>();
List<Long> warehouseIds = indexDTO.getWarehouseIds();
warehouseIds.forEach(warehouseId -> {
String key = CacheNames.tenantKey(AuthUtil.getTenantId(), "trunklineHandOrderData", "warehouseId:" + warehouseId);
IndexTrunklineHandOrderDataVO indexTrunklineHandOrderDataVO = bladeRedis.get(key);
if (Objects.isNull(indexTrunklineHandOrderDataVO)) {
indexTrunklineHandOrderDataVO = new IndexTrunklineHandOrderDataVO();
indexTrunklineHandOrderDataVO.setWarehouseId(warehouseId);
JSONObject packageJson = warehouseIndexMapper.findPackageTrunklineHandOrderData(warehouseId);
Integer packageWaybillNum = packageJson.getInteger("waybillNum");
Integer packageHandleNum = packageJson.getInteger("handleNum");
BigDecimal packageHandleWeight = packageJson.getBigDecimal("handleWeight");
BigDecimal packageHandleVolume = packageJson.getBigDecimal("handleVolume");
JSONObject zeroJson = warehouseIndexMapper.findZeroTrunklineHandOrderData(warehouseId);
Integer zeroWaybillNum = zeroJson.getInteger("waybillNum");
Integer zeroHandleNum = zeroJson.getInteger("handleNum");
BigDecimal zeroHandleWeight = zeroJson.getBigDecimal("handleWeight");
BigDecimal zeroHandleVolume = zeroJson.getBigDecimal("handleVolume");
indexTrunklineHandOrderDataVO.setWaybillNum(packageWaybillNum + zeroWaybillNum);
indexTrunklineHandOrderDataVO.setHandleNum(packageHandleNum + zeroHandleNum);
indexTrunklineHandOrderDataVO.setHandleWeight(packageHandleWeight.add(zeroHandleWeight));
indexTrunklineHandOrderDataVO.setHandleVolume(packageHandleVolume.add(zeroHandleVolume));
indexTrunklineHandOrderDataVO.setWarehouseName(getCacheWarehouseName(indexTrunklineHandOrderDataVO.getWarehouseId()));
data.add(indexTrunklineHandOrderDataVO);
}
//订制品
JSONObject packageJson = warehouseIndexMapper.findPackageTrunklineHandOrderData(indexDTO);
Integer packageWaybillNum = packageJson.getInteger("waybillNum");
Integer packageHandleNum = packageJson.getInteger("handleNum");
BigDecimal packageHandleWeight = packageJson.getBigDecimal("handleWeight");
BigDecimal packageHandleVolume = packageJson.getBigDecimal("handleVolume");
//零担
JSONObject zeroJson = warehouseIndexMapper.findZeroTrunklineHandOrderData(indexDTO);
Integer zeroWaybillNum = zeroJson.getInteger("waybillNum");
Integer zeroHandleNum = zeroJson.getInteger("handleNum");
BigDecimal zeroHandleWeight = zeroJson.getBigDecimal("handleWeight");
BigDecimal zeroHandleVolume = zeroJson.getBigDecimal("handleVolume");
indexTrunklineHandOrderDataVO.setWaybillNum(packageWaybillNum + zeroWaybillNum);
indexTrunklineHandOrderDataVO.setHandleNum(packageHandleNum + zeroHandleNum);
indexTrunklineHandOrderDataVO.setHandleWeight(packageHandleWeight.add(zeroHandleWeight));
indexTrunklineHandOrderDataVO.setHandleVolume(packageHandleVolume.add(zeroHandleVolume));
bladeRedis.setEx(key, indexTrunklineHandOrderDataVO, 3600L);
}
return indexTrunklineHandOrderDataVO;
});
return data;
}
@Override

24
blade-service/logpm-report/src/main/java/com/logpm/report/vo/IndexTrunklineHandOrderDataVO.java

@ -8,9 +8,33 @@ import java.math.BigDecimal;
@Data
public class IndexTrunklineHandOrderDataVO implements Serializable {
/**
* 运单总数
*/
private Integer waybillNum = 0;
/**
* 在库总件数
*/
private Integer handleNum = 0;
/**
* 在库总重量
*/
private BigDecimal handleWeight = BigDecimal.ZERO;
/**
* 在库总方数
*/
private BigDecimal handleVolume = BigDecimal.ZERO;
/**
* 仓库名称
*/
private String warehouseName;
/**
* 仓库ID
*/
private Long warehouseId;
}

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

@ -286,7 +286,8 @@
IF(ldsa.is_zero = 1,ldsa.hand_quantity,count(ldpl.id)) stock_num,
max(ldpl.warehouse_entry_time_end) entry_time_end,
min(ldpl.warehouse_entry_time_end) entry_time_start,
IF(ldsa.is_zero = 1,ldsa.trays,GROUP_CONCAT(DISTINCT ldpl.pallet)) tray_name
IF(ldsa.is_zero = 1,ldsa.trays,GROUP_CONCAT(DISTINCT ldpl.pallet)) tray_name,
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.order_code = ldpl.order_code
where ldpl.is_deleted = 0
@ -385,6 +386,9 @@
<if test="param.trayName != null and param.trayName != ''">
and t.tray_name like concat('%',#{param.trayName},'%')
</if>
<if test=" param.isTimeOut != null ">
and (NOW() > DATE_ADD(ldsa.warehouse_entry_time, INTERVAL 48 HOUR))= ${param.isTimeOut}
</if>
order by t.entry_time_end asc
</select>

10
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mq/waybil/StatusLogListener.java

@ -36,7 +36,8 @@ import java.util.stream.Collectors;
@AllArgsConstructor
public class StatusLogListener {
private final ITrunklineWaybillTrackClient trunklineWaybillTrackClient ;
// private final ITrunklineWaybillTrackClient trunklineWaybillTrackClient ;
private final ITrunklineWaybillTrackService trunklineWaybillTrackService;
@RabbitListener(bindings = @QueueBinding(
value = @Queue(name = FanoutConstants.DeliveryOfPickup.BillSignReview.QUEUE.waybillStatusLog, durable = "true"),
@ -93,7 +94,8 @@ public class StatusLogListener {
t.setType(3);
trunklineWaybillTrackClient.addSignWaybillLog(t);
// trunklineWaybillTrackClient.addSignWaybillLog(t);
trunklineWaybillTrackService.addSignWaybillLog(t);
}
@ -157,8 +159,8 @@ public class StatusLogListener {
t.setNum(waybillCountMap.get(waybillNumber));
t.setSignOrderCode(vo.getReservationCode());
t.setType(3);
trunklineWaybillTrackClient.addSignWaybillLog(t);
// trunklineWaybillTrackClient.addSignWaybillLog(t);
trunklineWaybillTrackService.addSignWaybillLog(t);
}
}

Loading…
Cancel
Save