diff --git a/bonus-common-biz/src/main/java/com/bonus/common/biz/enums/MaMachineStatusEnum.java b/bonus-common-biz/src/main/java/com/bonus/common/biz/enums/MaMachineStatusEnum.java new file mode 100644 index 00000000..92b82aa1 --- /dev/null +++ b/bonus-common-biz/src/main/java/com/bonus/common/biz/enums/MaMachineStatusEnum.java @@ -0,0 +1,39 @@ +package com.bonus.common.biz.enums; + +import lombok.Getter; + +/** + * 新购待入库 0 + * 在库 1 + * 在用 2 + * 退料检修 3 + * 检修待审核 4 + * 修试后待入库 5 + * 退料待报废 6 + * 维修待报废 7 + * 已报废审核 8 + * 退料待入库 9 + * 报废待审核 10 + */ +@Getter +public enum MaMachineStatusEnum { + NEW_PURCHASE(0, "新购待入库"), + IN_STORE(1, "在库"), + IN_USE(2, "在用"), + BACK_REPAIR(3, "退料检修"), + REPAIR_TO_AUDIT(4, "检修待审核"), + REPAIR_TO_STORE(5, "修试后待入库"), + BACK_TO_SCRAP(6, "退料待报废"), + REPAIR_TO_SCRAP(7, "维修待报废"), + SCRAP_AUDIT(8, "已报废审核"), + BACK_TO_STORE(9, "退料待入库"), + SCRAP_TO_AUDIT(10, "报废待审核"); + + private final Integer status; + private final String statusName; + + MaMachineStatusEnum(Integer status, String statusName) { + this.status = status; + this.statusName = statusName; + } +} diff --git a/bonus-common-biz/src/main/java/com/bonus/common/biz/enums/PurchaseTaskStatusEnum.java b/bonus-common-biz/src/main/java/com/bonus/common/biz/enums/PurchaseTaskStatusEnum.java index 86c5a2a0..0eb7316b 100644 --- a/bonus-common-biz/src/main/java/com/bonus/common/biz/enums/PurchaseTaskStatusEnum.java +++ b/bonus-common-biz/src/main/java/com/bonus/common/biz/enums/PurchaseTaskStatusEnum.java @@ -14,7 +14,9 @@ public enum PurchaseTaskStatusEnum { IN_STORE(19, "已入库"), TASK_TO_START(20, "入库待开始"), TASK_IN_PROGRESS(21, "入库进行中"), - TASK_FINISHED(22, "入库已完成"); + TASK_FINISHED(22, "入库已完成"), + LEASE_TASK_NO_PUBLISHED(0, "领料任务--未发布"), + LEASE_TASK_PUBLISHED(1, "领料任务--已发布"); private final Integer status; private final String statusName; diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/controller/LeaseApplyInfoController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/controller/LeaseApplyInfoController.java index 67f661c7..a8161499 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/controller/LeaseApplyInfoController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/controller/LeaseApplyInfoController.java @@ -12,9 +12,9 @@ import com.bonus.material.lease.service.ILeaseApplyInfoService; import com.bonus.material.task.domain.vo.TmTaskRequestVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import javax.validation.constraints.NotNull; import java.util.List; @@ -29,7 +29,8 @@ import java.util.List; @RestController @RequestMapping("/lease_apply_info") public class LeaseApplyInfoController extends BaseController { - @Autowired + + @Resource private ILeaseApplyInfoService leaseApplyInfoService; /** @@ -54,7 +55,7 @@ public class LeaseApplyInfoController extends BaseController { @PostMapping("/export") public void export(HttpServletResponse response, LeaseApplyInfo leaseApplyInfo) { List list = leaseApplyInfoService.selectLeaseApplyInfoList(leaseApplyInfo); - ExcelUtil util = new ExcelUtil(LeaseApplyInfo.class); + ExcelUtil util = new ExcelUtil<>(LeaseApplyInfo.class); util.exportExcel(response, list, "领料任务数据"); } @@ -64,7 +65,7 @@ public class LeaseApplyInfoController extends BaseController { @ApiOperation(value = "获取领料任务详细信息") //@RequiresPermissions("lease:info:query") @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable("id") @NotNull(message = "领料任务ID不能为空") Long id) { + public AjaxResult getInfo(@NotNull(message = "领料任务ID不能为空") @PathVariable("id") Long id) { return success(leaseApplyInfoService.selectLeaseApplyInfoById(id)); } @@ -76,7 +77,7 @@ public class LeaseApplyInfoController extends BaseController { //@RequiresPermissions("lease:info:add") @SysLog(title = "领料任务", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增领料任务") @PostMapping - public AjaxResult add(@RequestBody TmTaskRequestVo tmTaskRequestVo) { + public AjaxResult add(@NotNull(message = "领料任务不能为空") @RequestBody TmTaskRequestVo tmTaskRequestVo) { try { return leaseApplyInfoService.insertLeaseApplyInfo(tmTaskRequestVo); } catch (Exception e) { @@ -92,7 +93,7 @@ public class LeaseApplyInfoController extends BaseController { //@RequiresPermissions("lease:info:edit") @SysLog(title = "领料任务", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改领料任务") @PutMapping - public AjaxResult edit(@RequestBody TmTaskRequestVo tmTaskRequestVo) { + public AjaxResult edit(@RequestBody @NotNull TmTaskRequestVo tmTaskRequestVo) { try { return toAjax(leaseApplyInfoService.updateLeaseApplyInfo(tmTaskRequestVo)); } catch (Exception e) { @@ -100,6 +101,18 @@ public class LeaseApplyInfoController extends BaseController { } } + + /** + * 领料任务发布 + */ + @ApiOperation(value = "领料任务发布") + @PreventRepeatSubmit + @SysLog(title = "领料任务发布", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->发布领料任务") + @PostMapping("/publish") + public AjaxResult publish(@RequestBody @NotNull(message = "任务信息不能为空") LeaseApplyInfo leaseApplyInfo) { + return leaseApplyInfoService.publish(leaseApplyInfo); + } + /** * 删除领料任务 */ diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/domain/LeaseApplyDetails.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/domain/LeaseApplyDetails.java index 0dac353a..16f2e15c 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/domain/LeaseApplyDetails.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/domain/LeaseApplyDetails.java @@ -61,8 +61,21 @@ public class LeaseApplyDetails extends BaseEntity { @ApiModelProperty(value = "已领数量") private Long alNum; + /** + * 此数量是剩余需要出库的数量(preNum - alNum) + */ + @ApiModelProperty(value = "剩余最大出库数量") + private Integer outNum; + + /** + * 装备管理方式(0编号 1计数) + */ + @ApiModelProperty(name = "装备管理方式") + @Excel(name = "装备管理方式", readConverterExp = "0=编号,1=计数") + private int manageType; + /** 状态(0待审批,1进行中,2已出库) */ - @Excel(name = "状态", readConverterExp = "0=待审批,1进行中,2已出库") + @Excel(name = "状态", readConverterExp = "0=待审批,1=进行中,2=已出库") private String status; /** 数据所属组织 */ diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/domain/LeaseApplyInfo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/domain/LeaseApplyInfo.java index 0d9eb19d..07756675 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/domain/LeaseApplyInfo.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/domain/LeaseApplyInfo.java @@ -117,7 +117,7 @@ public class LeaseApplyInfo extends BaseEntity { private Long directId; /** 0工程1长期 */ - @Excel(name = "0工程1长期") + @Excel(name = "领用类型",readConverterExp = "0=工程,1=长期") @ApiModelProperty(value = "0工程1长期") private String leaseType; @@ -137,12 +137,14 @@ public class LeaseApplyInfo extends BaseEntity { List leaseApplyDetails; @ApiModelProperty(value = "租赁工程") + @Excel(name = "领料工程") private String leaseProject; @ApiModelProperty(value = "租赁工程id") private Integer leaseProjectId; @ApiModelProperty(value = "租赁单位") + @Excel(name = "领料单位") private String leaseUnit; @ApiModelProperty(value = "租赁单位id") @@ -152,6 +154,7 @@ public class LeaseApplyInfo extends BaseEntity { private Long agreementId; @ApiModelProperty(value = "协议号") + @Excel(name = "协议号") private String agreementCode; } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/mapper/LeaseApplyInfoMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/mapper/LeaseApplyInfoMapper.java index 6b490575..98f18157 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/mapper/LeaseApplyInfoMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/mapper/LeaseApplyInfoMapper.java @@ -16,7 +16,7 @@ public interface LeaseApplyInfoMapper { * @param id 领料任务主键 * @return 领料任务 */ - public LeaseApplyInfo selectLeaseApplyInfoById(Long id); + LeaseApplyInfo selectLeaseApplyInfoById(Long id); /** * 查询领料任务列表 @@ -24,7 +24,7 @@ public interface LeaseApplyInfoMapper { * @param leaseApplyInfo 领料任务 * @return 领料任务集合 */ - public List selectLeaseApplyInfoList(LeaseApplyInfo leaseApplyInfo); + List selectLeaseApplyInfoList(LeaseApplyInfo leaseApplyInfo); /** * 新增领料任务 @@ -32,7 +32,7 @@ public interface LeaseApplyInfoMapper { * @param leaseApplyInfo 领料任务 * @return 结果 */ - public int insertLeaseApplyInfo(LeaseApplyInfo leaseApplyInfo); + int insertLeaseApplyInfo(LeaseApplyInfo leaseApplyInfo); /** * 修改领料任务 @@ -40,7 +40,7 @@ public interface LeaseApplyInfoMapper { * @param leaseApplyInfo 领料任务 * @return 结果 */ - public int updateLeaseApplyInfo(LeaseApplyInfo leaseApplyInfo); + int updateLeaseApplyInfo(LeaseApplyInfo leaseApplyInfo); /** * 删除领料任务 @@ -48,7 +48,7 @@ public interface LeaseApplyInfoMapper { * @param id 领料任务主键 * @return 结果 */ - public int deleteLeaseApplyInfoById(Long id); + int deleteLeaseApplyInfoById(Long id); /** * 批量删除领料任务 @@ -56,5 +56,5 @@ public interface LeaseApplyInfoMapper { * @param ids 需要删除的数据主键集合 * @return 结果 */ - public int deleteLeaseApplyInfoByIds(Long[] ids); + int deleteLeaseApplyInfoByIds(Long[] ids); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/ILeaseApplyInfoService.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/ILeaseApplyInfoService.java index 02ce5716..a74bbc2a 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/ILeaseApplyInfoService.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/ILeaseApplyInfoService.java @@ -38,6 +38,11 @@ public interface ILeaseApplyInfoService { */ AjaxResult insertLeaseApplyInfo(TmTaskRequestVo leaseApplyRequestVo); + /** + * 发布任务 + */ + AjaxResult publish(LeaseApplyInfo leaseApplyInfo); + /** * 修改领料任务 * diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/ILeaseOutDetailsService.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/ILeaseOutDetailsService.java index 271828df..22a77582 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/ILeaseOutDetailsService.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/ILeaseOutDetailsService.java @@ -18,7 +18,7 @@ public interface ILeaseOutDetailsService { * @param id 领料出库详细主键 * @return 领料出库详细 */ - public LeaseOutDetails selectLeaseOutDetailsById(Long id); + LeaseOutDetails selectLeaseOutDetailsById(Long id); /** * 查询领料出库详细列表 @@ -26,7 +26,7 @@ public interface ILeaseOutDetailsService { * @param leaseOutDetails 领料出库详细 * @return 领料出库详细集合 */ - public List selectLeaseOutDetailsList(LeaseOutDetails leaseOutDetails); + List selectLeaseOutDetailsList(LeaseOutDetails leaseOutDetails); /** * 新增领料出库详细 @@ -34,7 +34,7 @@ public interface ILeaseOutDetailsService { * @param leaseOutDetailsList 领料出库详细 * @return 结果 */ - public AjaxResult insertLeaseOutDetails(List leaseOutDetailsList); + AjaxResult insertLeaseOutDetails(List leaseOutDetailsList); /** * 修改领料出库详细 @@ -42,7 +42,7 @@ public interface ILeaseOutDetailsService { * @param leaseOutDetails 领料出库详细 * @return 结果 */ - public int updateLeaseOutDetails(LeaseOutDetails leaseOutDetails); + int updateLeaseOutDetails(LeaseOutDetails leaseOutDetails); /** * 批量删除领料出库详细 @@ -50,7 +50,7 @@ public interface ILeaseOutDetailsService { * @param ids 需要删除的领料出库详细主键集合 * @return 结果 */ - public int deleteLeaseOutDetailsByIds(Long[] ids); + int deleteLeaseOutDetailsByIds(Long[] ids); /** * 删除领料出库详细信息 @@ -58,5 +58,5 @@ public interface ILeaseOutDetailsService { * @param id 领料出库详细主键 * @return 结果 */ - public int deleteLeaseOutDetailsById(Long id); + int deleteLeaseOutDetailsById(Long id); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseApplyInfoServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseApplyInfoServiceImpl.java index f2c94666..11bfa242 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseApplyInfoServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseApplyInfoServiceImpl.java @@ -3,6 +3,7 @@ package com.bonus.material.lease.service.impl; import java.util.List; import java.util.Optional; +import cn.hutool.core.collection.CollectionUtil; import com.bonus.common.biz.constant.MaterialConstants; import com.bonus.common.biz.enums.PurchaseTaskStatusEnum; import com.bonus.common.biz.enums.TmTaskTypeEnum; @@ -18,12 +19,12 @@ import com.bonus.material.task.domain.TmTaskAgreement; import com.bonus.material.task.domain.vo.TmTaskRequestVo; import com.bonus.material.task.mapper.TmTaskAgreementMapper; import com.bonus.material.task.mapper.TmTaskMapper; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.dao.DataAccessException; import org.springframework.stereotype.Service; import com.bonus.material.lease.mapper.LeaseApplyInfoMapper; import com.bonus.material.lease.domain.LeaseApplyInfo; import com.bonus.material.lease.service.ILeaseApplyInfoService; +import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import javax.annotation.Resource; @@ -36,10 +37,11 @@ import javax.annotation.Resource; */ @Service public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService { - @Autowired + + @Resource private LeaseApplyInfoMapper leaseApplyInfoMapper; - @Autowired + @Resource private LeaseApplyDetailsMapper leaseApplyDetailsMapper; @Resource @@ -48,7 +50,6 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService { @Resource TmTaskAgreementMapper tmTaskAgreementMapper; - /** * 查询领料任务 * @@ -101,6 +102,9 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService { if (tmTaskRequestVo.getLeaseApplyInfo() == null) { return AjaxResult.error("请先填写领料任务信息"); } + if (CollectionUtil.isEmpty(tmTaskRequestVo.getLeaseApplyDetailsList())) { + return AjaxResult.error("请先添加领料任务物资明细"); + } tmTaskRequestVo.getLeaseApplyInfo().setCreateTime(DateUtils.getNowDate()); tmTaskRequestVo.getLeaseApplyInfo().setCreateBy(SecurityUtils.getUsername()); try { @@ -131,6 +135,42 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService { } } + /** + * 发布任务 + * + * @param leaseApplyInfo 领料任务info + */ + @Override + @Transactional + public AjaxResult publish(LeaseApplyInfo leaseApplyInfo) { + if (leaseApplyInfo.getId() == null) { + return AjaxResult.error("ID为空,请完善后重新发布!"); + } + if (leaseApplyInfo.getTaskId() == null) { + return AjaxResult.error("任务ID为空,请完善后重新发布!"); + } + + leaseApplyInfo.setUpdateTime(DateUtils.getNowDate()); + leaseApplyInfo.setStatus(String.valueOf(PurchaseTaskStatusEnum.LEASE_TASK_PUBLISHED.getStatus())); + try { + int result = leaseApplyInfoMapper.updateLeaseApplyInfo(leaseApplyInfo); + if (result > 0) { + // 同步修改tm_task任务状态 + TmTask tmTask = new TmTask(); + tmTask.setTaskId(leaseApplyInfo.getTaskId()); + tmTask.setStatus(String.valueOf(PurchaseTaskStatusEnum.LEASE_TASK_PUBLISHED.getStatus())); + tmTaskMapper.updateTmTask(tmTask); + return AjaxResult.success("发布成功"); + } + return AjaxResult.error("发布失败"); + } catch (DataAccessException e) { + // 抛出异常、回滚数据 + throw new RuntimeException(); + } catch (Exception e) { + return AjaxResult.error("发布失败:" + e.getMessage()); + } + } + private AjaxResult insertPurchaseCheckDetails(List leaseApplyDetailsList, Long taskId) { if (!CollectionUtils.isEmpty(leaseApplyDetailsList)) { for (LeaseApplyDetails details : leaseApplyDetailsList) { @@ -168,16 +208,32 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService { */ @Override public boolean updateLeaseApplyInfo(TmTaskRequestVo tmTaskRequestVo) { - tmTaskRequestVo.getLeaseApplyInfo().setUpdateTime(DateUtils.getNowDate()); - tmTaskRequestVo.getLeaseApplyInfo().setUpdateBy(SecurityUtils.getUsername()); try { - Long[] ids = new Long[]{tmTaskRequestVo.getLeaseApplyInfo().getId()}; - leaseApplyDetailsMapper.deleteLeaseApplyDetailsByParentIds(ids); - insertPurchaseCheckDetails(tmTaskRequestVo.getLeaseApplyDetailsList(), tmTaskRequestVo.getLeaseApplyInfo().getTaskId()); - leaseApplyInfoMapper.updateLeaseApplyInfo(tmTaskRequestVo.getLeaseApplyInfo()); - return true; + // 提取到局部变量中,减少重复代码 + LeaseApplyInfo leaseApplyInfo = tmTaskRequestVo.getLeaseApplyInfo(); + if (leaseApplyInfo != null && leaseApplyInfo.getId() != null) { + leaseApplyInfo.setUpdateTime(DateUtils.getNowDate()); + leaseApplyInfo.setUpdateBy(SecurityUtils.getUsername()); + + // 去除创建一个新的数组对象,直接复用 + Long[] ids = {leaseApplyInfo.getId()}; + + if (CollectionUtil.isNotEmpty(tmTaskRequestVo.getLeaseApplyDetailsList())) { + // 业务逻辑代码 + leaseApplyDetailsMapper.deleteLeaseApplyDetailsByParentIds(ids); + insertPurchaseCheckDetails(tmTaskRequestVo.getLeaseApplyDetailsList(), leaseApplyInfo.getTaskId()); + } + // 修改外层info + leaseApplyInfoMapper.updateLeaseApplyInfo(leaseApplyInfo); + return true; + } + return false; + } catch (DataAccessException dae) { + throw new ServiceException("数据访问异常: " + dae.getMessage()); + } catch (IllegalArgumentException iae) { + throw new ServiceException("非法参数异常: " + iae.getMessage()); } catch (Exception e) { - throw new ServiceException("错误信息描述"); + throw new ServiceException("未知异常: " + e.getMessage()); } } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/task/controller/TmTaskController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/task/controller/TmTaskController.java index 67b9d693..4f006037 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/task/controller/TmTaskController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/task/controller/TmTaskController.java @@ -127,25 +127,25 @@ public class TmTaskController extends BaseController { * @param souceBy app为1 web为0 * @return 列表 */ - @ApiOperation(value = "查询机具领料申请列表") - @PreventRepeatSubmit - @RequiresPermissions("task:task:query") - @SysLog(title = "任务", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->查询机具领料申请列表") - @GetMapping(value = "getLeaseAuditListAll") - public AjaxResult getLeaseAuditListAll(TmTaskRequestVo task, Integer souceBy) { - if (StringUtils.isNull(task)) { - return AjaxResult.error("参数错误"); - } - List leaseAuditList; - if (souceBy != null && souceBy == 1) { - leaseAuditList = tmTaskService.getLeaseAuditList(task); - return AjaxResult.success(leaseAuditList); - } else { - startPage(); - leaseAuditList = tmTaskService.getLeaseAuditList(task); - return AjaxResult.success(getDataTable(leaseAuditList)); - } - } +// @ApiOperation(value = "查询机具领料申请列表") +// @PreventRepeatSubmit +// @RequiresPermissions("task:task:query") +// @SysLog(title = "任务", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->查询机具领料申请列表") +// @GetMapping(value = "getLeaseAuditListAll") +// public AjaxResult getLeaseAuditListAll(TmTaskRequestVo task, Integer souceBy) { +// if (StringUtils.isNull(task)) { +// return AjaxResult.error("参数错误"); +// } +// List leaseAuditList; +// if (souceBy != null && souceBy == 1) { +// leaseAuditList = tmTaskService.getLeaseAuditList(task); +// return AjaxResult.success(leaseAuditList); +// } else { +// startPage(); +// leaseAuditList = tmTaskService.getLeaseAuditList(task); +// return AjaxResult.success(getDataTable(leaseAuditList)); +// } +// } } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/task/domain/vo/TmTaskRequestVo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/task/domain/vo/TmTaskRequestVo.java index 5c1796a0..23db290f 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/task/domain/vo/TmTaskRequestVo.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/task/domain/vo/TmTaskRequestVo.java @@ -89,12 +89,6 @@ public class TmTaskRequestVo extends BaseEntity { @ApiModelProperty(value = "关键字") private String keyWord; - /** - * 领料任务实体集合 - */ - @ApiModelProperty(value = "领料任务实体集合") - private List leaseApplyInfoList; - @ApiModelProperty(value = "领料任务汇总") private LeaseApplyInfo leaseApplyInfo; diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/task/mapper/TmTaskAgreementMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/task/mapper/TmTaskAgreementMapper.java index 96eaf43f..2181ffa9 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/task/mapper/TmTaskAgreementMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/task/mapper/TmTaskAgreementMapper.java @@ -10,13 +10,14 @@ import com.bonus.material.task.domain.TmTaskAgreement; * @date 2024-10-16 */ public interface TmTaskAgreementMapper { + /** * 查询任务 * * @param taskId 任务主键 * @return 任务 */ - public TmTaskAgreement selectTmTaskAgreementByTaskId(Long taskId); + TmTaskAgreement selectTmTaskAgreementByTaskId(Long taskId); /** * 查询任务列表 @@ -24,7 +25,7 @@ public interface TmTaskAgreementMapper { * @param tmTaskAgreement 任务 * @return 任务集合 */ - public List selectTmTaskAgreementList(TmTaskAgreement tmTaskAgreement); + List selectTmTaskAgreementList(TmTaskAgreement tmTaskAgreement); /** * 新增任务 @@ -32,7 +33,7 @@ public interface TmTaskAgreementMapper { * @param tmTaskAgreement 任务 * @return 结果 */ - public int insertTmTaskAgreement(TmTaskAgreement tmTaskAgreement); + int insertTmTaskAgreement(TmTaskAgreement tmTaskAgreement); /** * 修改任务 @@ -40,7 +41,7 @@ public interface TmTaskAgreementMapper { * @param tmTaskAgreement 任务 * @return 结果 */ - public int updateTmTaskAgreement(TmTaskAgreement tmTaskAgreement); + int updateTmTaskAgreement(TmTaskAgreement tmTaskAgreement); /** * 删除任务 @@ -48,7 +49,7 @@ public interface TmTaskAgreementMapper { * @param taskId 任务主键 * @return 结果 */ - public int deleteTmTaskAgreementByTaskId(Long taskId); + int deleteTmTaskAgreementByTaskId(Long taskId); /** * 批量删除任务 @@ -56,5 +57,5 @@ public interface TmTaskAgreementMapper { * @param taskIds 需要删除的数据主键集合 * @return 结果 */ - public int deleteTmTaskAgreementByTaskIds(Long[] taskIds); + int deleteTmTaskAgreementByTaskIds(Long[] taskIds); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/task/mapper/TmTaskMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/task/mapper/TmTaskMapper.java index 47fbbee5..47f64e6d 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/task/mapper/TmTaskMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/task/mapper/TmTaskMapper.java @@ -89,11 +89,11 @@ public interface TmTaskMapper { int deleteTmTaskByPurchaseIds(Long[] ids); - List getAuditListByLeaseTmTask(@Param("record") TmTaskRequestVo tmTaskRequestVo); - - List getAuditListByLeaseTmTaskByPeople(@Param("record") TmTaskRequestVo tmTaskRequestVo); - - List getAuditListByLeaseInfo(@Param("record") TmTaskRequestVo record); - - List getLeaseApplyDetails(@Param("record") LeaseApplyInfo record); +// List getAuditListByLeaseTmTask(@Param("record") TmTaskRequestVo tmTaskRequestVo); +// +// List getAuditListByLeaseTmTaskByPeople(@Param("record") TmTaskRequestVo tmTaskRequestVo); +// +// List getAuditListByLeaseInfo(@Param("record") TmTaskRequestVo record); +// +// List getLeaseApplyDetails(@Param("record") LeaseApplyInfo record); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/task/service/ITmTaskService.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/task/service/ITmTaskService.java index 53886937..bf13ef28 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/task/service/ITmTaskService.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/task/service/ITmTaskService.java @@ -59,5 +59,7 @@ public interface ITmTaskService { */ public int deleteTmTaskByTaskId(Long taskId); - List getLeaseAuditList(TmTaskRequestVo tmTask); +// List getLeaseAuditList(TmTaskRequestVo tmTask); + + } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/task/service/impl/TmTaskServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/task/service/impl/TmTaskServiceImpl.java index c9107e48..c812bde3 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/task/service/impl/TmTaskServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/task/service/impl/TmTaskServiceImpl.java @@ -106,49 +106,50 @@ public class TmTaskServiceImpl implements ITmTaskService { /** * 获取单个申请列表 */ - @Override - public List getLeaseAuditList(TmTaskRequestVo tmTaskRequestVo) { - Set roles = SecurityUtils.getLoginUser().getRoles(); - List tmTaskList; - if (roles.contains(MaterialConstants.STRING_ADMIN)) { - tmTaskList = tmTaskMapper.getAuditListByLeaseTmTask(tmTaskRequestVo); - } else { - String username = SecurityUtils.getLoginUser().getUsername(); - tmTaskRequestVo.setCreateBy(username); - tmTaskList = tmTaskMapper.getAuditListByLeaseTmTaskByPeople(tmTaskRequestVo); - } - for (TmTaskRequestVo tmTask : tmTaskList) { - int count = 0; - if (tmTask != null) { - // 去查询任务分单表 - List auditListByLeaseInfo = tmTaskMapper.getAuditListByLeaseInfo(tmTask); - if (auditListByLeaseInfo != null && !auditListByLeaseInfo.isEmpty()) { - // 对领料任务集合查询具体详情 - for (LeaseApplyInfo leaseApplyInfo : auditListByLeaseInfo) { - if (leaseApplyInfo != null) { - // 去查询领料任务详情表 - List leaseApplyDetails = tmTaskMapper.getLeaseApplyDetails(leaseApplyInfo); - if (leaseApplyDetails != null && !leaseApplyDetails.isEmpty()) { - for (LeaseApplyDetails leaseApplyDetail : leaseApplyDetails) { - if (leaseApplyDetail != null && leaseApplyDetail.getPreNum() != null) { - // 统计预领数量 - count += leaseApplyDetail.getPreNum(); - } - } - // 塞入领料任务详情的集合中 - leaseApplyInfo.setLeaseApplyDetails(leaseApplyDetails); - } - } - } - // 存入领料任务实体集合 - tmTask.setLeaseApplyInfoList(auditListByLeaseInfo); - tmTask.setRemark(auditListByLeaseInfo.get(0).getRemark()); - } - // 塞入预领的合计数量 - tmTask.setPreCountNum(count); - } - } +// @Override +// public List getLeaseAuditList(TmTaskRequestVo tmTaskRequestVo) { +// Set roles = SecurityUtils.getLoginUser().getRoles(); +// List tmTaskList; +// if (roles.contains(MaterialConstants.STRING_ADMIN)) { +// tmTaskList = tmTaskMapper.getAuditListByLeaseTmTask(tmTaskRequestVo); +// } else { +// String username = SecurityUtils.getLoginUser().getUsername(); +// tmTaskRequestVo.setCreateBy(username); +// tmTaskList = tmTaskMapper.getAuditListByLeaseTmTaskByPeople(tmTaskRequestVo); +// } +// for (TmTaskRequestVo tmTask : tmTaskList) { +// int count = 0; +// if (tmTask != null) { +// // 去查询任务分单表 +// List auditListByLeaseInfo = tmTaskMapper.getAuditListByLeaseInfo(tmTask); +// if (auditListByLeaseInfo != null && !auditListByLeaseInfo.isEmpty()) { +// // 对领料任务集合查询具体详情 +// for (LeaseApplyInfo leaseApplyInfo : auditListByLeaseInfo) { +// if (leaseApplyInfo != null) { +// // 去查询领料任务详情表 +// List leaseApplyDetails = tmTaskMapper.getLeaseApplyDetails(leaseApplyInfo); +// if (leaseApplyDetails != null && !leaseApplyDetails.isEmpty()) { +// for (LeaseApplyDetails leaseApplyDetail : leaseApplyDetails) { +// if (leaseApplyDetail != null && leaseApplyDetail.getPreNum() != null) { +// // 统计预领数量 +// count += leaseApplyDetail.getPreNum(); +// } +// } +// // 塞入领料任务详情的集合中 +// leaseApplyInfo.setLeaseApplyDetails(leaseApplyDetails); +// } +// } +// } +// // 存入领料任务实体集合 +// tmTask.setLeaseApplyInfoList(auditListByLeaseInfo); +// tmTask.setRemark(auditListByLeaseInfo.get(0).getRemark()); +// } +// // 塞入预领的合计数量 +// tmTask.setPreCountNum(count); +// } +// } +// return tmTaskList; +// } + - return tmTaskList; - } } diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/common/SelectMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/common/SelectMapper.xml index 6793288c..6b18ebed 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/common/SelectMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/common/SelectMapper.xml @@ -71,7 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" FROM ma_machine mm LEFT JOIN ma_type mt ON mt.type_id = mm.type_id LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id - WHERE mm.ma_code is not null and mm.ma_status in (15) + WHERE mm.ma_code is not null and mm.ma_status in (1) GROUP BY mt.type_id) AS subquery0 ON subquery0.type_id = mt.type_id WHERE mt.del_flag = '0' diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyDetailsMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyDetailsMapper.xml index c7619d26..a1eb5b01 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyDetailsMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyDetailsMapper.xml @@ -31,6 +31,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select lad.id, lad.parent_id, mt.type_id, mt.type_name, mt2.type_name as ma_type_name, mt.storage_num, + mt.manage_type as manageType, + (lad.pre_num - IF(lad.al_num IS NULL,'0',lad.al_num)) AS outNum, lad.pre_num, lad.audit_num, lad.al_num, lad.status, mt.unit_name, lad.create_by, lad.create_time, lad.update_by, lad.update_time, lad.remark, lad.company_id from diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseOutDetailsMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseOutDetailsMapper.xml index 159b18cb..d1ae11f0 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseOutDetailsMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseOutDetailsMapper.xml @@ -154,7 +154,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" FROM ma_machine mm LEFT JOIN ma_type mt ON mt.type_id = mm.type_id LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id - WHERE mm.ma_code is not null and mm.ma_status in (15) + WHERE mm.ma_code is not null and mm.ma_status in (1) GROUP BY mt.type_id) AS subquery0 ON subquery0.type_id = mt.type_id WHERE mt.del_flag = '0' and mt.type_id = #{typeId} diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/TypeMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/TypeMapper.xml index f53f1c88..6f063418 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/TypeMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/TypeMapper.xml @@ -458,7 +458,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select DISTINCT m.type_id, m.type_name, m.parent_id, m.unit_id, m.unit_name, m.manage_type, m.lease_price,m.eff_time, m.rent_price, m.buy_price, m.pay_price, m.level, m.rated_load, m.test_load, m.holding_time, m.warn_num, - mpi.prop_name, m.del_flag, m.create_by, m.create_time, + m.del_flag, m.create_by, m.create_time, m.remark,m.type_id id , m.type_name label, CASE m.manage_type WHEN 0 THEN @@ -467,8 +467,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" IFNULL(m.storage_num, 0) END as storage_num from ma_type m - left join ma_prop_set mps on m.type_id = mps.type_id and mps.`status`='0' and mps.del_flag='0' - left join ma_prop_info mpi on mps.prop_id = mpi.prop_id and mpi.`status`='0' and mpi.del_flag='0' left join (SELECT mt.type_id, mt2.type_name AS typeName, mt.type_name AS typeModelName, @@ -476,7 +474,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" FROM ma_machine mm LEFT JOIN ma_type mt ON mt.type_id = mm.type_id LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id - WHERE mm.ma_code is not null and mm.ma_status in (15) + WHERE mm.ma_code is not null and mm.ma_status in (1) GROUP BY mt.type_id) AS subquery0 ON subquery0.type_id = m.type_id m.del_flag = '0' diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/task/TmTaskMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/task/TmTaskMapper.xml index 90dbacd8..95dcab9e 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/task/TmTaskMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/task/TmTaskMapper.xml @@ -129,127 +129,120 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ) - + + + + + + + - + + + + + + + - + + + + + + + + + + + - + + + + + + + + + + + + + + + \ No newline at end of file