优化功能
This commit is contained in:
parent
6de69becb8
commit
f840b2820a
|
|
@ -216,4 +216,11 @@ public interface LeaseApplyInfoMapper {
|
|||
* @return
|
||||
*/
|
||||
LeaseApplyInfo getInfoList(LeaseApplyInfo applyInfo);
|
||||
|
||||
/**
|
||||
* 查询是否存在出库数据
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
List<LeaseApplyDetails> selectInfo(Long id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1128,6 +1128,17 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
|||
}
|
||||
// 修改外层info
|
||||
leaseApplyInfoMapper.updateLeaseApplyInfo(leaseApplyInfo);
|
||||
// 进行状态判断
|
||||
List<LeaseApplyDetails> leaseApplyDetailsList = leaseApplyDetailsMapper.getByParentId(leaseApplyInfo.getId());
|
||||
int i = GlobalConstants.INT_0;
|
||||
for (LeaseApplyDetails bean : leaseApplyDetailsList) {
|
||||
if (Objects.equals(bean.getPreNum(), bean.getAlNum())) {
|
||||
i++;
|
||||
}
|
||||
}
|
||||
if (i == leaseApplyDetailsList.size()) {
|
||||
tmTaskMapper.updateTaskStatus(leaseApplyInfo.getTaskId().toString(), LeaseTaskStatusEnum.LEASE_TASK_FINISHED.getStatus());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
@ -1300,7 +1311,18 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
|||
*/
|
||||
@Override
|
||||
public int deleteLeaseApplyInfoByIds(Long[] ids) {
|
||||
return leaseApplyInfoMapper.deleteLeaseApplyInfoByIds(ids);
|
||||
// 根据ids去查询该任务是否存在出库数据,存在则不能删除
|
||||
for (Long id : ids) {
|
||||
List<LeaseApplyDetails> list = leaseApplyInfoMapper.selectInfo(id);
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
throw new RuntimeException("该任务存在出库数据,不允许删除!");
|
||||
}
|
||||
}
|
||||
int result = leaseApplyInfoMapper.deleteLeaseApplyInfoByIds(ids);
|
||||
if (result > 0) {
|
||||
result = leaseApplyDetailsMapper.deleteLeaseApplyDetailsByParentIds(ids);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -55,4 +55,22 @@ public class PartLeaseDetails extends BaseEntity implements java.io.Serializable
|
|||
|
||||
private String keyWord;
|
||||
|
||||
private String signUrl;
|
||||
|
||||
@ApiModelProperty(value = "签名类型 手写0 和 图片上传1")
|
||||
private int signType;
|
||||
|
||||
/**
|
||||
* 审核人
|
||||
*/
|
||||
private String auditor;
|
||||
|
||||
@ApiModelProperty(value = "操作人")
|
||||
private String creator;
|
||||
|
||||
private String createSignUrl;
|
||||
|
||||
@ApiModelProperty(value = "签名类型 手写0 和 图片上传1")
|
||||
private int createSignType;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.material.part.domain.vo;
|
||||
|
||||
import com.bonus.common.biz.domain.lease.LeaseOutSign;
|
||||
import com.bonus.material.part.domain.PartLeaseDetails;
|
||||
import lombok.Data;
|
||||
|
||||
|
|
@ -22,4 +23,19 @@ public class PartLeaseVo {
|
|||
* 领料明细
|
||||
*/
|
||||
private List<PartLeaseDetails> detailsList;
|
||||
|
||||
/**
|
||||
* 领料人兼制单人签名
|
||||
*/
|
||||
private LeaseOutSign leaseSignInfo;
|
||||
|
||||
/**
|
||||
* 审核人签名
|
||||
*/
|
||||
private List<LeaseOutSign> approveSignInfo;
|
||||
|
||||
/**
|
||||
* 库管签名
|
||||
*/
|
||||
private List<LeaseOutSign> kgSignInfo;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.material.part.mapper;
|
||||
|
||||
import com.bonus.common.biz.domain.lease.LeaseOutSign;
|
||||
import com.bonus.material.ma.domain.PartType;
|
||||
import com.bonus.material.part.domain.MaPartTypeKeeper;
|
||||
import com.bonus.material.part.domain.PartLeaseDetails;
|
||||
|
|
@ -165,4 +166,18 @@ public interface PartLeaseMapper {
|
|||
* @return
|
||||
*/
|
||||
List<PartType> selectUserList(PartType partType);
|
||||
|
||||
/**
|
||||
* 获取库存签名id集合
|
||||
* @param partLeaseDetails
|
||||
* @return
|
||||
*/
|
||||
String selectSignList(PartLeaseDetails partLeaseDetails);
|
||||
|
||||
/**
|
||||
* 根据id获取库管签名
|
||||
* @param signIdList
|
||||
* @return
|
||||
*/
|
||||
List<LeaseOutSign> selectSignListInfo(@Param("list") List<String> signIdList);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.bonus.material.part.service.impl;
|
|||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.alibaba.nacos.common.utils.CollectionUtils;
|
||||
import com.bonus.common.biz.constant.MaterialConstants;
|
||||
import com.bonus.common.biz.domain.lease.LeaseOutSign;
|
||||
import com.bonus.common.biz.enums.PartLeaseTaskStatusEnum;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
|
|
@ -149,6 +150,43 @@ public class PartLeaseServiceImpl implements PartLeaseService {
|
|||
details.setDeptName(deptName);
|
||||
details.setSendDeptName(sendDeptName);
|
||||
partLeaseVo.setDetails(details);
|
||||
// 获取list中的制单人签名
|
||||
PartLeaseDetails partLeaseDetails1 = list.get(0);
|
||||
if (StringUtils.isNotBlank(partLeaseDetails1.getCreateSignUrl())) {
|
||||
if (!partLeaseDetails1.getCreateSignUrl().startsWith("http")) {
|
||||
partLeaseDetails1.setCreateSignUrl("data:image/png;base64," + partLeaseDetails1.getCreateSignUrl());
|
||||
}
|
||||
LeaseOutSign leaseOutSign = new LeaseOutSign(partLeaseDetails1.getCreateSignType(),
|
||||
partLeaseDetails1.getCreateSignUrl());
|
||||
partLeaseVo.setLeaseSignInfo(leaseOutSign);
|
||||
}
|
||||
// 根据list集合中的auditor进行分组,分别获取签名
|
||||
Map<String, List<PartLeaseDetails>> auditorMap = list.stream()
|
||||
.filter(item -> StringUtils.isNotBlank(item.getAuditor()))
|
||||
.collect(Collectors.groupingBy(PartLeaseDetails::getAuditor));
|
||||
List<LeaseOutSign> arrayList = new ArrayList<>();
|
||||
// 根据key获取auditorMap中的值,每个key只有获取一次值即可,转入到arrayList中
|
||||
for (String key : auditorMap.keySet()) {
|
||||
List<PartLeaseDetails> value = auditorMap.get(key);
|
||||
PartLeaseDetails partLeaseDetails2 = value.get(0);
|
||||
if (StringUtils.isNotBlank(partLeaseDetails2.getSignUrl())) {
|
||||
if (!partLeaseDetails2.getSignUrl().startsWith("http")) {
|
||||
partLeaseDetails2.setSignUrl("data:image/png;base64," + partLeaseDetails2.getSignUrl());
|
||||
}
|
||||
LeaseOutSign leaseOutSign = new LeaseOutSign(partLeaseDetails2.getSignType(),
|
||||
partLeaseDetails2.getSignUrl());
|
||||
arrayList.add(leaseOutSign);
|
||||
}
|
||||
}
|
||||
partLeaseVo.setApproveSignInfo(arrayList);
|
||||
// 获取库管签名
|
||||
String signId = partLeaseMapper.selectSignList(partLeaseDetails);
|
||||
if (StringUtils.isNotBlank(signId)) {
|
||||
// 根据id获取库管签名,将signId转换为集合
|
||||
List<String> signIdList = Arrays.asList(signId.split(","));
|
||||
List<LeaseOutSign> signList = partLeaseMapper.selectSignListInfo(signIdList);
|
||||
partLeaseVo.setKgSignInfo(signList);
|
||||
}
|
||||
}
|
||||
return partLeaseVo;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -782,7 +782,7 @@ public class RepairInputDetailsServiceImpl implements IRepairInputDetailsService
|
|||
|
||||
RepairInputDetails inputInfo = new RepairInputDetails();
|
||||
if (StringUtils.isNotBlank(inputApplyDetails.getMaCode())) {
|
||||
inputInfo = checkCodeMachineStatus(inputApplyDetails.getMaCode());
|
||||
inputInfo = checkCodeMachineStatus(inputApplyDetails.getMaId());
|
||||
} else {
|
||||
inputInfo = checkMachineStatus(inputApplyDetails.getQrCode());
|
||||
}
|
||||
|
|
@ -813,28 +813,13 @@ public class RepairInputDetailsServiceImpl implements IRepairInputDetailsService
|
|||
|
||||
/**
|
||||
* 修饰入库之编码入库
|
||||
* @param maCode
|
||||
* @param maId
|
||||
* @return
|
||||
*/
|
||||
private RepairInputDetails checkCodeMachineStatus(String maCode) {
|
||||
RepairInputDetails inputInfo = new RepairInputDetails();
|
||||
|
||||
Machine ma = new Machine();
|
||||
ma.setMaCode(maCode);
|
||||
Machine ma2 = machineMapper.selectMachineByQrCode(ma);
|
||||
long maId = ma2.getMaId();
|
||||
|
||||
String status = ma2.getMaStatus();
|
||||
if("5".equals(status)){
|
||||
private RepairInputDetails checkCodeMachineStatus(Long maId) {
|
||||
InputApplyDetails inputApplyDetails = new InputApplyDetails();
|
||||
inputApplyDetails.setMaId(maId);
|
||||
inputInfo = repairInputDetailsMapper.selectInputInfoByMaId(inputApplyDetails);
|
||||
|
||||
|
||||
}else{
|
||||
inputInfo = null;
|
||||
}
|
||||
return inputInfo;
|
||||
return repairInputDetailsMapper.selectInputInfoByMaId(inputApplyDetails);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -118,8 +118,8 @@ public class SysWorkflowRecordHistoryServiceImpl implements SysWorkflowRecordHis
|
|||
|
||||
|
||||
|
||||
String flag = checkAuditUser(recordId,sysUser);
|
||||
|
||||
//String flag = checkAuditUser(recordId,sysUser);
|
||||
String flag = "0";
|
||||
if("0".equals( flag)){
|
||||
Integer taskId = sysWorkflowRecordHistory.getTaskId();
|
||||
Integer leaseId = sysWorkflowRecordHistory.getLeaseId();
|
||||
|
|
|
|||
|
|
@ -878,4 +878,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
HAVING
|
||||
SUM( out_num ) > 0
|
||||
</select>
|
||||
|
||||
<select id="selectInfo" resultType="com.bonus.material.lease.domain.LeaseApplyDetails">
|
||||
SELECT
|
||||
parent_id AS parentId,
|
||||
type_id AS typeId,
|
||||
pre_num AS preNum,
|
||||
al_num AS alNum,
|
||||
pre_num - IFNULL( al_num, 0 ) AS outNum
|
||||
FROM
|
||||
lease_apply_details
|
||||
WHERE
|
||||
parent_id = #{id} and al_num > 0
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -626,9 +626,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="qrCode != null and qrCode != ''">
|
||||
and mm.qr_code = #{qrCode}
|
||||
</if>
|
||||
<if test="maCode != null and maCode != ''">
|
||||
and mm.ma_code LIKE CONCAT('%',#{maCode},'%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getInfoByQrcode" resultType="com.bonus.material.ma.domain.Machine">
|
||||
|
|
|
|||
|
|
@ -88,7 +88,13 @@
|
|||
pcad.status as status,
|
||||
mp1.buy_price as bugPrice,
|
||||
dept.companyName as deptName,
|
||||
dept1.companyName as sendDeptName
|
||||
dept1.companyName as sendDeptName,
|
||||
su1.sign_type as signType,
|
||||
su1.sign_url as signUrl,
|
||||
pcad.auditor as auditor,
|
||||
p1.creator as creator,
|
||||
su.sign_type as createSignType,
|
||||
su.sign_url as createSignUrl
|
||||
FROM
|
||||
pa_collar_apply_details pcad
|
||||
LEFT JOIN ma_part_type mp1 ON pcad.part_id = mp1.pa_id
|
||||
|
|
@ -251,6 +257,36 @@
|
|||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectSignList" resultType="java.lang.String">
|
||||
SELECT
|
||||
GROUP_CONCAT( mp.user_id )
|
||||
FROM
|
||||
pa_collar_apply_details pa
|
||||
LEFT JOIN ma_part_type_keeper mp ON pa.part_id = mp.type_id
|
||||
LEFT JOIN sys_user su ON mp.user_id = su.user_id
|
||||
WHERE
|
||||
pa.task_id = #{taskId}
|
||||
GROUP BY
|
||||
pa.part_id
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
<select id="selectSignListInfo" resultType="com.bonus.common.biz.domain.lease.LeaseOutSign">
|
||||
SELECT
|
||||
sign_type as outSignType,
|
||||
sign_url as outSignUrl
|
||||
FROM
|
||||
sys_user
|
||||
WHERE
|
||||
sign_url IS NOT NULL
|
||||
<if test="list != null">
|
||||
and user_id in
|
||||
<foreach collection="list" item="item" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<insert id="insertPartLeaseDetails">
|
||||
insert into pa_collar_apply_details(task_id, part_id, pre_num, al_num, remarks)
|
||||
values (#{taskId}, #{partId}, #{preNum}, #{alNum}, #{remarks})
|
||||
|
|
|
|||
Loading…
Reference in New Issue