bug修改
This commit is contained in:
parent
a582236519
commit
edd012bc76
|
|
@ -62,6 +62,8 @@ public class AmProcessType implements Serializable {
|
|||
* 会签类型 单人:1 多人:2
|
||||
*/
|
||||
private String countersignType;
|
||||
private String beforeAuditId;
|
||||
private String nextAuditId;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -80,4 +80,8 @@ public interface New_CheckManageDao {
|
|||
void updateToolsStatus(String auditId, String isActive);
|
||||
|
||||
String getAuditProcessId(CheckManageBean o);
|
||||
|
||||
AmProcessType getIfCountersign(CheckManageBean o);
|
||||
|
||||
List<AmProcessType> getSortList(CheckManageBean o);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1272,16 +1272,52 @@ public class New_SubCheckManageServiceImpl implements New_SubCheckManageService
|
|||
|
||||
//1.1 判断是固定流程还是动态流程
|
||||
if (!"-1".equals(o.getProcessType()) && !"1".equals(o.getIfFinal())) { //固定流程
|
||||
//写一个SQL 查询出下一级别审核人
|
||||
AmProcessType amProcessType = checkManageDao.getFixeNextAuditId(o);
|
||||
if (amProcessType == null || "null".equals(amProcessType.getPhone())) {
|
||||
|
||||
|
||||
o.setIfFinal("1");
|
||||
} else {
|
||||
o.setNextAuditId(Objects.requireNonNull(amProcessType).getPhone());
|
||||
o.setCountersignType(Objects.requireNonNull(amProcessType).getCountersignType());
|
||||
//判断当前流程是否多人审核
|
||||
AmProcessType firstBean = checkManageDao.getIfCountersign(o);
|
||||
List<AmProcessType> sortList = checkManageDao.getSortList(o);
|
||||
boolean tf = false;
|
||||
for (int i = 0; i < sortList.size(); i++) {
|
||||
String phone = sortList.get(i).getPhone();
|
||||
String checkPhone = UserUtil.getLoginUser().getPhone();
|
||||
if(phone.contains(checkPhone) && (i+1) == sortList.size()){
|
||||
tf = true;
|
||||
}
|
||||
}
|
||||
if (firstBean == null){
|
||||
AmProcessType amProcessType = checkManageDao.getFixeNextAuditId(o);
|
||||
if (amProcessType == null || "null".equals(amProcessType.getPhone())) {
|
||||
o.setIfFinal("1");
|
||||
} else {
|
||||
o.setNextAuditId(Objects.requireNonNull(amProcessType).getPhone());
|
||||
o.setCountersignType(Objects.requireNonNull(amProcessType).getCountersignType());
|
||||
}
|
||||
}else if("2".equals(firstBean.getCountersignType()) && tf){
|
||||
//判断当前是否最后一个人
|
||||
String[] nextAuditId = firstBean.getNextAuditId().split(",");
|
||||
String[] beforeAuditId = {UserUtil.getLoginUser().getPhone()};
|
||||
if (!StringHelper.isEmpty(firstBean.getBeforeAuditId())){
|
||||
String[] newArr = new String[firstBean.getBeforeAuditId().split(",").length + 1];
|
||||
System.arraycopy(firstBean.getBeforeAuditId().split(","), 0, newArr, 0, firstBean.getBeforeAuditId().split(",").length);
|
||||
newArr[newArr.length - 1] = UserUtil.getLoginUser().getPhone();
|
||||
beforeAuditId = newArr;
|
||||
}
|
||||
if(nextAuditId.length == beforeAuditId.length) {
|
||||
o.setIfFinal("1");
|
||||
}else{
|
||||
o.setNextAuditId(firstBean.getNextAuditId());
|
||||
o.setCountersignType(firstBean.getCountersignType());
|
||||
}
|
||||
}else {
|
||||
AmProcessType amProcessType = checkManageDao.getFixeNextAuditId(o);
|
||||
if (amProcessType == null || "null".equals(amProcessType.getPhone())) {
|
||||
o.setIfFinal("1");
|
||||
} else {
|
||||
o.setNextAuditId(Objects.requireNonNull(amProcessType).getPhone());
|
||||
o.setCountersignType(Objects.requireNonNull(amProcessType).getCountersignType());
|
||||
}
|
||||
}
|
||||
//写一个SQL 查询出下一级别审核人
|
||||
|
||||
}
|
||||
String phone = Objects.requireNonNull(UserUtil.getLoginUser()).getPhone();
|
||||
String orgId = Objects.requireNonNull(UserUtil.getLoginUser()).getOrgId();
|
||||
|
|
|
|||
|
|
@ -418,7 +418,8 @@
|
|||
`am_process_type`
|
||||
WHERE
|
||||
type = #{processType}
|
||||
AND phone NOT IN ( SELECT next_audit_id FROM audit_processon WHERE audit_id = #{auditId} and create_time >(
|
||||
AND phone NOT IN ( SELECT next_audit_id FROM audit_processon WHERE audit_id = #{auditId} and
|
||||
create_time >(
|
||||
SELECT create_time from audit_processon WHERE audit_id = #{auditId} and audit_remark ='发起' ORDER BY id desc limit 1
|
||||
))
|
||||
ORDER BY
|
||||
|
|
@ -433,6 +434,21 @@
|
|||
select id from audit_processon where audit_id = #{auditId} and cons_id = #{id} and project_id = #{proId}
|
||||
order by id desc limit 1
|
||||
</select>
|
||||
<select id="getIfCountersign" resultType="com.bonus.nxdt.energy.basic.entity.AmProcessType">
|
||||
select
|
||||
ap.before_audit_id as beforeAuditId,
|
||||
ap.next_audit_id as nextAuditId,
|
||||
ap.countersign_type as countersignType
|
||||
from am_process_type t
|
||||
left join audit_pross_child apr on apr.process_type = t.type
|
||||
left join audit_processon ap on apr.audit_process = ap.audit_id
|
||||
where audit_id = #{auditId} and type = #{processType}
|
||||
order by ap.id desc
|
||||
limit 1
|
||||
</select>
|
||||
<select id="getSortList" resultType="com.bonus.nxdt.energy.basic.entity.AmProcessType">
|
||||
select phone,sort from am_process_type where type = #{processType} and is_active = '1'
|
||||
</select>
|
||||
|
||||
<update id="updateProcessType" parameterType="string">
|
||||
update audit_pross_child set process_type = #{processType} where id = #{childId}
|
||||
|
|
|
|||
Loading…
Reference in New Issue