diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/impl/LJDutyServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/impl/LJDutyServiceImpl.java index a19d86f62..134b96e34 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/impl/LJDutyServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/member/service/impl/LJDutyServiceImpl.java @@ -40,14 +40,15 @@ public class LJDutyServiceImpl extends ServiceImpl implemen @Override public List selectDutys(TDuty duty) { QueryWrapper queryWrapper = new QueryWrapper<>(); - if (ObjectUtil.isNotEmpty(duty.getStoreId())) { + /*if (ObjectUtil.isNotEmpty(duty.getStoreId())) { SysDept sysDept = sysDeptService.selectParentId(Long.valueOf(duty.getStoreId())); queryWrapper.eq("store_id", sysDept.getDeptId()); }else { AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); SysDept sysDept = sysDeptService.selectParentId(nowAccountInfo.getDeptId()); queryWrapper.eq("store_id", sysDept.getDeptId()); - } + }*/ + queryWrapper.eq("store_id", duty.getStoreId()); return baseMapper.selectList(queryWrapper); } @@ -63,14 +64,15 @@ public class LJDutyServiceImpl extends ServiceImpl implemen @Override public Page selectDutyPage(Page page, TDuty duty) { - if (ObjectUtil.isNotEmpty(duty.getStoreId())){ + /*if (ObjectUtil.isNotEmpty(duty.getStoreId())){ SysDept sysDept = sysDeptService.selectParentId(Long.valueOf(duty.getStoreId())); duty.setStoreId(Math.toIntExact(sysDept.getDeptId())); }else { AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); SysDept sysDept = sysDeptService.selectParentId(nowAccountInfo.getDeptId()); duty.setStoreId(Math.toIntExact(sysDept.getDeptId())); - } + }*/ + duty.setStoreId(duty.getStoreId()); return baseMapper.selectDutyPage(page,duty); } 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 542dbdf9d..bb5c31a93 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 @@ -22,6 +22,7 @@ import javax.swing.*; import java.awt.*; import java.awt.geom.Rectangle2D; import java.awt.image.BufferedImage; +import java.awt.image.RenderedImage; import java.io.*; /** @@ -128,6 +129,58 @@ public class QrCodeUtils { } } + public void createLogoCodePictures(InputStream logoStream, String url, String outImgPath, Integer staffId, Integer storeId,String urls) { + try { + // 读取原图片信息 + //得到文件 +//// File file = ResourceUtils.getFile(roundImage); +// ClassPathResource resource = new ClassPathResource(roundImage); +// ClassPathResource logoResource = new ClassPathResource(logoImage); +// File file = resource.getFile(); + + //文件转化为图片 + // 加水印 + //使用工具类生成二维码 + Image image = createQrCode(logoStream, url, 360, 360); + //将小图片绘到大图片上,500,300 .表示你的小图片在大图片上的位置。 + +// 查询当前店铺信息 + if (ObjectUtils.isNotEmpty(storeId)){ + LJStore store = storeService.selectStoreByStoreId(storeId); +// 查询加油员信息 + LJStaff staff = null; + if (ObjectUtil.isNotEmpty(staffId)){ + staff = staffService.selectStaffById(staffId); + } + LJStaff staff1 = staffService.selectStaffByStoreId(storeId); + }else { + //drawStringWithMultiLine(g,"欢迎光临", bufImg.getWidth()-20,20,940,10 ); + } + + +// // 将码牌编号文字绘制到指定位置 +// g.drawString(storeNumber, 200, 800); + // 输出图片 + String urlsss = "/temp/qrCode/"; + if (ObjectUtils.isNotEmpty(urls)){ + urlsss = urls; + } + File file1 = new File(urlsss); + // 判断目录是否存在 + if (!file1.exists()) { + file1.mkdirs(); + } + + FileOutputStream outImgStream = new FileOutputStream(outImgPath); + ImageIO.write((RenderedImage) image, "jpg", outImgStream); + outImgStream.flush(); + outImgStream.close(); + } catch (Exception e) { + e.printStackTrace(); + } + } + + public Font chineseFont() throws Exception { // 设置中文 Font b = null; diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/tag/service/impl/TagCodeServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/tag/service/impl/TagCodeServiceImpl.java index f401bdfba..9cf8e1b62 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/tag/service/impl/TagCodeServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/tag/service/impl/TagCodeServiceImpl.java @@ -85,14 +85,14 @@ public class TagCodeServiceImpl extends ServiceImpl impl tagCode.setDeptId(Integer.parseInt(nowAccountInfo.getDeptId().toString())); //在图片上生成二维码 - String backgroundImage = "static/qrCodeImg/huanyingguanglin2.jpg"; + String backgroundImage = "static/qrCodeImg/huanyingguanglin.jpg"; InputStream backgroundStream = this.getClass().getClassLoader().getResourceAsStream(backgroundImage); String urls = ""; urls = "/temp/tagCode/"+ DateUtil.formatDate(new Date(), "yyyyMMdd") + "-"+i2; File file1 = new File(urls); // String finalPath="/temp/tagCode/" + "byx"+i1 + ".jpg"; String finalPath=urls+"/" + "byx"+i1 + ".jpg"; - qrCodeUtils.createLogoCodePicture(backgroundStream, null, url, finalPath, null,null,urls); + qrCodeUtils.createLogoCodePictures(null, url, finalPath, null,null,urls); // 判断目录是否存在 @@ -107,13 +107,13 @@ public class TagCodeServiceImpl extends ServiceImpl impl // 返回图片路径 String saveFile = backendFileController.saveFile(resFile); //return saveFile; - tagCode.setImageUrl(finalPath); + tagCode.setImageUrl(saveFile); flag = save(tagCode); } //导出码牌 - //String IMAGE_DIRECTORY = "D:\\temp\\tagCode\\"+DateUtil.formatDate(new Date(), "yyyyMMdd")+"-"+i2; - String IMAGE_DIRECTORY = "/temp/tagCode/"+DateUtil.formatDate(new Date(), "yyyyMMdd")+"-"+i2; + String IMAGE_DIRECTORY = "D:\\temp\\tagCode\\"+DateUtil.formatDate(new Date(), "yyyyMMdd")+"-"+i2; + // String IMAGE_DIRECTORY = "/temp/tagCode/"+DateUtil.formatDate(new Date(), "yyyyMMdd")+"-"+i2; List imageFiles = getImageFiles(IMAGE_DIRECTORY); InputStream zipInputStream = createZipInputStream(imageFiles); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/AccountServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/AccountServiceImpl.java index 05c171728..ca1a272fd 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/AccountServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/AccountServiceImpl.java @@ -283,6 +283,12 @@ public class AccountServiceImpl extends ServiceImpl im tAccount.setAccountName(accountName); tAccount.setAccountStatus(Integer.parseInt(accountStatus)); tAccount.setPassword(password); + if (ObjectUtil.isNotEmpty(param.get("deptType")) && "2".equals(param.get("deptType"))){ + tAccount.setOwnerId(2); + } + if (ObjectUtil.isNotEmpty(param.get("deptType")) && "3".equals(param.get("deptType"))){ + tAccount.setOwnerId(3); + } tAccount.setIsActive(1); tAccount.setLocked(0); if (ObjectUtil.isEmpty(mtStore)) mtStore.setId(0); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendLoginController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendLoginController.java index 4b406b6d7..2c0e0eb5f 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendLoginController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendLoginController.java @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.extension.api.R; import com.fuint.business.member.entity.LJStaff; +import com.fuint.business.member.mapper.LJDutyMapper; import com.fuint.business.member.service.ILJStaffService; import com.fuint.business.storeInformation.entity.LJStore; import com.fuint.business.storeInformation.service.ILJStoreService; @@ -87,6 +88,9 @@ public class BackendLoginController extends BaseController { @Autowired public RedisTemplate redisTemplate; + @Resource + private LJDutyMapper ljDutyMapper; + /** * 后台登录 * */ @@ -100,6 +104,11 @@ public class BackendLoginController extends BaseController { String captchaCode = loginRequest.getCaptchaCode(); String uuid = loginRequest.getUuid(); + //不知道是哪个平台过来的请求 + /*LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(TAccount::getAccountName, accountName); + ljDutyMapper*/ + Boolean captchaVerify = captchaService.checkCodeByUuid(captchaCode, uuid); if (!captchaVerify) { return getFailureResult(201,"图形验证码有误");