领料出库签字
This commit is contained in:
parent
f16a59ce04
commit
6de4ee15c1
|
|
@ -107,4 +107,18 @@ public interface LeaseApplyInfoMapper {
|
|||
* @return
|
||||
*/
|
||||
int updateLeasePublishInfoSign(LeaseApplyInfo leaseApplyInfo);
|
||||
|
||||
/**
|
||||
* 新增领用发布签名
|
||||
* @param leaseApplyInfo
|
||||
* @return
|
||||
*/
|
||||
int insertLeaseSign(LeaseApplyInfo leaseApplyInfo);
|
||||
|
||||
/**
|
||||
* 查询未签名的领用单
|
||||
* @param leaseApplyInfo
|
||||
* @return
|
||||
*/
|
||||
List<LeaseApplyInfo> selectNoSignList(LeaseApplyInfo leaseApplyInfo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.bonus.material.lease.mapper;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import com.bonus.common.biz.domain.lease.LeaseApplyInfo;
|
||||
import com.bonus.common.biz.domain.lease.LeaseOutDetails;
|
||||
import com.bonus.material.ma.domain.Type;
|
||||
|
||||
|
|
@ -102,4 +103,11 @@ public interface LeaseOutDetailsMapper {
|
|||
* @return
|
||||
*/
|
||||
int updateMachine(LeaseOutDetails record);
|
||||
|
||||
/**
|
||||
* 修改领料出库详细
|
||||
* @param leaseApplyInfo
|
||||
* @return
|
||||
*/
|
||||
int updateLeaseOutSign(LeaseApplyInfo leaseApplyInfo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ import com.bonus.material.lease.domain.vo.LeaseApplyRequestVo;
|
|||
import com.bonus.common.biz.domain.lease.LeaseOutRequestVo;
|
||||
import com.bonus.material.lease.domain.vo.LeaseOutVo;
|
||||
import com.bonus.material.lease.mapper.LeaseApplyDetailsMapper;
|
||||
import com.bonus.material.lease.mapper.LeaseOutDetailsMapper;
|
||||
import com.bonus.material.lease.service.ILeaseOutDetailsService;
|
||||
import com.bonus.material.task.domain.TmTask;
|
||||
import com.bonus.material.task.domain.TmTaskAgreement;
|
||||
|
|
@ -74,6 +75,9 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
|||
@Resource
|
||||
private BmFileInfoMapper bmFileInfoMapper;
|
||||
|
||||
@Resource
|
||||
private LeaseOutDetailsMapper leaseOutDetailsMapper;
|
||||
|
||||
/**
|
||||
* 查询领料任务
|
||||
*
|
||||
|
|
@ -208,11 +212,7 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
|||
.filter(info -> StringUtils.isNotBlank(info.getLeaseSignUrl()))
|
||||
.collect(Collectors.toList());
|
||||
} else if (leaseApplyInfo.getHasSign() != null && leaseApplyInfo.getHasSign() == 0) {
|
||||
extracted(leaseApplyInfo, list);
|
||||
// 查询待签名的领料单
|
||||
list = list.stream()
|
||||
.filter(info -> StringUtils.isBlank(info.getLeaseSignUrl()))
|
||||
.collect(Collectors.toList());
|
||||
list = leaseApplyInfoMapper.selectNoSignList(leaseApplyInfo);
|
||||
}
|
||||
}
|
||||
// 使用 Stream API 进行降序排序
|
||||
|
|
@ -745,11 +745,29 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
|||
*/
|
||||
@Override
|
||||
public int updateLeaseApplyInfoSign(LeaseApplyInfo leaseApplyInfo) {
|
||||
// 领用电子签名修改
|
||||
if (leaseApplyInfo.getTaskType() != null && leaseApplyInfo.getTaskType() == 19) {
|
||||
return leaseApplyInfoMapper.updateLeasePublishInfoSign(leaseApplyInfo);
|
||||
int result = 0;
|
||||
Long userid = SecurityUtils.getLoginUser().getUserid();
|
||||
String nickName = SecurityUtils.getLoginUser().getSysUser().getNickName();
|
||||
leaseApplyInfo.setSignPerson(nickName);
|
||||
leaseApplyInfo.setCreateBy(userid.toString());
|
||||
leaseApplyInfo.setCreateTime(DateUtils.getNowDate());
|
||||
// 新增领料签字表lease_sign_info
|
||||
result = leaseApplyInfoMapper.insertLeaseSign(leaseApplyInfo);
|
||||
if (result == 0) {
|
||||
throw new RuntimeException("添加签名信息失败");
|
||||
}
|
||||
return leaseApplyInfoMapper.updateLeaseApplyInfoSign(leaseApplyInfo);
|
||||
// 往lease_out_details表增加新增签字id字段
|
||||
if (StringUtils.isNotBlank(leaseApplyInfo.getIds())) {
|
||||
List<String> ids = Collections.singletonList(leaseApplyInfo.getIds());
|
||||
for (String id : ids) {
|
||||
leaseApplyInfo.setId(Long.parseLong(id));
|
||||
result = leaseOutDetailsMapper.updateLeaseOutSign(leaseApplyInfo);
|
||||
if (result == 0) {
|
||||
throw new RuntimeException("修改领料签字信息失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -174,6 +174,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</trim>
|
||||
</insert>
|
||||
|
||||
<insert id="insertLeaseSign" parameterType="com.bonus.common.biz.domain.lease.LeaseApplyInfo" useGeneratedKeys="true" keyProperty="leaseSignId">
|
||||
insert into lease_sign_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="leaseSignUrl != null and leaseSignUrl != ''">lease_sign_url,</if>
|
||||
<if test="leaseSignType != null">lease_sign_type,</if>
|
||||
<if test="signPerson != null and signPerson != ''">lease_user,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="leaseSignUrl != null and leaseSignUrl != ''">#{leaseSignUrl},</if>
|
||||
<if test="leaseSignType != null">#{leaseSignType},</if>
|
||||
<if test="signPerson != null and signPerson != ''">#{signPerson},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateLeaseApplyInfo" parameterType="com.bonus.common.biz.domain.lease.LeaseApplyInfo">
|
||||
update lease_apply_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
|
|
@ -329,6 +347,49 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
su.user_id
|
||||
</select>
|
||||
|
||||
<select id="selectNoSignList" resultType="com.bonus.common.biz.domain.lease.LeaseApplyInfo">
|
||||
SELECT
|
||||
GROUP_CONCAT( DISTINCT lod.id ) AS ids,
|
||||
lai.id AS id,
|
||||
lai.CODE AS CODE,
|
||||
lai.create_by AS createBy,
|
||||
lai.create_time AS createTime,
|
||||
lai.lease_person AS leasePerson,
|
||||
lai.phone AS phone,
|
||||
bai.unit_id AS leaseUnitId,
|
||||
bai.project_id AS leaseProjectId,
|
||||
bu.unit_name AS leaseUnit,
|
||||
bp.pro_name AS leaseProject,
|
||||
bai.agreement_code AS agreementCode,
|
||||
IFNULL( sum( lod.out_num ), 0 ) AS alNum,
|
||||
GROUP_CONCAT( DISTINCT mt1.type_name ) AS maTypeNames,
|
||||
lai.task_id AS taskId,
|
||||
tt.task_type AS taskType,
|
||||
bp.external_id AS externalId,
|
||||
bu.bzz_idcard AS idCard
|
||||
FROM
|
||||
lease_out_details lod
|
||||
LEFT JOIN lease_apply_info lai ON lai.id = lod.parent_id
|
||||
LEFT JOIN tm_task tt ON lai.task_id = tt.task_id
|
||||
LEFT JOIN tm_task_agreement tta ON tt.task_id = tta.task_id
|
||||
LEFT JOIN bm_agreement_info bai ON tta.agreement_id = bai.agreement_id
|
||||
LEFT JOIN bm_unit bu ON bu.unit_id = bai.unit_id
|
||||
LEFT JOIN bm_project bp ON bp.pro_id = bai.project_id
|
||||
LEFT JOIN ma_type mt ON lod.type_id = mt.type_id
|
||||
AND mt.del_flag = '0'
|
||||
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
|
||||
AND mt1.del_flag = '0'
|
||||
WHERE
|
||||
1 = 1
|
||||
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
||||
<![CDATA[ AND DATE_FORMAT( lai.create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime} ]]>
|
||||
</if>
|
||||
GROUP BY
|
||||
lod.parent_id
|
||||
ORDER BY
|
||||
lod.create_time DESC
|
||||
</select>
|
||||
|
||||
<update id="confirmLeaseTask">
|
||||
update
|
||||
lease_apply_info
|
||||
|
|
|
|||
|
|
@ -265,6 +265,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</set>
|
||||
where id = #{maId}
|
||||
</update>
|
||||
<update id="updateLeaseOutSign">
|
||||
update lease_out_details
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="createTime != null">update_time = #{createTime},</if>
|
||||
<if test="leaseSignId != null">lease_sign_id = #{leaseSignId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteLeaseOutDetailsById" parameterType="Long">
|
||||
delete from lease_out_details where id = #{id}
|
||||
|
|
|
|||
Loading…
Reference in New Issue