Browse Source

Merge remote-tracking branch 'origin/dev' into dev

dev-warehouse
0.0 2 years ago
parent
commit
c2755a1265
  1. 12
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataClientClient.java
  2. 10
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataClientClient.java
  3. 3
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientUserMapper.java
  4. 20
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientUserMapper.xml
  5. 10
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataClientUserService.java
  6. 8
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientUserServiceImpl.java
  7. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockListController.java
  8. 20
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml
  9. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.java
  10. 121
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.xml
  11. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java
  12. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java
  13. 23
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java
  14. 86
      blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/UnloadCarComHandler.java

12
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataClientClient.java

@ -23,6 +23,8 @@ import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
/** /**
* 基础客户表 Feign接口类 * 基础客户表 Feign接口类
* *
@ -37,6 +39,7 @@ public interface IBasicdataClientClient {
String API_PREFIX = "/client"; String API_PREFIX = "/client";
String TOP = API_PREFIX + "/top2"; String TOP = API_PREFIX + "/top2";
String GETCUSTOMER = API_PREFIX + "/customer"; String GETCUSTOMER = API_PREFIX + "/customer";
String BASICDATACLIENTUSERENTITYLISTBYUSERID = API_PREFIX + "/BasicdataClientUserEntityListByUserId";
/** /**
* 获取基础客户表列表 * 获取基础客户表列表
@ -55,4 +58,13 @@ public interface IBasicdataClientClient {
@GetMapping(GETCUSTOMER) @GetMapping(GETCUSTOMER)
BasicdataClientEntity getCustomer(@RequestParam("customerName") String customerName,@RequestParam("customerCode") String customerCode); BasicdataClientEntity getCustomer(@RequestParam("customerName") String customerName,@RequestParam("customerCode") String customerCode);
/**
* 根据用户ID 获取用户绑定的客户
* @param userId
* @return
*/
@GetMapping(BASICDATACLIENTUSERENTITYLISTBYUSERID)
List<BasicdataClientEntity> getBasicdataClientUserEntityListByUserId(@RequestParam("userId") Long userId);
} }

10
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataClientClient.java

@ -20,6 +20,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.basicdata.service.IBasicdataClientUserService;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springblade.core.mp.support.BladePage; import org.springblade.core.mp.support.BladePage;
import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Condition;
@ -30,6 +31,8 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore; import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
/** /**
* 基础客户表 Feign实现类 * 基础客户表 Feign实现类
* *
@ -43,6 +46,8 @@ public class BasicdataClientClient implements IBasicdataClientClient {
private final IBasicdataClientService basicdataClientService; private final IBasicdataClientService basicdataClientService;
private final IBasicdataClientUserService basicdataClientUserService;
@Override @Override
@GetMapping(TOP) @GetMapping(TOP)
public BladePage<BasicdataClientEntity> top(Integer current, Integer size) { public BladePage<BasicdataClientEntity> top(Integer current, Integer size) {
@ -74,4 +79,9 @@ public class BasicdataClientClient implements IBasicdataClientClient {
); );
} }
@Override
public List<BasicdataClientEntity> getBasicdataClientUserEntityListByUserId(Long userId) {
return basicdataClientUserService.getBasicdataClientUserEntityListByUserId(userId);
}
} }

3
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientUserMapper.java

@ -20,6 +20,7 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.basicdata.entity.BasicdataCarrierEntity; import com.logpm.basicdata.entity.BasicdataCarrierEntity;
import com.logpm.basicdata.entity.BasicdataClientEntity;
import com.logpm.basicdata.entity.BasicdataClientUserEntity; import com.logpm.basicdata.entity.BasicdataClientUserEntity;
import com.logpm.basicdata.excel.BasicdataCarrierExcel; import com.logpm.basicdata.excel.BasicdataCarrierExcel;
import com.logpm.basicdata.vo.BasicdataCarrierVO; import com.logpm.basicdata.vo.BasicdataCarrierVO;
@ -36,4 +37,6 @@ import java.util.List;
public interface BasicdataClientUserMapper extends BaseMapper<BasicdataClientUserEntity> { public interface BasicdataClientUserMapper extends BaseMapper<BasicdataClientUserEntity> {
List<BasicdataClientEntity> getBasicdataClientUserEntityListByUserId(@Param("userId") Long userId);
} }

20
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientUserMapper.xml

@ -3,8 +3,28 @@
<mapper namespace="com.logpm.basicdata.mapper.BasicdataClientUserMapper"> <mapper namespace="com.logpm.basicdata.mapper.BasicdataClientUserMapper">
<resultMap id="basicdataClientEntity" type="com.logpm.basicdata.entity.BasicdataClientEntity">
<result column="create_dept" property="createDept"/>
<result column="id" property="id"/>
<result column="client_name" property="clientName"/>
<result column="type_service" property="typeService"/>
<result column="blade_region_province_id" property="bladeRegionProvinceId"/>
<result column="blade_region_city_id" property="bladeRegionCityId"/>
<result column="blade_region_area_id" property="bladeRegionAreaId"/>
<result column="lease_accessories" property="leaseAccessories"/>
<result column="contract_start_time" property="contractStartTime"/>
<result column="contract_ent_time" property="contractEntTime"/>
</resultMap>
<select id="getBasicdataClientUserEntityListByUserId" resultMap="basicdataClientEntity">
SELECT
lbc1.*
FROM
logpm_basicdata_clientuser lbc1
LEFT JOIN logpm_basicdata_client lbc ON lbc1.client_id = lbc.id
where lbc.`status`=1 and lbc1.user_id=#{userId}
</select>
</mapper> </mapper>

10
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataClientUserService.java

@ -1,7 +1,17 @@
package com.logpm.basicdata.service; package com.logpm.basicdata.service;
import com.logpm.basicdata.entity.BasicdataClientEntity;
import com.logpm.basicdata.entity.BasicdataClientUserEntity; import com.logpm.basicdata.entity.BasicdataClientUserEntity;
import org.springblade.core.mp.base.BaseService; import org.springblade.core.mp.base.BaseService;
import java.util.List;
public interface IBasicdataClientUserService extends BaseService<BasicdataClientUserEntity> { public interface IBasicdataClientUserService extends BaseService<BasicdataClientUserEntity> {
/**
* 根据当前登录人获取绑定客户ID集合
* @return
*/
List<BasicdataClientEntity> getBasicdataClientUserEntityListByUserId(Long userId);
} }

8
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientUserServiceImpl.java

@ -1,5 +1,6 @@
package com.logpm.basicdata.service.impl; package com.logpm.basicdata.service.impl;
import com.logpm.basicdata.entity.BasicdataClientEntity;
import com.logpm.basicdata.entity.BasicdataClientUserEntity; import com.logpm.basicdata.entity.BasicdataClientUserEntity;
import com.logpm.basicdata.mapper.BasicdataClientUserMapper; import com.logpm.basicdata.mapper.BasicdataClientUserMapper;
import com.logpm.basicdata.service.IBasicdataClientUserService; import com.logpm.basicdata.service.IBasicdataClientUserService;
@ -8,8 +9,15 @@ import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
@Slf4j @Slf4j
@Service @Service
@AllArgsConstructor @AllArgsConstructor
public class BasicdataClientUserServiceImpl extends BaseServiceImpl<BasicdataClientUserMapper, BasicdataClientUserEntity> implements IBasicdataClientUserService { public class BasicdataClientUserServiceImpl extends BaseServiceImpl<BasicdataClientUserMapper, BasicdataClientUserEntity> implements IBasicdataClientUserService {
@Override
public List<BasicdataClientEntity> getBasicdataClientUserEntityListByUserId(Long userId) {
return baseMapper.getBasicdataClientUserEntityListByUserId(userId);
}
} }

6
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockListController.java

@ -97,11 +97,11 @@ public class DistributionStockListController extends BladeController {
/** /**
* 库存品管理 商城客户查询列表 * 库存品管理 商城客户查询列表
*/ */
@GetMapping("/listclinet") @GetMapping("/listClient")
@ApiOperationSupport(order = 2) @ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入distributionStockList") @ApiOperation(value = "分页", notes = "传入distributionStockList")
public R<IPage<DistributionStockListVO>> listClinet(@ApiIgnore @RequestParam Map<String, Object> distributionStockList, Query query) { public R<IPage<DistributionStockListVO>> listClient(@ApiIgnore @RequestParam Map<String, Object> distributionStockList, Query query) {
IPage<DistributionStockListVO> pages = distributionStockListService.pageOwn(Condition.getPage(query), distributionStockList); IPage<DistributionStockListVO> pages = distributionStockListService.pageClient(Condition.getPage(query), distributionStockList);
return R.data(pages); return R.data(pages);
} }

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

@ -80,10 +80,28 @@
SELECT client_id from logpm_basicdata_clientuser where user_id =#{loginUserId} SELECT client_id from logpm_basicdata_clientuser where user_id =#{loginUserId}
) )
and and
ldsa.is_deleted = 0 and ldsa.type_service ='2' ldsa.is_deleted = 0 and ldsa.type_service ='2' and ldsa.genre = 1
<if test="distributionStockArticleVO.orderCode!=null and distributionStockArticleVO.orderCode !=''"> <if test="distributionStockArticleVO.orderCode!=null and distributionStockArticleVO.orderCode !=''">
and ldsa.order_code == #{distributionStockArticleVO.orderCode} and ldsa.order_code == #{distributionStockArticleVO.orderCode}
</if> </if>
<if test="distributionStockArticleVO.stockupStatus != null and distributionStockArticleVO.stockupStatus != ''">
and ldsa.stockup_status = #{distributionStockArticleVO.stockupStatus}
</if>
<if test="distributionStockArticleVO.reservationStatus != null and distributionStockArticleVO.reservationStatus != ''">
and ldsa.reservation_status = #{distributionStockArticleVO.reservationStatus}
</if>
<if test="distributionStockArticleVO.orderStatus != null and distributionStockArticleVO.orderStatus != ''">
and ldsa.order_status = #{distributionStockArticleVO.orderStatus}
</if>
<if test="distributionStockArticleVO.groundingStatus != null and distributionStockArticleVO.groundingStatus != ''">
and ldsa.grounding_status = #{distributionStockArticleVO.groundingStatus}
</if>
<if test="distributionStockArticleVO.freezeStatus != null and distributionStockArticleVO.freezeStatus != ''">
and ldsa.freeze_status = #{distributionStockArticleVO.freezeStatus}
</if>
<!-- 条件没有写完 --> <!-- 条件没有写完 -->
</select> </select>
<select id="getAllReservationStockArticleInfo" resultType="com.logpm.distribution.vo.DistributionStockArticleVO"> <select id="getAllReservationStockArticleInfo" resultType="com.logpm.distribution.vo.DistributionStockArticleVO">

3
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.java

@ -66,4 +66,7 @@ public interface DistributionStockListMapper extends BaseMapper<DistributionStoc
Integer submitQuantityByStockListId(@Param("num") int num, @Param("stockListId") Long stockListId); Integer submitQuantityByStockListId(@Param("num") int num, @Param("stockListId") Long stockListId);
IPage<DistributionStockListVO> pageClinet(IPage page,@Param("param") DistributionStockListEntity distributionStockListEntity,@Param("clientIds") List clientIds);
} }

121
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.xml

@ -23,7 +23,7 @@
<result column="description_goods" property="descriptionGoods"/> <result column="description_goods" property="descriptionGoods"/>
<result column="cargo_number" property="cargoNumber"/> <result column="cargo_number" property="cargoNumber"/>
<result column="warehouse" property="warehouseId"/> <result column="warehouse" property="warehouseId"/>
<!-- <result column="market" property="market"/>--> <!-- <result column="market" property="market"/>-->
<result column="cargo_unit" property="cargoUnit"/> <result column="cargo_unit" property="cargoUnit"/>
<result column="storage_location" property="storageLocation"/> <result column="storage_location" property="storageLocation"/>
<result column="mall_name" property="mallName"/> <result column="mall_name" property="mallName"/>
@ -31,20 +31,10 @@
<result column="outbound_quantity" property="outboundQuantity"/> <result column="outbound_quantity" property="outboundQuantity"/>
<result column="despatch" property="despatch"/> <result column="despatch" property="despatch"/>
<result column="pid" property="pid"/> <result column="pid" property="pid"/>
<!-- <result column="reservation_num" property="reservationNum"/>--> <!-- <result column="reservation_num" property="reservationNum"/>-->
</resultMap> </resultMap>
<sql id="stockList">
<select id="selectDistributionStockListPage" resultMap="distributionStockListResultMap">
select * from logpm_distribution_stock_list where is_deleted = 0
</select>
<select id="exportDistributionStockList" resultType="com.logpm.distribution.excel.DistributionStockListExcel">
SELECT * FROM logpm_distribution_stock_list ${ew.customSqlSegment}
</select>
<select id="pageOwn" resultType="com.logpm.distribution.vo.DistributionStockListVO">
select ldsi.service_number serviceNumber,ldsi.service_type serviceType,ldsi.description_goods descriptionGoods,ldsi.cargo_number cargoNumber,ldsi.despatch ,ldsi.incoming_batch incomingBatch, select ldsi.service_number serviceNumber,ldsi.service_type serviceType,ldsi.description_goods descriptionGoods,ldsi.cargo_number cargoNumber,ldsi.despatch ,ldsi.incoming_batch incomingBatch,
CASE WHEN ldsi.pid is null THEN CASE WHEN ldsi.pid is null THEN
(select sum(l.quantity_stock) (select sum(l.quantity_stock)
@ -77,19 +67,100 @@
END 'unpack', END 'unpack',
ldsi.market_id marketId,ldsi.store_id storeId,ldsi.material_id materialId,ldsi.id,ldsi.unpacking_quantity unpackingQuantity,ldsi.quantity_occupied quantityOccupied ldsi.market_id marketId,ldsi.store_id storeId,ldsi.material_id materialId,ldsi.id,ldsi.unpacking_quantity unpackingQuantity,ldsi.quantity_occupied quantityOccupied
from logpm_distribution_stock_list ldsi from logpm_distribution_stock_list ldsi
</sql>
<select id="selectDistributionStockListPage" resultMap="distributionStockListResultMap">
select * from logpm_distribution_stock_list where is_deleted = 0
</select>
<select id="exportDistributionStockList" resultType="com.logpm.distribution.excel.DistributionStockListExcel">
SELECT * FROM logpm_distribution_stock_list ${ew.customSqlSegment}
</select>
<select id="pageOwn" resultType="com.logpm.distribution.vo.DistributionStockListVO">
<include refid="stockList"></include>
<where> <where>
ldsi.is_deleted = 0 ldsi.is_deleted = 0
<if test=" param.serviceNumber != null and param.serviceNumber != ''"> and ldsi.service_number like concat('%',#{param.serviceNumber},'%') </if> <if test=" param.serviceNumber != null and param.serviceNumber != ''">and ldsi.service_number like
<if test=" param.serviceType != null and param.serviceType != ''"> and ldsi.service_type = #{param.serviceType}</if> concat('%',#{param.serviceNumber},'%')
<if test=" param.descriptionGoods != null and param.descriptionGoods != ''"> and ldsi.description_goods like concat('%', #{param.descriptionGoods},'%')</if> </if>
<if test=" param.cargoNumber != null and param.cargoNumber != ''"> and ldsi.cargo_number like concat('%',#{param.cargoNumber},'%')</if> <if test=" param.serviceType != null and param.serviceType != ''">and ldsi.service_type =
<if test=" param.despatch != null and param.despatch != ''"> and ldsi.despatch like concat('%', #{param.despatch},'%')</if> #{param.serviceType}
<if test=" param.incomingBatch != null and param.incomingBatch != ''"> and ldsi.incoming_batch like concat('%', #{param.incomingBatch},'%')</if> </if>
<if test=" param.brandName != null and param.brandName != ''"> and ldsi.brand_name like concat('%',#{param.brandName},'%')</if> <if test=" param.descriptionGoods != null and param.descriptionGoods != ''">and ldsi.description_goods like
<if test=" param.marketName != null and param.marketName != ''"> and ldsi.market_name like concat('%',#{param.marketName},'%')</if> concat('%', #{param.descriptionGoods},'%')
<if test=" param.storeName != null and param.storeName != ''"> and ldsi.store_name like concat('%',#{param.storeName},'%')</if> </if>
<if test=" param.warehouseName != null and param.warehouseName != ''"> and ldsi.warehouse_name like concat('%',#{param.warehouseName},'%')</if> <if test=" param.cargoNumber != null and param.cargoNumber != ''">and ldsi.cargo_number like
<if test=" param.unpack != null and param.unpack != ''"> and ldsi.unpack = #{param.unpack}</if> concat('%',#{param.cargoNumber},'%')
</if>
<if test=" param.despatch != null and param.despatch != ''">and ldsi.despatch like concat('%',
#{param.despatch},'%')
</if>
<if test=" param.incomingBatch != null and param.incomingBatch != ''">and ldsi.incoming_batch like
concat('%', #{param.incomingBatch},'%')
</if>
<if test=" param.brandName != null and param.brandName != ''">and ldsi.brand_name like
concat('%',#{param.brandName},'%')
</if>
<if test=" param.marketName != null and param.marketName != ''">and ldsi.market_name like
concat('%',#{param.marketName},'%')
</if>
<if test=" param.storeName != null and param.storeName != ''">and ldsi.store_name like
concat('%',#{param.storeName},'%')
</if>
<if test=" param.warehouseName != null and param.warehouseName != ''">and ldsi.warehouse_name like
concat('%',#{param.warehouseName},'%')
</if>
<if test=" param.unpack != null and param.unpack != ''">and ldsi.unpack = #{param.unpack}</if>
</where>
</select>
<select id="pageClinet" resultType="com.logpm.distribution.vo.DistributionStockListVO">
<include refid="stockList"></include>
<where>
ldsi.is_deleted = 0
<if test=" param.serviceNumber != null and param.serviceNumber != ''">and ldsi.service_number like
concat('%',#{param.serviceNumber},'%')
</if>
<if test=" param.serviceType != null and param.serviceType != ''">and ldsi.service_type =
#{param.serviceType}
</if>
<if test=" param.descriptionGoods != null and param.descriptionGoods != ''">and ldsi.description_goods like
concat('%', #{param.descriptionGoods},'%')
</if>
<if test=" param.cargoNumber != null and param.cargoNumber != ''">and ldsi.cargo_number like
concat('%',#{param.cargoNumber},'%')
</if>
<if test=" param.despatch != null and param.despatch != ''">and ldsi.despatch like concat('%',
#{param.despatch},'%')
</if>
<if test=" param.incomingBatch != null and param.incomingBatch != ''">and ldsi.incoming_batch like
concat('%', #{param.incomingBatch},'%')
</if>
<if test=" param.brandName != null and param.brandName != ''">and ldsi.brand_name like
concat('%',#{param.brandName},'%')
</if>
<if test=" param.marketName != null and param.marketName != ''">and ldsi.market_name like
concat('%',#{param.marketName},'%')
</if>
<if test=" param.storeName != null and param.storeName != ''">and ldsi.store_name like
concat('%',#{param.storeName},'%')
</if>
<if test=" param.warehouseName != null and param.warehouseName != ''">and ldsi.warehouse_name like
concat('%',#{param.warehouseName},'%')
</if>
<if test=" param.unpack != null and param.unpack != ''">and ldsi.unpack = #{param.unpack}</if>
<if test="clientIds!=null">
and ldsi.market_id in
<foreach collection="clientIds" item="clientId" open="(" separator="," close=")">
#{clientId}
</foreach>
</if>
</where> </where>
@ -159,7 +230,7 @@
group by ldsl.tray_name group by ldsl.tray_name
</select> </select>
<update id="submitQuantityByStockListId" > <update id="submitQuantityByStockListId">
update logpm_distribution_stock_list update logpm_distribution_stock_list
set quantity_stock = quantity_stock - #{num}, set quantity_stock = quantity_stock - #{num},
quantity_occupied = quantity_occupied - #{num}, quantity_occupied = quantity_occupied - #{num},

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

@ -94,4 +94,6 @@ public interface IDistributionStockListService extends BaseService<DistributionS
List<StockListInfoListVO> selectStockListInfoList(Long reservationId, Long stockListId); List<StockListInfoListVO> selectStockListInfoList(Long reservationId, Long stockListId);
Integer submitQuantityByStockListId(int num, Long stockListId); Integer submitQuantityByStockListId(int num, Long stockListId);
IPage<DistributionStockListVO> pageClient(IPage<Object> page, Map<String, Object> distributionStockList);
} }

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

@ -323,7 +323,9 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
distributionStockListEntity.setStoreCode(Optional.ofNullable(distributionStockArticleEntity.getStoreCode()).orElse(null));//门店编码 distributionStockListEntity.setStoreCode(Optional.ofNullable(distributionStockArticleEntity.getStoreCode()).orElse(null));//门店编码
distributionStockListEntity.setStoreName(Optional.ofNullable(distributionStockArticleEntity.getStoreName()).orElse(null));//门店名称 distributionStockListEntity.setStoreName(Optional.ofNullable(distributionStockArticleEntity.getStoreName()).orElse(null));//门店名称
distributionStockListEntity.setFactory(Optional.ofNullable(distributionStockArticleEntity.getFactoryTrain()).orElse(null));//工厂车次 distributionStockListEntity.setFactory(Optional.ofNullable(distributionStockArticleEntity.getFactoryTrain()).orElse(null));//工厂车次
distributionStockListEntity.setCategory(Optional.ofNullable(distributionParcelList.getBrandId()).orElse(null).toString());//品分类 // distributionStockListEntity.setCategory(Optional.ofNullable(distributionParcelList.getBrandId()+"").orElse(null));//品分类
// 品牌
distributionStockListEntity.setBrandId(Optional.ofNullable(distributionParcelList.getBrandId()).orElse(null));
distributionStockListEntity.setUnpackingQuantity(0); distributionStockListEntity.setUnpackingQuantity(0);
distributionStockListEntity.setTrayName(Optional.ofNullable(distributionParcelList.getPallet()).orElse(null)); distributionStockListEntity.setTrayName(Optional.ofNullable(distributionParcelList.getPallet()).orElse(null));
BasicMaterialEntity materialOwnId = basicMaterialClient.getMaterialOwnId(distributionParcelList.getMaterialId()); BasicMaterialEntity materialOwnId = basicMaterialClient.getMaterialOwnId(distributionParcelList.getMaterialId());

23
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java

@ -20,6 +20,8 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.basicdata.entity.BasicdataClientEntity;
import com.logpm.basicdata.feign.IBasicdataClientClient;
import com.logpm.distribution.dto.DistributionStockListDTO; import com.logpm.distribution.dto.DistributionStockListDTO;
import com.logpm.distribution.entity.DistributionStockListEntity; import com.logpm.distribution.entity.DistributionStockListEntity;
import com.logpm.distribution.entity.DistributionUnpackingDetailsEntity; import com.logpm.distribution.entity.DistributionUnpackingDetailsEntity;
@ -32,7 +34,9 @@ import com.logpm.distribution.vo.DistributionStockListVO;
import com.logpm.distribution.vo.DistributionStockupStockListInfoVO; import com.logpm.distribution.vo.DistributionStockupStockListInfoVO;
import com.logpm.distribution.vo.StockListInfoListVO; import com.logpm.distribution.vo.StockListInfoListVO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil; import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.Func;
@ -43,6 +47,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.*; import java.util.*;
import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
/** /**
@ -57,6 +62,9 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
private final IDistributionUnpackingDetailsService distributionUnpackingDetailsService; private final IDistributionUnpackingDetailsService distributionUnpackingDetailsService;
private final IBasicdataClientClient basicdataClientClient;
@Override @Override
public IPage<DistributionStockListVO> selectDistributionStockListPage(IPage<DistributionStockListVO> page, DistributionStockListVO distributionStockList) { public IPage<DistributionStockListVO> selectDistributionStockListPage(IPage<DistributionStockListVO> page, DistributionStockListVO distributionStockList) {
@ -226,10 +234,23 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
public IPage<DistributionStockListVO> pageOwn(IPage<Object> page, Map<String, Object> distributionStockList) { public IPage<DistributionStockListVO> pageOwn(IPage<Object> page, Map<String, Object> distributionStockList) {
DistributionStockListEntity distributionStockListEntity = JSONObject.parseObject(JSONObject.toJSONString(distributionStockList), DistributionStockListEntity.class); DistributionStockListEntity distributionStockListEntity = JSONObject.parseObject(JSONObject.toJSONString(distributionStockList), DistributionStockListEntity.class);
IPage<DistributionStockListVO> page1= baseMapper.pageOwn(page,distributionStockListEntity); IPage<DistributionStockListVO> page1= baseMapper.pageOwn(page,distributionStockListEntity);
return page1; return page1;
} }
@Override
public IPage<DistributionStockListVO> pageClient(IPage<Object> page, Map<String, Object> distributionStockList) {
DistributionStockListEntity distributionStockListEntity = JSONObject.parseObject(JSONObject.toJSONString(distributionStockList), DistributionStockListEntity.class);
// 得到当前登录用户的Id
List<BasicdataClientEntity> basicdataClientUserEntityListByUserIds = basicdataClientClient.getBasicdataClientUserEntityListByUserId(AuthUtil.getUserId());
List clientIds =null;
if(Func.isNotEmpty(basicdataClientUserEntityListByUserIds)){
clientIds = basicdataClientUserEntityListByUserIds.stream().map(e -> e.getId()).collect(Collectors.toList());
}
IPage<DistributionStockListVO> page1= baseMapper.pageClinet(page,distributionStockListEntity,clientIds);
return page1;
}
@Override @Override
public DistributionStockupStockListInfoVO selectStockListInfo(Long reservationId, Long stockListId) { public DistributionStockupStockListInfoVO selectStockListInfo(Long reservationId, Long stockListId) {
return baseMapper.selectStockListInfo(reservationId,stockListId); return baseMapper.selectStockListInfo(reservationId,stockListId);

86
blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/UnloadCarComHandler.java

@ -1,6 +1,8 @@
package com.logpm.factory.receiver; package com.logpm.factory.receiver;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.logpm.factory.comfac.dto.UnloadCarDTO; import com.logpm.factory.comfac.dto.UnloadCarDTO;
import com.logpm.factory.mt.entity.MtFactoryOrderMain; import com.logpm.factory.mt.entity.MtFactoryOrderMain;
@ -18,6 +20,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.RabbitConstant; import org.springblade.common.constant.RabbitConstant;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.api.ResultCode; import org.springblade.core.tool.api.ResultCode;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.amqp.core.Message; import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitHandler; import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener; import org.springframework.amqp.rabbit.annotation.RabbitListener;
@ -75,7 +78,6 @@ public class UnloadCarComHandler {
List<AdvanceDetailEntity> carNumList = advanceDetailClient.getByCarNum(unloadCarDTO.getUnloadCarNum()); List<AdvanceDetailEntity> carNumList = advanceDetailClient.getByCarNum(unloadCarDTO.getUnloadCarNum());
log.info("##################unloadCarComDataHandler carNumList:{}", carNumList); log.info("##################unloadCarComDataHandler carNumList:{}", carNumList);
/** /**
* 安装品类进行分组 * 安装品类进行分组
*/ */
@ -99,7 +101,6 @@ public class UnloadCarComHandler {
// 对这个集合内进行分组 // 对这个集合内进行分组
Map<String, List<MTOrderPackageRelationVO>> stringListMap = allMtData.stream().collect(Collectors.groupingBy(MTOrderPackageRelationVO::getInvoiceOrderCode)); Map<String, List<MTOrderPackageRelationVO>> stringListMap = allMtData.stream().collect(Collectors.groupingBy(MTOrderPackageRelationVO::getInvoiceOrderCode));
Set<String> set = stringListMap.keySet(); Set<String> set = stringListMap.keySet();
boolean isPush = false;
String carNum = null; String carNum = null;
for (String s : set) { for (String s : set) {
// 得到某个工厂运输批次的集合 // 得到某个工厂运输批次的集合
@ -109,61 +110,66 @@ public class UnloadCarComHandler {
// 当前批次的包间 在 这个配载计划中存在一个 则进行通知 // 当前批次的包间 在 这个配载计划中存在一个 则进行通知
for (String mtStr : mtStrs) { for (String mtStr : mtStrs) {
if (strs.contains(mtStr)) { if (strs.contains(mtStr)) {
isPush = true;
carNum = s; carNum = s;
break; break;
} }
} }
if (isPush) {
break;
}
}
if (isPush) {
try { try {
R r = mtFactoryDataService.sendUnloadCarNum(carNum, unloadCarDTO.getCompleteDate()); if (StringUtil.isNoneBlank(carNum)) {
log.info("##################{} 梦天确认签收数据推送1", carNum); sendDataCarNum(carNum, unloadCarDTO.getCompleteDate());
if (r.getCode() == ResultCode.SUCCESS.getCode()) {
log.info("##################{} 梦天确认签收数据推送2", carNum);
MtPushData mtPushData = new MtPushData();
mtPushData.setPushTime(new Date());
mtPushData.setPushStatus(1);// 推送状态
mtPushData.setRefCode(carNum);
mtPushData.setRefType(1);// 订单主表
// todo 这里需要查询主推送单的 ID
List<MtFactoryOrderMain> mtFactoryOrderMainList = mtFactoryOrderMainService.findMtFactoryOrderMainByInvoiceOrderCode(carNum);
if(mtFactoryOrderMainList.size()>0){
mtFactoryOrderMainList.get(0);
mtPushData.setRefId(mtFactoryOrderMainList.get(0).getId());
}
// 插入推送数据
mtPushDataService.save(mtPushData);
} }
} catch (ParseException e) { } catch (ParseException e) {
e.printStackTrace(); e.printStackTrace();
} catch (JsonProcessingException e) {
e.printStackTrace();
} catch (NoSuchAlgorithmException e) { } catch (NoSuchAlgorithmException e) {
e.printStackTrace(); e.printStackTrace();
} catch (JsonProcessingException e) {
e.printStackTrace();
} }
} else {
log.info("##################{} 车次 没有匹配需要推送的数据", unloadCarDTO.getUnloadCarNum());
} }
} }
/**
* 根基匹配到的发货单编号 推送梦天
*
* @param carNum
* @param completeDate
* @throws ParseException
* @throws NoSuchAlgorithmException
* @throws JsonProcessingException
*/
private void sendDataCarNum(String carNum, String completeDate) throws ParseException, NoSuchAlgorithmException, JsonProcessingException {
// 需要判断这个发货单编号是否推送过
LambdaQueryChainWrapper<MtPushData> lambdaQueryChainWrapper = new LambdaQueryChainWrapper<MtPushData>(MtPushData.class);
lambdaQueryChainWrapper.eq(MtPushData::getRefCode, carNum);
MtPushData ms = mtPushDataService.getOne(lambdaQueryChainWrapper);
if (ObjectUtils.isNotNull(ms)) {
log.info("##################{} 车次已经推送过", carNum);
return;
}
R r = mtFactoryDataService.sendUnloadCarNum(carNum, completeDate);
log.info("##################{} 梦天确认签收数据推送1", carNum);
if (r.getCode() == ResultCode.SUCCESS.getCode()) {
log.info("##################{} 梦天确认签收数据推送2", carNum);
MtPushData mtPushData = new MtPushData();
mtPushData.setPushTime(new Date());
mtPushData.setPushStatus(1);// 推送状态
mtPushData.setRefCode(carNum);
mtPushData.setRefType(1);// 订单主表
// todo 这里需要查询主推送单的 ID
List<MtFactoryOrderMain> mtFactoryOrderMainList = mtFactoryOrderMainService.findMtFactoryOrderMainByInvoiceOrderCode(carNum);
if (mtFactoryOrderMainList.size() > 0) {
mtFactoryOrderMainList.get(0);
mtPushData.setRefId(mtFactoryOrderMainList.get(0).getId());
}
// 插入推送数据
mtPushDataService.save(mtPushData);
}
}
} }

Loading…
Cancel
Save