功能优化

This commit is contained in:
mashuai 2025-09-02 01:58:32 +08:00
parent 01d5b2bdb4
commit a921294a14
7 changed files with 64 additions and 4 deletions

View File

@ -8,6 +8,7 @@ import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.convert.Convert;
import com.bonus.common.biz.config.ListPagingUtil;
import com.bonus.common.core.exception.ServiceException;
@ -18,6 +19,7 @@ import com.bonus.material.back.domain.*;
import com.bonus.material.back.domain.vo.*;
import com.bonus.material.basic.domain.BmUnit;
import com.bonus.material.common.annotation.PreventRepeatSubmit;
import com.bonus.material.repair.domain.RepairApplyDetails;
import com.bonus.material.task.mapper.TmTaskMapper;
import com.bonus.system.api.RemoteFileService;
import io.swagger.annotations.Api;
@ -365,7 +367,7 @@ public class BackApplyInfoController extends BaseController {
* 退料申请提交
*/
@ApiOperation(value = "退料申请提交")
@PreventRepeatSubmit(interval = 2)
@PreventRepeatSubmit
// @RequiresPermissions("back:info:submit")
@SysLog(title = "退料任务", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->退料申请提交")
@PostMapping("/submitBackApply")
@ -375,6 +377,13 @@ public class BackApplyInfoController extends BaseController {
if (unit != null && unit.getTypeId() == null) {
throw new ServiceException("单位类型为空");
}
// 根据提交id判断是否已经在维修表中存在
if (backApplyInfo.getId() != null) {
List<RepairApplyDetails> list = taskMapper.selectBackApplyInfoById(backApplyInfo);
if (CollectionUtil.isNotEmpty(list)) {
return AjaxResult.error("不允许重复提交,请稍候再试!");
}
}
if (unit != null && unit.getTypeId() == 1731L) {
// 班组退料提交
return backApplyInfoService.submitBzBackApply(backApplyInfo);

View File

@ -1160,6 +1160,11 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
}
int thisMonthMaxOrder = taskMapper.getMonthMaxOrderByDate(DateUtils.getCurrentYear(), DateUtils.getCurrentMonth(), TmTaskTypeEnum.TM_TASK_BACK.getTaskTypeId());
String code = genderTaskCode(thisMonthMaxOrder);
// 根据单号查询此任务是否存在
TmTask newTask = taskMapper.selectTaskByCode(code);
if (newTask != null) {
return AjaxResult.error("此任务单号已存在,请勿重复提交!");
}
TmTask tmTask = new TmTask(null, TmTaskTypeEnum.TM_TASK_BACK.getTaskTypeId(),
BackTaskStatusEnum.BACK_TASK_NO_FINISHED.getStatus(),
null, thisMonthMaxOrder + 1, code);
@ -1199,6 +1204,11 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
}
int thisMonthMaxOrder = taskMapper.getMonthMaxOrderByDate(DateUtils.getCurrentYear(), DateUtils.getCurrentMonth(), TmTaskTypeEnum.TM_TASK_BACK.getTaskTypeId());
String code = genderTaskCode(thisMonthMaxOrder);
// 根据单号查询此任务是否存在
TmTask newTask = taskMapper.selectTaskByCode(code);
if (newTask != null) {
return AjaxResult.error("此任务单号已存在,请勿重复提交!");
}
TmTask tmTask = new TmTask(null, TmTaskTypeEnum.TM_TASK_BACK.getTaskTypeId(),
BackTaskStatusEnum.BACK_TASK_NO_FINISHED.getStatus(),
null, thisMonthMaxOrder + 1, code);

View File

@ -264,6 +264,10 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
}
}
list.addAll(leaseApplyOutList);
// 移出leaseApplyOutList中alNum为0的数据
list = list.stream()
.filter(item -> item.getAlNum().compareTo(BigDecimal.ZERO) > 0)
.collect(Collectors.toList());
}
// 使用 Stream API 进行降序排序
List<MaterialLeaseApplyInfo> sortedList = list.stream()

View File

@ -11,7 +11,6 @@ import com.bonus.common.log.enums.OperaType;
import com.bonus.material.back.domain.vo.MaCodeVo;
import com.bonus.material.basic.domain.BmQrcodeInfo;
import com.bonus.material.common.annotation.PreventRepeatSubmit;
import com.bonus.material.input.domain.InputApplyDetails;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
@ -155,7 +154,6 @@ public class RepairInputDetailsController extends BaseController {
* @return
*/
@ApiOperation(value = "查询修试待入库机具编码")
@PreventRepeatSubmit
// @RequiresPermissions("purchase:storage:add")
@GetMapping("/getCodeList")
public AjaxResult getCodeList(MaCodeVo mdCodeVo) {

View File

@ -1044,7 +1044,9 @@ public class RepairServiceImpl implements RepairService {
repairApplyRecord.setCreateBy(loginUser.getSysUser().getNickName());
repairApplyRecord.setSupplierId(partList.get(i).getSupplierId());
repairApplyRecord.setPartPrice(Optional.ofNullable(partList.get(i).getBackCost()).orElse(BigDecimal.ZERO));
if (!CollectionUtils.isEmpty(bean.getOutRepairList())) {
repairApplyRecord.setRemark(StringUtils.isNotBlank(bean.getOutRepairList().get(0).getRemark()) ? bean.getOutRepairList().get(0).getRemark() : "");
}
if (MaTypeManageTypeEnum.CODE_DEVICE.getTypeId().equals(manageType)) {
repairApplyRecord.setRepairNum(BigDecimal.valueOf(!RepairTypeEnum.TO_SCRAP.getTypeId().equals(bean.getRepairType()) ? 1 : 0));
repairApplyRecord.setScrapNum(BigDecimal.valueOf(RepairTypeEnum.TO_SCRAP.getTypeId().equals(bean.getRepairType()) ? 1 : 0));

View File

@ -7,6 +7,7 @@ import com.bonus.common.biz.domain.lease.LeaseApplyInfo;
import com.bonus.common.biz.domain.lease.LeaseOutDetails;
import com.bonus.material.back.domain.BackApplyInfo;
import com.bonus.material.basic.domain.BmUnit;
import com.bonus.material.repair.domain.RepairApplyDetails;
import com.bonus.material.settlement.domain.SltAgreementInfo;
import com.bonus.material.task.domain.TmTask;
import org.apache.ibatis.annotations.Param;
@ -166,4 +167,18 @@ public interface TmTaskMapper {
* @return
*/
TmTask selectStatusByTaskId(Long taskId);
/**
* 根据任务编号查询任务信息
* @param code
* @return
*/
TmTask selectTaskByCode(String code);
/**
* 根据任务编号查询任务信息
* @param backApplyInfo
* @return
*/
List<RepairApplyDetails> selectBackApplyInfoById(BackApplyInfo backApplyInfo);
}

View File

@ -247,4 +247,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE
task_id = #{taskId}
</select>
<select id="selectTaskByCode" resultType="com.bonus.material.task.domain.TmTask">
SELECT
task_id as taskId,
task_type as taskType,
task_status as taskStatus,
code as code
FROM
tm_task
WHERE
code = #{code}
</select>
<select id="selectBackApplyInfoById" resultType="com.bonus.material.repair.domain.RepairApplyDetails">
SELECT
task_id as taskId,
back_id as backId
FROM
repair_apply_details
WHERE
back_id = #{id}
</select>
</mapper>