|
@@ -53,6 +53,7 @@ public class RateService {
|
|
|
private final RateAuditRepo rateAuditRepo;
|
|
private final RateAuditRepo rateAuditRepo;
|
|
|
private final UserRepo userRepo;
|
|
private final UserRepo userRepo;
|
|
|
private final NjwlSmsService njwlSmsService;
|
|
private final NjwlSmsService njwlSmsService;
|
|
|
|
|
+ private final OrganizationRepo organizationRepo;
|
|
|
|
|
|
|
|
public Page<Rate> all(PageQuery pageQuery) {
|
|
public Page<Rate> all(PageQuery pageQuery) {
|
|
|
return rateRepo.findAll(JpaUtils.toSpecification(pageQuery, Rate.class), JpaUtils.toPageRequest(pageQuery));
|
|
return rateRepo.findAll(JpaUtils.toSpecification(pageQuery, Rate.class), JpaUtils.toPageRequest(pageQuery));
|
|
@@ -121,11 +122,18 @@ public class RateService {
|
|
|
/*
|
|
/*
|
|
|
线下退回
|
|
线下退回
|
|
|
*/
|
|
*/
|
|
|
- public void offline(Long id) {
|
|
|
|
|
|
|
+ public void offline(Long id, Long userId, RateStatus status) {
|
|
|
Rate rate = rateRepo.findById(id).orElseThrow(new BusinessException("无记录"));
|
|
Rate rate = rateRepo.findById(id).orElseThrow(new BusinessException("无记录"));
|
|
|
- rate.setStatus(RateStatus.REVIEW_PENDING);
|
|
|
|
|
|
|
+ rate.setStatus(status);
|
|
|
rate.setSort(rate.getStatus().getSort());
|
|
rate.setSort(rate.getStatus().getSort());
|
|
|
rateRepo.save(rate);
|
|
rateRepo.save(rate);
|
|
|
|
|
+ RateAudit rateAudit = RateAudit.builder()
|
|
|
|
|
+ .userId(userId)
|
|
|
|
|
+ .rateId(id)
|
|
|
|
|
+ .remark(RateStatus.REVIEW_PENDING.equals(status) ? "线下考察材料提交不全,被退回!" : "已取消专家组分配!")
|
|
|
|
|
+ .status(status)
|
|
|
|
|
+ .build();
|
|
|
|
|
+ rateAuditRepo.save(rateAudit);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void audit(Long id, RateStatus status, String remark, Long userId) {
|
|
public void audit(Long id, RateStatus status, String remark, Long userId) {
|
|
@@ -169,15 +177,6 @@ public class RateService {
|
|
|
String message = "你区上报的承办单位等级评定申请被市文化和旅游局等级评定委员会退回,请根据反馈意见及时处理!";
|
|
String message = "你区上报的承办单位等级评定申请被市文化和旅游局等级评定委员会退回,请根据反馈意见及时处理!";
|
|
|
njwlSmsService.sendSms(phone, message);
|
|
njwlSmsService.sendSms(phone, message);
|
|
|
break;
|
|
break;
|
|
|
-// case REVIEW_PENDING:
|
|
|
|
|
-// List<Long> ids = new ArrayList<>(rate.getExpertMemberUserId());
|
|
|
|
|
-// ids.add(rate.getExpertUserId());
|
|
|
|
|
-// String expertPhone = userRepo.findAllById(ids)
|
|
|
|
|
-// .stream()
|
|
|
|
|
-// .map(User::getPhone)
|
|
|
|
|
-// .collect(Collectors.joining(","));
|
|
|
|
|
-// njwlSmsService.sendSms(expertPhone,"评分已被退回!");
|
|
|
|
|
-// break;
|
|
|
|
|
default:
|
|
default:
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
@@ -338,13 +337,6 @@ public class RateService {
|
|
|
* @return 压缩百分比
|
|
* @return 压缩百分比
|
|
|
*/
|
|
*/
|
|
|
public int getPercent(float weight) {
|
|
public int getPercent(float weight) {
|
|
|
-// float percent;
|
|
|
|
|
-// if (height > weight) {
|
|
|
|
|
-// percent = PageSize.A4.getHeight() / height * 100;
|
|
|
|
|
-// } else {
|
|
|
|
|
-// percent = PageSize.A4.getWidth() / weight * 100;
|
|
|
|
|
-// }
|
|
|
|
|
-// return Math.round(percent);
|
|
|
|
|
int p;
|
|
int p;
|
|
|
float p2;
|
|
float p2;
|
|
|
p2 = 530 / weight * 100;
|
|
p2 = 530 / weight * 100;
|
|
@@ -462,7 +454,6 @@ public class RateService {
|
|
|
for (InputStream is : files) {
|
|
for (InputStream is : files) {
|
|
|
is.close();
|
|
is.close();
|
|
|
}
|
|
}
|
|
|
-// return outputStream.toString();
|
|
|
|
|
|
|
|
|
|
response.setContentType("application/pdf");
|
|
response.setContentType("application/pdf");
|
|
|
response.setHeader("Content-Disposition", "attachment; filename=" + "result.pdf");
|
|
response.setHeader("Content-Disposition", "attachment; filename=" + "result.pdf");
|
|
@@ -480,6 +471,10 @@ public class RateService {
|
|
|
Map<Long, User> userMap = userRepo.findAllById(ids)
|
|
Map<Long, User> userMap = userRepo.findAllById(ids)
|
|
|
.stream()
|
|
.stream()
|
|
|
.collect(Collectors.toMap(User::getId, user -> user));
|
|
.collect(Collectors.toMap(User::getId, user -> user));
|
|
|
|
|
+ if (!rate.isChange()) {
|
|
|
|
|
+ Organization organization = organizationRepo.findById(rate.getId()).orElseThrow(new BusinessException("无记录"));
|
|
|
|
|
+ rate.setAddress(organization.getAddress());
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
String message = "现场检查计划已分配:\n" +
|
|
String message = "现场检查计划已分配:\n" +
|
|
|
"审核单位:%s\n" +
|
|
"审核单位:%s\n" +
|
|
@@ -497,7 +492,7 @@ public class RateService {
|
|
|
"检查日期:%s\n" +
|
|
"检查日期:%s\n" +
|
|
|
"组长:%s-%s";
|
|
"组长:%s-%s";
|
|
|
|
|
|
|
|
- DateTimeFormatter dtf = DateTimeFormatter.ofPattern(DateConfig.DEFAULT_DATE_FORMAT);
|
|
|
|
|
|
|
+ DateTimeFormatter dtf = DateTimeFormatter.ofPattern(DateConfig.DEFAULT_DATE_TIME_FORMAT);
|
|
|
|
|
|
|
|
User user = userMap.get(rate.getExpertUserId());
|
|
User user = userMap.get(rate.getExpertUserId());
|
|
|
StringBuilder sb = new StringBuilder();
|
|
StringBuilder sb = new StringBuilder();
|