This commit is contained in:
hongchao 2025-03-17 09:51:33 +08:00
commit de0957f63b
10 changed files with 69 additions and 27 deletions

View File

@ -173,7 +173,6 @@ public class ArchivesController extends BaseController {
* @return
*/
@ApiOperation(value = "下载电子档案右侧详情")
@PreventRepeatSubmit
//@RequiresPermissions("archives:type:download")
@GetMapping("/download")
public AjaxResult download(ArchivesVo archivesVo, HttpServletRequest request, HttpServletResponse response)

View File

@ -155,4 +155,11 @@ public interface LeaseApplyDetailsMapper {
* @return
*/
List<LeaseApplyDetails> selectPublishDetails(LeaseApplyDetails leaseApplyDetails);
/**
* 根据领用任务批次删除领用任务详细
* @param leaseOutDetails
* @return
*/
int deletePublishTask(LeaseOutDetails leaseOutDetails);
}

View File

@ -178,8 +178,8 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
leaseApplyInfo.setUserId(SecurityUtils.getUserId());
List<LeaseApplyInfo> list = leaseApplyInfoMapper.selectLeaseApplyInfoList(leaseApplyInfo);
// 如果statusList包含345则为领料出库查询需查询领用出库数据进行拼接
if (leaseApplyInfo.getStatusList() != null && leaseApplyInfo.getStatusList().contains(3)
|| leaseApplyInfo.getStatusList().contains(4) || leaseApplyInfo.getStatusList().contains(5)) {
if (!CollectionUtils.isEmpty(leaseApplyInfo.getStatusList())) {
if (leaseApplyInfo.getStatusList().contains(3) || leaseApplyInfo.getStatusList().contains(4) || leaseApplyInfo.getStatusList().contains(5)) {
// 查询领用出库数据
List<LeaseApplyInfo> leaseApplyOutList = leaseApplyInfoMapper.selectPublishList(leaseApplyInfo);
if (!CollectionUtils.isEmpty(leaseApplyOutList)) {
@ -195,6 +195,7 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
list.addAll(leaseApplyOutList);
}
}
}
// 使用 Stream API 进行降序排序
List<LeaseApplyInfo> sortedList = list.stream()
.sorted(Comparator.comparing(LeaseApplyInfo::getCreateTime).reversed())

View File

@ -4,6 +4,7 @@ import java.math.BigDecimal;
import java.util.List;
import java.util.Objects;
import com.bonus.common.biz.constant.MaterialConstants;
import com.bonus.common.biz.domain.lease.LeaseApplyInfo;
import com.bonus.common.biz.enums.InputOutEnum;
import com.bonus.common.biz.enums.LeaseTaskStatusEnum;
import com.bonus.common.biz.enums.MaMachineStatusEnum;
@ -228,20 +229,36 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
int res = 0;
try {
// 1 根据任务id查询此任务是否已经完结
if (StringUtils.isNotBlank(leaseOutDetails.getPublishTask())) {
// 查询领用出库数据
LeaseApplyInfo leaseApplyInfo = new LeaseApplyInfo();
leaseApplyInfo.setPublishTask(leaseOutDetails.getPublishTask());
List<LeaseApplyInfo> leaseApplyOutList = leaseApplyInfoMapper.selectPublishList(leaseApplyInfo);
if (!CollectionUtils.isEmpty(leaseApplyOutList)) {
for (LeaseApplyInfo applyInfo : leaseApplyOutList) {
if (applyInfo.getPreCountNum().compareTo(applyInfo.getAlNum()) == 0) {
return AjaxResult.error("该任务已完成,不能进行退库操作");
}
}
}
} else {
TmTask tmTask = tmTaskMapper.selectTmTaskByTaskId(Long.valueOf(leaseOutDetails.getTaskId()));
if (tmTask != null && tmTask.getTaskStatus().equals(LeaseTaskStatusEnum.LEASE_TASK_FINISHED.getStatus())) {
return AjaxResult.error("该任务已完成,不能进行退库操作");
}
}
// 2插入出库记录修改库存修改机具状态
res = updateRecords(leaseOutDetails);
if (res == 0) {
throw new RuntimeException("出库退回失败,更新设备规格库存数量时出错!");
}
// 3修改任务状态tm_task
if (StringUtils.isNotBlank(leaseOutDetails.getTaskId())) {
res = editTaskStatus(leaseOutDetails);
if (res == 0) {
throw new RuntimeException("出库退回失败,修改任务状态失败");
}
}
// 4删除结算记录
res = deleteSltInfo(leaseOutDetails);
if (res == 0) {

View File

@ -277,7 +277,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
AND mt1.del_flag = '0'
LEFT JOIN tm_task tt ON bs.task_id = tt.task_id
WHERE bs.in_num != 0 and and bs.result_msg = '操作成功'
WHERE bs.in_num != 0 and bs.result_msg = '操作成功'
<if test="inputType != null and inputType != ''">
and (
CASE

View File

@ -169,6 +169,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</delete>
<delete id="deletePublishTask">
delete from lease_out_details where parent_id = #{parentId} and type_id = #{typeId}
and publish_task = #{publishTask}
<if test="maId != null">
and ma_id = #{maId}
</if>
</delete>
<select id="getByParentId" resultType="com.bonus.material.lease.domain.LeaseApplyDetails">
<!--@mbg.generated-->
select

View File

@ -266,7 +266,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
IFNULL( sum( lpd.num ), 0 ) AS preCountNum,
IFNULL(lod.num, 0) AS alNum,
GROUP_CONCAT( DISTINCT mt1.type_name ) AS maTypeNames,
lpd.publish_task AS publishTask
lpd.publish_task AS publishTask,
lai.task_id AS taskId
FROM
lease_publish_details lpd
LEFT JOIN lease_apply_info lai ON lai.id = lpd.parent_id

View File

@ -184,6 +184,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deleteLeaseOutDetails">
delete from lease_out_details where parent_id = #{parentId} and type_id = #{typeId}
<if test="publishTask != null and publishTask != ''">
and publish_task = #{publishTask}
</if>
<if test="maId != null">
and ma_id = #{maId}
</if>

View File

@ -819,7 +819,7 @@
</if>
where tt.task_type = '19'
and tt.task_status in (1, 2, 3)
<!--<if test="taskStatus != null and taskStatus != ''">
<if test="taskStatus != null and taskStatus != ''">
and tt.task_status = #{taskStatus}
</if>
<if test="taskId != null ">and lai.task_id = #{taskId}</if>
@ -833,7 +833,7 @@
AND DATE_FORMAT( lai.create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
</if>
<if test="isApp != null and taskStatus==1">and (tt.task_status = 0 or tt.task_status = 1 or tt.task_status = 2) </if>
<if test="isApp != null and taskStatus==3">and (tt.task_status = 3 or tt.task_status = 4)</if>-->
<if test="isApp != null and taskStatus==3">and (tt.task_status = 3 or tt.task_status = 4)</if>
GROUP BY lai.id
ORDER BY tt.task_status,tt.create_time desc
</select>

View File

@ -144,6 +144,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="record.maId != null">
AND ma_id = #{record.maId}
</if>
<if test="record.publishTask != null and record.publishTask != ''">
AND publish_task = #{record.publishTask}
</if>
</delete>
<select id="getSltAgreementInfo" resultType="com.bonus.material.settlement.domain.SltAgreementInfo">
@ -171,6 +174,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ma_id IS NULL
AND
status = '0'
<if test="publishTask != null and publishTask != ''">
AND publish_task = #{publishTask}
</if>
AND
DATE(start_time) = CURDATE();
</select>
@ -242,8 +248,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<insert id="insSltInfo">
insert into slt_agreement_info (agreement_id,type_id,ma_id,num,start_time,status,lease_id,lease_price,buy_price,is_slt,company_id,lease_type,create_time)
values (#{agreementId},#{record.typeId},#{record.maId},#{record.outNum},now(),0,#{record.parentId},#{ma.finalPrice},#{ma.buyPrice},'0',#{record.companyId},#{record.leaseType},now());
insert into slt_agreement_info (agreement_id,type_id,ma_id,num,start_time,status,lease_id,lease_price,buy_price,is_slt,company_id,lease_type,create_time,publish_task)
values (#{agreementId},#{record.typeId},#{record.maId},#{record.outNum},now(),0,#{record.parentId},#{ma.finalPrice},#{ma.buyPrice},'0',#{record.companyId},#{record.leaseType},now(),#{record.publishTask});
</insert>
<select id="getLeaseList" resultType="com.bonus.material.settlement.domain.SltAgreementInfo">