| | |
| | | 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; |
| | |
| | | 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) { |