| | |
| | | content.append("</body></html>"); |
| | | |
| | | try { |
| | | EmailSend.sendArrivalEmail(revicerList,content.toString()); |
| | | EmailSend.sendArrivalEmail(revicerList,content.toString(),"-待补货试剂"); |
| | | // 发送成功,更新邮件发送状态为:已发送 |
| | | } catch (BusinessException e) { |
| | | // 发送失败,更新邮件发送状态为:发送失败 |
| | |
| | | * @date 2021/8/19 9:06 |
| | | */ |
| | | @Scheduled(cron = "0 0 2 * * ?") |
| | | // @Scheduled(cron = "0/5 * * * * ?") //每隔5秒执行一次 |
| | | public void ReagentPriceSend(){ |
| | | //0.限制在姑苏实验室 |
| | | if (StringUtils.isBlank(reagentApi) || reagentApi.length() == 0) return; |
| | |
| | | if (admin == null ||StringUtils.isBlank(admin.getEmail())) throw new BusinessException(ExceptionEnumCode.PARAM_NULL,"找不到管理员或者管理员邮箱信息"); |
| | | |
| | | //2.获取国药试剂 |
| | | String supplierId = sysSupplierService.getSysSupplierIdByname(send_supplier_name); |
| | | if (StringUtils.isBlank(supplierId)) |
| | | Long supplierId = sysSupplierService.getSysSupplierIdByname(send_supplier_name); |
| | | if (supplierId==null) |
| | | throw new BusinessException(ExceptionEnumCode.PARAM_NO_EXIST, "没有找到与(" + send_supplier_name + ")相关供应商,请检查最近信息更新"); |
| | | |
| | | List<SysReagent> guoyao_reagents = sysReagentService.getSysReagentListNew(null, null, supplierId, 1, null, null, null); |
| | |
| | | BigDecimal goodsCostPrice = goodJson.getBigDecimal("goodsCostPrice"); |
| | | BigDecimal price = reagent.getPrice(); |
| | | //保留两位 |
| | | BigDecimal price_afterDiscount = SALE_85.multiply(price).setScale(2, RoundingMode.HALF_UP); |
| | | if (price_afterDiscount.compareTo(goodsCostPrice) != 0) { |
| | | BigDecimal price_afterDiscount = SALE_85.multiply(goodsCostPrice).setScale(2, RoundingMode.HALF_UP); |
| | | if (price_afterDiscount.compareTo(price) > 0) { |
| | | sendDataList.add(new JSONObject() {{ |
| | | put("goodsName", goodsName); |
| | | put("goodsCostPrice", goodsCostPrice); |
| | |
| | | |
| | | |
| | | //发送邮件 |
| | | EmailSend.sendArrivalEmail(Collections.singletonList(admin.getEmail()),content.toString()); |
| | | EmailSend.sendArrivalEmail(Collections.singletonList(admin.getEmail()),content.toString(),"-国药试剂价格变动"); |
| | | // 发送成功,更新邮件发送状态为:已发送 |
| | | |
| | | } catch (BusinessException e) { |