From 77535090a0cde4d71514c812276f4433acbc9c0d Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Tue, 12 Nov 2024 18:25:46 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E9=A2=86=E6=96=99=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../material/basic/BmAgreementInfoMapper.xml | 57 ++++--------------- 1 file changed, 12 insertions(+), 45 deletions(-) diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/BmAgreementInfoMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/BmAgreementInfoMapper.xml index c39b06ae..ac7afa70 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/BmAgreementInfoMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/BmAgreementInfoMapper.xml @@ -63,51 +63,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - insert into bm_agreement_info - - agreement_code, - sign_time, - unit_id, - project_id, - create_by, - lease_day, - plan_start_time, - contract_code, - auth_person, - phone, - create_time, - update_by, - update_time, - remark, - company_id, - file_name, - file_url, - status, - protocol, - is_slt, - - - #{agreementCode}, - #{signTime}, - #{unitId}, - #{projectId}, - #{createBy}, - #{leaseDay}, - #{planStartTime}, - #{contractCode}, - #{authPerson}, - #{phone}, - #{createTime}, - #{updateBy}, - #{updateTime}, - #{remark}, - #{companyId}, - #{fileName}, - #{fileUrl}, - '1', - #{protocol}, - #{isSlt}, - + insert into bm_agreement_info (agreement_code, sign_time, unit_id, + project_id, create_by, lease_day, + plan_start_time, contract_code, auth_person, + phone, create_time, update_by, + update_time, remark, company_id + ) + values (#{agreementCode,jdbcType=VARCHAR}, #{signTime,jdbcType=VARCHAR}, #{unitId,jdbcType=INTEGER}, + #{projectId,jdbcType=INTEGER}, #{createBy,jdbcType=VARCHAR}, #{leaseDay,jdbcType=INTEGER}, + #{planStartTime,jdbcType=TIMESTAMP}, #{contractCode,jdbcType=VARCHAR}, #{authPerson,jdbcType=VARCHAR}, + #{phone,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, + #{updateTime,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER} + ) From 8cdbb77ab233192377ef76796815b72b100aa071 Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Tue, 12 Nov 2024 18:53:33 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E9=A2=86=E6=96=99=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../material/basic/service/impl/BmAgreementInfoServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/impl/BmAgreementInfoServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/impl/BmAgreementInfoServiceImpl.java index c64b40dd..a01e3332 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/impl/BmAgreementInfoServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/impl/BmAgreementInfoServiceImpl.java @@ -81,6 +81,7 @@ public class BmAgreementInfoServiceImpl implements IBmAgreementInfoService try { bmAgreementInfo.setCreateTime(DateUtils.getNowDate()); bmAgreementInfo.setCreateBy(SecurityUtils.getUsername()); + bmAgreementInfo.setSignTime(DateUtils.getNowDate()); bmAgreementInfo.setAgreementCode(getAgreementCode()); int count = bmAgreementInfoMapper.insertBmAgreementInfo(bmAgreementInfo); if (count > 0) { From a24d84e6246c59afa583aa620d25eb44d1158efe Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Wed, 13 Nov 2024 07:07:27 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E9=A2=86=E6=96=99=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/biz/constant/MaterialConstants.java | 3 +++ .../service/impl/LeaseApplyInfoServiceImpl.java | 17 ++++++++++++----- .../material/task/domain/TmTaskAgreement.java | 7 ++++++- .../task/domain/vo/TmTaskRequestVo.java | 2 +- 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/bonus-common-biz/src/main/java/com/bonus/common/biz/constant/MaterialConstants.java b/bonus-common-biz/src/main/java/com/bonus/common/biz/constant/MaterialConstants.java index 1d732e7f..2179ff29 100644 --- a/bonus-common-biz/src/main/java/com/bonus/common/biz/constant/MaterialConstants.java +++ b/bonus-common-biz/src/main/java/com/bonus/common/biz/constant/MaterialConstants.java @@ -52,4 +52,7 @@ public class MaterialConstants { /** 协议号的开头字母 */ public static final String AGREEMENT_PREFIX = "H"; + /** 领料单号的开头字母 */ + public static final String LEASE_TASK_TYPE_LABEL = "L"; + } 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 cffccac0..256e26a2 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 @@ -2,6 +2,7 @@ package com.bonus.material.lease.service.impl; import java.util.List; +import com.bonus.common.biz.constant.MaterialConstants; import com.bonus.common.biz.enums.PurchaseTaskStatusEnum; import com.bonus.common.biz.enums.TmTaskTypeEnum; import com.bonus.common.core.exception.ServiceException; @@ -15,7 +16,9 @@ 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.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; @@ -44,7 +47,8 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService { @Resource private TmTaskMapper tmTaskMapper; - public static final String LEASE_TASK_TYPE_LABEL = "L"; + @Resource + TmTaskAgreementMapper tmTaskAgreementMapper; /** * 查询领料任务 @@ -86,11 +90,14 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService { tmTaskRequestVo.getLeaseApplyInfo().getCompanyId(), "1", thisMonthMaxOrder + 1, taskCode); tmTask.setCreateTime(DateUtils.getNowDate()); tmTaskMapper.insertTmTask(tmTask); - Long taskId = tmTask.getTaskId(); - tmTaskRequestVo.getLeaseApplyInfo().setTaskId(taskId); + TmTaskAgreement tmTaskAgreement = new TmTaskAgreement(tmTask.getTaskId(), tmTaskRequestVo.getAgreementId()); + tmTaskAgreement.setCreateTime(DateUtils.getNowDate()); + tmTaskAgreement.setCreateBy(SecurityUtils.getUsername()); + tmTaskAgreementMapper.insertTmTaskAgreement(tmTaskAgreement); + tmTaskRequestVo.getLeaseApplyInfo().setTaskId(tmTask.getTaskId()); int count = leaseApplyInfoMapper.insertLeaseApplyInfo(tmTaskRequestVo.getLeaseApplyInfo()); if (count > 0) { - return insertPurchaseCheckDetails(tmTaskRequestVo.getLeaseApplyDetailsList(), taskId); + return insertPurchaseCheckDetails(tmTaskRequestVo.getLeaseApplyDetailsList(), tmTask.getTaskId()); } else { return AjaxResult.error("新增任务失败,lease_apply_info表插入0条"); } @@ -127,7 +134,7 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService { * @return 任务对象 */ private static String genderTaskCode(Integer thisMonthMaxOrder) { - return LEASE_TASK_TYPE_LABEL + DateUtils.getCurrentYear() + DateUtils.getCurrentMonth() + String.format("%06d", thisMonthMaxOrder + 1); + return MaterialConstants.LEASE_TASK_TYPE_LABEL + DateUtils.getCurrentYear() + DateUtils.getCurrentMonth() + String.format("%06d", thisMonthMaxOrder + 1); } /** diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/task/domain/TmTaskAgreement.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/task/domain/TmTaskAgreement.java index 6ab8333f..2ea7a475 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/task/domain/TmTaskAgreement.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/task/domain/TmTaskAgreement.java @@ -6,6 +6,8 @@ import lombok.Data; import lombok.ToString; import com.bonus.common.core.web.domain.BaseEntity; +import java.util.Date; + /** * 任务对象 tm_task_agreement * @@ -32,5 +34,8 @@ public class TmTaskAgreement extends BaseEntity { @ApiModelProperty(value = "数据所属组织") private Long companyId; - + public TmTaskAgreement(Long taskId, Long agreementId) { + this.taskId = taskId; + this.agreementId = agreementId; + } } 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 a6a9336b..133e1cdf 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 @@ -49,7 +49,7 @@ public class TmTaskRequestVo extends BaseEntity { private List leaseApplyDetailsList; @ApiModelProperty(value = "协议id") - private Integer agreementId; + private Long agreementId; @ApiModelProperty(value = "协议编号") @Excel(name = "协议号", sort = 4)