Browse Source

1.干线-车辆配载辅助功能添加

pull/1/head
zhenghaoyu 1 year ago
parent
commit
9510a212f9
  1. 1
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/LoadCarsDTO.java
  2. 44
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineCarsLoadContractEntity.java
  3. 51
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineCarsLoadFinanceEntity.java
  4. 141
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/CarsLoadController.java
  5. 29
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/TripartiteTransferController.java
  6. 9
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadContractMapper.java
  7. 6
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadContractMapper.xml
  8. 9
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadFinanceMapper.java
  9. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.java
  10. 12
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml
  11. 7
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadContractService.java
  12. 7
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadFinanceService.java
  13. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadScanService.java
  14. 13
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadService.java
  15. 16
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadContractServiceImpl.java
  16. 15
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadFinanceServiceImpl.java
  17. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadLogServiceImpl.java
  18. 5
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadScanServiceImpl.java
  19. 266
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

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

@ -111,4 +111,5 @@ public class LoadCarsDTO implements Serializable {
private String customerTrain;
private String remark;
private String url;
}

44
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineCarsLoadContractEntity.java

@ -0,0 +1,44 @@
package com.logpm.trunkline.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
@Data
@TableName("logpm_trunkline_cars_load_contract")
@ApiModel(value = "TrunklineCarsLoadContract对象", description = "车辆配载合同表")
@EqualsAndHashCode(callSuper = true)
public class TrunklineCarsLoadContractEntity extends TenantEntity {
/** 预留1 */
@ApiModelProperty(name = "预留1",notes = "")
private String reserve1 ;
/** 预留2 */
@ApiModelProperty(name = "预留2",notes = "")
private String reserve2 ;
/** 预留3 */
@ApiModelProperty(name = "预留3",notes = "")
private String reserve3 ;
/** 预留4 */
@ApiModelProperty(name = "预留4",notes = "")
private String reserve4 ;
/** 预留5 */
@ApiModelProperty(name = "预留5",notes = "")
private String reserve5 ;
/** 创建人名称 */
@ApiModelProperty(name = "创建人名称",notes = "")
private String createUserName ;
/** 文件地址 */
@ApiModelProperty(name = "文件地址",notes = "")
private String url ;
/** 配载id */
@ApiModelProperty(name = "配载id",notes = "")
private Long loadId ;
}

51
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineCarsLoadFinanceEntity.java

@ -0,0 +1,51 @@
package com.logpm.trunkline.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
@Data
@TableName("logpm_trunkline_cars_load_finance")
@ApiModel(value = "TrunklineCarsLoadFinance对象", description = "车辆配载财务表")
@EqualsAndHashCode(callSuper = true)
public class TrunklineCarsLoadFinanceEntity extends TenantEntity {
/** 预留1 */
@ApiModelProperty(name = "预留1",notes = "")
private String reserve1 ;
/** 预留2 */
@ApiModelProperty(name = "预留2",notes = "")
private String reserve2 ;
/** 预留3 */
@ApiModelProperty(name = "预留3",notes = "")
private String reserve3 ;
/** 预留4 */
@ApiModelProperty(name = "预留4",notes = "")
private String reserve4 ;
/** 预留5 */
@ApiModelProperty(name = "预留5",notes = "")
private String reserve5 ;
/** 配载id */
@ApiModelProperty(name = "配载id",notes = "")
private Long loadId ;
/** 创建人名称 */
@ApiModelProperty(name = "创建人名称",notes = "")
private String createUserName ;
/** 节点id */
@ApiModelProperty(name = "节点id",notes = "")
private Long warehouseId ;
/** 节点名称 */
@ApiModelProperty(name = "节点名称",notes = "")
private String warehouseName ;
/** 修改内容 */
@ApiModelProperty(name = "修改内容",notes = "")
private String content ;
}

141
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/CarsLoadController.java

@ -1140,7 +1140,7 @@ public class CarsLoadController {
}
return carsLoadService.updateLoadFeeByNodeId(carsLoadDTO,myCurrentWarehouse.getId());
return carsLoadService.updateLoadFeeByNodeId(carsLoadDTO,myCurrentWarehouse.getId(),myCurrentWarehouse.getName());
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
@ -1943,7 +1943,7 @@ public class CarsLoadController {
@ApiOperationSupport(order = 1)
@ApiOperation(value = "查询装载清单数据", notes = "传入loadCarsDTO")
public R findLoadingListData(@RequestBody LoadCarsDTO loadCarsDTO) {
String method = "############manualLoading: ";
String method = "############findLoadingListData: ";
log.info(method + "请求参数{}", loadCarsDTO);
Long loadId = loadCarsDTO.getLoadId();
@ -1972,4 +1972,141 @@ public class CarsLoadController {
}
@ResponseBody
@PostMapping("/findCarsLoadLogs")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "查询配载计划日志跟踪", notes = "传入loadCarsDTO")
public R findCarsLoadLogs(@RequestBody LoadCarsDTO loadCarsDTO) {
String method = "############findCarsLoadLogs: ";
log.info(method + "请求参数{}", loadCarsDTO);
Long loadId = loadCarsDTO.getLoadId();
try{
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(405,"仓库信息为空");
}
loadCarsDTO.setWarehouseId(myCurrentWarehouse.getId());
if(Objects.isNull(loadId)){
log.warn(method+"配载id为空 loadId={}",loadId);
return R.fail(405,"配载id为空");
}
return carsLoadService.findCarsLoadLogs(loadCarsDTO);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常",e);
return R.fail(500,"系统异常");
}
}
@ResponseBody
@PostMapping("/addContractByLoadId")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "增加配载合同", notes = "传入loadCarsDTO")
public R addContractByLoadId(@RequestBody LoadCarsDTO loadCarsDTO) {
String method = "############addContractByLoadId: ";
log.info(method + "请求参数{}", loadCarsDTO);
Long loadId = loadCarsDTO.getLoadId();
String url = loadCarsDTO.getUrl();
try{
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(405,"仓库信息为空");
}
loadCarsDTO.setWarehouseId(myCurrentWarehouse.getId());
if(Objects.isNull(loadId)){
log.warn(method+"配载id为空 loadId={}",loadId);
return R.fail(405,"配载id为空");
}
if(StringUtil.isBlank(url)){
log.warn(method+"配载id为空 url={}",url);
return R.fail(405,"合同地址为空");
}
return carsLoadService.addContractByLoadId(loadId,url);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常",e);
return R.fail(500,"系统异常");
}
}
@ResponseBody
@PostMapping("/findContractList")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "查询合同列表", notes = "传入loadCarsDTO")
public R findContractList(@RequestBody LoadCarsDTO loadCarsDTO) {
String method = "############findContractList: ";
log.info(method + "请求参数{}", loadCarsDTO);
Long loadId = loadCarsDTO.getLoadId();
try{
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(405,"仓库信息为空");
}
loadCarsDTO.setWarehouseId(myCurrentWarehouse.getId());
if(Objects.isNull(loadId)){
log.warn(method+"配载id为空 loadId={}",loadId);
return R.fail(405,"配载id为空");
}
return carsLoadService.findContractList(loadId);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常",e);
return R.fail(500,"系统异常");
}
}
@ResponseBody
@PostMapping("/findFinanceList")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "查询财务记录列表", notes = "传入loadCarsDTO")
public R findFinanceList(@RequestBody LoadCarsDTO loadCarsDTO) {
String method = "############findFinanceList: ";
log.info(method + "请求参数{}", loadCarsDTO);
Long loadId = loadCarsDTO.getLoadId();
try{
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(405,"仓库信息为空");
}
loadCarsDTO.setWarehouseId(myCurrentWarehouse.getId());
if(Objects.isNull(loadId)){
log.warn(method+"配载id为空 loadId={}",loadId);
return R.fail(405,"配载id为空");
}
return carsLoadService.findFinanceList(loadId);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常",e);
return R.fail(500,"系统异常");
}
}
}

29
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/TripartiteTransferController.java

@ -308,6 +308,35 @@ public class TripartiteTransferController {
}
}
@ResponseBody
@PostMapping("/signLoadScanByIds")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "三方中转包件签收", notes = "传入loadCarsDTO")
public R signLoadScanByIds(@RequestBody LoadCarsDTO loadCarsDTO) {
String method = "############signCars: ";
log.info(method+"请求参数{}",loadCarsDTO);
List<Long> loadScanIds = loadCarsDTO.getLoadScanIds();
try{
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(400,"仓库信息为空");
}
return carsLoadService.signLoadScanByIds(loadScanIds);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常",e);
return R.fail(500,"系统异常");
}
}
@ResponseBody
@PostMapping("/settlementCars")
@ApiOperationSupport(order = 1)

9
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadContractMapper.java

@ -0,0 +1,9 @@
package com.logpm.trunkline.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.trunkline.entity.TrunklineCarsLoadContractEntity;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface TrunklineCarsLoadContractMapper extends BaseMapper<TrunklineCarsLoadContractEntity> {
}

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

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.logpm.trunkline.mapper.TrunklineCarsLoadContractMapper">
</mapper>

9
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadFinanceMapper.java

@ -0,0 +1,9 @@
package com.logpm.trunkline.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.trunkline.entity.TrunklineCarsLoadFinanceEntity;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface TrunklineCarsLoadFinanceMapper extends BaseMapper<TrunklineCarsLoadFinanceEntity> {
}

3
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.java

@ -86,4 +86,7 @@ public interface TrunklineCarsLoadScanMapper extends BaseMapper<TrunklineCarsLoa
List<LoadingListMainVO> findUnloadListDataMain(@Param("loadId") Long loadId, @Param("warehouseId") Long warehouseId);
List<LoadingListGoodsVO> findUnloadGoods(@Param("loadId") Long loadId, @Param("warehouseId") Long warehouseId, @Param("orderCode") String orderCode, @Param("waybillNo") String waybillNo);
void updateScanStatus(@Param("loadScanIds") List<Long> loadScanIds, @Param("scanStatus") String scanStatus);
}

12
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml

@ -400,4 +400,16 @@
ltco.unload_num
</select>
<update id="updateScanStatus">
update logpm_trunkline_cars_load_scan
set scan_status = #{scanStatus}
where 1=1
<if test="loadScanIds != null and loadScanIds.size() > 0">
and id in
<foreach collection="loadScanIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</update>
</mapper>

7
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadContractService.java

@ -0,0 +1,7 @@
package com.logpm.trunkline.service;
import com.logpm.trunkline.entity.TrunklineCarsLoadContractEntity;
import org.springblade.core.mp.base.BaseService;
public interface ITrunklineCarsLoadContractService extends BaseService<TrunklineCarsLoadContractEntity> {
}

7
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadFinanceService.java

@ -0,0 +1,7 @@
package com.logpm.trunkline.service;
import com.logpm.trunkline.entity.TrunklineCarsLoadFinanceEntity;
import org.springblade.core.mp.base.BaseService;
public interface ITrunklineCarsLoadFinanceService extends BaseService<TrunklineCarsLoadFinanceEntity> {
}

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadScanService.java

@ -81,4 +81,6 @@ public interface ITrunklineCarsLoadScanService extends BaseService<TrunklineCars
List<LoadingListMainVO> findUnloadListDataMain(Long loadId, Long warehouseId);
List<LoadingListGoodsVO> findUnloadGoods(Long loadId, Long warehouseId, String orderCode, String waybillNo);
void updateScanStatus(List<Long> loadScanIds, String scanStatus);
}

13
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadService.java

@ -11,6 +11,7 @@ import org.springblade.core.mp.base.BaseService;
import org.springblade.core.tool.api.R;
import java.math.BigDecimal;
import java.util.List;
public interface ITrunklineCarsLoadService extends BaseService<TrunklineCarsLoadEntity> {
@ -110,7 +111,7 @@ public interface ITrunklineCarsLoadService extends BaseService<TrunklineCarsLoad
R findLoadFeeByNodeId(Long loadId,Long warehouseId);
R updateLoadFeeByNodeId(TrunklineCarsLoadDTO carsLoadDTO,Long warehouseId);
R updateLoadFeeByNodeId(TrunklineCarsLoadDTO carsLoadDTO,Long warehouseId,String warehouseName);
R findCarsLoadingOrderDetail(Long loadId, String orderCode, Long warehouseId);
@ -171,4 +172,14 @@ public interface ITrunklineCarsLoadService extends BaseService<TrunklineCarsLoad
R findLoadZeroList(LoadCarsDTO loadCarsDTO);
R findLoadingListData(LoadCarsDTO loadCarsDTO);
R signLoadScanByIds(List<Long> loadScanIds);
R findCarsLoadLogs(LoadCarsDTO loadCarsDTO);
R addContractByLoadId(Long loadId, String url);
R findContractList(Long loadId);
R findFinanceList(Long loadId);
}

16
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadContractServiceImpl.java

@ -0,0 +1,16 @@
package com.logpm.trunkline.service.impl;
import com.logpm.trunkline.entity.TrunklineCarsLoadContractEntity;
import com.logpm.trunkline.mapper.TrunklineCarsLoadContractMapper;
import com.logpm.trunkline.service.ITrunklineCarsLoadContractService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
@AllArgsConstructor
@Service
@Slf4j
public class TrunklineCarsLoadContractServiceImpl extends BaseServiceImpl<TrunklineCarsLoadContractMapper, TrunklineCarsLoadContractEntity> implements ITrunklineCarsLoadContractService {
}

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

@ -0,0 +1,15 @@
package com.logpm.trunkline.service.impl;
import com.logpm.trunkline.entity.TrunklineCarsLoadFinanceEntity;
import com.logpm.trunkline.mapper.TrunklineCarsLoadFinanceMapper;
import com.logpm.trunkline.service.ITrunklineCarsLoadFinanceService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
@Slf4j
@Service
@AllArgsConstructor
public class TrunklineCarsLoadFinanceServiceImpl extends BaseServiceImpl<TrunklineCarsLoadFinanceMapper, TrunklineCarsLoadFinanceEntity> implements ITrunklineCarsLoadFinanceService {
}

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadLogServiceImpl.java

@ -122,6 +122,8 @@ public class TrunklineCarsLoadLogServiceImpl extends BaseServiceImpl<TrunklineCa
",司机手机号:"+driverMobile;
}
carsLoadLogEntity.setContent(content);
carsLoadLogEntity.setType(cardLoadType);
carsLoadLogEntity.setCreateUserName(AuthUtil.getNickName());
save(carsLoadLogEntity);
}
}

5
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadScanServiceImpl.java

@ -197,4 +197,9 @@ public class TrunklineCarsLoadScanServiceImpl extends BaseServiceImpl<TrunklineC
return baseMapper.findUnloadGoods(loadId,warehouseId,orderCode,waybillNo);
}
@Override
public void updateScanStatus(List<Long> loadScanIds, String scanStatus) {
baseMapper.updateScanStatus(loadScanIds,scanStatus);
}
}

266
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

@ -76,6 +76,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
private final ITrunklineCarsSignLogService trunklineCarsSignLogService;
private final RabbitTemplate rabbitTemplate;
private final IInComingService inComingService;
private final ITrunklineCarsLoadContractService carsLoadContractService;
private final ITrunklineCarsLoadFinanceService carsLoadFinanceService;
@Override
public IPage<TrunklineCarsLoadVO> loadCarsPageList(LoadCarsDTO loadCarsDTO) {
@ -89,7 +91,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Long loadId = trunklineCarsLoadVO.getId();
QueryWrapper<TrunklineCarsLoadLineEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("is_deleted",0)
.eq("load_id",loadId);
.eq("load_id",loadId)
.orderByAsc("sort");
List<TrunklineCarsLoadLineEntity> list = trunklineCarsLoadLineService.list(queryWrapper);
trunklineCarsLoadVO.setCarsLoadLineList(list);
}
@ -109,7 +112,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Long loadId = trunklineCarsLoadVO.getId();
QueryWrapper<TrunklineCarsLoadLineEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("is_deleted",0)
.eq("load_id",loadId);
.eq("load_id",loadId)
.orderByAsc("sort");
List<TrunklineCarsLoadLineEntity> list = trunklineCarsLoadLineService.list(queryWrapper);
trunklineCarsLoadVO.setCarsLoadLineList(list);
}
@ -374,10 +378,12 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
updateById(carsLoadEntity);
try{
TrunklineCarsLoadLineEntity carsLoadLineEntity = trunklineCarsLoadLineService.findEntityByLoadIdAndNodeId(loadId, warehouseId);
if(!nodeId.equals(endNodeId)){
trunklineCarsLoadLogService.saveLog(carsLoadEntity,currentCarsLoadLineEntity, CarsLoadLogTypeConstant.NET_ARRIVE_CARS_LOAD.getValue());
trunklineCarsLoadLogService.saveLog(carsLoadEntity,carsLoadLineEntity, CarsLoadLogTypeConstant.NET_ARRIVE_CARS_LOAD.getValue());
}else{
trunklineCarsLoadLogService.saveLog(carsLoadEntity,currentCarsLoadLineEntity, CarsLoadLogTypeConstant.END_ARRIVE_CARS_LOAD.getValue());
trunklineCarsLoadLogService.saveLog(carsLoadEntity,carsLoadLineEntity, CarsLoadLogTypeConstant.END_ARRIVE_CARS_LOAD.getValue());
}
}catch (Exception e){
log.warn("#############arriveCarByLoadId: 存入日志失败");
@ -861,7 +867,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
}
try{
trunklineCarsLoadLogService.saveLog(carsLoadEntity,null, CarsLoadLogTypeConstant.CREATE_CARS_LOAD.getValue());
TrunklineCarsLoadLineEntity carsLoadLineEntity = trunklineCarsLoadLineService.findEntityByLoadIdAndNodeId(carsLoadEntity.getId(), warehouseId);
trunklineCarsLoadLogService.saveLog(carsLoadEntity,carsLoadLineEntity, CarsLoadLogTypeConstant.CREATE_CARS_LOAD.getValue());
}catch (Exception e){
log.warn("#############unloadByLoadId: 存入日志失败");
}
@ -1152,6 +1159,17 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
}
}
loadLineTitleName = "";
List<TrunklineCarsLoadLineEntity> loadLineEntityList = trunklineCarsLoadLineService.findListByLoadId(loadId);
for (TrunklineCarsLoadLineEntity carsLoadLineEntity : loadLineEntityList) {
String nodeName = carsLoadLineEntity.getNodeName();
if(StringUtil.isBlank(loadLineTitleName)){
loadLineTitleName = nodeName;
}else{
loadLineTitleName = loadLineTitleName + "->" + nodeName;
}
}
carsLoadEntity.setCarsLineName(loadLineTitleName);
carsLoadEntity.setEndWarehouseIds(endWarehouseIds);
carsLoadEntity.setEndWarehouseNames(endWarehouseNames);
@ -1160,7 +1178,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
updateNumByLoadId(loadId);
try{
trunklineCarsLoadLogService.saveLog(carsLoadEntity,null, CarsLoadLogTypeConstant.UPDATE_CARS_LOAD.getValue());
TrunklineCarsLoadLineEntity carsLoadLineEntity = trunklineCarsLoadLineService.findEntityByLoadIdAndNodeId(loadId, warehouseId);
trunklineCarsLoadLogService.saveLog(carsLoadEntity,carsLoadLineEntity, CarsLoadLogTypeConstant.UPDATE_CARS_LOAD.getValue());
}catch (Exception e){
log.warn("#############updateCarsLoadBasicData: 存入日志失败");
}
@ -1455,7 +1474,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
}
try{
trunklineCarsLoadLogService.saveLog(carsLoadEntity,null, CarsLoadLogTypeConstant.CREATE_CARS_LOAD.getValue());
TrunklineCarsLoadLineEntity loadLineEntity = trunklineCarsLoadLineService.findEntityByLoadIdAndNodeId(carsLoadEntity.getId(), warehouseId);
trunklineCarsLoadLogService.saveLog(carsLoadEntity,loadLineEntity, CarsLoadLogTypeConstant.CREATE_CARS_LOAD.getValue());
}catch (Exception e){
log.warn("#############unloadByLoadId: 存入日志失败");
}
@ -1505,6 +1525,12 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadEntity.setLoadStatus("10");
updateById(carsLoadEntity);
try{
trunklineCarsLoadLogService.saveLog(carsLoadEntity,carsLoadLineEntity, CarsLoadLogTypeConstant.FIRST_START_CARS_LOAD.getValue());
}catch (Exception e){
log.warn("#############startCarByLoadId: 存入日志失败");
}
return R.success("发车成功");
}
@ -1553,6 +1579,12 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadEntity.setStartTime(null);
updateById(carsLoadEntity);
try{
trunklineCarsLoadLogService.saveLog(carsLoadEntity,currentCarsLoadLineEntity, CarsLoadLogTypeConstant.CANCEL_FIRST_START_CARS_LOAD.getValue());
}catch (Exception e){
log.warn("#############startCarByLoadId: 存入日志失败");
}
return R.success("取消成功");
}
@ -1597,6 +1629,12 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadEntity.setArriveTime(date);
updateById(carsLoadEntity);
try{
trunklineCarsLoadLogService.saveLog(carsLoadEntity,carsLoadLineEntity, CarsLoadLogTypeConstant.END_ARRIVE_CARS_LOAD.getValue());
}catch (Exception e){
log.warn("#############startCarByLoadId: 存入日志失败");
}
return R.success("到达成功");
}
@ -2110,15 +2148,17 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
}
@Override
public R updateLoadFeeByNodeId(TrunklineCarsLoadDTO carsLoadDTO,Long warehouseId) {
public R updateLoadFeeByNodeId(TrunklineCarsLoadDTO carsLoadDTO,Long warehouseId,String warehouseName) {
Long loadId = carsLoadDTO.getId();
String str = "";
TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId);
if(Objects.isNull(carsLoadEntity)){
log.warn("##########updateLoadFeeByNodeId: 配载计划信息不存在 loadId={}",loadId);
return R.fail(405,"配载计划信息不存在");
}
BigDecimal oldCountTransportCost = carsLoadEntity.getCountTransportCost();
Long carId = carsLoadDTO.getCarId();
String carNumber = carsLoadDTO.getCarNumber();
Long driverId = carsLoadDTO.getDriverId();
@ -2143,6 +2183,10 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadEntity.setCountTransportCost(countTransportCost);
updateById(carsLoadEntity);
if(oldCountTransportCost.compareTo(countTransportCost) != 0){
str = "运输费用: 由【"+oldCountTransportCost+"】改为"+countTransportCost+"。&";
}
List<TrunklineCarsLoadLineDTO> carsLoadLineList = carsLoadDTO.getCarsLoadLineList();
for (TrunklineCarsLoadLineDTO carsLoadLineDTO : carsLoadLineList) {
Long loadCarsLineId = carsLoadLineDTO.getId();
@ -2160,12 +2204,166 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
loadLineEntity.setUnloadOtherCost(carsLoadLineDTO.getUnloadOtherCost());
loadLineEntity.setFuel(carsLoadLineDTO.getFuel());
loadLineEntity.setTollFee(carsLoadLineDTO.getTollFee());
String s = compareLineFee(carsLoadLineDTO, loadLineEntity);
if(StringUtil.isNotBlank(s)){
str = str + loadLineEntity.getNodeName()+":"+s;
}
trunklineCarsLoadLineService.updateById(loadLineEntity);
}
if(StringUtil.isNotBlank(str)){
TrunklineCarsLoadFinanceEntity carsLoadFinanceEntity = new TrunklineCarsLoadFinanceEntity();
carsLoadFinanceEntity.setLoadId(loadId);
carsLoadFinanceEntity.setWarehouseId(warehouseId);
carsLoadFinanceEntity.setWarehouseName(warehouseName);
carsLoadFinanceEntity.setCreateUserName(AuthUtil.getNickName());
carsLoadFinanceEntity.setContent(str);
try{
carsLoadFinanceService.save(carsLoadFinanceEntity);
}catch (Exception e){
log.warn("#############updateLoadFeeByNodeId: 保存财务记录失败");
}
}
return R.success("修改成功");
}
private String compareLineFee(TrunklineCarsLoadLineDTO carsLoadLineDTO, TrunklineCarsLoadLineEntity loadLineEntity) {
String result = "";
BigDecimal oldNowTransportCost = loadLineEntity.getNowTransportCost();
BigDecimal nowTransportCost = carsLoadLineDTO.getNowTransportCost();
if(oldNowTransportCost.compareTo(nowTransportCost) != 0){
if(StringUtil.isBlank(result)){
result = "【现付运输费】"+nowTransportCost;
}else{
result = result+",【现付运输费】"+nowTransportCost;
}
}
BigDecimal oldOilCost = loadLineEntity.getOilCost();
BigDecimal oilCost = carsLoadLineDTO.getOilCost();
if(oldOilCost.compareTo(oilCost) != 0){
if(StringUtil.isBlank(result)){
result = "【现付油卡费】"+oilCost;
}else{
result = result+",【现付油卡费】"+oilCost;
}
}
BigDecimal oldBackTransportCost = loadLineEntity.getBackTransportCost();
BigDecimal backTransportCost = carsLoadLineDTO.getBackTransportCost();
if(oldBackTransportCost.compareTo(backTransportCost) != 0){
if(StringUtil.isBlank(result)){
result = "【回付运输费】"+backTransportCost;
}else{
result = result+",【回付运输费】"+backTransportCost;
}
}
BigDecimal oldReachTransportCost = loadLineEntity.getReachTransportCost();
BigDecimal reachTransportCost = carsLoadLineDTO.getReachTransportCost();
if(oldReachTransportCost.compareTo(reachTransportCost) != 0){
if(StringUtil.isBlank(result)){
result = "【到付运输费】"+reachTransportCost;
}else{
result = result+",【到付运输费】"+reachTransportCost;
}
}
BigDecimal oldWholeCarInfoCost = loadLineEntity.getWholeCarInfoCost();
BigDecimal wholeCarInfoCost = carsLoadLineDTO.getWholeCarInfoCost();
if(oldWholeCarInfoCost.compareTo(wholeCarInfoCost) != 0){
if(StringUtil.isBlank(result)){
result = "【整车信息费】"+wholeCarInfoCost;
}else{
result = result+",【整车信息费】"+wholeCarInfoCost;
}
}
BigDecimal oldWholeCarInsuranceCost = loadLineEntity.getWholeCarInsuranceCost();
BigDecimal wholeCarInsuranceCost = carsLoadLineDTO.getWholeCarInsuranceCost();
if(oldWholeCarInsuranceCost.compareTo(wholeCarInsuranceCost) != 0){
if(StringUtil.isBlank(result)){
result = "【整车保险费】"+wholeCarInsuranceCost;
}else{
result = result+",【整车保险费】"+wholeCarInsuranceCost;
}
}
BigDecimal oldWholeCarGroundCost = loadLineEntity.getWholeCarGroundCost();
BigDecimal wholeCarGroundCost = carsLoadLineDTO.getWholeCarGroundCost();
if(oldWholeCarGroundCost.compareTo(wholeCarGroundCost) != 0){
if(StringUtil.isBlank(result)){
result = "【整车落地费】"+wholeCarGroundCost;
}else{
result = result+",【整车落地费】"+wholeCarGroundCost;
}
}
BigDecimal oldHairWholeCost = loadLineEntity.getHairWholeCost();
BigDecimal hairWholeCost = carsLoadLineDTO.getHairWholeCost();
if(oldHairWholeCost.compareTo(hairWholeCost) != 0){
if(StringUtil.isBlank(result)){
result = "【发站装车费】"+hairWholeCost;
}else{
result = result+",【发站装车费】"+hairWholeCost;
}
}
BigDecimal oldHairWholeOtherCost = loadLineEntity.getHairWholeOtherCost();
BigDecimal hairWholeOtherCost = carsLoadLineDTO.getHairWholeOtherCost();
if(oldHairWholeOtherCost.compareTo(hairWholeOtherCost) != 0){
if(StringUtil.isBlank(result)){
result = "【发站其他费】"+hairWholeOtherCost;
}else{
result = result+",【发站其他费】"+hairWholeOtherCost;
}
}
BigDecimal oldUnloadCost = loadLineEntity.getUnloadCost();
BigDecimal unloadCost = carsLoadLineDTO.getUnloadCost();
if(oldUnloadCost.compareTo(unloadCost) != 0){
if(StringUtil.isBlank(result)){
result = "【到站卸车费】"+unloadCost;
}else{
result = result+",【到站卸车费】"+unloadCost;
}
}
BigDecimal oldUnloadOtherCost = loadLineEntity.getUnloadOtherCost();
BigDecimal unloadOtherCost = carsLoadLineDTO.getUnloadOtherCost();
if(oldUnloadOtherCost.compareTo(unloadOtherCost) != 0){
if(StringUtil.isBlank(result)){
result = "【到站其他费】"+unloadOtherCost;
}else{
result = result+",【到站其他费】"+unloadOtherCost;
}
}
BigDecimal oldFuel = loadLineEntity.getFuel();
BigDecimal fuel = carsLoadLineDTO.getFuel();
if(oldFuel.compareTo(fuel) != 0){
if(StringUtil.isBlank(result)){
result = "【油费】"+fuel;
}else{
result = result+",【油费】"+fuel;
}
}
BigDecimal oldTollFee = loadLineEntity.getTollFee();
BigDecimal tollFee = carsLoadLineDTO.getTollFee();
if(oldTollFee.compareTo(tollFee) != 0){
if(StringUtil.isBlank(result)){
result = "【路桥费】"+tollFee;
}else{
result = result+",【路桥费】"+tollFee;
}
}
return result;
}
@Override
public R findCarsLoadingOrderDetail(Long loadId, String orderCode, Long warehouseId) {
@ -3426,6 +3624,56 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
}
}
@Override
public R signLoadScanByIds(List<Long> loadScanIds) {
trunklineCarsLoadScanService.updateScanStatus(loadScanIds,"3");
return R.success("签收成功");
}
@Override
public R findCarsLoadLogs(LoadCarsDTO loadCarsDTO) {
Long loadId = loadCarsDTO.getLoadId();
QueryWrapper<TrunklineCarsLoadLogEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("load_id",loadId)
.orderByAsc("create_time");
List<TrunklineCarsLoadLogEntity> list = trunklineCarsLoadLogService.list(queryWrapper);
return R.data(list);
}
@Override
public R addContractByLoadId(Long loadId, String url) {
TrunklineCarsLoadContractEntity carsLoadContractEntity = new TrunklineCarsLoadContractEntity();
carsLoadContractEntity.setLoadId(loadId);
carsLoadContractEntity.setUrl(url);
carsLoadContractEntity.setCreateUserName(AuthUtil.getNickName());
carsLoadContractService.save(carsLoadContractEntity);
return R.success("添加合同成功");
}
@Override
public R findContractList(Long loadId) {
QueryWrapper<TrunklineCarsLoadContractEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("load_id",loadId)
.eq("is_deleted",0);
List<TrunklineCarsLoadContractEntity> list = carsLoadContractService.list(queryWrapper);
return R.data(list);
}
@Override
public R findFinanceList(Long loadId) {
QueryWrapper<TrunklineCarsLoadFinanceEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("load_id",loadId)
.eq("is_deleted",0);
List<TrunklineCarsLoadFinanceEntity> list = carsLoadFinanceService.list(queryWrapper);
return R.data(list);
}
@Override
public R loadingTrayInfo(LoadCarsDTO loadCarsDTO) {
log.info("##############loadingTrayInfo: 查询托盘的货物信息");

Loading…
Cancel
Save