28 changed files with 585 additions and 162 deletions
@ -0,0 +1,27 @@
|
||||
package com.logpm.trunkline.feign; |
||||
|
||||
import org.springblade.common.constant.ModuleNameConstant; |
||||
import org.springblade.core.tool.api.R; |
||||
import org.springframework.cloud.openfeign.FeignClient; |
||||
import org.springframework.web.bind.annotation.GetMapping; |
||||
import org.springframework.web.bind.annotation.RequestParam; |
||||
|
||||
@FeignClient( |
||||
value = ModuleNameConstant.APPLICATION_TRUNKLINE_NAME |
||||
) |
||||
public interface ITrunklineCarsLoadScanClient { |
||||
|
||||
String API_PREFIX = "trunklineCarsLoadScan/client"; |
||||
|
||||
@GetMapping(API_PREFIX+"/removeLoadScanById") |
||||
void removeLoadScanById(@RequestParam Long carsLoadScanId); |
||||
|
||||
@GetMapping(API_PREFIX+"/incomingPackage") |
||||
R incomingPackage(@RequestParam Long carsLoadScanId); |
||||
|
||||
|
||||
// @PostMapping(API_PREFIX+"/addAdvanceReturnId")
|
||||
// Long addAdvanceReturnId(@RequestBody TrunklineAdvanceEntity trunklineAdvanceEntity);
|
||||
|
||||
|
||||
} |
@ -0,0 +1,17 @@
|
||||
package com.logpm.aftersales.dto; |
||||
|
||||
import com.logpm.aftersales.entity.AftersalesAbnormalRecordEntity; |
||||
import lombok.Data; |
||||
|
||||
@Data |
||||
public class AbnormalRecordDTO extends AftersalesAbnormalRecordEntity { |
||||
|
||||
private Long abnormalRecordId; |
||||
private Long warehouseId; |
||||
|
||||
private Integer pageNum; |
||||
private Integer pageSize; |
||||
|
||||
private Integer dealType; |
||||
|
||||
} |
@ -0,0 +1,31 @@
|
||||
package com.logpm.aftersales.feign; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.logpm.aftersales.entity.AftersalesAbnormalRecordEntity; |
||||
import com.logpm.aftersales.service.IAftersalesAbnormalRecordService; |
||||
import lombok.AllArgsConstructor; |
||||
import org.springframework.web.bind.annotation.RestController; |
||||
import springfox.documentation.annotations.ApiIgnore; |
||||
|
||||
import java.util.List; |
||||
|
||||
@ApiIgnore() |
||||
@RestController |
||||
@AllArgsConstructor |
||||
public class AftersalesAbnormalRecordClient implements IAftersalesAbnormalRecordClient { |
||||
|
||||
private final IAftersalesAbnormalRecordService aftersalesAbnormalRecordService; |
||||
|
||||
@Override |
||||
public void addAbnormalRecord(AftersalesAbnormalRecordEntity abnormalRecordEntity) { |
||||
aftersalesAbnormalRecordService.save(abnormalRecordEntity); |
||||
} |
||||
|
||||
@Override |
||||
public List<AftersalesAbnormalRecordEntity> findAbnormalList(String carsNo) { |
||||
QueryWrapper<AftersalesAbnormalRecordEntity> queryWrapper = new QueryWrapper<>(); |
||||
queryWrapper.eq("cars_no",carsNo) |
||||
.eq("abnormal_status",0); |
||||
return aftersalesAbnormalRecordService.list(queryWrapper); |
||||
} |
||||
} |
@ -0,0 +1,16 @@
|
||||
package com.logpm.aftersales.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.logpm.aftersales.dto.AbnormalRecordDTO; |
||||
import com.logpm.aftersales.entity.AftersalesAbnormalRecordEntity; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
import org.apache.ibatis.annotations.Param; |
||||
|
||||
@Mapper |
||||
public interface AftersalesAbnormalRecordMapper extends BaseMapper<AftersalesAbnormalRecordEntity> { |
||||
|
||||
|
||||
IPage<AftersalesAbnormalRecordEntity> findPageList(IPage<Object> page, @Param("param") AbnormalRecordDTO abnormalRecordDTO); |
||||
|
||||
} |
@ -1,11 +1,14 @@
|
||||
<?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.warehouse.mapper.WarehouseAbnormalRecordMapper"> |
||||
<mapper namespace="com.logpm.aftersales.mapper.AftersalesAbnormalRecordMapper"> |
||||
|
||||
<select id="findPageList" resultType="com.logpm.warehouse.entity.WarehouseAbnormalRecordEntity"> |
||||
<select id="findPageList" resultType="com.logpm.aftersales.entity.AftersalesAbnormalRecordEntity"> |
||||
select * |
||||
from logpm_warehouse_abnormal_record |
||||
where 1=1 |
||||
<if test=""> |
||||
|
||||
</if> |
||||
</select> |
||||
|
||||
</mapper> |
@ -0,0 +1,13 @@
|
||||
package com.logpm.aftersales.service; |
||||
|
||||
import com.logpm.aftersales.dto.AbnormalRecordDTO; |
||||
import com.logpm.aftersales.entity.AftersalesAbnormalRecordEntity; |
||||
import org.springblade.core.mp.base.BaseService; |
||||
import org.springblade.core.tool.api.R; |
||||
|
||||
public interface IAftersalesAbnormalRecordService extends BaseService<AftersalesAbnormalRecordEntity> { |
||||
R findPageList(AbnormalRecordDTO abnormalRecordDTO); |
||||
|
||||
R dealAbnormal(AbnormalRecordDTO abnormalRecordDTO); |
||||
|
||||
} |
@ -0,0 +1,77 @@
|
||||
package com.logpm.aftersales.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.logpm.aftersales.dto.AbnormalRecordDTO; |
||||
import com.logpm.aftersales.entity.AftersalesAbnormalRecordEntity; |
||||
import com.logpm.aftersales.mapper.AftersalesAbnormalRecordMapper; |
||||
import com.logpm.aftersales.service.IAftersalesAbnormalRecordService; |
||||
import com.logpm.trunkline.feign.ITrunklineCarsLoadScanClient; |
||||
import lombok.AllArgsConstructor; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springblade.core.mp.base.BaseServiceImpl; |
||||
import org.springblade.core.secure.utils.AuthUtil; |
||||
import org.springblade.core.tool.api.R; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.util.Date; |
||||
import java.util.Objects; |
||||
|
||||
@Slf4j |
||||
@Service |
||||
@AllArgsConstructor |
||||
public class AftersalesAbnormalRecordServiceImpl extends BaseServiceImpl<AftersalesAbnormalRecordMapper, AftersalesAbnormalRecordEntity> implements IAftersalesAbnormalRecordService { |
||||
|
||||
private final ITrunklineCarsLoadScanClient trunklineCarsLoadScanClient; |
||||
|
||||
@Override |
||||
public R findPageList(AbnormalRecordDTO abnormalRecordDTO) { |
||||
IPage<Object> page = new Page<>(); |
||||
page.setCurrent(abnormalRecordDTO.getPageNum()); |
||||
page.setSize(abnormalRecordDTO.getPageSize()); |
||||
|
||||
IPage<AftersalesAbnormalRecordEntity> pageList = baseMapper.findPageList(page,abnormalRecordDTO); |
||||
|
||||
return R.data(pageList); |
||||
} |
||||
|
||||
@Override |
||||
public R dealAbnormal(AbnormalRecordDTO abnormalRecordDTO) { |
||||
Long abnormalRecordId = abnormalRecordDTO.getAbnormalRecordId(); |
||||
AftersalesAbnormalRecordEntity abnormalRecordEntity = baseMapper.selectById(abnormalRecordId); |
||||
if(!Objects.isNull(abnormalRecordEntity)){ |
||||
Integer abnormalStatus = abnormalRecordEntity.getAbnormalStatus(); |
||||
if(abnormalStatus.equals(1)){ |
||||
log.warn("################dealAbnormal: 异常已完结"); |
||||
return R.fail(405,"异常已完结"); |
||||
} |
||||
String abnormalType = abnormalRecordEntity.getAbnormalType(); |
||||
String upWarehouseName = abnormalRecordEntity.getUpWarehouseName(); |
||||
if("1".equals(abnormalType)){ |
||||
Integer dealType = abnormalRecordDTO.getDealType(); |
||||
Long carsLoadScanId = abnormalRecordEntity.getAssociationId(); |
||||
if(dealType.equals(1)){ |
||||
//无效包条码
|
||||
abnormalRecordEntity.setRemark("已确认为无效包条码("+upWarehouseName+" "+AuthUtil.getNickName()+")"); |
||||
|
||||
//删除装车异常数据
|
||||
trunklineCarsLoadScanClient.removeLoadScanById(carsLoadScanId); |
||||
|
||||
}else if(dealType.equals(2)){ |
||||
//暂存单入库
|
||||
R r = trunklineCarsLoadScanClient.incomingPackage(carsLoadScanId); |
||||
int code = r.getCode(); |
||||
if(code != 200){ |
||||
return r; |
||||
} |
||||
} |
||||
} |
||||
abnormalRecordEntity.setAbnormalStatus(1); |
||||
abnormalRecordEntity.setDealTime(new Date()); |
||||
abnormalRecordEntity.setDealUserId(AuthUtil.getUserId()); |
||||
abnormalRecordEntity.setDealUserName(AuthUtil.getNickName()); |
||||
} |
||||
|
||||
return R.success("处理成功"); |
||||
} |
||||
} |
@ -0,0 +1,28 @@
|
||||
package com.logpm.trunkline.feign; |
||||
|
||||
import com.logpm.trunkline.service.ITrunklineCarsLoadService; |
||||
import lombok.AllArgsConstructor; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springblade.core.tool.api.R; |
||||
import org.springframework.web.bind.annotation.RestController; |
||||
import springfox.documentation.annotations.ApiIgnore; |
||||
|
||||
@Slf4j |
||||
@ApiIgnore() |
||||
@RestController |
||||
@AllArgsConstructor |
||||
public class TrunklineCarsLoadScanClient implements ITrunklineCarsLoadScanClient{ |
||||
|
||||
private final ITrunklineCarsLoadService trunklineCarsLoadService; |
||||
|
||||
|
||||
@Override |
||||
public void removeLoadScanById(Long carsLoadScanId) { |
||||
trunklineCarsLoadService.abnormalRemove(carsLoadScanId); |
||||
} |
||||
|
||||
@Override |
||||
public R incomingPackage(Long carsLoadScanId) { |
||||
return trunklineCarsLoadService.syncIncomingPackage(carsLoadScanId); |
||||
} |
||||
} |
@ -1,14 +0,0 @@
|
||||
package com.logpm.warehouse.dto; |
||||
|
||||
import com.logpm.warehouse.entity.WarehouseAbnormalRecordEntity; |
||||
import lombok.Data; |
||||
|
||||
@Data |
||||
public class AbnormalRecordDTO extends WarehouseAbnormalRecordEntity { |
||||
|
||||
private Long warehouseId; |
||||
|
||||
private Integer pageNum; |
||||
private Integer pageSize; |
||||
|
||||
} |
@ -1,21 +0,0 @@
|
||||
package com.logpm.warehouse.feign; |
||||
|
||||
import com.logpm.warehouse.entity.WarehouseAbnormalRecordEntity; |
||||
import com.logpm.warehouse.service.IWarehouseAbnormalRecordService; |
||||
import lombok.AllArgsConstructor; |
||||
import org.springframework.web.bind.annotation.RestController; |
||||
import springfox.documentation.annotations.ApiIgnore; |
||||
|
||||
@ApiIgnore() |
||||
@RestController |
||||
@AllArgsConstructor |
||||
public class WarehouseAbnormalRecordClient implements IWarehouseAbnormalRecordClient { |
||||
|
||||
private final IWarehouseAbnormalRecordService warehouseAbnormalRecordService; |
||||
|
||||
@Override |
||||
public void addAbnormalRecord(WarehouseAbnormalRecordEntity warehouseAbnormalRecordEntity) { |
||||
warehouseAbnormalRecordEntity.setAbnormalStatus(0); |
||||
warehouseAbnormalRecordService.save(warehouseAbnormalRecordEntity); |
||||
} |
||||
} |
@ -1,16 +0,0 @@
|
||||
package com.logpm.warehouse.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.logpm.warehouse.dto.AbnormalRecordDTO; |
||||
import com.logpm.warehouse.entity.WarehouseAbnormalRecordEntity; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
import org.apache.ibatis.annotations.Param; |
||||
|
||||
@Mapper |
||||
public interface WarehouseAbnormalRecordMapper extends BaseMapper<WarehouseAbnormalRecordEntity> { |
||||
|
||||
|
||||
IPage<WarehouseAbnormalRecordEntity> findPageList(IPage<Object> page, @Param("param") AbnormalRecordDTO abnormalRecordDTO); |
||||
|
||||
} |
@ -1,12 +0,0 @@
|
||||
package com.logpm.warehouse.service; |
||||
|
||||
import com.logpm.warehouse.dto.AbnormalRecordDTO; |
||||
import com.logpm.warehouse.entity.WarehouseAbnormalRecordEntity; |
||||
import org.springblade.core.mp.base.BaseService; |
||||
import org.springblade.core.tool.api.R; |
||||
|
||||
public interface IWarehouseAbnormalRecordService extends BaseService<WarehouseAbnormalRecordEntity> { |
||||
R findPageList(AbnormalRecordDTO abnormalRecordDTO); |
||||
|
||||
|
||||
} |
@ -1,31 +0,0 @@
|
||||
package com.logpm.warehouse.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.logpm.warehouse.dto.AbnormalRecordDTO; |
||||
import com.logpm.warehouse.entity.WarehouseAbnormalRecordEntity; |
||||
import com.logpm.warehouse.mapper.WarehouseAbnormalRecordMapper; |
||||
import com.logpm.warehouse.service.IWarehouseAbnormalRecordService; |
||||
import lombok.AllArgsConstructor; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springblade.core.mp.base.BaseServiceImpl; |
||||
import org.springblade.core.tool.api.R; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
@Slf4j |
||||
@Service |
||||
@AllArgsConstructor |
||||
public class WarehouseAbnormalRecordServiceImpl extends BaseServiceImpl<WarehouseAbnormalRecordMapper,WarehouseAbnormalRecordEntity> implements IWarehouseAbnormalRecordService { |
||||
|
||||
|
||||
@Override |
||||
public R findPageList(AbnormalRecordDTO abnormalRecordDTO) { |
||||
IPage<Object> page = new Page<>(); |
||||
page.setCurrent(abnormalRecordDTO.getPageNum()); |
||||
page.setSize(abnormalRecordDTO.getPageSize()); |
||||
|
||||
IPage<WarehouseAbnormalRecordEntity> pageList = baseMapper.findPageList(page,abnormalRecordDTO); |
||||
|
||||
return R.data(pageList); |
||||
} |
||||
} |
Loading…
Reference in new issue