This commit is contained in:
zt
2025-08-28 14:37:30 +08:00
parent 936145138e
commit 7e0cd7c946
19 changed files with 157 additions and 27 deletions

View File

@ -133,10 +133,8 @@ public class BusMrpBaseController extends BaseController {
* 获取剩余量
*/
@GetMapping("/remaining")
public R<Integer> remaining(Long suppliespriceId) {
BigDecimal remaining = busMrpBaseService.remaining(suppliespriceId);
BusBillofquantities byId = busBillofquantitiesService.getById(suppliespriceId);
return R.ok(byId.getQuantity().subtract(remaining).intValue());
public R<BigDecimal> remaining(Long suppliespriceId,Long mrpBaseId) {
return R.ok(busMrpBaseService.remaining(suppliespriceId,mrpBaseId));
}

View File

@ -1,5 +1,6 @@
package org.dromara.cailiaoshebei.domain.vo;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
@ -43,6 +44,11 @@ public class BusMaterialbatchdemandplanVo implements Serializable {
@ExcelProperty(value = "批次ID")
private String batchId;
/**
* 批次号
*/
private String batchNumber;
/**
* 基础信息ID
*/
@ -125,4 +131,9 @@ public class BusMaterialbatchdemandplanVo implements Serializable {
*/
private String qs;
/**
* 创建时间
*/
private BigDecimal remaining;
}

View File

@ -87,5 +87,5 @@ public interface IBusMrpBaseService extends IService<BusMrpBase>{
/**
* 获取物资已有数量
*/
BigDecimal remaining(Long suppliespriceId);
BigDecimal remaining(Long suppliespriceId,Long mrpBaseId);
}

View File

@ -63,6 +63,7 @@ public class BusMrpBaseServiceImpl extends ServiceImpl<BusMrpBaseMapper, BusMrpB
private final IBusBillofquantitiesService busBillofquantitiesService;
/**
* 查询物资-批次需求计划基础信息
*
@ -77,6 +78,10 @@ public class BusMrpBaseServiceImpl extends ServiceImpl<BusMrpBaseMapper, BusMrpB
BusMaterialbatchdemandplanBo planBo = new BusMaterialbatchdemandplanBo();
planBo.setMrpBaseId(id);
List<BusMaterialbatchdemandplanVo> voList = planservice.queryList(planBo);
for (BusMaterialbatchdemandplanVo vo : voList) {
BigDecimal remaining = remaining(vo.getSuppliespriceId(), id);
vo.setRemaining(remaining);
}
busMrpVo.setMrpBaseBo(busMrpBaseVo);
busMrpVo.setPlanList(voList);
@ -266,20 +271,22 @@ public class BusMrpBaseServiceImpl extends ServiceImpl<BusMrpBaseMapper, BusMrpB
@Override
public BigDecimal remaining(Long suppliespriceId) {
public BigDecimal remaining(Long suppliespriceId,Long mrpBaseId) {
BusBillofquantities byId = busBillofquantitiesService.getById(suppliespriceId);
// 获取数据库中已有的数量
List<BusMaterialbatchdemandplan> existingList = planservice.list(
Wrappers.lambdaQuery(BusMaterialbatchdemandplan.class)
.eq(BusMaterialbatchdemandplan::getSuppliespriceId, suppliespriceId) // 排除当前批次
.eq(BusMaterialbatchdemandplan::getSuppliespriceId, suppliespriceId)
.ne(mrpBaseId!=null,BusMaterialbatchdemandplan::getMrpBaseId, mrpBaseId)// 排除当前批次
);
if(CollectionUtil.isEmpty(existingList)){
return BigDecimal.ZERO;
}
return existingList.stream()
BigDecimal reduce = existingList.stream()
.map(BusMaterialbatchdemandplan::getDemandQuantity)
.reduce(BigDecimal.ZERO, BigDecimal::add);
return byId.getQuantity().subtract(reduce);
}
/**

View File

@ -107,4 +107,6 @@ public class BusDrawingreviewReceiptsController extends BaseController {
return toAjax(busDrawingreviewReceiptsService.deleteWithValidByIds(List.of(ids), true));
}
}

View File

@ -159,4 +159,9 @@ public class BusDrawingreviewReceipts extends BaseEntity {
private String finalState;
private Long approveId;
private String approve;
}

View File

@ -151,4 +151,8 @@ public class BusDrawingreviewReceiptsBo extends BaseEntity {
private String finalState;
private Long approveId;
private String approve;
}

View File

@ -429,6 +429,11 @@ public class DesVolumeFileServiceImpl extends ServiceImpl<DesVolumeFileMapper, D
}
desVolumeFile.setAuditStatus(processEvent.getStatus());
if (processEvent.getStatus().equals("finish")) {
//修改目录状态
volumeCatalogService.update(Wrappers.<DesVolumeCatalog>lambdaUpdate()
.set(DesVolumeCatalog::getDesignState, "1")
.eq(DesVolumeCatalog::getDesign, desVolumeFile.getVolumeCatalogId())
);
//异步处理二维码
self.addQRCodeToPDF(desVolumeFile.getId(), false)
.thenAccept(result -> log.info("图纸[{}-{} ]添加二维码成功", desVolumeFile.getFileName(), desVolumeFile.getId()))

View File

@ -429,6 +429,7 @@ public class MatMaterialReceiveServiceImpl extends ServiceImpl<MatMaterialReceiv
String orderingUnit = req.getOrderingUnit();
String supplierUnit = req.getSupplierUnit();
String storageType = req.getStorageType();
lqw.orderByDesc(MatMaterialReceive::getCreateTime);
lqw.like(StringUtils.isNotBlank(projectName), MatMaterialReceive::getProjectName, projectName);
lqw.like(StringUtils.isNotBlank(materialName), MatMaterialReceive::getMaterialName, materialName);
lqw.like(StringUtils.isNotBlank(contractName), MatMaterialReceive::getContractName, contractName);

View File

@ -31,4 +31,7 @@ public class SysUserRole {
*/
private Long projectId;
private Long projectId;
}

View File

@ -845,14 +845,16 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
* @return 用户
*/
@Override
public List<UserDTO> selectUsersByRoleIds(List<Long> roleIds) {
public List<UserDTO> selectUsersByRoleIds(List<Long> roleIds,Long projectId) {
if (CollUtil.isEmpty(roleIds)) {
return List.of();
}
// 通过角色ID获取用户角色信息
List<SysUserRole> userRoles = userRoleMapper.selectList(
new LambdaQueryWrapper<SysUserRole>().in(SysUserRole::getRoleId, roleIds));
new LambdaQueryWrapper<SysUserRole>().in(SysUserRole::getRoleId, roleIds)
.eq(projectId!=null,SysUserRole::getProjectId, projectId)
);
// 获取用户ID列表
Set<Long> userIds = StreamUtils.toSet(userRoles, SysUserRole::getUserId);