直转签名
This commit is contained in:
parent
deb5f9ce89
commit
39f0b41bbb
|
|
@ -24,4 +24,7 @@ public class LeaseOutSign {
|
|||
this.outSignType = outSignType;
|
||||
this.outSignUrl = outSignUrl;
|
||||
}
|
||||
|
||||
public LeaseOutSign() {
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -178,4 +178,23 @@ public class ClzDirectApplyInfo extends BaseEntity {
|
|||
@ApiModelProperty(value = "用户id")
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 签名
|
||||
*/
|
||||
private String outSignUrl;
|
||||
/**
|
||||
* 签名类型
|
||||
*/
|
||||
private int outSignType;
|
||||
|
||||
/**
|
||||
* 类型ID
|
||||
*/
|
||||
private Long typeId;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Long nodeSort;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,6 +38,14 @@ public class SelectController {
|
|||
return service.getUnitList(bmUnit);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "单位下拉选--项目部--过滤班组")
|
||||
@PostMapping("getUnitProDepList")
|
||||
public AjaxResult getUnitProDepList(@RequestBody BmUnit bmUnit) {
|
||||
bmUnit.setEnableFilterTeam(true);
|
||||
bmUnit.setTypeId(36L);
|
||||
return service.getUnitList(bmUnit);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "往来单位下拉选,过滤掉班组类型")
|
||||
@PostMapping("getUnitListFilterTeam")
|
||||
public AjaxResult getUnitListFilterTeam(@RequestBody BmUnit bmUnit) {
|
||||
|
|
|
|||
|
|
@ -214,5 +214,16 @@ public class DirectRotationController extends BaseController {
|
|||
return AjaxResult.success(new DirectApplyInfo());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取直转签名列表
|
||||
* @param sltAgreementInfo
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "获取直转签名列表")
|
||||
@GetMapping("/getSignatureList")
|
||||
public AjaxResult getSignatureList(SltAgreementInfo sltAgreementInfo) {
|
||||
return service.getSignatureList(sltAgreementInfo);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.bonus.material.ma.mapper;
|
||||
|
||||
import com.bonus.common.biz.domain.lease.LeaseOutSign;
|
||||
import com.bonus.material.clz.domain.direct.ClzDirectApplyInfo;
|
||||
import com.bonus.material.ma.domain.DirectApplyDetails;
|
||||
import com.bonus.material.ma.domain.DirectApplyExportInfo;
|
||||
import com.bonus.material.ma.domain.DirectApplyInfo;
|
||||
|
|
@ -91,4 +92,13 @@ public interface DirectRotationMapper {
|
|||
* @return
|
||||
*/
|
||||
List<LeaseOutSign> getApproveList(SltAgreementInfo sltAgreementInfo);
|
||||
|
||||
/**
|
||||
* 获取审批列表
|
||||
* @param sltAgreementInfo
|
||||
* @return
|
||||
*/
|
||||
List<ClzDirectApplyInfo> getSignatureList(SltAgreementInfo sltAgreementInfo);
|
||||
|
||||
ClzDirectApplyInfo getSignById(SltAgreementInfo sltAgreementInfo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,4 +92,11 @@ public interface DirectRotationService {
|
|||
* @return
|
||||
*/
|
||||
DirectApplySignInfo getApproveList(SltAgreementInfo sltAgreementInfo);
|
||||
|
||||
/**
|
||||
* 获取直转签名列表
|
||||
* @param sltAgreementInfo
|
||||
* @return
|
||||
*/
|
||||
AjaxResult getSignatureList(SltAgreementInfo sltAgreementInfo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import com.bonus.common.security.utils.SecurityUtils;
|
|||
import com.bonus.material.back.domain.BackApplyDetails;
|
||||
import com.bonus.material.back.domain.BackApplyInfo;
|
||||
import com.bonus.material.back.mapper.BackApplyInfoMapper;
|
||||
import com.bonus.material.clz.domain.direct.ClzDirectApplyInfo;
|
||||
import com.bonus.material.event.InsertWorkflowEvent;
|
||||
import com.bonus.material.lease.domain.LeaseApplyDetails;
|
||||
import com.bonus.material.lease.mapper.LeaseApplyDetailsMapper;
|
||||
|
|
@ -482,6 +483,113 @@ public class DirectRotationImpl implements DirectRotationService {
|
|||
return directApplySignInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getSignatureList(SltAgreementInfo sltAgreementInfo) {
|
||||
try {
|
||||
List<DirectApplySignInfo> directApplySignInfoList = new ArrayList<>();
|
||||
|
||||
// 创建签名列表
|
||||
List<LeaseOutSign> list1 = new ArrayList<>();
|
||||
List<LeaseOutSign> list2 = new ArrayList<>();
|
||||
List<LeaseOutSign> list3 = new ArrayList<>();
|
||||
|
||||
//先判断是否为没有审核的直转
|
||||
ClzDirectApplyInfo bean = mapper.getSignById(sltAgreementInfo);
|
||||
if (bean != null && bean.getId()==null){
|
||||
LeaseOutSign leaseOutSign = new LeaseOutSign();
|
||||
leaseOutSign.setOutSignType(bean.getOutSignType());
|
||||
leaseOutSign.setOutSignUrl(bean.getOutSignUrl());
|
||||
list1.add(leaseOutSign);
|
||||
list2.add(leaseOutSign);
|
||||
list3.add(leaseOutSign);
|
||||
DirectApplySignInfo directApplySignInfo1 = new DirectApplySignInfo();
|
||||
directApplySignInfo1.setApproveSignList(list1);
|
||||
DirectApplySignInfo directApplySignInfo2 = new DirectApplySignInfo();
|
||||
directApplySignInfo2.setApproveSignList(list2);
|
||||
DirectApplySignInfo directApplySignInfo3 = new DirectApplySignInfo();
|
||||
directApplySignInfo3.setApproveSignList(list3);
|
||||
directApplySignInfoList.add(directApplySignInfo1);
|
||||
directApplySignInfoList.add(directApplySignInfo2);
|
||||
directApplySignInfoList.add(directApplySignInfo3);
|
||||
return AjaxResult.success(directApplySignInfoList);
|
||||
}
|
||||
|
||||
List<ClzDirectApplyInfo> list = mapper.getSignatureList(sltAgreementInfo);
|
||||
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
for (ClzDirectApplyInfo clzDirectApplyInfo : list) {
|
||||
// 跳过签名URL为空的项
|
||||
if (clzDirectApplyInfo == null || StringUtils.isBlank(clzDirectApplyInfo.getOutSignUrl())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 如果签名链接不是以http开头,则将其处理为base64格式
|
||||
if (!clzDirectApplyInfo.getOutSignUrl().startsWith("http")) {
|
||||
clzDirectApplyInfo.setOutSignUrl("data:image/png;base64," + clzDirectApplyInfo.getOutSignUrl());
|
||||
}
|
||||
|
||||
LeaseOutSign leaseOutSign = new LeaseOutSign();
|
||||
leaseOutSign.setOutSignUrl(clzDirectApplyInfo.getOutSignUrl());
|
||||
leaseOutSign.setOutSignType(clzDirectApplyInfo.getOutSignType());
|
||||
|
||||
// 根据TypeId和NodeSort分类
|
||||
classifySignature(clzDirectApplyInfo, leaseOutSign, list1, list2, list3);
|
||||
}
|
||||
}
|
||||
|
||||
// 构建返回结果
|
||||
directApplySignInfoList.add(createDirectApplySignInfo(list1));
|
||||
directApplySignInfoList.add(createDirectApplySignInfo(list2));
|
||||
directApplySignInfoList.add(createDirectApplySignInfo(list3));
|
||||
|
||||
return AjaxResult.success(directApplySignInfoList);
|
||||
} catch (Exception e) {
|
||||
log.error("查询签名失败: " + e.getMessage(), e);
|
||||
return AjaxResult.success(new ArrayList<>());
|
||||
}
|
||||
}
|
||||
|
||||
// 将签名分类的逻辑提取到一个单独的方法
|
||||
private void classifySignature(ClzDirectApplyInfo clzDirectApplyInfo, LeaseOutSign leaseOutSign,
|
||||
List<LeaseOutSign> list1, List<LeaseOutSign> list2, List<LeaseOutSign> list3) {
|
||||
Long typeId = clzDirectApplyInfo.getTypeId();
|
||||
Long nodeSort = clzDirectApplyInfo.getNodeSort();
|
||||
|
||||
if (typeId == 15) {
|
||||
// 直转审批流(需要接收审批)
|
||||
if (nodeSort == 1) {
|
||||
// 发起方材料员
|
||||
list1.add(leaseOutSign);
|
||||
} else if (nodeSort == 6) {
|
||||
// 转入方材料员
|
||||
list3.add(leaseOutSign);
|
||||
} else if (nodeSort >= 2 && nodeSort <= 6) {
|
||||
// 审核
|
||||
list2.add(leaseOutSign);
|
||||
}
|
||||
} else if (typeId == 21) {
|
||||
// 直转审批流2(无需接收审批)
|
||||
if (nodeSort == 1) {
|
||||
// 发起方材料员
|
||||
list1.add(leaseOutSign);
|
||||
} else if (nodeSort == 4) {
|
||||
// 转入方材料员
|
||||
list3.add(leaseOutSign);
|
||||
} else if (nodeSort >= 2 && nodeSort <= 5) {
|
||||
// 审核
|
||||
list2.add(leaseOutSign);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 创建 DirectApplySignInfo 对象的简化方法
|
||||
private DirectApplySignInfo createDirectApplySignInfo(List<LeaseOutSign> signList) {
|
||||
DirectApplySignInfo directApplySignInfo = new DirectApplySignInfo();
|
||||
directApplySignInfo.setApproveSignList(signList);
|
||||
return directApplySignInfo;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 生成退料单号
|
||||
|
|
|
|||
|
|
@ -329,4 +329,32 @@
|
|||
WHERE
|
||||
swr.task_id = #{id}
|
||||
</select>
|
||||
<select id="getSignatureList" resultType="com.bonus.material.clz.domain.direct.ClzDirectApplyInfo">
|
||||
SELECT
|
||||
swh.node_id AS nodeId,
|
||||
su.sign_type AS outSignType,
|
||||
su.sign_url AS outSignUrl,
|
||||
swn.type_id as typeId,
|
||||
swn.node_sort as nodeSort
|
||||
FROM
|
||||
sys_workflow_record_history swh
|
||||
LEFT JOIN sys_workflow_record swr ON swh.record_id = swr.id
|
||||
LEFT JOIN sys_user su ON swh.create_by = su.user_id
|
||||
LEFT JOIN sys_workflow_node swn on swn.id=swh.node_id
|
||||
WHERE
|
||||
swr.task_id = #{id}
|
||||
ORDER BY swh.create_time ASC
|
||||
</select>
|
||||
<select id="getSignById" resultType="com.bonus.material.clz.domain.direct.ClzDirectApplyInfo">
|
||||
SELECT
|
||||
swr.id,
|
||||
su.sign_type AS outSignType,
|
||||
su.sign_url AS outSignUrl
|
||||
FROM
|
||||
direct_apply_info dai
|
||||
LEFT JOIN sys_workflow_record swr on swr.task_id=dai.id
|
||||
LEFT JOIN sys_user su on su.user_id=dai.create_by
|
||||
WHERE
|
||||
dai.id=#{id}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue