Browse Source

修改直接入库入库批次号不存在

training
caoyizhong 1 year ago
parent
commit
af4f2d8e81
  1. 19
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java
  2. 10
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/IAftersalesWorkOrderService.java
  3. 13
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java
  4. 177
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java
  5. 19
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWarehousingEntryServiceImpl.java

19
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java

@ -46,6 +46,8 @@ import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.tool.constant.BladeConstant;
import springfox.documentation.annotations.ApiIgnore;
import java.util.Calendar;
import java.util.Map;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
@ -91,6 +93,21 @@ public class AftersalesWorkOrderController extends BladeController {
return R.data(AftersalesWorkOrderWrapper.build().pageVO(pages));
}
/**
* 客服异常工单 查询异常完整数据集合
*/
@GetMapping("/listOwn")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入aftersalesWorkOrder")
public R<IPage<AftersalesWorkOrderVO>> getListOwn(@ApiIgnore @RequestParam Map<String, Object> aftersalesWorkOrder, Query query) {
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(ObjectUtils.isNotNull(myCurrentWarehouse)){
aftersalesWorkOrder.put("warehouseId", myCurrentWarehouse.getId());
}
IPage<AftersalesWorkOrderEntity> pages = aftersalesWorkOrderService.pageListOwn(aftersalesWorkOrder, Condition.getPage(query));
return R.data(AftersalesWorkOrderWrapper.build().pageVO(pages));
}
/**
* 客服异常工单 自定义分页
*/
@ -118,7 +135,7 @@ public class AftersalesWorkOrderController extends BladeController {
*/
@PostMapping("/addCompletionEnd")
@ApiOperationSupport(order = 4)
@ApiOperation(value = "新增", notes = "传入aftersalesWorkOrder")
@ApiOperation(value = "完结处理", notes = "传入aftersalesWorkOrder")
public R addCompletionEnd(@Valid @RequestBody List<AftersalesWorkOrderDTO> aftersalesWorkOrder) {
return R.status(aftersalesWorkOrderService.addCompletionEnd(aftersalesWorkOrder));

10
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/IAftersalesWorkOrderService.java

@ -24,6 +24,7 @@ import com.logpm.aftersales.excel.AftersalesWorkOrderExcel;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseService;
import java.util.List;
import java.util.Map;
/**
* 客服异常工单 服务类
@ -71,4 +72,13 @@ public interface IAftersalesWorkOrderService extends BaseService<AftersalesWorkO
* @return
*/
boolean addCompletionEnd(List<AftersalesWorkOrderDTO> aftersalesWorkOrder);
/**
* 查询异常完整数据集合
*
* @param aftersalesWorkOrder
* @param page
* @return
*/
IPage<AftersalesWorkOrderEntity> pageListOwn(Map<String, Object> aftersalesWorkOrder, IPage<Object> page);
}

13
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java

@ -46,6 +46,7 @@ import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* 客服异常工单 服务实现类
@ -243,4 +244,16 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
return true;
}
/**
* 查询异常完整数据集合
*
* @param aftersalesWorkOrder
* @param page
* @return
*/
@Override
public IPage<AftersalesWorkOrderEntity> pageListOwn(Map<String, Object> aftersalesWorkOrder, IPage<Object> page) {
return null;
}
}

177
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java

@ -765,98 +765,113 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
List<QuestDetailEntity> detailEntityList = new ArrayList<>();
//处理的包件
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> tag {}",4);
for (QuestDetailDTO i : taskSearchDTO.getQuestDetailList()) {
taskSearchDTO.getQuestDetailList().forEach(i ->{
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> tag {}",45);
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> tag {}",45);
Long taskID;
if(ObjectUtils.isNotNull(i.getId())){
taskID = i.getId();
}else{
taskID = getTaskID();
}
if(i.getIsNew().equals(1)){
//新增数据
Long taskID;
if(ObjectUtils.isNotNull(i.getId())){
taskID = i.getId();
}else{
taskID = getTaskID();
}
if(i.getIsNew().equals(1)){
//新增数据
QuestDetailEntity questDetail = new QuestDetailEntity();
BeanUtil.copyProperties(i,questDetail);
questDetail.setTenantId(user.getTenantId());
questDetail.setCreateDept(Long.valueOf(user.getDeptId()));
questDetail.setCreateTime(new Date());
questDetail.setIsDeleted(0);
questDetail.setStatus(1);
questDetail.setCreateUser(user.getUserId());
questDetail.setUpdateUser(user.getUserId());
questDetail.setUpdateTime(new Date());
questDetail.setId(taskID);
questDetail.setWarehouseId(warehouseId);
questDetail.setQuestStatus(1);
List<QuestDetailEntity> entityList = new ArrayList<>();
entityList.add(questDetail);
baseMapper.insertQuestDetail( questNum,entityList);
}
Integer stockNum = i.getStockNum();
Integer lossNum = i.getLossNum();
Integer deliveNum = i.getDeliveNum();
Integer wornNum = i.getWornNum();
Integer noReceivedNum = i.getNoReceivedNum();
Integer noRepairNum = i.getNoRepairNum();
if(stockNum > 0 || lossNum > 0 || deliveNum > 0 || wornNum > 0 || noReceivedNum > 0 || noRepairNum > 0){
//查询盘点包件信息
if(ObjectUtils.isNotNull(i.getOrderPackageCode())){
QuestDetailEntity questDetail = new QuestDetailEntity();
questDetail.setOrderPackageCode(i.getOrderPackageCode());
QuestDetailEntity questDetail1 = baseMapper.selectOneTaskInfo(taskSearchDTO.getQuestNum(), questDetail);
if(ObjectUtils.isNotNull(questDetail1)){
i.setId(questDetail1.getId());
}
BeanUtil.copyProperties(i,questDetail);
questDetail.setTenantId(user.getTenantId());
questDetail.setCreateDept(Long.valueOf(user.getDeptId()));
questDetail.setCreateTime(new Date());
questDetail.setIsDeleted(0);
questDetail.setStatus(1);
questDetail.setCreateUser(user.getUserId());
questDetail.setUpdateUser(user.getUserId());
questDetail.setUpdateTime(new Date());
questDetail.setId(taskID);
questDetail.setWarehouseId(warehouseId);
questDetail.setQuestStatus(1);
List<QuestDetailEntity> entityList = new ArrayList<>();
entityList.add(questDetail);
baseMapper.insertQuestDetail( questNum,entityList);
}
//添加
List<QuestDetailChildEntity> childList = new ArrayList<>();
childList.add(addQuestDetailChild(stockNum,"10",taskID,warehouseId,questNum));
childList.add(addQuestDetailChild(wornNum,"20",taskID,warehouseId,questNum));
childList.add(addQuestDetailChild(lossNum,"30",taskID,warehouseId,questNum));
childList.add(addQuestDetailChild(noRepairNum,"40",taskID,warehouseId,questNum));
childList.add(addQuestDetailChild(deliveNum,"50",taskID,warehouseId,questNum));
childList.add(addQuestDetailChild(noReceivedNum,"60",taskID,warehouseId,questNum));
if(!childList.isEmpty()){
boolean b = childList.stream().anyMatch(ii -> ObjectUtils.isNull(ii.getId()));
if(b){
//添加
baseMapper.insertQuestDetailChildList(taskSearchDTO.getQuestNum()+"_child",childList);
//修改盘点数据
List<QuestDetailEntity> list = new ArrayList<>();
Integer stockNum = i.getStockNum();
Integer lossNum = i.getLossNum();
Integer deliveNum = i.getDeliveNum();
Integer wornNum = i.getWornNum();
Integer noReceivedNum = i.getNoReceivedNum();
Integer noRepairNum = i.getNoRepairNum();
if(stockNum > 0 || lossNum > 0 || deliveNum > 0 || wornNum > 0 || noReceivedNum > 0 || noRepairNum > 0){
//查询盘点包件信息
if(ObjectUtils.isNotNull(i.getOrderPackageCode())){
QuestDetailEntity questDetail = new QuestDetailEntity();
questDetail.setId(i.getId());
questDetail.setQuestStatus(1); //已盘
questDetail.setUpdateUser(user.getUserId());
questDetail.setUpdateTime(new Date());
if(ObjectUtils.isNotNull(i.getTrayId())){
questDetail.setTrayId(i.getTrayId());
questDetail.setTrayCode(i.getTrayCode());
questDetail.setOrderPackageCode(i.getOrderPackageCode());
QuestDetailEntity questDetail1 = baseMapper.selectOneTaskInfo(taskSearchDTO.getQuestNum(), questDetail);
if(ObjectUtils.isNotNull(questDetail1)){
i.setId(questDetail1.getId());
}
}
//添加
List<QuestDetailChildEntity> childList = new ArrayList<>();
childList.add(addQuestDetailChild(stockNum,"10",taskID,warehouseId,questNum));
childList.add(addQuestDetailChild(wornNum,"20",taskID,warehouseId,questNum));
childList.add(addQuestDetailChild(lossNum,"30",taskID,warehouseId,questNum));
childList.add(addQuestDetailChild(noRepairNum,"40",taskID,warehouseId,questNum));
childList.add(addQuestDetailChild(deliveNum,"50",taskID,warehouseId,questNum));
childList.add(addQuestDetailChild(noReceivedNum,"60",taskID,warehouseId,questNum));
if(!childList.isEmpty()){
boolean b = childList.stream().anyMatch(ii -> ObjectUtils.isNull(ii.getId()));
if(b){
//添加
baseMapper.insertQuestDetailChildList(taskSearchDTO.getQuestNum()+"_child",childList);
//修改盘点数据
List<QuestDetailEntity> list = new ArrayList<>();
QuestDetailEntity questDetail = new QuestDetailEntity();
questDetail.setId(i.getId());
questDetail.setQuestStatus(1); //已盘
questDetail.setUpdateUser(user.getUserId());
questDetail.setUpdateTime(new Date());
if(ObjectUtils.isNotNull(i.getTrayId())){
questDetail.setTrayId(i.getTrayId());
questDetail.setTrayCode(i.getTrayCode());
}
list.add(questDetail);
baseMapper.updatePositionCodeList(taskSearchDTO.getQuestNum(),list);
}else{
//修改
List<QuestDetailChildEntity> collect = childList.stream().filter( ii -> ObjectUtils.isNotNull(ii.getQuestNum()) && ii.getQuestNum() > 0).collect(Collectors.toList());
baseMapper.updetaQuestDetailChildList(questNum+"_child",collect);
}
list.add(questDetail);
baseMapper.updatePositionCodeList(taskSearchDTO.getQuestNum(),list);
}else{
//修改
List<QuestDetailChildEntity> collect = childList.stream().filter( ii -> ObjectUtils.isNotNull(ii.getQuestNum()) && ii.getQuestNum() > 0).collect(Collectors.toList());
baseMapper.updetaQuestDetailChildList(questNum+"_child",collect);
}
}
}
//是否修改库位
QuestDetailEntity questDetail = new QuestDetailEntity();
if(ObjectUtils.isNotNull(i.getGroundingAllocationId())){
questDetail.setId(i.getId());
//是否修改库位
QuestDetailEntity questDetail = new QuestDetailEntity();
if(ObjectUtils.isNotNull(i.getGroundingAllocationId())){
//查询当前待更新货位是否包含已更新货位数据
QuestDetailEntity questDetail1 = new QuestDetailEntity();
questDetail1.setGroundingAllocationId(i.getGroundingAllocationId());
List<QuestDetailEntity> questDetailEntities = baseMapper.selectTaskInfo(taskSearchDTO.getQuestNum(), questDetail1);
if(!questDetailEntities.isEmpty()){
boolean b = questDetailEntities.stream().anyMatch(q -> ObjectUtils.isNotNull(q.getTrayId()));
if(b){
return Resp.scanFail("更新的货位,已有数据,无法上架更新!","更新的货位,已有数据,无法上架更新!");
}
}
questDetail.setId(i.getId());
// questDetail.setGroundingAllocationId(Long.valueOf(i.getAllocationId()));
questDetail.setGroundingAllocationId(i.getGroundingAllocationId());
questDetail.setGroundingPositionCode(i.getGroundingPositionCode());
detailEntityList.add(questDetail);
}
});
questDetail.setGroundingAllocationId(i.getGroundingAllocationId());
questDetail.setGroundingPositionCode(i.getGroundingPositionCode());
detailEntityList.add(questDetail);
}
}
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> tag {}",5);
//修改货位

19
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWarehousingEntryServiceImpl.java

@ -110,7 +110,7 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
if(ObjectUtils.isNull(warehouseWarehousingEntryDTO.getType())){
throw new ServiceException("入库类型不能为空!!");
}
if(warehouseWarehousingEntryDTO.getType().equals("2")){
if("2".equals(warehouseWarehousingEntryDTO.getType())){
//直接入库
List<WarehouseWarehousingDetailEntity> list = warehouseWarehousingEntryDTO.getList();
WarehouseWarehousingEntryEntity warehouseWarehousingEntry = new WarehouseWarehousingEntryEntity();
@ -119,7 +119,9 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
if(ObjectUtils.isNull( warehouseWarehousingEntry.getReceiptBatch() )){
long time = new Date().getTime();
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
warehouseWarehousingEntry.setReceiptBatch("RK"+myCurrentWarehouse.getWarehouseCode()+time);
String s = "RK" + myCurrentWarehouse.getWarehouseCode() + time;
warehouseWarehousingEntry.setReceiptBatch(s);
warehouseWarehousingEntryDTO.setReceiptBatch(s);
}
WarehouseWarehousingEntryEntity entryEntity = new WarehouseWarehousingEntryEntity();
entryEntity.setId(warehouseWarehousingEntryDTO.getId());
@ -146,7 +148,7 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
// iterator.remove();
// }
// }
if(list.size() > 0){
if(!list.isEmpty()){
list.forEach(i ->{
i.setWarehousingEntryId(warehouseWarehousingEntry.getId());
i.setConditions("3");
@ -155,7 +157,7 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
warehouseWarehousingDetailService.saveBatch(list);
}
return true;
}else if(warehouseWarehousingEntryDTO.getType().equals("1")){
}else if("1".equals(warehouseWarehousingEntryDTO.getType())){
//预计入库
List<WarehouseWarehousingDetailEntity> list = warehouseWarehousingEntryDTO.getList();
WarehouseWarehousingEntryEntity warehouseWarehousingEntry = new WarehouseWarehousingEntryEntity();
@ -176,7 +178,7 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
.eq(WarehouseWarehousingDetailEntity::getWarehousingEntryId, warehouseWarehousingEntry.getId())
.apply("conditions in (1,2) ")
);//查询不是确定的数据
if(list1.size() > 0){
if(!list1.isEmpty()){
AtomicReference<Integer> num = new AtomicReference<>(0);
list1.forEach( i ->{
boolean b = list.stream().anyMatch(w -> w.getMaterialId().equals(i.getMaterialId()));
@ -209,7 +211,7 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
}
}else{
if(i.getConditions().equals("1")){
if("1".equals(i.getConditions())){
//删除
detailEntityList.add(i.getId());
}
@ -222,7 +224,7 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
entryEntity.setConditions("3");
}
baseMapper.updateById(entryEntity);
if(detailEntityList.size() > 0){
if(!detailEntityList.isEmpty()){
//删除多余的
warehouseWarehousingDetailService.deleteLogic(detailEntityList);
}
@ -249,7 +251,7 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
iterator.remove();
}
}
if(list.size() > 0){
if(!list.isEmpty()){
list.forEach(i ->{
i.setWarehousingEntryId(warehouseWarehousingEntry.getId());
i.setConditions("1");
@ -279,6 +281,7 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
if(num < 1){
return true;
}else{
//查询库存品信息
DistributionStockListEntity stockListEntity = new DistributionStockListEntity();
stockListEntity.setStoreId(warehousingEntryDTO.getStoreId());
stockListEntity.setMarketId(warehousingEntryDTO.getClientId());

Loading…
Cancel
Save