退料审核人签名

This commit is contained in:
hongchao 2025-01-17 11:03:29 +08:00
parent 26c6415877
commit f3f8dc0e85
5 changed files with 77 additions and 7 deletions

View File

@ -1,10 +1,7 @@
package com.bonus.common.biz.config;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.ss.usermodel.BorderStyle;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.IndexedColors;
import org.apache.poi.ss.usermodel.VerticalAlignment;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.ss.util.RegionUtil;
@ -215,7 +212,7 @@ public class PoiOutPage {
// 创建样式
HSSFCellStyle titleStyle = createTitleStyle(workbook);
HSSFCellStyle headerStyle = createHeaderStyle(workbook);
HSSFCellStyle contentStyle = createCellStyle(workbook);
HSSFCellStyle contentStyle = createCellStyleCost(workbook);
// 设置工作簿名称
workbook.setSheetName(0, filename);
@ -250,7 +247,7 @@ public class PoiOutPage {
// 创建样式
HSSFCellStyle titleStyle = createTitleStyle(workbook);
HSSFCellStyle headerStyle = createHeaderStyle(workbook);
HSSFCellStyle contentStyle = createCellStyle(workbook);
HSSFCellStyle contentStyle = createCellStyleCost(workbook);
// 设置工作簿名称
workbook.setSheetName(0, filename);
@ -677,4 +674,38 @@ public class PoiOutPage {
return style;
}
/**
* 创建内容样式
* @param workbook
* @return
*/
private static HSSFCellStyle createCellStyleCost(HSSFWorkbook workbook) {
HSSFCellStyle style = workbook.createCellStyle();
style.setAlignment(HorizontalAlignment.CENTER);
style.setVerticalAlignment(VerticalAlignment.CENTER);
HSSFFont font = workbook.createFont();
font.setFontHeightInPoints((short) 10);
style.setFont(font);
// 设置边框
style.setBorderTop(BorderStyle.THIN);
style.setBorderBottom(BorderStyle.THIN);
style.setBorderLeft(BorderStyle.THIN);
style.setBorderRight(BorderStyle.THIN);
// 设置边框颜色为黑色
style.setTopBorderColor(IndexedColors.BLACK.getIndex());
style.setBottomBorderColor(IndexedColors.BLACK.getIndex());
style.setLeftBorderColor(IndexedColors.BLACK.getIndex());
style.setRightBorderColor(IndexedColors.BLACK.getIndex());
// 设置数字格式为保留两位小数
DataFormat dataFormat = workbook.createDataFormat();
style.setDataFormat(dataFormat.getFormat("0.00")); // 设置格式为"0.00"
return style;
}
}

View File

@ -166,4 +166,7 @@ public class BackApplyInfo implements Serializable {
@ApiModelProperty(value="二维码")
private String qrCode;
@ApiModelProperty(value = "审批人人签名URL")
private String directAuditSignUrl;
}

View File

@ -3,6 +3,7 @@ package com.bonus.material.back.mapper;
import java.util.Date;
import java.util.List;
import com.bonus.common.biz.domain.lease.LeaseApplyInfo;
import com.bonus.material.back.domain.BackApplyDetails;
import com.bonus.material.back.domain.BackApplyInfo;
import com.bonus.material.back.domain.MaCodeDto;
@ -326,4 +327,10 @@ public interface BackApplyInfoMapper {
* @return
*/
int update(BackApplyDetails backApplyDetails);
/** 设置审批人为默认的李勇 --防止代码冲突 **/
Long getDirectAuditBy();
/** 设置审批人签名url 防止代码冲突 **/
String getDirectAuditUrl(BackApplyInfo backApplyInfo);
}

View File

@ -83,6 +83,12 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
BackApplyRequestVo backApplyRequestVo = new BackApplyRequestVo();
//先根据外层id查询上层信息
BackApplyInfo backApplyInfo = backApplyInfoMapper.selectBackApplyInfoById(id);
/** 设置审批人签名url 防止代码冲突 **/
String directAuditUrl = backApplyInfoMapper.getDirectAuditUrl(backApplyInfo);
backApplyInfo.setDirectAuditSignUrl(directAuditUrl);
/** 设置审批人签名url 防止代码冲突 **/
backApplyRequestVo.setBackApplyInfo(backApplyInfo);
//查询退料详情信息
List<BackApplyDetails> backApplyDetailsList = backApplyInfoMapper.selectBackApplyDetailsListByTaskId(id);
@ -280,6 +286,12 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
tmTaskAgreement.setCreateBy(SecurityUtils.getUsername());
taskAgreementMapper.insertTmTaskAgreement(tmTaskAgreement);
backApplyInfo.setTaskId(tmTask.getTaskId());
/** 设置审批人为默认的李勇 --防止代码冲突 **/
Long peopleId = backApplyInfoMapper.getDirectAuditBy();
backApplyInfo.setDirectAuditBy(peopleId);
/** 设置审批人为默认的李勇 --防止代码冲突 **/
result += backApplyInfoMapper.insertBackApplyInfo(backApplyInfo);
}
// 保存退料详情

View File

@ -144,7 +144,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
bu.unit_id AS unitId,
bu.unit_name AS unitName,
bp.pro_id AS proId,
bp.pro_name AS proName
bp.pro_name AS proName,
bai.direct_audit_by AS directAuditBy
FROM
back_apply_info bai
LEFT JOIN tm_task_agreement tta ON bai.task_id = tta.task_id
@ -747,4 +748,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<delete id="deleteBackApplyDetailsById">
delete from back_apply_details where parent_id = #{parentId} and type_id = #{typeId}
</delete>
<!-- 设置审批人为默认的李勇 防止代码冲突-->
<select id="getDirectAuditBy" resultType="Long">
select
sc.people_id as peopleId
from sign_config sc
where sc.process_id = 1 and sc.sign_type = 0 and sc.del_flag = 0
</select>
<!-- 设置审批人签名url 防止代码冲突-->
<select id="getDirectAuditUrl" resultType="java.lang.String">
select
su.sign_url as directAuditSignUrl
from sys_user su
where su.user_id = #{directAuditBy} and su.del_flag = 0
</select>
</mapper>