提交人瞩

This commit is contained in:
quyixiao 2020-08-26 10:41:07 +08:00
parent 6298717ff0
commit f93210b175
6 changed files with 62 additions and 10 deletions

View File

@ -187,6 +187,7 @@ public class ResultRecordController extends AbstractController {
listAuth = recordAuthService.selectAuthInfo(staffRoleMap.get(getUserId()));
auth = recordAuthService.getAuth(listAuth);
}
List<ResultDetail> resultDetails = resultDetailService.selectByRecordId(resultRecord.getId());
BigDecimal sumWenHuaJiaZhiGuan = BigDecimal.ZERO;
BigDecimal sumYeJi = BigDecimal.ZERO;

View File

@ -37,4 +37,8 @@ public class ResultRecordReq {
private Long rollbackFlowId;
private List<Long > statusList ;
private String statusStr;
private Long approvalStaffId;
}

View File

@ -48,6 +48,12 @@ public class ResultRecord implements java.io.Serializable {
private String departmentName;
//员工姓名
private String staffName;
//当前审批的员工 id
private Long currentApprovalStaffId;
//当前审批的员工名以逗号隔开
private String currentApprovalStaffName;
/**
*
* @return
@ -277,6 +283,22 @@ public class ResultRecord implements java.io.Serializable {
this.staffName = staffName;
}
public Long getCurrentApprovalStaffId() {
return currentApprovalStaffId;
}
public void setCurrentApprovalStaffId(Long currentApprovalStaffId) {
this.currentApprovalStaffId = currentApprovalStaffId;
}
public String getCurrentApprovalStaffName() {
return currentApprovalStaffName;
}
public void setCurrentApprovalStaffName(String currentApprovalStaffName) {
this.currentApprovalStaffName = currentApprovalStaffName;
}
@Override
public String toString() {
return "ResultRecord{" +

View File

@ -164,6 +164,9 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
params.setStatusList(listx);
}
}
if("1,2,5".equals(params.getStatusStr())){
params.setApprovalStaffId(user.getUserId());
}
params.setDepartmentIds(departmentIds);
String departmentLevel = Constant.ME;
if (params.getIsSelf() != 1) { // 表示点击我们审批
@ -181,7 +184,6 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
PageUtils pageUtils = PageUtils.startPage(params.getPage(), params.getLimit()).doSelect(
page -> resultRecordMapper.selectByConditionByLeader(page, params)
);
List<ResultRecord> resultRecords = pageUtils.getList();
if (CollectionUtils.isNotEmpty(resultRecords)) {
List<ResultRecordResp> list = new ArrayList<>();
@ -365,6 +367,9 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
if (index < 0) { //表示流程己经结束
lastFlowRecord.setFlowName(mySelf.getName() + "-审批通过");
flowRecordService.updateCoverFlowRecordById(lastFlowRecord);
resultRecordService.updateFlowStaffIdRoleToNull(resultRecord.getId());// 更新用户权限
return R.ok("流程审批结束")
.put("from", staff)
@ -390,18 +395,20 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
FlowDepartment flowD = staffEntityMap.get(departmentLevel);
if (flowD == null) {
List<StaffRole> staffRoles = staffRoleService.selectByRole(departmentLevel);
for (StaffRole staffRole : staffRoles) {
List<StaffRoleDepartment> staffRoleDepartments = staffRoleDepartmentService.selectStaffRoleDepartmentByStaffRoleId(staffRole.getId());
Map<String, String> departmentIdMap = departmentsService.selectUserAllDepartmentIds(resultRecord.getDepartmentId());
for (StaffRoleDepartment staffRoleDepartment : staffRoleDepartments) {
String value = departmentIdMap.get(staffRoleDepartment.getDepartmentId());
if (StringUtil.isNotBlank(value)) {
StaffRoleDto staffRoleDto = new StaffRoleDto(staffRole.getStaffId(), TypeRoleDto.getRoleId(staffRole.getTypeRoleIds(),resultRecord.getType()));
StaffRoleDto staffRoleDto = new StaffRoleDto(staffRole.getStaffId(), TypeRoleDto.getRoleId(staffRole.getTypeRoleIds(), resultRecord.getType()));
staffRoleDtos.add(staffRoleDto);
}
}
}
if (staffRoleDtos.size() == 1) { //表示只有一个审批的用户
if (staffRoleDtos.size() >= 1) { //表示只有一个审批的用户
approvalStaff = staffService.selectStaffById(staffRoleDtos.get(0).getStaffId());
}
} else {
@ -410,14 +417,19 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
staffRoleDtos.add(staffRoleDto);
}
}
flowRecord.setFlowName((approvalStaff != null ? approvalStaff.getName() + "-" : "") + flows.get(flowIndex - 1).getOptDesc());
flowRecord.setApprovalStaffId(approvalStaff != null ? approvalStaff.getId() : null);
flowRecord.setApprovalStaffName(approvalStaff != null ? approvalStaff.getName() : null);
String staffRoles = JSON.toJSONString(staffRoleDtos);
flowRecord.setFlowStaffIdRole(staffRoles);
flowRecordService.insertFlowRecord(flowRecord);
resultRecord.setFlowStaffIdRole(staffRoles);
resultRecord.setStatus(1); //审批中
resultRecord.setCurrentApprovalStaffId(approvalStaff != null ? approvalStaff.getId() : null);
resultRecord.setCurrentApprovalStaffName(approvalStaff != null ? approvalStaff.getName() : null);
resultRecordService.updateResultRecordById(resultRecord);// 更新用户权限
return R.ok("提交审批成功")
.put("from", staff)

View File

@ -19,12 +19,14 @@
<result column="department_id" property="departmentId"/>
<result column="department_name" property="departmentName"/>
<result column="staff_name" property="staffName"/>
<result column="current_approval_staff_id" property="currentApprovalStaffId"/>
<result column="current_approval_staff_name" property="currentApprovalStaffName"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, month_time AS monthTime, status AS status, last_score AS lastScore, all_score AS allScore, remark AS remark, staff_id AS staffId, type AS type, flow_staff_id_role AS flowStaffIdRole, department_id AS departmentId, department_name AS departmentName, staff_name AS staffName
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, month_time AS monthTime, status AS status, last_score AS lastScore, all_score AS allScore, remark AS remark, staff_id AS staffId, type AS type, flow_staff_id_role AS flowStaffIdRole, department_id AS departmentId, department_name AS departmentName, staff_name AS staffName, current_approval_staff_id AS currentApprovalStaffId, current_approval_staff_name AS currentApprovalStaffName
</sql>
@ -48,6 +50,8 @@
<if test="departmentId != null">department_id, </if>
<if test="departmentName != null">department_name, </if>
<if test="staffName != null">staff_name, </if>
<if test="currentApprovalStaffId != null">current_approval_staff_id, </if>
<if test="currentApprovalStaffName != null">current_approval_staff_name, </if>
is_delete,
gmt_create,
gmt_modified
@ -63,6 +67,8 @@
<if test="departmentId != null">#{ departmentId}, </if>
<if test="departmentName != null">#{ departmentName}, </if>
<if test="staffName != null">#{ staffName}, </if>
<if test="currentApprovalStaffId != null">#{ currentApprovalStaffId}, </if>
<if test="currentApprovalStaffName != null">#{ currentApprovalStaffName}, </if>
0,
now(),
now()
@ -86,7 +92,9 @@
<if test="flowStaffIdRole != null">flow_staff_id_role = #{flowStaffIdRole},</if>
<if test="departmentId != null">department_id = #{departmentId},</if>
<if test="departmentName != null">department_name = #{departmentName},</if>
<if test="staffName != null">staff_name = #{staffName}</if>
<if test="staffName != null">staff_name = #{staffName},</if>
<if test="currentApprovalStaffId != null">current_approval_staff_id = #{currentApprovalStaffId},</if>
<if test="currentApprovalStaffName != null">current_approval_staff_name = #{currentApprovalStaffName}</if>
</trim>
,gmt_modified = now()
where id = #{id}
@ -109,7 +117,9 @@
flow_staff_id_role = #{flowStaffIdRole},
department_id = #{departmentId},
department_name = #{departmentName},
staff_name = #{staffName}
staff_name = #{staffName},
current_approval_staff_id = #{currentApprovalStaffId},
current_approval_staff_name = #{currentApprovalStaffName}
,gmt_modified = now()
where id = #{id}
</update>
@ -120,6 +130,7 @@
</update>
<select id="selectByCondition" resultType="com.lz.modules.sys.entity.app.ResultRecord">
select * from lz_result_record where is_delete = 0
<if test="req.monthBeginDate != null and req.monthBeginDate != '' ">
@ -198,23 +209,25 @@
#{item}
</foreach>
</if>
<if test="req.statusList != null and req.statusList.size() > 0 ">
and rd.status in
<foreach collection="req.statusList" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</if>
<if test="req.staffId != null and req.staffId !='' ">
and rd.staff_id = #{req.staffId}
</if>
<if test="req.approvalStaffId !=null and req.approvalStaffId !=''" >
and rd.current_approval_staff_id = #{req.approvalStaffId}
</if>
order by fr.id desc )
a GROUP by id order by department_id desc
</select>
<update id="updateFlowStaffIdRoleToNull">
update lz_result_record set flow_staff_id_role = '[]',status = 4 where id = #{id}
update lz_result_record set flow_staff_id_role = '[]',status = 4,current_approval_staff_id = null ,current_approval_staff_name = null where id = #{id}
</update>
<select id="selectResultRecordByIds" resultType="com.lz.modules.sys.entity.app.ResultRecord">

View File

@ -61,7 +61,7 @@ public class MysqlMain {
}
List<TablesBean> list = new ArrayList<TablesBean>();
list.add(new TablesBean("lz_record_file"));
list.add(new TablesBean("lz_result_record"));
List<TablesBean> list2 = new ArrayList<TablesBean>();
Map<String, String> map = MysqlUtil2ShowCreateTable.getComments();