This commit is contained in:
hayu 2025-08-29 18:18:41 +08:00
parent 813266dca2
commit 9ebd493f87
3 changed files with 26 additions and 2 deletions

View File

@ -209,4 +209,11 @@ public interface LeaseTaskMapper {
String getAncestors(Long userId); String getAncestors(Long userId);
String getProjectNameById(Long projectId); String getProjectNameById(Long projectId);
/**
* 根据新类型查询旧类型
* @param leaseApplyDetails
* @return
*/
LeaseApplyDetails selectTypeByNewType(LeaseApplyDetails leaseApplyDetails);
} }

View File

@ -954,13 +954,18 @@ public class LeaseTaskServiceImpl implements ILeaseTaskService {
if (leaseApplyDetails == null) { if (leaseApplyDetails == null) {
return AjaxResult.error("参数不能为空"); return AjaxResult.error("参数不能为空");
} }
//查询是否有newType
LeaseApplyDetails newType = mapper.selectTypeByNewType(leaseApplyDetails);
if (newType != null) {
leaseApplyDetails.setTypeId(newType.getTypeId());
}
// 根据parentId及typeId更新lease_apply_details表的发布数量 // 根据parentId及typeId更新lease_apply_details表的发布数量
int result = mapper.updatePublishSub(leaseApplyDetails); int result = mapper.updatePublishSub(leaseApplyDetails);
if (result == 0) { if (result == 0) {
return AjaxResult.error("发布驳回失败,请联系管理员"); return AjaxResult.error("发布驳回失败,请联系管理员");
} }
// 根据parentId及typeId更新lease_apply_details表的发布数量 // 根据parentId及newTypeId更新lease_apply_details表的发布数量
int details = mapper.deletePublishDetails(leaseApplyDetails); int details = mapper.deletePublishDetails(leaseApplyDetails);
if (details == 0) { if (details == 0) {
throw new ServiceException("发布驳回详情删除失败,请联系管理员"); throw new ServiceException("发布驳回详情删除失败,请联系管理员");

View File

@ -1039,7 +1039,7 @@
lease_publish_details lease_publish_details
WHERE WHERE
parent_id = #{parentId} parent_id = #{parentId}
and type_id = #{typeId} and new_type = #{newTypeId}
and publish_task = #{publishTask} and publish_task = #{publishTask}
</delete> </delete>
@ -1064,4 +1064,16 @@
<select id="getProjectNameById" resultType="java.lang.String"> <select id="getProjectNameById" resultType="java.lang.String">
select pro_name as projectName from bm_project where pro_id = #{projectId} select pro_name as projectName from bm_project where pro_id = #{projectId}
</select> </select>
<select id="selectTypeByNewType" resultType="com.bonus.material.lease.domain.LeaseApplyDetails">
SELECT
id,
parent_id as parentId,
type_id as typeId,
new_type as newTypeId
FROM
lease_publish_details lpd
WHERE
lpd.parent_id=#{parentId}
and new_type=#{newTypeId}
</select>
</mapper> </mapper>