Merge remote-tracking branch 'origin/cc_20230520_partner' into cc_20230520_partner

This commit is contained in:
苏竹红
2023-06-21 17:24:13 +08:00
10 changed files with 81 additions and 25 deletions

View File

@@ -5,6 +5,7 @@ import com.lowagie.text.Font;
import com.lowagie.text.Image;
import com.lowagie.text.Paragraph;
import com.lowagie.text.pdf.*;
import lombok.extern.slf4j.Slf4j;
import org.icepdf.core.exceptions.PDFException;
import org.icepdf.core.exceptions.PDFSecurityException;
import org.icepdf.core.pobjects.Page;
@@ -19,6 +20,7 @@ import java.io.*;
/**
* 使用 OpenPDF 封装的 pdf 工具类
*/
@Slf4j
public class PDFUtils {
private static final int[] A4Size = {595, 842};
@@ -145,20 +147,16 @@ public class PDFUtils {
GraphicsRenderingHints.SCREEN, Page.BOUNDARY_CROPBOX,
rotation, scale);
RenderedImage rendImage = image;
try {
ImageIO.write(rendImage, "png", outputStream);
//例子中是pdf转png格式的也可以将上面两行改成jpg转出jpg格式的
//但是从转换效果来看png清晰度会相对较高。有个小技巧是第一行行改成jpg
//但第二行使用png也就是转换成jpg格式但有png清晰度的图片。
} catch (IOException e) {
e.printStackTrace();
}
ImageIO.write(rendImage, "png", outputStream);
//例子中是pdf转png格式的也可以将上面两行改成jpg转出jpg格式的
//但是从转换效果来看png的清晰度会相对较高。有个小技巧是第一行行改成jpg
//但第二行使用png也就是转换成jpg格式但有png清晰度的图片。
image.flush();
document.dispose();
return outputStream;
}
} catch (PDFException | PDFSecurityException | IOException e1) {
e1.printStackTrace();
} catch (PDFException | IOException | PDFSecurityException e) {
log.error("PDF转图片异常, e{}", e.getMessage());
} finally {
try {
outputStream.close();

View File

@@ -0,0 +1,12 @@
package com.cool.store.dto.content;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class ContentDelDto {
@ApiModelProperty("动态id")
private String contentId;
}

View File

@@ -0,0 +1,12 @@
package com.cool.store.dto.content;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class ContentQueryDetailDto {
@ApiModelProperty("动态id")
private String contentId;
}

View File

@@ -0,0 +1,12 @@
package com.cool.store.dto.partner;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class PartnerGetPassLetterDetailDto {
@ApiModelProperty("面试计划id")
private String interviewPlanId;
}

View File

@@ -0,0 +1,12 @@
package com.cool.store.dto.partner;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class PartnerQueryInterviewDto {
@ApiModelProperty("加盟商用户id")
private String partnerId;
}

View File

@@ -92,7 +92,7 @@ public class FlowServiceImpl implements FlowService {
fraSourceDO.setKey("HSAYPartner");
fraSourceDO.setText("沪上阿姨合伙人");
data.setFraSource(fraSourceDO);
data.setAmtDeposit(Integer.valueOf(request.getSecurityFund()));
data.setAmtDeposit(Integer.parseInt(request.getSecurityFund()));
//获取授权码
String authCode = null;
@@ -118,9 +118,9 @@ public class FlowServiceImpl implements FlowService {
}
data.setIntendedSigner(request.getIntentionSignerUsername());
data.setIntendedSignerTel(request.getIntentionSignerMobile());
//通过 rpc 请求审核系统获取返回数据
Map<String, String> qualifyVerifyRespData = JSON.parseObject(createQualifyVerify(rpcRequest), new TypeReference<HashMap<String,String>>() {});
//2.更新审核信息
HyPartnerCertificationInfoDO partnerCertificationInfoDO = new HyPartnerCertificationInfoDO();
partnerCertificationInfoDO.setPartnerId(request.getPartnerId());
@@ -147,6 +147,7 @@ public class FlowServiceImpl implements FlowService {
//set 意向合同编号
partnerCertificationInfoDO.setIntentionContractNo(qualifyVerifyRespData.get("sequenceNo"));
hyPartnerCertificationInfoMapper.updateByPrimaryKeySelective(partnerCertificationInfoDO);
//3.更新面试信息
//根据面试id获取面试信息
HyPartnerInterviewDO hyPartnerInterviewDO = hyPartnerInterviewMapper.selectByPrimaryKeySelective(request.getInterviewId());
@@ -158,6 +159,13 @@ public class FlowServiceImpl implements FlowService {
hyPartnerInterviewDO.setStatus(Integer.valueOf(WorkflowStatusEnum.INTERVIEW_4.getCode()));
hyPartnerInterviewMapper.updateByPrimaryKeySelective(hyPartnerInterviewDO);
//4. 更新线索信息(开发主管)
if (!StringUtils.isEmpty(request.getDevtDirectorId())) {
HyPartnerLineInfoDO hyPartnerLineInfoDO = new HyPartnerLineInfoDO();
hyPartnerLineInfoDO.setId(Long.parseLong(request.getLineId()));
hyPartnerLineInfoDO.setDevelopmentDirector(request.getDevtDirectorId());
hyPartnerLineInfoMapper.updateByPrimaryKeySelective(hyPartnerLineInfoDO);
}
}
@Override

View File

@@ -1,8 +1,6 @@
package com.cool.store.controller;
import com.cool.store.dto.content.ContentAddDto;
import com.cool.store.dto.content.ContentQueryListDto;
import com.cool.store.dto.content.ContentUpdateDto;
import com.cool.store.dto.content.*;
import com.cool.store.entity.HyContentInfoDO;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.ContentService;
@@ -34,8 +32,8 @@ public class ContentController {
@PostMapping("/delete")
@ApiOperation("删除动态")
public ResponseResult deleteContent(@RequestParam(value = "contentId") String contentId) {
contentService.deleteContent(contentId);
public ResponseResult deleteContent(@RequestBody ContentDelDto dto) {
contentService.deleteContent(dto.getContentId());
return ResponseResult.success();
}
@@ -57,8 +55,8 @@ public class ContentController {
@PostMapping("/detail")
@ApiOperation("动态详情")
public ResponseResult<HyContentInfoDO> queryContentInfo(@RequestBody String contentId) {
return ResponseResult.success(contentService.queryContentInfo(contentId));
public ResponseResult<HyContentInfoDO> queryContentInfo(@RequestBody ContentQueryDetailDto dto) {
return ResponseResult.success(contentService.queryContentInfo(dto.getContentId()));
}
}

View File

@@ -112,6 +112,7 @@ public class SignValidateFilter implements Filter {
// 前后端验签不等
if (!newSign.equals(sign)) {
response.setStatus(HttpStatus.OK.value());
response.setContentType("application/json;charset=UTF-8");
response.getWriter().write(JSON.toJSONString(ResponseResult.fail(ErrorCodeEnum.SIGN_FAIL)));
return;
}

View File

@@ -1,5 +1,6 @@
package com.cool.store.controller;
import com.cool.store.dto.content.ContentQueryDetailDto;
import com.cool.store.dto.content.ContentQueryListDto;
import com.cool.store.entity.HyContentInfoDO;
import com.cool.store.response.ResponseResult;
@@ -35,8 +36,8 @@ public class ContentController {
@PostMapping("/detail")
@ApiOperation("动态详情")
public ResponseResult<HyContentInfoDO> queryContentInfo(@RequestBody String contentId) {
return ResponseResult.success(contentService.queryContentInfo(contentId));
public ResponseResult<HyContentInfoDO> queryContentInfo(@RequestBody ContentQueryDetailDto dto) {
return ResponseResult.success(contentService.queryContentInfo(dto.getContentId()));
}
}

View File

@@ -1,6 +1,8 @@
package com.cool.store.controller;
import com.cool.store.dto.partner.EnterInterviewDto;
import com.cool.store.dto.partner.PartnerGetPassLetterDetailDto;
import com.cool.store.dto.partner.PartnerQueryInterviewDto;
import com.cool.store.exception.ApiException;
import com.cool.store.request.CreateAppointmentReq;
import com.cool.store.request.ModifyInterviewTimeReq;
@@ -30,8 +32,8 @@ public class InterviewController {
@PostMapping("/queryByPartnerId")
@ApiOperation("根据用户id查询面试信息")
public ResponseResult<PartnerInterviewInfoVO> queryByPartnerId(@RequestBody String partnerId) {
return ResponseResult.success(interviewService.queryByPartnerId(partnerId));
public ResponseResult<PartnerInterviewInfoVO> queryByPartnerId(@RequestBody PartnerQueryInterviewDto dto) {
return ResponseResult.success(interviewService.queryByPartnerId(dto.getPartnerId()));
}
@PostMapping("/enter")
@@ -42,8 +44,8 @@ public class InterviewController {
@PostMapping("/passLetter/detail")
@ApiOperation("通过函详情")
public ResponseResult<PartnerPassLetterDetailVO> passLetterDetail(@RequestParam String interviewPlanId) {
return ResponseResult.success(interviewService.passLetterDetail(interviewPlanId));
public ResponseResult<PartnerPassLetterDetailVO> passLetterDetail(@RequestBody PartnerGetPassLetterDetailDto dto) {
return ResponseResult.success(interviewService.passLetterDetail(dto.getInterviewPlanId()));
}
@PostMapping("/appointment/submit")