修复
This commit is contained in:
1 parent
f03701b34b
commit
f75b9ed179
5 files changed
+46
-9
No files matched your search
-2
@@ -116,8 +116,6 @@ public class VisitorsAppYYDetailVo {
|
||||
@Schema(description="随行人员集合")
|
||||
private List <VisitorsPeopleAppDTO> otherPeople;
|
||||
|
||||
|
||||
|
||||
// @Schema(description="邀约id")
|
||||
// private Long yyId;
|
||||
|
||||
|
||||
+21
-5
@@ -325,17 +325,33 @@ public class VisitorsServiceImpl extends ServiceImpl<VisitorsMapper, VisitorsEnt
|
||||
throw new ServiceException("数据不存在");
|
||||
}
|
||||
|
||||
if (!dataVisitors.getCheckStatus().equals(TaskCheckStatusEnum.PADDING.getCode())) {
|
||||
throw new ServiceException("数据已处理");
|
||||
}
|
||||
// if (!dataVisitors.getCheckStatus().equals(TaskCheckStatusEnum.PADDING.getCode())) {
|
||||
// throw new ServiceException("数据已处理");
|
||||
// }
|
||||
|
||||
VisitorUserEntity visitorUserEntity = visitorUserService.getById(dataVisitors.getUserId());
|
||||
|
||||
VisitorsEntity visitors = new VisitorsEntity();
|
||||
visitors.setId(id);
|
||||
visitors.setCheckStatus(checkStatus);
|
||||
//审核成功,发送通知短信
|
||||
if (checkStatus.equals(TaskCheckStatusEnum.RESULT.getCode())){
|
||||
sendVisitorApprovalSms(visitorUserEntity, dataVisitors);
|
||||
}
|
||||
//取消邀约
|
||||
if (checkStatus.equals(TaskCheckStatusEnum.CANCEL.getCode())){
|
||||
//查询是否有接受过邀约,有接受过就取消掉,并且发送短信
|
||||
VisitorsEntity cancelVisitor = baseMapper.selectOne(
|
||||
new LambdaQueryWrapper<VisitorsEntity>().eq(VisitorsEntity::getYyId,id));
|
||||
if (cancelVisitor != null){
|
||||
//发送短信
|
||||
|
||||
// sendVisitorCancelSms(visitorUser, cancelVisitor);
|
||||
//取消邀约
|
||||
cancelVisitor.setCheckStatus(TaskCheckStatusEnum.CANCEL.getCode());
|
||||
baseMapper.updateById(cancelVisitor);
|
||||
}
|
||||
}
|
||||
return baseMapper.updateById(visitors);
|
||||
}
|
||||
|
||||
@@ -432,7 +448,7 @@ public class VisitorsServiceImpl extends ServiceImpl<VisitorsMapper, VisitorsEnt
|
||||
//邀约者的数据信息
|
||||
VisitorsEntity yyVisitors = baseMapper.selectById(id);
|
||||
if (yyVisitors == null) {
|
||||
throw new ServiceException("该访客信息不存在");
|
||||
throw new ServiceException("该邀约信息不存在");
|
||||
}
|
||||
//查询当前用户信息
|
||||
VisitorUserEntity visitorUserEntity = visitorUserService.getById(currentVisitorUserId);
|
||||
@@ -456,7 +472,7 @@ public class VisitorsServiceImpl extends ServiceImpl<VisitorsMapper, VisitorsEnt
|
||||
String uniqueToken = UUID.randomUUID().toString();
|
||||
String token = uniqueToken.replace("-", "");
|
||||
dataVisitors.setToken(token);
|
||||
|
||||
dataVisitors.setYyId(visitorsReceiveAppDTO.getId());
|
||||
dataVisitors.setIsDrive(yyVisitors.getIsDrive());
|
||||
dataVisitors.setIsOtherPeople(yyVisitors.getIsOtherPeople());
|
||||
|
||||
|
||||
+1
@@ -381,4 +381,5 @@ public class SmErpInventoryRecordsController {
|
||||
public R updatePDById(@RequestBody PDUpdateDTO pdfUpdateDTO) {
|
||||
return R.ok(smErpInventoryRecordsService.updateIPD(pdfUpdateDTO));
|
||||
}
|
||||
|
||||
}
|
||||
+3
@@ -127,4 +127,7 @@ public interface SmErpInventoryRecordsService extends IService<SmErpInventoryRec
|
||||
* @return
|
||||
*/
|
||||
Object updateIPD(PDUpdateDTO pdfUpdateDTO);
|
||||
|
||||
|
||||
|
||||
}
|
||||
+21
-2
@@ -1,8 +1,6 @@
|
||||
package com.bsd.pjcloud.supermarket.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.admin.api.dto.UserInfo;
|
||||
@@ -580,6 +578,24 @@ public class SmErpInventoryRecordsServiceImpl extends ServiceImpl<SmErpInventory
|
||||
if (!toDeleteCodeIds.isEmpty()) {
|
||||
smErpInventoryRecordsItemMapper.deleteByIds(toDeleteCodeIds);
|
||||
}
|
||||
|
||||
// 重新计算主表的totalAmount
|
||||
List<SmErpInventoryRecordsItemEntity> finalItems = smErpInventoryRecordsItemMapper.selectList(
|
||||
new LambdaQueryWrapper<SmErpInventoryRecordsItemEntity>()
|
||||
.eq(SmErpInventoryRecordsItemEntity::getInventoryId, inventoryRecordEditDTO.getId())
|
||||
);
|
||||
|
||||
// 计算新的总金额
|
||||
int newTotalAmount = finalItems.stream()
|
||||
.mapToInt(item -> item.getTotalAmount() != null ? item.getTotalAmount() : 0)
|
||||
.sum();
|
||||
|
||||
// 更新主表的totalAmount
|
||||
SmErpInventoryRecordsEntity updateEntity = new SmErpInventoryRecordsEntity();
|
||||
updateEntity.setId(inventoryRecordEditDTO.getId());
|
||||
updateEntity.setTotalAmount(newTotalAmount);
|
||||
baseMapper.updateById(updateEntity);
|
||||
|
||||
//todo 实际上应该审批后才会入库
|
||||
//更新库存
|
||||
smErpStockService.updateStock(updateStockDTOS);
|
||||
@@ -1268,4 +1284,7 @@ public class SmErpInventoryRecordsServiceImpl extends ServiceImpl<SmErpInventory
|
||||
|
||||
return new ArrayList<>(summaryMap.values());
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user