| | |
| | | TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmSupplier)){ |
| | | SysUser sysUser = sysUserService.selectUserById(userId); |
| | | crmSupplier = crmSupplierService.getById(sysUser.getObjectId()); |
| | | } |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | |
| | |
| | | TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmSupplier)){ |
| | | SysUser sysUser = sysUserService.selectUserById(userId); |
| | | crmSupplier = crmSupplierService.getById(sysUser.getObjectId()); |
| | | } |
| | | supplierAndClinicId = crmSupplier.getId(); |
| | | } else { |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | |
| | | TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmSupplier)){ |
| | | SysUser sysUser = sysUserService.selectUserById(userId); |
| | | crmSupplier = crmSupplierService.getById(sysUser.getObjectId()); |
| | | } |
| | | // 查询药品总类和总数 |
| | | Integer typeTotalCount = erpProcurementService.supplierSalesStatisticsTypeCount(crmSupplier.getId()); |
| | | Integer totalCount = erpProcurementService.supplierSalesStatisticsCount(crmSupplier.getId()); |
| | |
| | | TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmSupplier)){ |
| | | SysUser sysUser = sysUserService.selectUserById(userId); |
| | | crmSupplier = crmSupplierService.getById(sysUser.getObjectId()); |
| | | } |
| | | SupplierSalesStatisticsVO supplierSalesStatisticsVO = new SupplierSalesStatisticsVO(); |
| | | // 销售金额 |
| | | BigDecimal totalMoney = erpProcurementService.supplierSalesStatisticsMoney(crmSupplier.getId(), startTime, endTime); |
| | |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.WebUtils; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | |
| | | TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmSupplier)){ |
| | | SysUser sysUser = sysUserService.selectUserById(userId); |
| | | crmSupplier = crmSupplierService.getById(sysUser.getObjectId()); |
| | | } |
| | | query.setSupplierId(crmSupplier.getId()); |
| | | } |
| | | if (Objects.equals(roleType, 5)) { |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | // --- |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(userId); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | query.setClinicId(crmClinic.getId()); |
| | | } |
| | | |
| | |
| | | TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmSupplier)){ |
| | | SysUser sysUser = sysUserService.selectUserById(userId); |
| | | crmSupplier = crmSupplierService.getById(sysUser.getObjectId()); |
| | | } |
| | | query.setSupplierId(crmSupplier.getId()); |
| | | } |
| | | if (Objects.equals(roleType, 5)) { |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | // --- |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(userId); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | query.setClinicId(crmClinic.getId()); |
| | | } |
| | | List<ProcurementReportClinicExport> procurementReportClinicExports = erpProcurementService.exportProcurementReportClinic(query); |
| | |
| | | TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmSupplier)){ |
| | | SysUser sysUser = sysUserService.selectUserById(userId); |
| | | crmSupplier = crmSupplierService.getById(sysUser.getObjectId()); |
| | | } |
| | | query.setSupplierId(crmSupplier.getId()); |
| | | } |
| | | if (Objects.equals(roleType, 5)) { |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | // --- |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(userId); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | query.setClinicId(crmClinic.getId()); |
| | | } |
| | | List<ProcurementReportSupplierExport> procurementReportSupplierExports = erpProcurementService.exportProcurementReportSupplier(query); |
| | |
| | | TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmSupplier)){ |
| | | SysUser sysUser = sysUserService.selectUserById(userId); |
| | | crmSupplier = crmSupplierService.getById(sysUser.getObjectId()); |
| | | } |
| | | query.setSupplierId(crmSupplier.getId()); |
| | | } |
| | | if (Objects.equals(roleType, 5)) { |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | // --- |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(userId); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | query.setClinicId(crmClinic.getId()); |
| | | } |
| | | List<ProcurementReportPlatformExport> procurementReportPlatformExports = erpProcurementService.exportProcurementReportPlatform(query); |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmSupplier)){ |
| | | SysUser sysUser = sysUserService.selectUserById(userId); |
| | | crmSupplier = crmSupplierService.getById(sysUser.getObjectId()); |
| | | } |
| | | TCrmWarehouse crmWarehouse = crmWarehouseService.getById(crmSupplier.getWarehouseId()); |
| | | return R.ok(crmWarehouse); |
| | | } |
| | |
| | | import javax.validation.Valid; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | private final TCrmSupplierService crmSupplierService; |
| | | private final TErpClinicWarehousingBatchService erpClinicWarehousingBatchService; |
| | | private final TErpGoodsUnitService erpGoodsUnitService; |
| | | private final ISysUserService sysUserService; |
| | | |
| | | |
| | | @Autowired |
| | | public TErpClinicWarehousingController(TErpClinicWarehousingService erpClinicWarehousingService, TErpGoodsService erpGoodsService, TokenService tokenService, |
| | | TCrmClinicService crmClinicService,TCrmSupplierService crmSupplierService,TErpClinicWarehousingBatchService erpClinicWarehousingBatchService, |
| | | TErpGoodsUnitService erpGoodsUnitService) { |
| | | TCrmClinicService crmClinicService, TCrmSupplierService crmSupplierService, TErpClinicWarehousingBatchService erpClinicWarehousingBatchService, |
| | | TErpGoodsUnitService erpGoodsUnitService, ISysUserService sysUserService) { |
| | | this.erpClinicWarehousingService = erpClinicWarehousingService; |
| | | this.erpGoodsService = erpGoodsService; |
| | | this.tokenService = tokenService; |
| | |
| | | this.erpClinicWarehousingBatchService = erpClinicWarehousingBatchService; |
| | | this.erpGoodsUnitService = erpGoodsUnitService; |
| | | |
| | | this.sysUserService = sysUserService; |
| | | } |
| | | |
| | | |
| | |
| | | TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmSupplier)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmSupplier = crmSupplierService.getById(sysUser.getObjectId()); |
| | | } |
| | | query.setSupplierClinicId(crmSupplier.getId()); |
| | | } |
| | | if(roleType == 5){ |
| | |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // --- |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | query.setSupplierClinicId(crmClinic.getId()); |
| | | } |
| | | |
| | |
| | | TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmSupplier)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmSupplier = crmSupplierService.getById(sysUser.getObjectId()); |
| | | } |
| | | query.setSupplierClinicId(crmSupplier.getId()); |
| | | } |
| | | if(roleType == 5){ |
| | |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // --- |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | query.setSupplierClinicId(crmClinic.getId()); |
| | | } |
| | | |
| | |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // --- |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | supplierClinicId = crmClinic.getId(); |
| | | } |
| | | |
| | |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // --- |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | supplierClinicId = crmClinic.getId(); |
| | | } |
| | | |
| | |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // --- |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | supplierClinicId = crmClinic.getId(); |
| | | } |
| | | |
| | |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // --- |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | supplierClinicId = crmClinic.getId(); |
| | | } |
| | | |
| | |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // --- |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | supplierClinicId = crmClinic.getId(); |
| | | } |
| | | erpClinicWarehousingService.warehouseGoods(dto,user,supplierClinicId); |
| | |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // --- |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | supplierClinicId = crmClinic.getId(); |
| | | List<TErpClinicWarehousing> list = erpClinicWarehousingService.list(new LambdaQueryWrapper<TErpClinicWarehousing>().eq(TErpClinicWarehousing::getClinicId, supplierClinicId).eq(TErpClinicWarehousing::getStatus, 1).orderByDesc(BaseModel::getCreateTime)); |
| | | if(list.isEmpty()){ |
| | |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // --- |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | supplierClinicId = crmClinic.getId(); |
| | | } |
| | | |
| | |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // --- |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | supplierClinicId = crmClinic.getId(); |
| | | } |
| | | erpClinicWarehousingService.outboundGoods(dto,user,supplierClinicId); |
| | |
| | | import java.math.RoundingMode; |
| | | import java.net.URLEncoder; |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | private final TErpMaintenanceReminderService erpMaintenanceReminderService; |
| | | private final TCrmClinicService crmClinicService; |
| | | private final TCrmSupplierService crmSupplierService; |
| | | private final ISysUserService sysUserService; |
| | | |
| | | @Autowired |
| | | public TErpGoodsController(TErpGoodsService erpGoodsService, TokenService tokenService, TErpGoodsTypeService erpGoodsTypeService, TErpGoodsUnitService erpGoodsUnitService, |
| | | TErpSupplierWarehousingBatchService erpSupplierWarehousingBatchService, TErpSupplierWarehousingService erpSupplierWarehousingService, |
| | | TErpSupplierOutboundGoodsService erpSupplierOutboundGoodsService, TErpMaintenanceReminderService erpMaintenanceReminderService, TCrmClinicService crmClinicService, TCrmSupplierService crmSupplierService) { |
| | | TErpSupplierOutboundGoodsService erpSupplierOutboundGoodsService, TErpMaintenanceReminderService erpMaintenanceReminderService, TCrmClinicService crmClinicService, TCrmSupplierService crmSupplierService, ISysUserService sysUserService) { |
| | | this.erpGoodsService = erpGoodsService; |
| | | this.tokenService = tokenService; |
| | | this.erpGoodsTypeService = erpGoodsTypeService; |
| | |
| | | this.erpMaintenanceReminderService = erpMaintenanceReminderService; |
| | | this.crmClinicService = crmClinicService; |
| | | this.crmSupplierService = crmSupplierService; |
| | | this.sysUserService = sysUserService; |
| | | } |
| | | |
| | | |
| | |
| | | TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmSupplier)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmSupplier = crmSupplierService.getById(sysUser.getObjectId()); |
| | | } |
| | | |
| | | query.setSupplierClinicId(crmSupplier.getId()); |
| | | } |
| | | if(roleType == 5){ |
| | |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // --- |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | query.setSupplierClinicId(crmClinic.getId()); |
| | | } |
| | | return R.ok(erpGoodsService.pageList(query,user)); |
| | |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // --- |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | clinicSupplierId = crmClinic.getId(); |
| | | } |
| | | Page<TErpGoods> tErpGoodsPage = new Page<>(query.getPageNum(), query.getPageSize()); |
| | |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // --- |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | clinicSupplierId = crmClinic.getId(); |
| | | } |
| | | |
| | |
| | | TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmSupplier)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmSupplier = crmSupplierService.getById(sysUser.getObjectId()); |
| | | } |
| | | goods.setSupplierClinicId(crmSupplier.getId()); |
| | | goods.setGoodsSource(1); |
| | | } |
| | |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // --- |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | goods.setSupplierClinicId(crmClinic.getId()); |
| | | goods.setGoodsSource(2); |
| | | } |
| | |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // --- |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | goods.setSupplierClinicId(crmClinic.getId()); |
| | | goods.setGoodsSource(2); |
| | | } |
| | |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // --- |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | goods.setSupplierClinicId(crmClinic.getId()); |
| | | goods.setGoodsSource(2); |
| | | } |
| | |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // --- |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | cid = crmClinic.getId(); |
| | | if(goods.getGoodsSource()==1){ |
| | | String clinicIds = goods.getClinicIds(); |
| | |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // --- |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | cid = crmClinic.getId(); |
| | | for (TErpGoods goods : list) { |
| | | String clinicIds = goods.getClinicIds(); |
| | |
| | | TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmSupplier)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmSupplier = crmSupplierService.getById(sysUser.getObjectId()); |
| | | } |
| | | clinicSupplierId = crmSupplier.getId(); |
| | | } |
| | | if(roleType == 5){ |
| | |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // --- |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | clinicSupplierId =crmClinic.getId(); |
| | | } |
| | | |
| | |
| | | TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmSupplier)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmSupplier = crmSupplierService.getById(sysUser.getObjectId()); |
| | | } |
| | | query.setSupplierClinicId(crmSupplier.getId()); |
| | | } |
| | | if(roleType == 5){ |
| | |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // --- |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | query.setSupplierClinicId(crmClinic.getId()); |
| | | } |
| | | |
| | |
| | | TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmSupplier)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmSupplier = crmSupplierService.getById(sysUser.getObjectId()); |
| | | } |
| | | goods.setSupplierClinicId(crmSupplier.getId()); |
| | | goods.setGoodsSource(1); |
| | | } |
| | |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // --- |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | goods.setSupplierClinicId(crmClinic.getId()); |
| | | goods.setGoodsSource(2); |
| | | } |
| | |
| | | import com.ruoyi.system.model.TErpGoods; |
| | | import com.ruoyi.system.model.TErpIssueReporting; |
| | | import com.ruoyi.system.query.TErpIssueReportingQuery; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import com.ruoyi.system.service.TCrmClinicService; |
| | | import com.ruoyi.system.service.TCrmSupplierService; |
| | | import com.ruoyi.system.service.TErpIssueReportingService; |
| | |
| | | private final TCrmClinicService crmClinicService; |
| | | private final TCrmSupplierService crmSupplierService; |
| | | private final TokenService tokenService; |
| | | private final ISysUserService sysUserService; |
| | | @Autowired |
| | | public TErpIssueReportingController(TErpIssueReportingService erpIssueReportingService, TCrmClinicService crmClinicService, TCrmSupplierService crmSupplierService, TokenService tokenService) { |
| | | public TErpIssueReportingController(TErpIssueReportingService erpIssueReportingService, TCrmClinicService crmClinicService, TCrmSupplierService crmSupplierService, TokenService tokenService, ISysUserService sysUserService) { |
| | | this.erpIssueReportingService = erpIssueReportingService; |
| | | this.crmClinicService = crmClinicService; |
| | | this.crmSupplierService = crmSupplierService; |
| | | this.tokenService = tokenService; |
| | | this.sysUserService = sysUserService; |
| | | } |
| | | |
| | | /** |
| | |
| | | TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmSupplier)){ |
| | | SysUser sysUser = sysUserService.selectUserById(userId); |
| | | crmSupplier = crmSupplierService.getById(sysUser.getObjectId()); |
| | | } |
| | | query.setReportUserId(crmSupplier.getId()); |
| | | } |
| | | if(roleType == 5){ |
| | |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | // --- |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(userId); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | query.setReportUserId(crmClinic.getId()); |
| | | } |
| | | return R.ok(erpIssueReportingService.pageList(query)); |
| | |
| | | TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmSupplier)){ |
| | | SysUser sysUser = sysUserService.selectUserById(userId); |
| | | crmSupplier = crmSupplierService.getById(sysUser.getObjectId()); |
| | | } |
| | | dto.setReportUserId(crmSupplier.getId()); |
| | | } |
| | | if(roleType == 5){ |
| | |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | // --- |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(userId); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | dto.setReportUserId(crmClinic.getId()); |
| | | } |
| | | return R.ok(erpIssueReportingService.save(dto)); |
| | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | private final TCrmSalespersonService crmSalespersonService; |
| | | private final TErpProcurementCommissionService erpProcurementCommissionService; |
| | | private final TCrmWarehouseService crmWarehouseService; |
| | | private final ISysUserService sysUserService; |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | public TErpProcurementController(TErpProcurementService erpProcurementService, TokenService tokenService, TCrmClinicService crmClinicService, TErpProcurementGoodsService erpProcurementGoodsService |
| | | , TErpGoodsService erpGoodsService, TErpClinicWarehousingService erpClinicWarehousingService, TErpClinicWarehousingBatchService erpClinicWarehousingBatchService, |
| | | TCrmSupplierService crmSupplierService, TErpMaintenanceReminderService erpMaintenanceReminderService, TSysOtherConfigService sysOtherConfigService, TCrmClinicPointsService crmClinicPointsService, TCrmChangePointsService crmChangePointsService, TCrmBranchService crmBranchService, TCrmSalespersonService crmSalespersonService, TErpProcurementCommissionService erpProcurementCommissionService, TCrmWarehouseService crmWarehouseService) { |
| | | TCrmSupplierService crmSupplierService, TErpMaintenanceReminderService erpMaintenanceReminderService, TSysOtherConfigService sysOtherConfigService, TCrmClinicPointsService crmClinicPointsService, TCrmChangePointsService crmChangePointsService, TCrmBranchService crmBranchService, TCrmSalespersonService crmSalespersonService, TErpProcurementCommissionService erpProcurementCommissionService, TCrmWarehouseService crmWarehouseService, ISysUserService sysUserService) { |
| | | this.erpProcurementService = erpProcurementService; |
| | | this.tokenService = tokenService; |
| | | this.crmClinicService = crmClinicService; |
| | |
| | | |
| | | this.crmWarehouseService = crmWarehouseService; |
| | | |
| | | this.sysUserService = sysUserService; |
| | | } |
| | | |
| | | |
| | |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // --- |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | clinicSupplierId = crmClinic.getId(); |
| | | } |
| | | erpProcurementService.addProcurement(clinicSupplierId, user, dtos); |
| | |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // --- |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | clinicSupplierId = crmClinic.getId(); |
| | | } |
| | | TErpProcurement tErpProcurement = erpProcurementService.getById(id); |
| | |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // --- |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | clinicSupplierId = crmClinic.getId(); |
| | | } |
| | | |
| | |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // --- |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | clinicSupplierId = crmClinic.getId(); |
| | | } |
| | | ArrayList<DetailProcurementNextVO> detailProcurementNextVOS = new ArrayList<>(); |
| | |
| | | crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // --- |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | clinicSupplierId = crmClinic.getId(); |
| | | } |
| | | TErpProcurement erpProcurement = erpProcurementService.getById(dto.getId()); |
| | |
| | | import com.ruoyi.system.model.TCrmClinic; |
| | | import com.ruoyi.system.model.TCrmSupplier; |
| | | import com.ruoyi.system.query.*; |
| | | import com.ruoyi.system.service.TCrmClinicService; |
| | | import com.ruoyi.system.service.TCrmSupplierService; |
| | | import com.ruoyi.system.service.TErpGoodsService; |
| | | import com.ruoyi.system.service.TErpSupplierWarehousingService; |
| | | import com.ruoyi.system.service.*; |
| | | import com.ruoyi.system.vo.*; |
| | | import com.ruoyi.web.core.config.LakalaConfig; |
| | | import io.swagger.annotations.Api; |
| | |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | private final TokenService tokenService; |
| | | private final TCrmClinicService crmClinicService; |
| | | private final TCrmSupplierService crmSupplierService; |
| | | private final ISysUserService sysUserService; |
| | | |
| | | @Autowired |
| | | public TErpSupplierWarehousingController(TErpSupplierWarehousingService erpSupplierWarehousingService, TErpGoodsService erpGoodsService, TokenService tokenService, |
| | | TCrmClinicService crmClinicService,TCrmSupplierService crmSupplierService) { |
| | | TCrmClinicService crmClinicService, TCrmSupplierService crmSupplierService, ISysUserService sysUserService) { |
| | | this.erpSupplierWarehousingService = erpSupplierWarehousingService; |
| | | this.erpGoodsService = erpGoodsService; |
| | | this.tokenService = tokenService; |
| | | this.crmClinicService = crmClinicService; |
| | | this.crmSupplierService = crmSupplierService; |
| | | this.sysUserService = sysUserService; |
| | | } |
| | | |
| | | |
| | |
| | | TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmSupplier)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmSupplier = crmSupplierService.getById(sysUser.getObjectId()); |
| | | } |
| | | query.setSupplierClinicId(crmSupplier.getId()); |
| | | } |
| | | if(roleType == 5){ |
| | |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // --- |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | query.setSupplierClinicId(crmClinic.getId()); |
| | | } |
| | | |
| | |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | |
| | | private final TCrmClinicService crmClinicService; |
| | | private final TokenService tokenService; |
| | | private final TSysOtherConfigService sysOtherConfigService; |
| | | private final ISysUserService sysUserService; |
| | | @Autowired |
| | | public TSysAppUserController(TSysAppUserService sysAppUserService, TSysInspectionService sysInspectionService, TSysOrderService sysOrderService, TSysChronicDiseaseService sysChronicDiseaseService, MsgUtils msgUtils, TSysMessageTemplateService sysMessageTemplateService, TCrmClinicService crmClinicService, TokenService tokenService, TSysOtherConfigService sysOtherConfigService) { |
| | | public TSysAppUserController(TSysAppUserService sysAppUserService, TSysInspectionService sysInspectionService, TSysOrderService sysOrderService, TSysChronicDiseaseService sysChronicDiseaseService, MsgUtils msgUtils, TSysMessageTemplateService sysMessageTemplateService, TCrmClinicService crmClinicService, TokenService tokenService, TSysOtherConfigService sysOtherConfigService, ISysUserService sysUserService) { |
| | | this.sysAppUserService = sysAppUserService; |
| | | this.sysInspectionService = sysInspectionService; |
| | | this.sysOrderService = sysOrderService; |
| | |
| | | this.crmClinicService = crmClinicService; |
| | | this.tokenService = tokenService; |
| | | this.sysOtherConfigService = sysOtherConfigService; |
| | | this.sysUserService = sysUserService; |
| | | } |
| | | |
| | | /** |
| | |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, clinicUserId) |
| | | .last("LIMIT 1")); |
| | | // --- |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(clinicUserId); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | if(crmClinic == null){ |
| | | return R.fail("未找到该诊所信息"); |
| | | } |
| | |
| | | Long userId = tokenService.getLoginUser().getUserId(); |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, userId)); |
| | | // --- |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(userId); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | dto.setClinicId(crmClinic.getId()); |
| | | return R.ok(sysAppUserService.save(dto)); |
| | | } |
| | |
| | | private final TCrmClinicService crmClinicService; |
| | | private final TCrmClinicPointsService crmClinicPointsService; |
| | | private final TCrmChangePointsService crmChangePointsService; |
| | | private final ISysUserService sysUserService; |
| | | |
| | | |
| | | @Autowired |
| | | public TSysGoodsController(TokenService tokenService, TSysGoodsService sysGoodsService, TCrmSupplierService crmSupplierService, TSysGoodsExchangeService sysGoodsExchangeService, TCrmClinicService crmClinicService, TCrmClinicPointsService crmClinicPointsService, TCrmChangePointsService crmChangePointsService) { |
| | | public TSysGoodsController(TokenService tokenService, TSysGoodsService sysGoodsService, TCrmSupplierService crmSupplierService, TSysGoodsExchangeService sysGoodsExchangeService, TCrmClinicService crmClinicService, TCrmClinicPointsService crmClinicPointsService, TCrmChangePointsService crmChangePointsService, ISysUserService sysUserService) { |
| | | this.sysGoodsService = sysGoodsService; |
| | | this.tokenService = tokenService; |
| | | this.crmSupplierService = crmSupplierService; |
| | |
| | | |
| | | this.crmChangePointsService = crmChangePointsService; |
| | | |
| | | this.sysUserService = sysUserService; |
| | | } |
| | | |
| | | /** |
| | |
| | | TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmSupplier)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmSupplier = crmSupplierService.getById(sysUser.getObjectId()); |
| | | } |
| | | LambdaQueryWrapper<TSysGoods> tSysGoodsLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | tSysGoodsLambdaQueryWrapper.eq(TSysGoods::getSupplierId, crmSupplier.getId()); |
| | | if (query.getGoodsName() != null && !query.getGoodsName().isEmpty()) { |
| | |
| | | TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | |
| | | // *** |
| | | if(Objects.isNull(crmSupplier)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmSupplier = crmSupplierService.getById(sysUser.getObjectId()); |
| | | } |
| | | if(crmSupplier.getIsAddPointsGoods() == 2){ |
| | | return R.fail("当前供应商已禁止添加积分商品"); |
| | | } |
| | |
| | | TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmSupplier)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmSupplier = crmSupplierService.getById(sysUser.getObjectId()); |
| | | } |
| | | goods.setSupplierId(crmSupplier.getId()); |
| | | sysGoodsService.updateById(goods); |
| | | return R.ok(goods.getId()); |
| | |
| | | TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmSupplier)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmSupplier = crmSupplierService.getById(sysUser.getObjectId()); |
| | | } |
| | | TSysGoods goods = sysGoodsService.getById(id); |
| | | if (goods.getSupplierId().equals(crmSupplier.getId())) { |
| | | sysGoodsService.removeById(id); |
| | |
| | | TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmSupplier)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmSupplier = crmSupplierService.getById(sysUser.getObjectId()); |
| | | } |
| | | TSysGoods goods = sysGoodsService.getById(dto.getId()); |
| | | if (goods.getSupplierId().equals(crmSupplier.getId())) { |
| | | goods.setStatus(dto.getState()); |
| | |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // --- |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | List<TCrmClinicPoints> list = crmClinicPointsService.list(new LambdaQueryWrapper<TCrmClinicPoints>().eq(TCrmClinicPoints::getClinicId, crmClinic.getId()).ge(TCrmClinicPoints::getExpireTime, new Date()).last(" and points > use_points")); |
| | | map.put("myPoints", list.stream().mapToInt(item -> item.getPoints() - item.getUsePoints()).sum()); |
| | | } |
| | |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // --- |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | sysGoodsService.exchangeGoods(crmClinic, dto); |
| | | return R.ok(); |
| | | } |
| | |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // --- |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | |
| | | LambdaQueryWrapper<TSysGoodsExchange> eq = new LambdaQueryWrapper<TSysGoodsExchange>().eq(TSysGoodsExchange::getClinicId, crmClinic.getId()); |
| | | if (query.getName() != null && !query.getName().isEmpty()) { |
| | |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // --- |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | TSysGoodsExchange exchangeServiceById = sysGoodsExchangeService.getById(id); |
| | | if (exchangeServiceById.getClinicId().equals(crmClinic.getId())) { |
| | | ExchangeGoodsRecordDetailVo vo = new ExchangeGoodsRecordDetailVo(); |
| | |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // --- |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | LambdaQueryWrapper<TCrmChangePoints> eq = new LambdaQueryWrapper<TCrmChangePoints>().eq(TCrmChangePoints::getBranchSalespersonId, crmClinic.getId()).eq(TCrmChangePoints::getUserType, 3); |
| | | if (query.getChangeReason() != null) { |
| | | eq.eq(TCrmChangePoints::getChangeReason, query.getChangeReason()); |
| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.model.TCrmClinic; |
| | | import com.ruoyi.system.model.TSysInspection; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import com.ruoyi.system.service.TCrmClinicService; |
| | | import com.ruoyi.system.service.TSysInspectionService; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | private final TSysInspectionService sysInspectionService; |
| | | private final TokenService tokenService; |
| | | private final TCrmClinicService crmClinicService; |
| | | private final ISysUserService sysUserService; |
| | | @Autowired |
| | | public TSysInspectionController(TSysInspectionService sysInspectionService, TokenService tokenService, TCrmClinicService crmClinicService) { |
| | | public TSysInspectionController(TSysInspectionService sysInspectionService, TokenService tokenService, TCrmClinicService crmClinicService, ISysUserService sysUserService) { |
| | | this.sysInspectionService = sysInspectionService; |
| | | this.tokenService = tokenService; |
| | | this.crmClinicService = crmClinicService; |
| | | this.sysUserService = sysUserService; |
| | | } |
| | | |
| | | // /** |
| | |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | // --- |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(userId); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | dto.setClinicId(crmClinic.getId()); |
| | | return R.ok(sysInspectionService.save(dto)); |
| | | } |
| | |
| | | import com.ruoyi.system.model.TSysOrderGoods; |
| | | import com.ruoyi.system.query.TSysAppUserQuery; |
| | | import com.ruoyi.system.query.TSysOrderQuery; |
| | | import com.ruoyi.system.service.TCrmClinicService; |
| | | import com.ruoyi.system.service.TSysAppUserService; |
| | | import com.ruoyi.system.service.TSysOrderGoodsService; |
| | | import com.ruoyi.system.service.TSysOrderService; |
| | | import com.ruoyi.system.service.*; |
| | | import com.ruoyi.system.vo.TSysOrderDetailVo; |
| | | import com.ruoyi.system.vo.TSysOrderPageVo; |
| | | import io.swagger.annotations.Api; |
| | |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | private final TCrmClinicService crmClinicService; |
| | | private final TSysAppUserService sysAppUserService; |
| | | private final TSysOrderGoodsService sysOrderGoodsService; |
| | | private final ISysUserService sysUserService; |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | public TSysOrderController(TokenService tokenService, TSysOrderService sysOrderService, TCrmClinicService crmClinicService, TSysAppUserService sysAppUserService, TSysOrderGoodsService sysOrderGoodsService) { |
| | | public TSysOrderController(TokenService tokenService, TSysOrderService sysOrderService, TCrmClinicService crmClinicService, TSysAppUserService sysAppUserService, TSysOrderGoodsService sysOrderGoodsService, ISysUserService sysUserService) { |
| | | this.sysOrderService = sysOrderService; |
| | | this.tokenService = tokenService; |
| | | this.crmClinicService = crmClinicService; |
| | | this.sysAppUserService = sysAppUserService; |
| | | this.sysOrderGoodsService = sysOrderGoodsService; |
| | | |
| | | this.sysUserService = sysUserService; |
| | | } |
| | | |
| | | /** |
| | |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // --- |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | query.setClinicId(crmClinic.getId()); |
| | | } |
| | | return R.ok(sysOrderService.pageList(query)); |
| | |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // --- |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | sysOrderService.add(dto,crmClinic,user.getNickName(),user.getUserId().toString()); |
| | | return R.ok("添加成功"); |
| | | } |
| | |
| | | @Autowired |
| | | private TCrmClinicService crmClinicService; |
| | | |
| | | private final ISysUserService sysUserService; |
| | | |
| | | public SysUserController(ISysUserService sysUserService) { |
| | | this.sysUserService = sysUserService; |
| | | } |
| | | |
| | | /** |
| | | * 获取用户列表 |
| | | */ |
| | |
| | | TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmSupplier)){ |
| | | SysUser sysUser = sysUserService.selectUserById(userId); |
| | | crmSupplier = crmSupplierService.getById(sysUser.getObjectId()); |
| | | } |
| | | query.setObjectId(crmSupplier.getId()); |
| | | } |
| | | if(roleType == 5){ |
| | |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | // --- |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(userId); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | query.setObjectId(crmClinic.getId()); |
| | | } |
| | | PageInfo<SysUserVO> list = userService.pageList(query); |
| | |
| | | TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmSupplier)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmSupplier = crmSupplierService.getById(sysUser.getObjectId()); |
| | | } |
| | | user.setObjectId(crmSupplier.getId()); |
| | | } |
| | | if(roleType == 5){ |
| | |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | // --- |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicService.getById(sysUser.getObjectId()); |
| | | } |
| | | user.setObjectId(crmClinic.getId()); |
| | | } |
| | | user.setRoleType(roleType); |
| | |
| | | import com.ruoyi.system.mapper.*; |
| | | import com.ruoyi.system.model.*; |
| | | import com.ruoyi.system.query.*; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import com.ruoyi.system.service.TCrmSupplierService; |
| | | import com.ruoyi.system.service.TErpClinicWarehousingService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.system.vo.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Propagation; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | @Resource |
| | | private TCrmSupplierMapper crmSupplierMapper; |
| | | |
| | | @Autowired |
| | | private ISysUserService sysUserService; |
| | | |
| | | |
| | | @Override |
| | | public PageInfo<PageInventoryListVo> pageInventoryList(TErpInventoryQuery query, SysUser user) { |
| | |
| | | TCrmClinic crmClinic = crmClinicMapper.selectOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicMapper.selectById(sysUser.getObjectId()); |
| | | } |
| | | supplierClinicId = crmClinic.getId(); |
| | | } |
| | | String sTime = null; |
| | |
| | | TCrmClinic crmClinic = crmClinicMapper.selectOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicMapper.selectById(sysUser.getObjectId()); |
| | | } |
| | | supplierClinicId = crmClinic.getId(); |
| | | } |
| | | // 获取当前时间后1个月的时间 |
| | |
| | | import com.ruoyi.system.mapper.*; |
| | | import com.ruoyi.system.model.*; |
| | | import com.ruoyi.system.query.*; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import com.ruoyi.system.service.TErpGoodsService; |
| | | import com.ruoyi.system.service.TErpSupplierInventoryGoodsService; |
| | | import com.ruoyi.system.vo.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Propagation; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | |
| | | @Resource |
| | | private TErpProcurementMapper erpProcurementMapper; |
| | | |
| | | @Autowired |
| | | private ISysUserService sysUserService; |
| | | |
| | | |
| | | |
| | |
| | | TCrmSupplier crmSupplier = crmSupplierMapper.selectOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmSupplier)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmSupplier = crmSupplierMapper.selectById(sysUser.getObjectId()); |
| | | } |
| | | supplierClinicId =crmSupplier.getId(); |
| | | } |
| | | if(roleType == 5){ |
| | |
| | | TCrmClinic crmClinic = crmClinicMapper.selectOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicMapper.selectById(sysUser.getObjectId()); |
| | | } |
| | | supplierClinicId =crmClinic.getId(); |
| | | } |
| | | |
| | |
| | | TCrmSupplier crmSupplier = crmSupplierMapper.selectOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmSupplier)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmSupplier = crmSupplierMapper.selectById(sysUser.getObjectId()); |
| | | } |
| | | supplierClinicId =crmSupplier.getId(); |
| | | } |
| | | if(roleType == 5){ |
| | |
| | | TCrmClinic crmClinic = crmClinicMapper.selectOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicMapper.selectById(sysUser.getObjectId()); |
| | | } |
| | | supplierClinicId =crmClinic.getId(); |
| | | } |
| | | |
| | |
| | | TCrmSupplier crmSupplier = crmSupplierMapper.selectOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmSupplier)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmSupplier = crmSupplierMapper.selectById(sysUser.getObjectId()); |
| | | } |
| | | supplierClinicId =crmSupplier.getId(); |
| | | } |
| | | if(roleType == 5){ |
| | |
| | | TCrmClinic crmClinic = crmClinicMapper.selectOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicMapper.selectById(sysUser.getObjectId()); |
| | | } |
| | | supplierClinicId =crmClinic.getId(); |
| | | } |
| | | |
| | |
| | | TCrmSupplier crmSupplier = crmSupplierMapper.selectOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmSupplier)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmSupplier = crmSupplierMapper.selectById(sysUser.getObjectId()); |
| | | } |
| | | supplierClinicId =crmSupplier.getId(); |
| | | } |
| | | if(roleType == 5){ |
| | |
| | | TCrmClinic crmClinic = crmClinicMapper.selectOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicMapper.selectById(sysUser.getObjectId()); |
| | | } |
| | | supplierClinicId =crmClinic.getId(); |
| | | } |
| | | |
| | |
| | | TCrmSupplier crmSupplier = crmSupplierMapper.selectOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmSupplier)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmSupplier = crmSupplierMapper.selectById(sysUser.getObjectId()); |
| | | } |
| | | supplierClinicId =crmSupplier.getId(); |
| | | } |
| | | if(roleType == 5){ |
| | |
| | | TCrmClinic crmClinic = crmClinicMapper.selectOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicMapper.selectById(sysUser.getObjectId()); |
| | | } |
| | | supplierClinicId =crmClinic.getId(); |
| | | } |
| | | TErpSupplierInventory tErpSupplierInventory = new TErpSupplierInventory(); |
| | |
| | | TCrmSupplier crmSupplier = crmSupplierMapper.selectOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmSupplier)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmSupplier = crmSupplierMapper.selectById(sysUser.getObjectId()); |
| | | } |
| | | supplierClinicId =crmSupplier.getId(); |
| | | } |
| | | if(roleType == 5){ |
| | |
| | | TCrmClinic crmClinic = crmClinicMapper.selectOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicMapper.selectById(sysUser.getObjectId()); |
| | | } |
| | | supplierClinicId =crmClinic.getId(); |
| | | } |
| | | TErpClinicInventory tErpSupplierInventory = new TErpClinicInventory(); |
| | |
| | | import com.ruoyi.system.mapper.*; |
| | | import com.ruoyi.system.model.*; |
| | | import com.ruoyi.system.query.TErpMaintenanceReminderQuery; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import com.ruoyi.system.service.TErpMaintenanceReminderService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.system.vo.TErpMaintenanceReminderDetailVo; |
| | | import com.ruoyi.system.vo.TErpMaintenanceReminderListVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | @Resource |
| | | private TCrmSupplierMapper crmSupplierMapper; |
| | | |
| | | @Autowired |
| | | private ISysUserService sysUserService; |
| | | |
| | | @Override |
| | | public PageInfo<TErpMaintenanceReminderListVo> pageList(TErpMaintenanceReminderQuery query, SysUser user) { |
| | | Integer roleType = user.getRoleType(); |
| | |
| | | TCrmSupplier crmSupplier = crmSupplierMapper.selectOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmSupplier)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmSupplier = crmSupplierMapper.selectById(sysUser.getObjectId()); |
| | | } |
| | | supplierClinicId =crmSupplier.getId(); |
| | | } |
| | | if(roleType == 5){ |
| | |
| | | TCrmClinic crmClinic = crmClinicMapper.selectOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicMapper.selectById(sysUser.getObjectId()); |
| | | } |
| | | supplierClinicId =crmClinic.getId(); |
| | | } |
| | | PageInfo<TErpMaintenanceReminderListVo> page = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | |
| | | import com.ruoyi.system.query.PerformanceReportQuery; |
| | | import com.ruoyi.system.query.TErpGoodsQuery; |
| | | import com.ruoyi.system.query.TErpProcurementQuery; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import com.ruoyi.system.service.TErpGoodsService; |
| | | import com.ruoyi.system.service.TErpProcurementGoodsService; |
| | | import com.ruoyi.system.service.TErpProcurementService; |
| | |
| | | @Resource |
| | | private TErpProcurementCommissionMapper erpProcurementCommissionMapper; |
| | | |
| | | @Autowired |
| | | private ISysUserService sysUserService; |
| | | |
| | | |
| | | @Override |
| | | public PageInfo<TErpProcurementVo> pageList(TErpProcurementQuery query, SysUser user) { |
| | |
| | | TCrmSupplier crmSupplier = crmSupplierMapper.selectOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmSupplier)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmSupplier = crmSupplierMapper.selectById(sysUser.getObjectId()); |
| | | } |
| | | supplierClinicId = crmSupplier.getId(); |
| | | } |
| | | if (roleType == 5) { |
| | |
| | | TCrmClinic crmClinic = crmClinicMapper.selectOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicMapper.selectById(sysUser.getObjectId()); |
| | | } |
| | | supplierClinicId = crmClinic.getId(); |
| | | } |
| | | |
| | |
| | | TCrmSupplier crmSupplier = crmSupplierMapper.selectOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmSupplier)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmSupplier = crmSupplierMapper.selectById(sysUser.getObjectId()); |
| | | } |
| | | supplierClinicId = crmSupplier.getId(); |
| | | } |
| | | if (roleType == 5) { |
| | |
| | | TCrmClinic crmClinic = crmClinicMapper.selectOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicMapper.selectById(sysUser.getObjectId()); |
| | | } |
| | | supplierClinicId = crmClinic.getId(); |
| | | } |
| | | |
| | |
| | | import com.ruoyi.system.query.TErpGoodsWarehouseQuery; |
| | | import com.ruoyi.system.query.TErpInventoryQuery; |
| | | import com.ruoyi.system.query.ValidityPeriodWarningQuery; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import com.ruoyi.system.service.TCrmClinicService; |
| | | import com.ruoyi.system.service.TCrmSupplierService; |
| | | import com.ruoyi.system.service.TErpSupplierWarehousingService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.system.vo.*; |
| | | import org.apache.poi.ss.formula.functions.T; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Propagation; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | @Resource |
| | | private TCrmSupplierMapper crmSupplierMapper; |
| | | |
| | | @Autowired |
| | | private ISysUserService sysUserService; |
| | | @Override |
| | | public PageInfo<TErpGoodsVO> pageList(TErpGoodsQuery query, SysUser user) { |
| | | PageInfo<TErpGoodsVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | |
| | | TCrmSupplier crmSupplier = crmSupplierMapper.selectOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmSupplier)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmSupplier = crmSupplierMapper.selectById(sysUser.getObjectId()); |
| | | } |
| | | supplierClinicId =crmSupplier.getId(); |
| | | } |
| | | if(roleType == 5){ |
| | |
| | | TCrmClinic crmClinic = crmClinicMapper.selectOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicMapper.selectById(sysUser.getObjectId()); |
| | | } |
| | | |
| | | supplierClinicId =crmClinic.getId(); |
| | | } |
| | | |
| | |
| | | TCrmSupplier crmSupplier = crmSupplierMapper.selectOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmSupplier)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmSupplier = crmSupplierMapper.selectById(sysUser.getObjectId()); |
| | | } |
| | | supplierClinicId =crmSupplier.getId(); |
| | | } |
| | | if(roleType == 5){ |
| | |
| | | TCrmClinic crmClinic = crmClinicMapper.selectOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicMapper.selectById(sysUser.getObjectId()); |
| | | } |
| | | supplierClinicId =crmClinic.getId(); |
| | | } |
| | | query.setSupplierClinicId(supplierClinicId); |
| | |
| | | TCrmSupplier crmSupplier = crmSupplierMapper.selectOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmSupplier)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmSupplier = crmSupplierMapper.selectById(sysUser.getObjectId()); |
| | | } |
| | | supplierClinicId =crmSupplier.getId(); |
| | | } |
| | | if(roleType == 5){ |
| | |
| | | TCrmClinic crmClinic = crmClinicMapper.selectOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicMapper.selectById(sysUser.getObjectId()); |
| | | } |
| | | supplierClinicId =crmClinic.getId(); |
| | | } |
| | | for (WarehousingGoodsDto dto : dtos) { |
| | |
| | | TCrmSupplier crmSupplier = crmSupplierMapper.selectOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmSupplier)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmSupplier = crmSupplierMapper.selectById(sysUser.getObjectId()); |
| | | } |
| | | supplierClinicId =crmSupplier.getId(); |
| | | } |
| | | if(roleType == 5){ |
| | |
| | | TCrmClinic crmClinic = crmClinicMapper.selectOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicMapper.selectById(sysUser.getObjectId()); |
| | | } |
| | | supplierClinicId =crmClinic.getId(); |
| | | } |
| | | // 获取当前时间后9个月的时间 |
| | |
| | | TCrmSupplier crmSupplier = crmSupplierMapper.selectOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmSupplier)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmSupplier = crmSupplierMapper.selectById(sysUser.getObjectId()); |
| | | } |
| | | supplierClinicId =crmSupplier.getId(); |
| | | } |
| | | if(roleType == 5){ |
| | |
| | | TCrmClinic crmClinic = crmClinicMapper.selectOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicMapper.selectById(sysUser.getObjectId()); |
| | | } |
| | | supplierClinicId =crmClinic.getId(); |
| | | } |
| | | String sTime=null; |
| | |
| | | TCrmSupplier crmSupplier = crmSupplierMapper.selectOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmSupplier)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmSupplier = crmSupplierMapper.selectById(sysUser.getObjectId()); |
| | | } |
| | | supplierClinicId =crmSupplier.getId(); |
| | | } |
| | | if(roleType == 5){ |
| | |
| | | TCrmClinic crmClinic = crmClinicMapper.selectOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | // *** |
| | | if(Objects.isNull(crmClinic)){ |
| | | SysUser sysUser = sysUserService.selectUserById(user.getUserId()); |
| | | crmClinic = crmClinicMapper.selectById(sysUser.getObjectId()); |
| | | } |
| | | supplierClinicId =crmClinic.getId(); |
| | | } |
| | | BigDecimal add = new BigDecimal(0); |