diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/entity/Const.java b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/entity/Const.java index c69471fc9..fc1531ef8 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/entity/Const.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/entity/Const.java @@ -49,8 +49,8 @@ public class Const { public static String NOTIFY_PUBLIC_KEYS="MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCbBAl3xSB7YeUnze4yYZmnTeT7OtXZr0sP10TsDVRH2SY/VEjgS9KPmHMmVeKZT3+6xKsUvulgVyie46GGtZPrnoh+glF1gzsYAXJ7dvR/R5nYO5VvfwK/ChPFTiKhbTtO4OKtchgBZuqCbsemG+gFIiVJo37dY0Kg0zISmFHdOQIDAQAB"; //异步通知(回调地址) - public static String notify_url = "https://www.tuofeng.cc/oilAdmin/api/fyPay/notify"; -// public static String notify_url = "https://8q4f124343.yicp.fun/api/fyPay/notify"; +// public static String notify_url = "https://www.tuofeng.cc/oilAdmin/api/fyPay/notify"; + public static String notify_url = "https://8q4f124343.yicp.fun/api/fyPay/notify"; //下单 public static String fuiou_21_url = "https://fundwx.fuiou.com/preCreate"; diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeDiscount/vo/ActiveConsumptionVO.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeDiscount/vo/ActiveConsumptionVO.java index d67709986..2a1f4d437 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeDiscount/vo/ActiveConsumptionVO.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeDiscount/vo/ActiveConsumptionVO.java @@ -11,6 +11,8 @@ public class ActiveConsumptionVO implements Serializable { private Integer activeId; //活动名称 private String activeName; + //适用会员类型 0:全部用户 1:全部会员 2:等级会员 + private String adaptUserType; //适用会员 private String adaptUser; //可用油品 diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/service/impl/ActiveExchangeServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/service/impl/ActiveExchangeServiceImpl.java index 7cb46f4f7..2e19ea5a2 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/service/impl/ActiveExchangeServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/activeExchange/service/impl/ActiveExchangeServiceImpl.java @@ -841,8 +841,9 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService { UserBalance userBalance1 = new UserBalance(); if (CollectionUtils.isNotEmpty(activeConsumptionVOS)){ for (ActiveConsumptionVO activeConsumptionVO : activeConsumptionVOS) { - if (activeConsumptionVO.getOilId().contains(paymentActiveDTO.getOilId().toString()) && - activeConsumptionVO.getAdaptUser().contains(paymentActiveDTO.getMtUserLevel().toString())){ + if (activeConsumptionVO.getAdaptUserType().equals("2") && activeConsumptionVO.getOilId().contains(paymentActiveDTO.getOilId().toString()) && + activeConsumptionVO.getAdaptUser().contains(paymentActiveDTO.getMtUserLevel().toString()) || activeConsumptionVO.getAdaptUserType().equals("0") && activeConsumptionVO.getOilId().contains(paymentActiveDTO.getOilId().toString()) + || activeConsumptionVO.getAdaptUserType().equals("1") && activeConsumptionVO.getOilId().contains(paymentActiveDTO.getOilId().toString()) && StringUtils.isNotEmpty(paymentActiveDTO.getMtUserLevel().toString())){ //如果满足条件/给当前用户加积分 //用户 (新用户新建 老用户叠加) if (ObjectUtils.isNotEmpty(userBalance)){ @@ -861,7 +862,7 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService { userBalanceService.save(userBalance1); } //优惠券 - if (activeConsumptionVO.getActiveGift().equals("1")){ + if (StringUtils.isNotEmpty(activeConsumptionVO.getActiveGift()) && activeConsumptionVO.getActiveGift().equals("1")){ CardFavorableRecord cardFavorableRecord = new CardFavorableRecord(); cardFavorableRecord.setCardFavorableId(activeConsumptionVO.getVouchersId()); cardFavorableRecord.setStoreId(storeId1); @@ -872,7 +873,7 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService { cardFavorableRecord.setExchangeFrom("充值送券"); cardFavorableRecordService.addCardFavorableRecord(cardFavorableRecord); //兑换券 - }else if (activeConsumptionVO.getActiveGift().equals("2")){ + }else if (StringUtils.isNotEmpty(activeConsumptionVO.getActiveGift()) && activeConsumptionVO.getActiveGift().equals("2")){ CardExchangeRecord cardExchangeRecord = new CardExchangeRecord(); cardExchangeRecord.setCardExchangeId(activeConsumptionVO.getVouchersId()); cardExchangeRecord.setStoreId(storeId1); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/impl/CardFavorableRecordServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/impl/CardFavorableRecordServiceImpl.java index 82b36d48f..454ce5720 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/impl/CardFavorableRecordServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardFavorable/service/impl/CardFavorableRecordServiceImpl.java @@ -232,17 +232,24 @@ public class CardFavorableRecordServiceImpl extends ServiceImpl couponVOS = cardFavorableRecordMapper.selectAllByCondition(page,cardFavorableDTOS); List records = couponVOS.getRecords(); //有效期 - List collect = records.stream().filter(s -> s.getEndTime().getTime() > System.currentTimeMillis()).collect(Collectors.toList()); + List collect = records.stream().filter(s -> s.getEndTime().getTime() < System.currentTimeMillis()).collect(Collectors.toList()); if (ObjectUtils.isNotEmpty(collect)){ for (CouponVO couponVO : collect) { CardFavorableRecord cardFavorableRecord = new CardFavorableRecord(); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/mapper/xml/CardValueRecordMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/mapper/xml/CardValueRecordMapper.xml index 78840bf86..74f2a0fa9 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/mapper/xml/CardValueRecordMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValue/mapper/xml/CardValueRecordMapper.xml @@ -66,7 +66,7 @@ combined_result.mtUserId, combined_result.storeId, combined_result.OilName, - combined_result.type + combined_result.type, combined_result.paymentType FROM (SELECT '储值卡' AS recordName,payment_type paymentType,mt_user_id mtUserId, recharge_balance rechargeBalance, gift_balance obtain, fringe_benefit oilName,royalty_type type,create_time createTime, chain_store_id chainStoreId, store_id storeId FROM card_value_record diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/impl/LJStaffServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/impl/LJStaffServiceImpl.java index 7e17b4aec..2e3698fa5 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/impl/LJStaffServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/impl/LJStaffServiceImpl.java @@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.fuint.business.member.entity.LJStaff; import com.fuint.business.member.mapper.LJStaffMapper; import com.fuint.business.member.service.ILJStaffService; +import com.fuint.business.member.utils.QrCodeUtils; import com.fuint.business.storeInformation.entity.LJStore; import com.fuint.business.storeInformation.service.ILJStoreService; import com.fuint.common.dto.AccountInfo; @@ -28,10 +29,7 @@ import org.springframework.stereotype.Service; import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletRequest; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; +import java.io.*; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; @@ -240,15 +238,20 @@ public class LJStaffServiceImpl extends ServiceImpl impl LJStaff staff = this.selectStaffById(id); LJStore store = storeService.selectStoreByStoreId(staff.getStoreId()); //在图片上生成二维码 - String backgroundImage = "/static/qrCodeImg/laigeyouhui_bg.jpg"; - String logoImage = "/static/qrCodeImg/logo.png"; -// String backgroundImage = env.getProperty("staff.bg"); -// String logoImage = env.getProperty("staff.logo"); + String backgroundImage = "static/qrCodeImg/laigeyouhui_bg.jpg"; + String logoImage = "static/qrCodeImg/logo.png"; String url = staff.getStaffCode(); String area = store.getName(); - String finalPath="D:/ruoyi/qrCode/" + area + ".jpg"; + String finalPath="/temp/qrCode/" + area + ".jpg"; + InputStream backgroundStream = this.getClass().getClassLoader().getResourceAsStream(backgroundImage); + InputStream logoStream = this.getClass().getClassLoader().getResourceAsStream(logoImage); //背景图片路径 loge图片 二维码 输出地址 - createLogoCodePicture(backgroundImage, logoImage, url, finalPath, area,store.getAddress()); + createLogoCodePicture(backgroundStream, logoStream, url, finalPath, area,store.getAddress()); + File file1 = new File("/temp/qrCode/"); + // 判断目录是否存在 + if (!file1.exists()) { + file1.mkdir(); + } File file =new File(finalPath); FileInputStream fileInputStream =new FileInputStream(file); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/utils/QrCodeUtils.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/utils/QrCodeUtils.java index 53ff5f92c..b79f89775 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/utils/QrCodeUtils.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/utils/QrCodeUtils.java @@ -9,10 +9,7 @@ import org.springframework.util.ResourceUtils; import javax.imageio.ImageIO; import java.awt.*; import java.awt.image.BufferedImage; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; +import java.io.*; /** * @Description: QrCodeUtils @@ -24,16 +21,17 @@ public class QrCodeUtils { /*** * 在一张背景图上添加二维码 */ - public static void createLogoCodePicture(String roundImage, String logoImage, String url, String outImgPath, String storeName, String storeNumber) { + public static void createLogoCodePicture(InputStream backgroundStream, InputStream logoStream, String url, String outImgPath, String storeName, String storeNumber) { try { // 读取原图片信息 //得到文件 -// File file = ResourceUtils.getFile(roundImage); - ClassPathResource resource = new ClassPathResource(roundImage); - ClassPathResource logoResource = new ClassPathResource(logoImage); - File file = resource.getFile(); +//// File file = ResourceUtils.getFile(roundImage); +// ClassPathResource resource = new ClassPathResource(roundImage); +// ClassPathResource logoResource = new ClassPathResource(logoImage); +// File file = resource.getFile(); + //文件转化为图片 - Image srcImg = ImageIO.read(file); + Image srcImg = ImageIO.read(backgroundStream); //获取图片的宽 int srcImgWidth = srcImg.getWidth(null); //获取图片的高 @@ -43,7 +41,7 @@ public class QrCodeUtils { Graphics2D g = bufImg.createGraphics(); g.drawImage(srcImg, 0, 0, srcImgWidth, srcImgHeight, null); //使用工具类生成二维码 - Image image = createQrCode(logoResource.getFile().toString(), url, 360, 360); + Image image = createQrCode(logoStream, url, 360, 360); //将小图片绘到大图片上,500,300 .表示你的小图片在大图片上的位置。 g.drawImage(image, 260, 320, null); // 设置字体,样式,字体大小 @@ -56,6 +54,11 @@ public class QrCodeUtils { // g.drawString(storeNumber, 200, 800); g.dispose(); // 输出图片 + File file1 = new File("/temp/qrCode/"); + // 判断目录是否存在 + if (!file1.exists()) { + file1.mkdir(); + } FileOutputStream outImgStream = new FileOutputStream(outImgPath); ImageIO.write(bufImg, "jpg", outImgStream); @@ -69,31 +72,30 @@ public class QrCodeUtils { /** * 将字符串转为二维码 * - * @param roundImage * @param url * @param width * @param height * @return * @throws IOException */ - private static BufferedImage createQrCode(String roundImage, String url, int width, int height) throws IOException { + private static BufferedImage createQrCode(InputStream logoStream, String url, int width, int height) throws IOException { QrConfig config = new QrConfig(width, height); - Image image = ImageIO.read(new FileInputStream(roundImage)); + Image image = ImageIO.read(logoStream); config.setImg(image); config.setMargin(1); config.setErrorCorrection(ErrorCorrectionLevel.H); return QrCodeUtil.generate(url, config); } - public static void main(String[] args) { - //在图片上生成二维码 - String backgroundImage = "D:/ruoyi/qrCode/laigeyouhui_bg.jpg"; - String logoImage = "D:/ruoyi/qrCode/logo.png"; - String url = "https://www.baidu.com"; - String area = "来个油慧测试店铺"; - String room = "lgyh15487"; - String outImgPath = "D:/ruoyi/qrCode/" + area + ".jpg"; - //背景图片路径 loge图片 二维码 输出地址 病区 病房号 床号 - createLogoCodePicture(backgroundImage, logoImage, url, outImgPath, area, room); - } +// public static void main(String[] args) { +// //在图片上生成二维码 +// String backgroundImage = "D:/ruoyi/qrCode/laigeyouhui_bg.jpg"; +// String logoImage = "D:/ruoyi/qrCode/logo.png"; +// String url = "https://www.baidu.com"; +// String area = "来个油慧测试店铺"; +// String room = "lgyh15487"; +// String outImgPath = "D:/ruoyi/qrCode/" + area + ".jpg"; +// //背景图片路径 loge图片 二维码 输出地址 病区 病房号 床号 +// createLogoCodePicture(backgroundImage, logoImage, url, outImgPath, area, room); +// } } \ No newline at end of file diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/OilOrderMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/OilOrderMapper.xml index e657dc60e..c9eed705b 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/OilOrderMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/OilOrderMapper.xml @@ -459,13 +459,16 @@ ac.adapt_oil oilId, ac.points points, ac.participation_condition_money amount, + ac.adapt_user_type adaptUserType, acc.active_gift activeGift, acc.vouchers_id vouchersId FROM active_consumption ac LEFT JOIN active_consumption_child acc ON ac.id = acc.active_consumption_id where ac.store_id = #{storeId} + and ac.status = 0 and ac.participation_condition_money <= #{amount} + group by ac.id