| | |
| | | import com.ruoyi.system.model.*; |
| | | import com.ruoyi.system.query.TErpGoodsQuery; |
| | | import com.ruoyi.system.query.TErpGoodsWarehouseQuery; |
| | | import com.ruoyi.system.query.ValidityPeriodWarningQuery; |
| | | import com.ruoyi.system.service.TErpSupplierWarehousingService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.system.vo.TErpGoodsVO; |
| | | import com.ruoyi.system.vo.TErpGoodsWarehouseLastVO; |
| | | import com.ruoyi.system.vo.TErpGoodsWarehouseRecordLastVO; |
| | | import com.ruoyi.system.vo.TErpGoodsWarehouseVO; |
| | | import com.ruoyi.system.vo.*; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | |
| | | |
| | | @Resource |
| | | private TCrmWarehouseMapper crmWarehouseMapper; |
| | | |
| | | @Resource |
| | | private TErpMaintenanceReminderMapper tErpMaintenanceReminderMapper; |
| | | |
| | | |
| | | @Override |
| | |
| | | tErpSupplierWarehousingBatch.setProductionDate(warehousingGoodsNextDto.getProductionDate().atStartOfDay()); |
| | | tErpSupplierWarehousingBatch.setExpiryDate(warehousingGoodsNextDto.getExpiryDate().atStartOfDay()); |
| | | erpSupplierWarehousingBatchMapper.insert(tErpSupplierWarehousingBatch); |
| | | |
| | | if(goods.getMaintenanceInterval()!=null){ |
| | | TErpMaintenanceReminder tErpMaintenanceReminder = new TErpMaintenanceReminder(); |
| | | tErpMaintenanceReminder.setClinicSupplierId(user.getUserId().toString()); |
| | | tErpMaintenanceReminder.setMaintenanceType(1); |
| | | tErpMaintenanceReminder.setWarehousingBatchId(tErpSupplierWarehousingBatch.getId()); |
| | | Integer day = Integer.valueOf(goods.getMaintenanceInterval()); |
| | | // 当前时间+day天 |
| | | LocalDateTime time1 = LocalDateTime.now().plusDays(day); |
| | | tErpMaintenanceReminder.setMaintenanceTime(time1); |
| | | tErpMaintenanceReminderMapper.insert(tErpMaintenanceReminder); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public PageInfo<ValidityPeriodWarningVo> validityPeriodWarning(ValidityPeriodWarningQuery query, SysUser user) { |
| | | // 获取当前时间后9个月的时间 |
| | | LocalDateTime nineMonthLater = LocalDateTime.now().plusMonths(9); |
| | | |
| | | PageInfo<ValidityPeriodWarningVo> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | return this.baseMapper.validityPeriodWarning(pageInfo,query,user,nineMonthLater); |
| | | |
| | | |
| | | } |
| | | } |