This commit is contained in:
parent
813266dca2
commit
9ebd493f87
|
|
@ -209,4 +209,11 @@ public interface LeaseTaskMapper {
|
|||
String getAncestors(Long userId);
|
||||
|
||||
String getProjectNameById(Long projectId);
|
||||
|
||||
/**
|
||||
* 根据新类型查询旧类型
|
||||
* @param leaseApplyDetails
|
||||
* @return
|
||||
*/
|
||||
LeaseApplyDetails selectTypeByNewType(LeaseApplyDetails leaseApplyDetails);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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("发布驳回详情删除失败,请联系管理员");
|
||||
|
|
|
|||
|
|
@ -1039,7 +1039,7 @@
|
|||
lease_publish_details
|
||||
WHERE
|
||||
parent_id = #{parentId}
|
||||
and type_id = #{typeId}
|
||||
and new_type = #{newTypeId}
|
||||
and publish_task = #{publishTask}
|
||||
</delete>
|
||||
|
||||
|
|
@ -1064,4 +1064,16 @@
|
|||
<select id="getProjectNameById" resultType="java.lang.String">
|
||||
select pro_name as projectName from bm_project where pro_id = #{projectId}
|
||||
</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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue