From 21249c4d7433c78a3c50392d0429a1bb8c13971d Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Tue, 12 Nov 2024 16:02:02 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=86=E6=96=99=E6=8E=A5=E5=8F=A3=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/LeaseApplyInfoController.java | 9 +-- .../lease/service/ILeaseApplyInfoService.java | 7 +- .../impl/LeaseApplyInfoServiceImpl.java | 31 ++++---- .../task/domain/vo/TmTaskRequestVo.java | 72 +++++++++++++++++++ 4 files changed, 97 insertions(+), 22 deletions(-) create mode 100644 bonus-modules/bonus-material/src/main/java/com/bonus/material/task/domain/vo/TmTaskRequestVo.java 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 8a004c26..965e4390 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 @@ -5,6 +5,7 @@ import javax.servlet.http.HttpServletResponse; import com.bonus.common.log.enums.OperaType; import com.bonus.material.common.annotation.PreventRepeatSubmit; import com.bonus.material.lease.domain.vo.LeaseApplyRequestVo; +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; @@ -82,9 +83,9 @@ public class LeaseApplyInfoController extends BaseController { //@RequiresPermissions("lease:info:add") @SysLog(title = "领料任务", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增领料任务") @PostMapping - public AjaxResult add(@RequestBody LeaseApplyRequestVo leaseApplyRequestVo) { + public AjaxResult add(@RequestBody TmTaskRequestVo tmTaskRequestVo) { try { - return leaseApplyInfoService.insertLeaseApplyInfo(leaseApplyRequestVo); + return leaseApplyInfoService.insertLeaseApplyInfo(tmTaskRequestVo); } catch (Exception e) { return error("系统错误, " + e.getMessage()); } @@ -98,9 +99,9 @@ public class LeaseApplyInfoController extends BaseController { //@RequiresPermissions("lease:info:edit") @SysLog(title = "领料任务", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改领料任务") @PutMapping - public AjaxResult edit(@RequestBody LeaseApplyRequestVo leaseApplyRequestVo) { + public AjaxResult edit(@RequestBody TmTaskRequestVo tmTaskRequestVo) { try { - return toAjax(leaseApplyInfoService.updateLeaseApplyInfo(leaseApplyRequestVo)); + return toAjax(leaseApplyInfoService.updateLeaseApplyInfo(tmTaskRequestVo)); } catch (Exception e) { return error("系统错误, " + e.getMessage()); } 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 995f49b1..fda31d68 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 @@ -5,6 +5,7 @@ import java.util.List; import com.bonus.common.core.web.domain.AjaxResult; import com.bonus.material.lease.domain.LeaseApplyInfo; import com.bonus.material.lease.domain.vo.LeaseApplyRequestVo; +import com.bonus.material.task.domain.vo.TmTaskRequestVo; /** * 领料任务Service接口 @@ -35,15 +36,15 @@ public interface ILeaseApplyInfoService { * @param leaseApplyRequestVo 领料任务 * @return 结果 */ - public AjaxResult insertLeaseApplyInfo(LeaseApplyRequestVo leaseApplyRequestVo); + public AjaxResult insertLeaseApplyInfo(TmTaskRequestVo leaseApplyRequestVo); /** * 修改领料任务 * - * @param leaseApplyRequestVo 领料任务 + * @param tmTaskRequestVo 领料任务 * @return 结果 */ - public boolean updateLeaseApplyInfo(LeaseApplyRequestVo leaseApplyRequestVo); + public boolean updateLeaseApplyInfo(TmTaskRequestVo tmTaskRequestVo); /** * 批量删除领料任务 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 4f7b5286..cffccac0 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 @@ -15,6 +15,7 @@ import com.bonus.material.lease.mapper.LeaseApplyDetailsMapper; import com.bonus.material.purchase.domain.PurchaseCheckDetails; import com.bonus.material.purchase.domain.dto.PurchaseCheckDto; import com.bonus.material.task.domain.TmTask; +import com.bonus.material.task.domain.vo.TmTaskRequestVo; import com.bonus.material.task.mapper.TmTaskMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.dao.DataAccessException; @@ -70,26 +71,26 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService { /** * 新增领料任务 * - * @param leaseApplyRequestVo 领料任务 + * @param tmTaskRequestVo 领料任务 * @return 结果 */ @Override - public AjaxResult insertLeaseApplyInfo(LeaseApplyRequestVo leaseApplyRequestVo) { - leaseApplyRequestVo.getLeaseApplyInfo().setCreateTime(DateUtils.getNowDate()); - leaseApplyRequestVo.getLeaseApplyInfo().setCreateBy(SecurityUtils.getUsername()); + public AjaxResult insertLeaseApplyInfo(TmTaskRequestVo tmTaskRequestVo) { + tmTaskRequestVo.getLeaseApplyInfo().setCreateTime(DateUtils.getNowDate()); + tmTaskRequestVo.getLeaseApplyInfo().setCreateBy(SecurityUtils.getUsername()); try { int thisMonthMaxOrder = tmTaskMapper.getMonthMaxOrderByDate(DateUtils.getCurrentYear(), DateUtils.getCurrentMonth(), TmTaskTypeEnum.TM_TASK_LEASE.getTaskTypeId()); String taskCode = genderTaskCode(thisMonthMaxOrder); TmTask tmTask = new TmTask(null, TmTaskTypeEnum.TM_TASK_LEASE.getTaskTypeId(), PurchaseTaskStatusEnum.TO_NOTICE.getStatus(), - leaseApplyRequestVo.getLeaseApplyInfo().getCompanyId(), "1", thisMonthMaxOrder + 1, taskCode); + tmTaskRequestVo.getLeaseApplyInfo().getCompanyId(), "1", thisMonthMaxOrder + 1, taskCode); tmTask.setCreateTime(DateUtils.getNowDate()); tmTaskMapper.insertTmTask(tmTask); Long taskId = tmTask.getTaskId(); - leaseApplyRequestVo.getLeaseApplyInfo().setTaskId(taskId); - int count = leaseApplyInfoMapper.insertLeaseApplyInfo(leaseApplyRequestVo.getLeaseApplyInfo()); + tmTaskRequestVo.getLeaseApplyInfo().setTaskId(taskId); + int count = leaseApplyInfoMapper.insertLeaseApplyInfo(tmTaskRequestVo.getLeaseApplyInfo()); if (count > 0) { - return insertPurchaseCheckDetails(leaseApplyRequestVo.getLeaseApplyDetailsList(), taskId); + return insertPurchaseCheckDetails(tmTaskRequestVo.getLeaseApplyDetailsList(), taskId); } else { return AjaxResult.error("新增任务失败,lease_apply_info表插入0条"); } @@ -132,18 +133,18 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService { /** * 修改领料任务 * - * @param leaseApplyRequestVo 领料任务 + * @param tmTaskRequestVo 领料任务 * @return 结果 */ @Override - public boolean updateLeaseApplyInfo(LeaseApplyRequestVo leaseApplyRequestVo) { - leaseApplyRequestVo.getLeaseApplyInfo().setUpdateTime(DateUtils.getNowDate()); - leaseApplyRequestVo.getLeaseApplyInfo().setUpdateBy(SecurityUtils.getUsername()); + public boolean updateLeaseApplyInfo(TmTaskRequestVo tmTaskRequestVo) { + tmTaskRequestVo.getLeaseApplyInfo().setUpdateTime(DateUtils.getNowDate()); + tmTaskRequestVo.getLeaseApplyInfo().setUpdateBy(SecurityUtils.getUsername()); try { - Long[] ids = new Long[]{leaseApplyRequestVo.getLeaseApplyInfo().getId()}; + Long[] ids = new Long[]{tmTaskRequestVo.getLeaseApplyInfo().getId()}; leaseApplyDetailsMapper.deleteLeaseApplyDetailsByParentIds(ids); - insertPurchaseCheckDetails(leaseApplyRequestVo.getLeaseApplyDetailsList(), leaseApplyRequestVo.getLeaseApplyInfo().getTaskId()); - leaseApplyInfoMapper.updateLeaseApplyInfo(leaseApplyRequestVo.getLeaseApplyInfo()); + insertPurchaseCheckDetails(tmTaskRequestVo.getLeaseApplyDetailsList(), tmTaskRequestVo.getLeaseApplyInfo().getTaskId()); + leaseApplyInfoMapper.updateLeaseApplyInfo(tmTaskRequestVo.getLeaseApplyInfo()); return true; } catch (Exception e) { throw new ServiceException("错误信息描述"); 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 new file mode 100644 index 00000000..a6a9336b --- /dev/null +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/task/domain/vo/TmTaskRequestVo.java @@ -0,0 +1,72 @@ +package com.bonus.material.task.domain.vo; + +import com.bonus.common.core.annotation.Excel; +import com.bonus.common.core.web.domain.BaseEntity; +import com.bonus.material.lease.domain.LeaseApplyDetails; +import com.bonus.material.lease.domain.LeaseApplyInfo; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import java.util.List; + +@Data +public class TmTaskRequestVo extends BaseEntity { + + /** 任务ID */ + private Long taskId; + + /** 任务类型(定义数据字典) */ + @Excel(name = "任务类型(定义数据字典)") + @ApiModelProperty(value = "任务类型(定义数据字典)") + private Integer taskType; + + /** 任务状态(定义数据字典) */ + @Excel(name = "任务状态(定义数据字典)") + @ApiModelProperty(value = "任务状态(定义数据字典)") + private Integer taskStatus; + + /** 编号 */ + @Excel(name = "编号") + @ApiModelProperty(value = "编号") + private String code; + + /** 数据所属组织 */ + @Excel(name = "数据所属组织") + @ApiModelProperty(value = "数据所属组织") + private Long companyId; + + /** 0不启用 1启用 */ + @Excel(name = "0不启用 1启用") + @ApiModelProperty(value = "0不启用 1启用") + private String status; + + @ApiModelProperty(value = "任务当月序号 例如:1 插入及查询时请携带任务类型") + private Integer monthOrder; + + @ApiModelProperty(value = "领料任务汇总") + private LeaseApplyInfo leaseApplyInfo; + + @ApiModelProperty(value = "领料任务物资列表") + private List leaseApplyDetailsList; + + @ApiModelProperty(value = "协议id") + private Integer agreementId; + + @ApiModelProperty(value = "协议编号") + @Excel(name = "协议号", sort = 4) + private String agreementCode; + + @ApiModelProperty(value = "领料人") + //@Excel(name = "领料人", sort = 5) + private String leasePerson; + + @ApiModelProperty(value = "领料人手机号") + //@Excel(name = "联系电话", sort = 6) + private String leasePhone; + + @ApiModelProperty(value = "往来单位id") + private Long unitId; + + @ApiModelProperty(value = "工程id") + private Long projectId; + +}