This commit is contained in:
mashuai 2025-06-21 11:00:18 +08:00
parent 0772811caa
commit 9335bc9041
13 changed files with 216 additions and 50 deletions

View File

@ -0,0 +1,22 @@
package com.bonus.common.biz.domain.lease;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
/**
* @Author ma_sh
* @create 2025/6/20 17:16
*/
@EqualsAndHashCode(callSuper = false)
@Data
@ToString
public class LeaseOutSign {
@ApiModelProperty(value = "出库人签名URL")
private String outSignUrl;
@ApiModelProperty(value = "出库人签名类型")
private int outSignType;
}

View File

@ -608,6 +608,11 @@ public class ArchivesServiceImpl implements ArchivesService {
}
info.setUserId(userId);
ElcSignatureInfo elcSignatureInfo = archivesMapper.getSign(info);
if (elcSignatureInfo != null) {
if (StringUtils.isNotBlank(elcSignatureInfo.getSignUrl())) {
elcSignatureInfo.setSignUrl("data:image/png;base64," + elcSignatureInfo.getSignUrl());
}
}
return AjaxResult.success(elcSignatureInfo);
}

View File

@ -156,6 +156,17 @@ public class BackApplyInfoController extends BaseController {
return backApplyInfoService.getMachineById(dto);
}
/**
* 根据单位和工程id查询领料机具
* @param dto
* @return
*/
@ApiOperation(value = "根据单位和工程id查询领料机具")
@GetMapping("/selectMachineById")
public AjaxResult selectMachineById(BackApplyInfo dto){
return backApplyInfoService.selectMachineById(dto);
}
/**
* app根据设备编码去检索领料详情
* @param dto
@ -326,6 +337,16 @@ public class BackApplyInfoController extends BaseController {
return backApplyInfoService.deleteBackApplyInfoById(backApplyInfo.getId());
}
/**
* todo :删除退料任务,仅供app使用整张单据删除时里面有内容不允许删除
*/
@ApiOperation(value = "APP删除退料任务")
@PreventRepeatSubmit
@PostMapping("/deleteByApp")
public AjaxResult deleteByApp(@RequestBody BackApplyInfo backApplyInfo) {
return backApplyInfoService.deleteByApp(backApplyInfo.getId());
}
/**
* app内层删除退料任务
*/

View File

@ -151,5 +151,19 @@ public interface IBackApplyInfoService {
* @return
*/
BackApplyInfoVo selectSecondList(BackApplyInfoVo dto);
/**
* 根据单位和工程id查询领料机具
* @param dto
* @return
*/
AjaxResult selectMachineById(BackApplyInfo dto);
/**
* APP删除退料任务
* @param id
* @return
*/
AjaxResult deleteByApp(Long id);
}

View File

@ -92,7 +92,9 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
String directAuditUrl = backApplyInfoMapper.getDirectAuditUrl(backApplyInfo);
backApplyInfo.setDirectAuditSignUrl(directAuditUrl);
/** 设置审批人签名url 防止代码冲突 **/
if (StringUtils.isNotBlank(backApplyInfo.getBackSignUrl())) {
backApplyInfo.setBackSignUrl("data:image/png;base64," + backApplyInfo.getBackSignUrl());
}
backApplyRequestVo.setBackApplyInfo(backApplyInfo);
//查询退料详情信息
backApplyInfo.setKeyWord(keyWord);
@ -1176,7 +1178,7 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
@Override
public AjaxResult getMachine(BackApplyInfo dto) {
// 首先根据idmaCode或者qrCode进行查询看此条数据是否已经存在该退料单中
if (dto.getId() != null) {
if (dto.getId() != null && (StringUtils.isNotBlank(dto.getMaCode()) || StringUtils.isNotBlank(dto.getQrCode()))) {
List<MaCodeVo> maCodeVoList = backApplyInfoMapper.getMachineByIdAndCode(dto);
if (CollectionUtils.isNotEmpty(maCodeVoList)) {
return AjaxResult.error("该编码已存在该退料单中,请重新选择");
@ -1197,7 +1199,7 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
}
return AjaxResult.success(list);
}
return AjaxResult.error(HttpCodeEnum.SYSTEM_ERROR.getCode(), "编码检索为空");
return AjaxResult.error(HttpCodeEnum.SYSTEM_ERROR.getCode(), "检索为空或该设备非该单位和工程所领");
}
/**
@ -1439,6 +1441,54 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
return vo;
}
/**
* 根据单位和工程id查询领料机具
* @param dto
* @return
*/
@Override
public AjaxResult selectMachineById(BackApplyInfo dto) {
List<MaCodeVo> list = backApplyInfoMapper.getMachineById(dto);
if (CollectionUtils.isNotEmpty(list)) {
// 根据id查询该单据可能存在的设备编码
List<MaCodeVo> maCodeVos = backApplyInfoMapper.selectByCode(dto.getId());
if (CollectionUtils.isNotEmpty(maCodeVos)) {
// 获取maCodeVos中的编码
List<String> maCodes = maCodeVos.stream().map(MaCodeVo::getMaCode).collect(Collectors.toList());
// 将maCodes中存在于list集合中的编码把数据从list集合中去除
list = list.stream().
filter(info -> !maCodes.contains(info.getMaCode())).
collect(Collectors.toList());
}
}
return AjaxResult.success(list);
}
/**
* APP删除退料任务
* @param id
* @return
*/
@Override
public AjaxResult deleteByApp(Long id) {
try {
// 查询信息
BackApplyInfo backApplyInfo = backApplyInfoMapper.selectBackApplyInfoById(id);
List<BackApplyDetails> backApplyDetailsList = backApplyInfoMapper.selectBackApplyDetailsListByTaskId(backApplyInfo);
if (CollectionUtils.isNotEmpty(backApplyDetailsList)) {
return AjaxResult.error("该单据中存在相关退料数据,不允许删除");
}
// 删除相关任务信息
int result = deleteTaskInfo(backApplyInfo);
if (result > 0) {
return AjaxResult.success(result);
}
} catch (Exception e) {
e.printStackTrace();
}
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), HttpCodeEnum.FAIL.getMsg());
}
/**
* 关键字搜索

View File

@ -1,7 +1,7 @@
package com.bonus.material.lease.domain.vo;
import com.bonus.common.biz.domain.lease.LeaseOutSign;
import com.bonus.common.core.web.domain.BaseEntity;
import com.bonus.material.back.domain.vo.MaCodeVo;
import com.bonus.material.lease.domain.LeaseApplyDetails;
import com.bonus.common.biz.domain.lease.LeaseApplyInfo;
import io.swagger.annotations.ApiModelProperty;
@ -34,6 +34,11 @@ public class LeaseApplyRequestVo extends BaseEntity {
private List<LeaseOutVo> leaseOutVoList;
/**
* 库管签名集合
*/
private List<LeaseOutSign> kgSignList;
private int statusFlag;
}

View File

@ -3,6 +3,7 @@ package com.bonus.material.lease.mapper;
import java.util.Date;
import java.util.List;
import com.bonus.common.biz.domain.lease.LeaseApplyInfo;
import com.bonus.common.biz.domain.lease.LeaseOutSign;
import org.apache.ibatis.annotations.Param;
/**
@ -99,4 +100,11 @@ public interface LeaseApplyInfoMapper {
* @return
*/
List<LeaseApplyInfo> getNoSignList(LeaseApplyInfo leaseApplyInfo);
/**
* 查询领料单的领料单出库签名
* @param id
* @return
*/
List<LeaseOutSign> selectLeaseApplyOutList(Long id);
}

View File

@ -10,6 +10,7 @@ import cn.hutool.core.collection.CollectionUtil;
import com.bonus.common.biz.config.PoiOutPage;
import com.bonus.common.biz.constant.MaterialConstants;
import com.bonus.common.biz.domain.BmFileInfo;
import com.bonus.common.biz.domain.lease.LeaseOutSign;
import com.bonus.common.biz.enums.HttpCodeEnum;
import com.bonus.common.biz.enums.LeaseTaskStatusEnum;
import com.bonus.common.biz.enums.MaMachineStatusEnum;
@ -122,6 +123,10 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
String sendUnit = leaseApplyInfoMapper.getSendUnit(info);
info.setSendUnit(sendUnit);
}
// 电子签名进行base64拼接
if (StringUtils.isNotBlank(info.getLeaseSignUrl())) {
info.setLeaseSignUrl("data:image/png;base64," + info.getLeaseSignUrl());
}
/** 设置发料单位 防止代码冲突 **/
leaseApplyRequestVo.setLeaseApplyInfo(info);
@ -156,6 +161,16 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
}
}
}
// 根据id查询领料出库情况查询出库人电子签名详情
List<LeaseOutSign> outSignList = leaseApplyInfoMapper.selectLeaseApplyOutList(id);
if (!CollectionUtils.isEmpty(outSignList)) {
for (LeaseOutSign applyInfo : outSignList) {
if (StringUtils.isNotBlank(applyInfo.getOutSignUrl())) {
applyInfo.setOutSignUrl("data:image/png;base64," + applyInfo.getOutSignUrl());
}
}
leaseApplyRequestVo.setKgSignList(outSignList);
}
});
@ -179,7 +194,7 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
List<LeaseApplyInfo> list = leaseApplyInfoMapper.selectLeaseApplyInfoList(leaseApplyInfo);
// 如果statusList包含345则为领料出库查询需查询领用出库数据进行拼接
if (!CollectionUtils.isEmpty(leaseApplyInfo.getStatusList())) {
if (leaseApplyInfo.getStatusList().contains(3) || leaseApplyInfo.getStatusList().contains(4) || leaseApplyInfo.getStatusList().contains(5)) {
if (leaseApplyInfo.getStatusList().containsAll(Arrays.asList(3, 4, 5))) {
// 查询领用出库数据
List<LeaseApplyInfo> leaseApplyOutList = leaseApplyInfoMapper.selectPublishList(leaseApplyInfo);
if (!CollectionUtils.isEmpty(leaseApplyOutList)) {
@ -209,7 +224,8 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
}
// 使用 Stream API 进行降序排序
List<LeaseApplyInfo> sortedList = list.stream()
.sorted(Comparator.comparing(LeaseApplyInfo::getCreateTime).reversed())
.sorted(Comparator.comparing(LeaseApplyInfo::getCreateTime,
Comparator.nullsFirst(Comparator.naturalOrder())).reversed())
.collect(Collectors.toList());
if (!CollectionUtils.isEmpty(sortedList)) {
String keyWord = leaseApplyInfo.getKeyWord();
@ -274,9 +290,9 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
}
// 使用 Stream API 进行降序排序
List<LeaseApplyInfo> sortedList = list.stream()
.sorted(Comparator.comparing(LeaseApplyInfo::getCreateTime).reversed())
.sorted(Comparator.comparing(LeaseApplyInfo::getCreateTime,
Comparator.nullsFirst(Comparator.naturalOrder())).reversed())
.collect(Collectors.toList());
if (!CollectionUtils.isEmpty(sortedList)) {
String keyWord = leaseApplyInfo.getKeyWord();
// 如果关键字不为空进行过滤
@ -779,12 +795,12 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
if (CollectionUtil.isNotEmpty(recordList)) {
recordList = recordList.stream().filter(item -> item.getMaStatus().equals(MaMachineStatusEnum.IN_STORE.getStatus().toString())).collect(Collectors.toList());
if (recordList.size() > 0) {
msg = "监测到" + bmQrcodeInfo.getQrCode() + "符合出库条件,请确认是否出库!";
msg = "监测到当前设备符合出库条件,请确认是否出库!";
}else{
msg = "监测到" + bmQrcodeInfo.getQrCode() + "编码不符合出库条件,请检查后重新提交!";
msg = "监测到当前设备不符合出库条件,无法出库!";
}
} else {
msg = "监测到" + bmQrcodeInfo.getQrCode() + "编码不符合出库条件,请检查后重新提交!";
msg = "监测到当前设备不符合出库条件,无法出库!!";
}
// 返回包含设备列表和消息的结果
Map<String, Object> result = new HashMap<>(2);

View File

@ -443,7 +443,7 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
}
if (res > 0) {
// 插入领料出库明细表lease_out_details
record.setCreateBy(SecurityUtils.getLoginUser().getSysUser().getNickName());
record.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString());
res = leaseOutDetailsMapper.insertLeaseOutDetails(record);
if (res > 0) {
// 普通机具减少 (ma_type 设备规格表)的库存数量

View File

@ -3,10 +3,12 @@ package com.bonus.material.purchase.domain.vo;
import com.bonus.material.archives.domain.ElcSignatureInfo;
import com.bonus.material.purchase.domain.PurchaseCheckDetails;
import com.bonus.material.purchase.domain.PurchaseSignRecord;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
@ -27,7 +29,8 @@ public class PurchaseCheckFormVo {
private String supplier;
@ApiModelProperty(value = "到货日期")
private String arrivalDate;
@JsonFormat(pattern = "yyyy-MM-dd")
private Date arrivalDate;
@ApiModelProperty(value = "供应科")
private String supplyDept;

View File

@ -51,7 +51,7 @@ public class ScrapDetailsListVo {
private String scrapSource;
/** 0自然1人为 */
@Excel(name = "损坏类型", readConverterExp = "0=自然损坏1=人为损坏")
@Excel(name = "损坏类型")
private String scrapType;
@ApiModelProperty(value = "任务创建人昵称")

View File

@ -125,9 +125,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and sai.ma_id = lod.ma_id
LEFT JOIN bm_agreement_info ba ON sai.agreement_id = ba.agreement_id
WHERE
1 = 1 and mm.ma_status = '2' and mm.type_id = #{typeId}
mm.ma_status = '2'
AND ba.unit_id = #{unitId}
AND ba.project_id = #{proId}
<if test="typeId != null">
and mm.type_id = #{typeId}
</if>
GROUP BY mm.ma_code
</select>
@ -150,7 +153,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
bu.unit_name AS unitName,
bp.pro_id AS proId,
bp.pro_name AS proName,
bai.direct_audit_by AS directAuditBy
bai.direct_audit_by AS directAuditBy,
bai.back_sign_url AS backSignUrl,
bai.back_sign_type AS backSignType
FROM
back_apply_info bai
LEFT JOIN tm_task_agreement tta ON bai.task_id = tta.task_id
@ -303,39 +308,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="getMachine" resultType="com.bonus.material.back.domain.vo.MaCodeVo">
SELECT
mm.ma_id AS maId,
mm.ma_code AS maCode,
mm.ma_status AS maStatus,
mt1.type_name AS typeName,
mm.type_id AS typeId,
mt.type_name AS materialName,
mt2.type_name AS materialType,
ba.unit_id AS unitId,
bu.unit_name AS unitName,
ba.project_id AS proId,
bp.pro_name AS proName,
ba.agreement_id AS agreementId
FROM
lease_out_details lod
LEFT JOIN ma_machine mm ON lod.ma_id = mm.ma_id
LEFT JOIN ma_type mt ON mm.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'
LEFT JOIN ma_type mt2 ON mt1.parent_id = mt2.type_id
AND mt2.del_flag = '0'
LEFT JOIN lease_apply_info lai ON lod.parent_id = lai.id
LEFT JOIN tm_task_agreement tta ON lai.task_id = tta.task_id
LEFT JOIN bm_agreement_info ba ON tta.agreement_id = ba.agreement_id
LEFT JOIN bm_project bp on bp.pro_id = ba.project_id
AND bp.del_flag = '0'
LEFT JOIN bm_unit bu on bu.unit_id = ba.unit_id
AND bu.del_flag = '0'
WHERE
mm.ma_status = '2' and mm.ma_code = #{maCode}
AND ba.unit_id = #{unitId}
AND ba.project_id = #{proId}
SELECT mm.ma_id AS maId,
mm.ma_code AS maCode,
mm.ma_status AS maStatus,
mt1.type_name AS typeName,
mm.type_id AS typeId,
mt.type_name AS materialName,
mt2.type_name AS materialType,
ba.unit_id AS unitId,
bu.unit_name AS unitName,
ba.project_id AS proId,
bp.pro_name AS proName,
ba.agreement_id AS agreementId
FROM lease_out_details lod
LEFT JOIN ma_machine mm ON lod.ma_id = mm.ma_id
LEFT JOIN ma_type mt ON mm.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'
LEFT JOIN ma_type mt2 ON mt1.parent_id = mt2.type_id
AND mt2.del_flag = '0'
LEFT JOIN slt_agreement_info sai on lod.type_id = sai.type_id
and sai.ma_id = lod.ma_id
LEFT JOIN bm_agreement_info ba ON sai.agreement_id = ba.agreement_id
LEFT JOIN bm_project bp on bp.pro_id = ba.project_id
AND bp.del_flag = '0'
LEFT JOIN bm_unit bu on bu.unit_id = ba.unit_id
AND bu.del_flag = '0'
WHERE mm.ma_status = '2'
and mm.ma_code = #{maCode}
AND ba.unit_id = #{unitId}
AND ba.project_id = #{proId}
</select>
<select id="getNum" resultType="java.lang.Integer">
@ -426,6 +429,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND bu.del_flag = '0'
WHERE
mm.ma_status = '2' and mm.qr_code = #{qrCode}
<if test="agreementId != null">
AND ba.unit_id = #{unitId}
</if>
<if test="agreementId != null">
AND ba.project_id = #{proId}
</if>
</select>
<select id="getDetailsById" resultType="com.bonus.material.back.domain.BackApplyDetails">

View File

@ -54,7 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
sda.dict_label as taskStatusName,
IFNULL(sum(lad.pre_num),0) as preCountNum,
IFNULL(sum(lad.al_num),0) as alNum,
GROUP_CONCAT(mt1.type_name) as maTypeNames,
GROUP_CONCAT(DISTINCT mt1.type_name) as maTypeNames,
bp.contract_part as contractPart,
sd.dept_name as impUnitName
from
@ -346,6 +346,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ORDER BY tt.task_status,tt.create_time desc
</select>
<select id="selectLeaseApplyOutList" resultType="com.bonus.common.biz.domain.lease.LeaseOutSign">
SELECT
su.sign_type AS outSignType,
su.sign_url AS outSignUrl
FROM
sys_user su
LEFT JOIN lease_out_details lod ON su.user_id = lod.create_by
WHERE
lod.parent_id = #{id}
GROUP BY
su.user_id
</select>
<update id="confirmLeaseTask">
update
lease_apply_info