Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
5df71896fd
|
|
@ -8,6 +8,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
import com.bonus.common.biz.config.ListPagingUtil;
|
import com.bonus.common.biz.config.ListPagingUtil;
|
||||||
import com.bonus.common.core.exception.ServiceException;
|
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.back.domain.vo.*;
|
||||||
import com.bonus.material.basic.domain.BmUnit;
|
import com.bonus.material.basic.domain.BmUnit;
|
||||||
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||||
|
import com.bonus.material.repair.domain.RepairApplyDetails;
|
||||||
import com.bonus.material.task.mapper.TmTaskMapper;
|
import com.bonus.material.task.mapper.TmTaskMapper;
|
||||||
import com.bonus.system.api.RemoteFileService;
|
import com.bonus.system.api.RemoteFileService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
|
|
@ -365,7 +367,7 @@ public class BackApplyInfoController extends BaseController {
|
||||||
* 退料申请提交
|
* 退料申请提交
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "退料申请提交")
|
@ApiOperation(value = "退料申请提交")
|
||||||
@PreventRepeatSubmit(interval = 2)
|
@PreventRepeatSubmit
|
||||||
// @RequiresPermissions("back:info:submit")
|
// @RequiresPermissions("back:info:submit")
|
||||||
@SysLog(title = "退料任务", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->退料申请提交")
|
@SysLog(title = "退料任务", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->退料申请提交")
|
||||||
@PostMapping("/submitBackApply")
|
@PostMapping("/submitBackApply")
|
||||||
|
|
@ -375,6 +377,13 @@ public class BackApplyInfoController extends BaseController {
|
||||||
if (unit != null && unit.getTypeId() == null) {
|
if (unit != null && unit.getTypeId() == null) {
|
||||||
throw new ServiceException("单位类型为空");
|
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) {
|
if (unit != null && unit.getTypeId() == 1731L) {
|
||||||
// 班组退料提交
|
// 班组退料提交
|
||||||
return backApplyInfoService.submitBzBackApply(backApplyInfo);
|
return backApplyInfoService.submitBzBackApply(backApplyInfo);
|
||||||
|
|
|
||||||
|
|
@ -1160,6 +1160,11 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
||||||
}
|
}
|
||||||
int thisMonthMaxOrder = taskMapper.getMonthMaxOrderByDate(DateUtils.getCurrentYear(), DateUtils.getCurrentMonth(), TmTaskTypeEnum.TM_TASK_BACK.getTaskTypeId());
|
int thisMonthMaxOrder = taskMapper.getMonthMaxOrderByDate(DateUtils.getCurrentYear(), DateUtils.getCurrentMonth(), TmTaskTypeEnum.TM_TASK_BACK.getTaskTypeId());
|
||||||
String code = genderTaskCode(thisMonthMaxOrder);
|
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(),
|
TmTask tmTask = new TmTask(null, TmTaskTypeEnum.TM_TASK_BACK.getTaskTypeId(),
|
||||||
BackTaskStatusEnum.BACK_TASK_NO_FINISHED.getStatus(),
|
BackTaskStatusEnum.BACK_TASK_NO_FINISHED.getStatus(),
|
||||||
null, thisMonthMaxOrder + 1, code);
|
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());
|
int thisMonthMaxOrder = taskMapper.getMonthMaxOrderByDate(DateUtils.getCurrentYear(), DateUtils.getCurrentMonth(), TmTaskTypeEnum.TM_TASK_BACK.getTaskTypeId());
|
||||||
String code = genderTaskCode(thisMonthMaxOrder);
|
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(),
|
TmTask tmTask = new TmTask(null, TmTaskTypeEnum.TM_TASK_BACK.getTaskTypeId(),
|
||||||
BackTaskStatusEnum.BACK_TASK_NO_FINISHED.getStatus(),
|
BackTaskStatusEnum.BACK_TASK_NO_FINISHED.getStatus(),
|
||||||
null, thisMonthMaxOrder + 1, code);
|
null, thisMonthMaxOrder + 1, code);
|
||||||
|
|
|
||||||
|
|
@ -264,6 +264,10 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
list.addAll(leaseApplyOutList);
|
list.addAll(leaseApplyOutList);
|
||||||
|
// 移出leaseApplyOutList中alNum为0的数据
|
||||||
|
list = list.stream()
|
||||||
|
.filter(item -> item.getAlNum().compareTo(BigDecimal.ZERO) > 0)
|
||||||
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
// 使用 Stream API 进行降序排序
|
// 使用 Stream API 进行降序排序
|
||||||
List<MaterialLeaseApplyInfo> sortedList = list.stream()
|
List<MaterialLeaseApplyInfo> sortedList = list.stream()
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@ import com.bonus.common.log.enums.OperaType;
|
||||||
import com.bonus.material.back.domain.vo.MaCodeVo;
|
import com.bonus.material.back.domain.vo.MaCodeVo;
|
||||||
import com.bonus.material.basic.domain.BmQrcodeInfo;
|
import com.bonus.material.basic.domain.BmQrcodeInfo;
|
||||||
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||||
import com.bonus.material.input.domain.InputApplyDetails;
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
@ -155,7 +154,6 @@ public class RepairInputDetailsController extends BaseController {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "查询修试待入库机具编码")
|
@ApiOperation(value = "查询修试待入库机具编码")
|
||||||
@PreventRepeatSubmit
|
|
||||||
// @RequiresPermissions("purchase:storage:add")
|
// @RequiresPermissions("purchase:storage:add")
|
||||||
@GetMapping("/getCodeList")
|
@GetMapping("/getCodeList")
|
||||||
public AjaxResult getCodeList(MaCodeVo mdCodeVo) {
|
public AjaxResult getCodeList(MaCodeVo mdCodeVo) {
|
||||||
|
|
|
||||||
|
|
@ -1044,7 +1044,9 @@ public class RepairServiceImpl implements RepairService {
|
||||||
repairApplyRecord.setCreateBy(loginUser.getSysUser().getNickName());
|
repairApplyRecord.setCreateBy(loginUser.getSysUser().getNickName());
|
||||||
repairApplyRecord.setSupplierId(partList.get(i).getSupplierId());
|
repairApplyRecord.setSupplierId(partList.get(i).getSupplierId());
|
||||||
repairApplyRecord.setPartPrice(Optional.ofNullable(partList.get(i).getBackCost()).orElse(BigDecimal.ZERO));
|
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() : "");
|
repairApplyRecord.setRemark(StringUtils.isNotBlank(bean.getOutRepairList().get(0).getRemark()) ? bean.getOutRepairList().get(0).getRemark() : "");
|
||||||
|
}
|
||||||
if (MaTypeManageTypeEnum.CODE_DEVICE.getTypeId().equals(manageType)) {
|
if (MaTypeManageTypeEnum.CODE_DEVICE.getTypeId().equals(manageType)) {
|
||||||
repairApplyRecord.setRepairNum(BigDecimal.valueOf(!RepairTypeEnum.TO_SCRAP.getTypeId().equals(bean.getRepairType()) ? 1 : 0));
|
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));
|
repairApplyRecord.setScrapNum(BigDecimal.valueOf(RepairTypeEnum.TO_SCRAP.getTypeId().equals(bean.getRepairType()) ? 1 : 0));
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import com.bonus.common.biz.domain.lease.LeaseApplyInfo;
|
||||||
import com.bonus.common.biz.domain.lease.LeaseOutDetails;
|
import com.bonus.common.biz.domain.lease.LeaseOutDetails;
|
||||||
import com.bonus.material.back.domain.BackApplyInfo;
|
import com.bonus.material.back.domain.BackApplyInfo;
|
||||||
import com.bonus.material.basic.domain.BmUnit;
|
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.settlement.domain.SltAgreementInfo;
|
||||||
import com.bonus.material.task.domain.TmTask;
|
import com.bonus.material.task.domain.TmTask;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
@ -166,4 +167,18 @@ public interface TmTaskMapper {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
TmTask selectStatusByTaskId(Long taskId);
|
TmTask selectStatusByTaskId(Long taskId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据任务编号查询任务信息
|
||||||
|
* @param code
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
TmTask selectTaskByCode(String code);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据任务编号查询任务信息
|
||||||
|
* @param backApplyInfo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<RepairApplyDetails> selectBackApplyInfoById(BackApplyInfo backApplyInfo);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -247,4 +247,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
WHERE
|
WHERE
|
||||||
task_id = #{taskId}
|
task_id = #{taskId}
|
||||||
</select>
|
</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>
|
</mapper>
|
||||||
Loading…
Reference in New Issue