项目部授权--项目委托书,电子签名

This commit is contained in:
hongchao 2025-07-08 09:51:09 +08:00
parent 5e9f28a5d5
commit 605e2f452b
7 changed files with 217 additions and 1 deletions

View File

@ -10,6 +10,8 @@ import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.common.core.web.page.TableDataInfo;
import com.bonus.common.log.annotation.SysLog;
import com.bonus.common.log.enums.OperaType;
import com.bonus.material.common.annotation.PreventRepeatSubmit;
import com.bonus.material.materialStation.domain.ProAuthorizeDetails;
import com.bonus.material.materialStation.domain.ProAuthorizeInfo;
import com.bonus.material.materialStation.service.ProAuthorizeService;
import com.bonus.material.repair.domain.vo.RepairDeviceVO;
@ -97,6 +99,44 @@ public class ProAuthorizeController extends BaseController {
return service.authorizeView(bean);
}
/**
* 授权委托书查看
*/
@ApiOperation(value = "授权委托书查看")
@PostMapping("/authorizeInfoView")
public AjaxResult authorizeInfoView(@RequestBody ProAuthorizeInfo bean) {
return service.authorizeInfoView(bean);
}
/**
* 授权书电子签名
*/
@ApiOperation(value = "授权书电子签名")
@PreventRepeatSubmit
@SysLog(title = "授权书电子签名", businessType = OperaType.UPDATE, logType = 1,module = "授权管理->授权书电子签名")
@PostMapping("/updateLeaseApplyInfoSign")
public AjaxResult updateAuthorizeInfoSign(@RequestBody @NotNull ProAuthorizeDetails bean) {
try {
return toAjax(service.updateAuthorizeInfoSign(bean));
} catch (Exception e) {
return error("系统错误, " + e.getMessage());
}
}
/**
* 列表展示
*/
@ApiOperation(value = "列表展示")
@GetMapping("/getAuthorList")
public AjaxResult getAuthorList(ProAuthorizeInfo bean) {
Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1);
Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10);
try {
List<ProAuthorizeInfo> list = service.getAuthorList(bean);
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
} catch (Exception e) {
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, new ArrayList<>()));
}
}
}

View File

@ -60,4 +60,14 @@ public class ProAuthorizeDetails {
* 修改时间
*/
private String updateTime;
/**
* 签名
*/
private String signName;
/**
* 签名类型
*/
private Byte signType;
}

View File

@ -1,7 +1,10 @@
package com.bonus.material.materialStation.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
@ -70,4 +73,26 @@ public class ProAuthorizeInfo {
* 关联外部(第三方)的工程ID
*/
private String externalId;
private String leaseUnit;
private String leaseProject;
private String userName;
private String leaseSignUrl;
private Byte leaseSignType;
private String signStatus;
@JsonFormat(pattern = "yyyy-MM-dd")
private Date startTime;
@JsonFormat(pattern = "yyyy-MM-dd")
private Date endTime;
private String keyWord;
private String code;
}

View File

@ -56,4 +56,12 @@ public interface ProAuthorizeMapper {
* @return
*/
int deleteProAuthorizeDetails(Long authId);
ProAuthorizeInfo selectProAuthorizeInfoView(ProAuthorizeInfo bean);
List<ProAuthorizeInfo> getAuthorList(ProAuthorizeInfo bean);
int updateAuthorizeInfoSign(ProAuthorizeDetails bean);
int updateAuthorizeInfoSignStatus(ProAuthorizeDetails bean);
}

View File

@ -4,6 +4,7 @@ package com.bonus.material.materialStation.service;
import com.bonus.common.biz.domain.lease.LeaseApplyInfo;
import com.bonus.common.biz.domain.lease.LeasePublishInfo;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.material.materialStation.domain.ProAuthorizeDetails;
import com.bonus.material.materialStation.domain.ProAuthorizeInfo;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;
@ -46,4 +47,14 @@ public interface ProAuthorizeService {
* @return
*/
AjaxResult authorizeView(ProAuthorizeInfo bean);
AjaxResult authorizeInfoView(ProAuthorizeInfo bean);
/**
* 授权书电子签名
*/
int updateAuthorizeInfoSign(ProAuthorizeDetails bean);
List<ProAuthorizeInfo> getAuthorList(ProAuthorizeInfo bean);
}

View File

@ -206,6 +206,65 @@ public class ProAuthorizeServiceImpl implements ProAuthorizeService {
}
}
@Override
public AjaxResult authorizeInfoView(ProAuthorizeInfo bean) {
try {
if (bean.getLeaseId()!= null){
//查询授权信息
ProAuthorizeInfo info = mapper.selectProAuthorizeInfoView(bean);
if (info != null){
List<ProAuthorizeDetails> detailsList = mapper.getDetailsList(info.getId());
// 电子签名进行base64拼接
if(!detailsList.isEmpty()){
detailsList.forEach(details -> {
details.setSignName("data:image/png;base64," + details.getSignName());
});
}
info.setDetailsList(detailsList);
}
return AjaxResult.success(info);
} else {
log.error("授权查看没有id");
return AjaxResult.error("授权信息查看失败");
}
} catch (Exception e) {
log.error("授权信息查看失败", e.getMessage());
return AjaxResult.error("授权信息查看失败");
}
}
/**
* 授权书电子签名
*
* @param bean
*/
@Override
public int updateAuthorizeInfoSign(ProAuthorizeDetails bean) {
// 领用电子签名修改
int count = 0;
//修改pro_authorize_user表
count = mapper.updateAuthorizeInfoSign(bean);
if(count==0){
throw new RuntimeException("授权书电子签名失败");
}else{
//修改pro_authorize_info表
return mapper.updateAuthorizeInfoSignStatus(bean);
}
}
@Override
public List<ProAuthorizeInfo> getAuthorList(ProAuthorizeInfo bean) {
try {
List<ProAuthorizeInfo> list = mapper.getAuthorList(bean);
return list;
} catch (Exception e){
log.error("项目部授权列表查询", e.getMessage());
return new ArrayList<>();
}
}
/**
* 判断关键字是否包含在item中
* @param item

View File

@ -50,6 +50,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
create_time, update_by, update_time)
values (#{parentId}, #{name}, #{idNumber}, #{frontUrl}, #{backUrl}, #{createBy}, NOW(),#{createBy},NOW())
</insert>
<update id="updateAuthorizeInfoSign">
update pro_authorize_user set sign_url = #{signName}, sign_type = #{signType}
where parent_id = #{parentId}
</update>
<update id="updateAuthorizeInfoSignStatus">
update pro_authorize_info set sign_status = 1
where id = #{parentId}
</update>
<delete id="deleteProAuthorizeDetails">
delete
@ -124,8 +132,63 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
`name`,
id_number as idNumber,
front_url as frontUrl,
back_url as backUrl
back_url as backUrl,
sign_url as signName,
sign_type as signType
FROM pro_authorize_user
WHERE parent_id = #{id}
</select>
<select id="selectProAuthorizeInfoView" resultType="com.bonus.material.materialStation.domain.ProAuthorizeInfo">
SELECT pai.id,
pai.lease_id as leaseId,
pai.team_id as teamId,
pai.team_name as teamName,
bu.unit_name as leaseUnit,
bp.pro_name as leaseProject,
su.nick_name as userName,
DATE_FORMAT(pai.create_time, '%Y-%m-%d') as createTime
FROM pro_authorize_info pai
left join lease_apply_info lai on pai.lease_id = lai.id
left join tm_task tt on lai.task_id = tt.task_id
left join tm_task_agreement tta on lai.task_id = tta.task_id
left join bm_unit bu on bu.unit_id = lai.unit_id
left join bm_project bp on bp.pro_id = lai.project_id
left join sys_user su on pai.create_by = su.user_id
WHERE pai.lease_id = #{leaseId}
</select>
<select id="getAuthorList" resultType="com.bonus.material.materialStation.domain.ProAuthorizeInfo">
SELECT pai.id,
pai.lease_id as leaseId,
pai.team_id as teamId,
pai.team_name as teamName,
bu.unit_name as leaseUnit,
bp.pro_name as leaseProject,
su.nick_name as userName,
lai.code as code,
lai.create_by as createBy,
lai.create_time createTime,
pai.sign_status as signStatus
FROM pro_authorize_info pai
left join lease_apply_info lai on pai.lease_id = lai.id
left join tm_task tt on lai.task_id = tt.task_id
left join tm_task_agreement tta on lai.task_id = tta.task_id
left join bm_unit bu on bu.unit_id = lai.unit_id
left join bm_project bp on bp.pro_id = lai.project_id
left join sys_user su on pai.create_by = su.user_id
WHERE
pai.status = 1
<if test="keyWord != null and keyWord != ''">
AND (
pai.team_name LIKE concat('%', #{keyWord}, '%') or
lai.code LIKE concat('%', #{keyWord}, '%')
)
</if>
<if test="signStatus != null">
and pai.sign_status = #{signStatus}
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND DATE_FORMAT( lai.create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
</if>
order by pai.create_time desc
</select>
</mapper>