diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/mapper/LeaseTaskMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/mapper/LeaseTaskMapper.java index 59b01659..8589782e 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/mapper/LeaseTaskMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/mapper/LeaseTaskMapper.java @@ -209,4 +209,11 @@ public interface LeaseTaskMapper { String getAncestors(Long userId); String getProjectNameById(Long projectId); + + /** + * 根据新类型查询旧类型 + * @param leaseApplyDetails + * @return + */ + LeaseApplyDetails selectTypeByNewType(LeaseApplyDetails leaseApplyDetails); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseTaskServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseTaskServiceImpl.java index c11c3c6e..de69691b 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseTaskServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseTaskServiceImpl.java @@ -954,13 +954,18 @@ public class LeaseTaskServiceImpl implements ILeaseTaskService { if (leaseApplyDetails == null) { return AjaxResult.error("参数不能为空"); } + //查询是否有newType + LeaseApplyDetails newType = mapper.selectTypeByNewType(leaseApplyDetails); + if (newType != null) { + leaseApplyDetails.setTypeId(newType.getTypeId()); + } // 根据parentId及typeId更新lease_apply_details表的发布数量 int result = mapper.updatePublishSub(leaseApplyDetails); if (result == 0) { return AjaxResult.error("发布驳回失败,请联系管理员"); } - // 根据parentId及typeId更新lease_apply_details表的发布数量 + // 根据parentId及newTypeId更新lease_apply_details表的发布数量 int details = mapper.deletePublishDetails(leaseApplyDetails); if (details == 0) { throw new ServiceException("发布驳回详情删除失败,请联系管理员"); diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseTaskMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseTaskMapper.xml index 4976b12c..72a408eb 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseTaskMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseTaskMapper.xml @@ -1039,7 +1039,7 @@ lease_publish_details WHERE parent_id = #{parentId} - and type_id = #{typeId} + and new_type = #{newTypeId} and publish_task = #{publishTask} @@ -1064,4 +1064,16 @@ +