Merge remote-tracking branch 'origin/master'

This commit is contained in:
jjLv 2024-11-13 09:03:54 +08:00
commit 4e65478292
6 changed files with 35 additions and 52 deletions

View File

@ -52,4 +52,7 @@ public class MaterialConstants {
/** 协议号的开头字母 */ /** 协议号的开头字母 */
public static final String AGREEMENT_PREFIX = "H"; public static final String AGREEMENT_PREFIX = "H";
/** 领料单号的开头字母 */
public static final String LEASE_TASK_TYPE_LABEL = "L";
} }

View File

@ -81,6 +81,7 @@ public class BmAgreementInfoServiceImpl implements IBmAgreementInfoService
try { try {
bmAgreementInfo.setCreateTime(DateUtils.getNowDate()); bmAgreementInfo.setCreateTime(DateUtils.getNowDate());
bmAgreementInfo.setCreateBy(SecurityUtils.getUsername()); bmAgreementInfo.setCreateBy(SecurityUtils.getUsername());
bmAgreementInfo.setSignTime(DateUtils.getNowDate());
bmAgreementInfo.setAgreementCode(getAgreementCode()); bmAgreementInfo.setAgreementCode(getAgreementCode());
int count = bmAgreementInfoMapper.insertBmAgreementInfo(bmAgreementInfo); int count = bmAgreementInfoMapper.insertBmAgreementInfo(bmAgreementInfo);
if (count > 0) { if (count > 0) {

View File

@ -2,6 +2,7 @@ package com.bonus.material.lease.service.impl;
import java.util.List; import java.util.List;
import com.bonus.common.biz.constant.MaterialConstants;
import com.bonus.common.biz.enums.PurchaseTaskStatusEnum; import com.bonus.common.biz.enums.PurchaseTaskStatusEnum;
import com.bonus.common.biz.enums.TmTaskTypeEnum; import com.bonus.common.biz.enums.TmTaskTypeEnum;
import com.bonus.common.core.exception.ServiceException; 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.PurchaseCheckDetails;
import com.bonus.material.purchase.domain.dto.PurchaseCheckDto; import com.bonus.material.purchase.domain.dto.PurchaseCheckDto;
import com.bonus.material.task.domain.TmTask; 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.domain.vo.TmTaskRequestVo;
import com.bonus.material.task.mapper.TmTaskAgreementMapper;
import com.bonus.material.task.mapper.TmTaskMapper; import com.bonus.material.task.mapper.TmTaskMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException; import org.springframework.dao.DataAccessException;
@ -44,7 +47,8 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
@Resource @Resource
private TmTaskMapper tmTaskMapper; 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); tmTaskRequestVo.getLeaseApplyInfo().getCompanyId(), "1", thisMonthMaxOrder + 1, taskCode);
tmTask.setCreateTime(DateUtils.getNowDate()); tmTask.setCreateTime(DateUtils.getNowDate());
tmTaskMapper.insertTmTask(tmTask); tmTaskMapper.insertTmTask(tmTask);
Long taskId = tmTask.getTaskId(); TmTaskAgreement tmTaskAgreement = new TmTaskAgreement(tmTask.getTaskId(), tmTaskRequestVo.getAgreementId());
tmTaskRequestVo.getLeaseApplyInfo().setTaskId(taskId); tmTaskAgreement.setCreateTime(DateUtils.getNowDate());
tmTaskAgreement.setCreateBy(SecurityUtils.getUsername());
tmTaskAgreementMapper.insertTmTaskAgreement(tmTaskAgreement);
tmTaskRequestVo.getLeaseApplyInfo().setTaskId(tmTask.getTaskId());
int count = leaseApplyInfoMapper.insertLeaseApplyInfo(tmTaskRequestVo.getLeaseApplyInfo()); int count = leaseApplyInfoMapper.insertLeaseApplyInfo(tmTaskRequestVo.getLeaseApplyInfo());
if (count > 0) { if (count > 0) {
return insertPurchaseCheckDetails(tmTaskRequestVo.getLeaseApplyDetailsList(), taskId); return insertPurchaseCheckDetails(tmTaskRequestVo.getLeaseApplyDetailsList(), tmTask.getTaskId());
} else { } else {
return AjaxResult.error("新增任务失败,lease_apply_info表插入0条"); return AjaxResult.error("新增任务失败,lease_apply_info表插入0条");
} }
@ -127,7 +134,7 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
* @return 任务对象 * @return 任务对象
*/ */
private static String genderTaskCode(Integer thisMonthMaxOrder) { 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);
} }
/** /**

View File

@ -6,6 +6,8 @@ import lombok.Data;
import lombok.ToString; import lombok.ToString;
import com.bonus.common.core.web.domain.BaseEntity; import com.bonus.common.core.web.domain.BaseEntity;
import java.util.Date;
/** /**
* 任务对象 tm_task_agreement * 任务对象 tm_task_agreement
* *
@ -32,5 +34,8 @@ public class TmTaskAgreement extends BaseEntity {
@ApiModelProperty(value = "数据所属组织") @ApiModelProperty(value = "数据所属组织")
private Long companyId; private Long companyId;
public TmTaskAgreement(Long taskId, Long agreementId) {
this.taskId = taskId;
this.agreementId = agreementId;
}
} }

View File

@ -49,7 +49,7 @@ public class TmTaskRequestVo extends BaseEntity {
private List<LeaseApplyDetails> leaseApplyDetailsList; private List<LeaseApplyDetails> leaseApplyDetailsList;
@ApiModelProperty(value = "协议id") @ApiModelProperty(value = "协议id")
private Integer agreementId; private Long agreementId;
@ApiModelProperty(value = "协议编号") @ApiModelProperty(value = "协议编号")
@Excel(name = "协议号", sort = 4) @Excel(name = "协议号", sort = 4)

View File

@ -63,51 +63,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<insert id="insertBmAgreementInfo" parameterType="com.bonus.material.basic.domain.BmAgreementInfo" useGeneratedKeys="true" keyProperty="agreementId"> <insert id="insertBmAgreementInfo" parameterType="com.bonus.material.basic.domain.BmAgreementInfo" useGeneratedKeys="true" keyProperty="agreementId">
insert into bm_agreement_info insert into bm_agreement_info (agreement_code, sign_time, unit_id,
<trim prefix="(" suffix=")" suffixOverrides=","> project_id, create_by, lease_day,
<if test="agreementCode != null">agreement_code,</if> plan_start_time, contract_code, auth_person,
<if test="signTime != null">sign_time,</if> phone, create_time, update_by,
<if test="unitId != null">unit_id,</if> update_time, remark, company_id
<if test="projectId != null">project_id,</if> )
<if test="createBy != null">create_by,</if> values (#{agreementCode,jdbcType=VARCHAR}, #{signTime,jdbcType=VARCHAR}, #{unitId,jdbcType=INTEGER},
<if test="leaseDay != null">lease_day,</if> #{projectId,jdbcType=INTEGER}, #{createBy,jdbcType=VARCHAR}, #{leaseDay,jdbcType=INTEGER},
<if test="planStartTime != null">plan_start_time,</if> #{planStartTime,jdbcType=TIMESTAMP}, #{contractCode,jdbcType=VARCHAR}, #{authPerson,jdbcType=VARCHAR},
<if test="contractCode != null">contract_code,</if> #{phone,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR},
<if test="authPerson != null">auth_person,</if> #{updateTime,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER}
<if test="phone != null">phone,</if> )
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
<if test="companyId != null">company_id,</if>
<if test="fileName != null">file_name,</if>
<if test="fileUrl != null">file_url,</if>
<if test="status != null">status,</if>
<if test="protocol != null">protocol,</if>
<if test="isSlt != null">is_slt,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="agreementCode != null">#{agreementCode},</if>
<if test="signTime != null">#{signTime},</if>
<if test="unitId != null">#{unitId},</if>
<if test="projectId != null">#{projectId},</if>
<if test="createBy != null">#{createBy},</if>
<if test="leaseDay != null">#{leaseDay},</if>
<if test="planStartTime != null">#{planStartTime},</if>
<if test="contractCode != null">#{contractCode},</if>
<if test="authPerson != null">#{authPerson},</if>
<if test="phone != null">#{phone},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
<if test="companyId != null">#{companyId},</if>
<if test="fileName != null">#{fileName},</if>
<if test="fileUrl != null">#{fileUrl},</if>
'1',
<if test="protocol != null">#{protocol},</if>
<if test="isSlt != null">#{isSlt},</if>
</trim>
</insert> </insert>
<update id="updateBmAgreementInfo" parameterType="com.bonus.material.basic.domain.BmAgreementInfo"> <update id="updateBmAgreementInfo" parameterType="com.bonus.material.basic.domain.BmAgreementInfo">