|
@@ -3,7 +3,6 @@ package com.gree.mall.miniapp.logic.policy;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
-import cn.hutool.core.io.FileUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
@@ -12,6 +11,7 @@ import com.gree.mall.miniapp.bean.policy.PolicyDetail;
|
|
|
import com.gree.mall.miniapp.bean.policy.PolicyOrderDetail;
|
|
|
import com.gree.mall.miniapp.bean.policy.WorkerRemind;
|
|
|
import com.gree.mall.miniapp.bean.user.CurrentCompanyWechat;
|
|
|
+import com.gree.mall.miniapp.constant.Constant;
|
|
|
import com.gree.mall.miniapp.enums.ExamineWorkerStatusEnum;
|
|
|
import com.gree.mall.miniapp.enums.IsYesNoEnum;
|
|
|
import com.gree.mall.miniapp.enums.PolicyOrderStutasEnum;
|
|
@@ -28,11 +28,9 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
-import org.springframework.util.FileCopyUtils;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
-import java.io.File;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
@@ -86,6 +84,9 @@ public class WorkerLogic {
|
|
|
@Autowired
|
|
|
OCRUtil ocrUtil;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ WorkerSignConfirmService workerSignConfirmService;
|
|
|
+
|
|
|
|
|
|
|
|
|
public List<WorkerRemind> remind() {
|
|
@@ -621,22 +622,22 @@ public class WorkerLogic {
|
|
|
if (!user.getType().equals(UserTypeEnum.WORKER.getKey())) {
|
|
|
throw new RemoteServiceException("非“师傅”类型账号, 操作失败");
|
|
|
}
|
|
|
- String path = System.getProperty("user.dir");
|
|
|
+// String path = System.getProperty("user.dir");
|
|
|
// 生成的文件的存放路径
|
|
|
|
|
|
- String mkdir = path + "/tmp/ocr/";
|
|
|
- if (!FileUtil.exist(path + "/tmp/ocr/")) {
|
|
|
- FileUtil.mkdir(path + "/tmp/ocr/");
|
|
|
- }
|
|
|
+// String mkdir = path + "/tmp/ocr/";
|
|
|
+// if (!FileUtil.exist(path + "/tmp/ocr/")) {
|
|
|
+// FileUtil.mkdir(path + "/tmp/ocr/");
|
|
|
+// }
|
|
|
|
|
|
// 创建文件
|
|
|
- final String signFilePath = mkdir + signFile.getOriginalFilename();
|
|
|
+// final String signFilePath = mkdir + joinFile.getOriginalFilename();
|
|
|
// File outputFile = new File(mkdir + "r" +signFile.getOriginalFilename());
|
|
|
- File uploadFile = new File(signFilePath);
|
|
|
- uploadFile.createNewFile();
|
|
|
+// File uploadFile = new File(signFilePath);
|
|
|
+// uploadFile.createNewFile();
|
|
|
|
|
|
// 将文件写入磁盘
|
|
|
- FileCopyUtils.copy(signFile.getBytes(), uploadFile);
|
|
|
+// FileCopyUtils.copy(joinFile.getBytes(), uploadFile);
|
|
|
|
|
|
// Thumbnails.of(uploadFile).scale(1).rotate(-90).toFile(outputFile);
|
|
|
//
|
|
@@ -657,15 +658,31 @@ public class WorkerLogic {
|
|
|
if (!StrUtil.equals(name, user.getNickName().replace(" ", ""))) {
|
|
|
return false;
|
|
|
}
|
|
|
+
|
|
|
final CommonFile commonFile = commonLogic.uploadFile(joinFile);
|
|
|
|
|
|
- userService.lambdaUpdate()
|
|
|
- .set(type.equals("gz"), User::getWorkerSignGz, commonFile.getUrl())
|
|
|
- .set(type.equals("fs"), User::getWorkerSignFs, commonFile.getUrl())
|
|
|
- .eq(User::getUserId, user.getUserId())
|
|
|
- .update();
|
|
|
+ WorkerSignConfirm confirm = new WorkerSignConfirm();
|
|
|
+ confirm.setCompanyWechatId(currentCompanyWechat.getCompanyWechatId())
|
|
|
+ .setBelongCompanyCode(type.equals("gz") ? Constant.gree.GUANGZHOUXIAOSI : Constant.gree.FOSHANXIAOSI)
|
|
|
+ .setBelongCompanyName(type.equals("gz") ? "广州" : "佛山")
|
|
|
+ .setWorkerNumber(user.getWorkerNumber())
|
|
|
+ .setName(type.equals("gz") ? "广州嘉讯茂辅材费用确认书" : "佛山嘉讯茂辅材费用确认书")
|
|
|
+ .setUrl(commonFile.getUrl())
|
|
|
+ .insert();
|
|
|
+// userService.lambdaUpdate()
|
|
|
+// .set(type.equals("gz"), User::getWorkerSignGz, commonFile.getUrl())
|
|
|
+// .set(type.equals("fs"), User::getWorkerSignFs, commonFile.getUrl())
|
|
|
+// .eq(User::getUserId, user.getUserId())
|
|
|
+// .update();
|
|
|
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
+ public List<WorkerSignConfirm> signConfirm() {
|
|
|
+ CurrentCompanyWechat currentCompanyWechat = commonLogic.getCurrentCompanyWechat();
|
|
|
+ return workerSignConfirmService.lambdaQuery()
|
|
|
+ .eq(WorkerSignConfirm::getCompanyWechatId, currentCompanyWechat.getCurrentCompanyWechatId())
|
|
|
+ .eq(WorkerSignConfirm::getWorkerNumber, currentCompanyWechat.getUser().getWorkerNumber())
|
|
|
+ .list();
|
|
|
+ }
|
|
|
}
|