bug修复
This commit is contained in:
parent
67e3cead5d
commit
084f83e3be
|
|
@ -110,6 +110,13 @@ public class FinanceService {
|
|||
if (rows <= 0) {
|
||||
throw new RuntimeException("财务数据新增失败");
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(addDto.getFiles())) {
|
||||
for (ResourceFilePo file : addDto.getFiles()) {
|
||||
file.setBusinessId(addDto.getFinanceId());
|
||||
file.setSourceTable(TableConstants.TB_ENTERPRISE_FINANCE);
|
||||
}
|
||||
sourceFileService.saveResourceFile(addDto.getFiles());
|
||||
}
|
||||
|
||||
return AjaxResult.success("新增财务信息成功");
|
||||
} catch (RuntimeException e) {
|
||||
|
|
|
|||
|
|
@ -97,6 +97,10 @@ public class RejectionItemService {
|
|||
}
|
||||
|
||||
try {
|
||||
int result = imdRejectionItemService.isRepeat(addDto);
|
||||
if(result > 0){
|
||||
return AjaxResult.error("废标项已存在");
|
||||
}
|
||||
// 2. 调用内层Service新增废标项(操作类型1=新增)
|
||||
int rows = imdRejectionItemService.operRejectionItemData(addDto, 1);
|
||||
if (rows <= 0) {
|
||||
|
|
@ -126,6 +130,10 @@ public class RejectionItemService {
|
|||
}
|
||||
|
||||
try {
|
||||
int result = imdRejectionItemService.isRepeat(editDto);
|
||||
if(result > 0){
|
||||
return AjaxResult.error("废标项已存在");
|
||||
}
|
||||
// 2. 校验废标项是否存在
|
||||
RejectionItemVo existVo = imdRejectionItemService.selectRejectionItemDetail(editDto);
|
||||
if (Objects.isNull(existVo) || Objects.isNull(existVo.getItemId())) {
|
||||
|
|
|
|||
|
|
@ -75,7 +75,6 @@ public class QualificationDto {
|
|||
* 发证机构
|
||||
* 新增、修改时必填
|
||||
*/
|
||||
@NotBlank(message = "发证机构不能为空", groups = {ADD.class, UPDATE.class})
|
||||
@Length(max = 64, message = "发证机构长度不能超过64", groups = {ADD.class, UPDATE.class})
|
||||
private String certificateInstitution;
|
||||
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ public class RejectionItemDto extends BaseEntity {
|
|||
/**
|
||||
* 废标项描述- 支持自动换行,排序4
|
||||
*/
|
||||
@NotBlank(message = "废标项描述不能为空", groups = {ADD.class, UPDATE.class,UPDATE.class,IMPORT.class})
|
||||
@Length(max = 256, message = "废标项描述长度不能超过256", groups = {ADD.class, UPDATE.class,IMPORT.class})
|
||||
private String itemDesc;
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ public class TemplateInfoVo extends BaseEntity {
|
|||
/**
|
||||
* 模板名称
|
||||
*/
|
||||
private Long templateName;
|
||||
private String templateName;
|
||||
|
||||
/**
|
||||
* 解析标签名称(新增:关联查询,用于前端展示标签名称)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.mainDataBase.mapper;
|
||||
|
||||
import com.bonus.common.domain.mainDatabase.dto.QualificationDto;
|
||||
import com.bonus.common.domain.mainDatabase.dto.RejectionItemDto;
|
||||
import com.bonus.common.domain.mainDatabase.vo.RejectionItemVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
|
@ -68,4 +69,15 @@ public interface IMDRejectionItemMapper {
|
|||
*/
|
||||
List<String> selectExistingItemNames(RejectionItemDto dto);
|
||||
|
||||
/**
|
||||
* 废标项是否重复(同一企业下唯一)
|
||||
*
|
||||
* @param dto 废标项校验DTO
|
||||
* @return int 重复数量:0=不重复,>0=重复
|
||||
* @author csy
|
||||
* @date 2025/10/30 14:08
|
||||
*/
|
||||
int isRepeat(RejectionItemDto dto);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.mainDataBase.service;
|
||||
|
||||
import com.bonus.common.domain.mainDatabase.dto.QualificationDto;
|
||||
import com.bonus.common.domain.mainDatabase.dto.RejectionItemDto;
|
||||
import com.bonus.common.domain.mainDatabase.vo.RejectionItemVo;
|
||||
|
||||
|
|
@ -53,4 +54,14 @@ public interface IMDRejectionItemService {
|
|||
* @return 废标项名称列表(格式:["名称1", "名称2"])
|
||||
*/
|
||||
List<String> findExistingItemNames(RejectionItemDto dto);
|
||||
|
||||
/**
|
||||
* 校验废项标是否重复
|
||||
* @param dto 废项标校验DTO
|
||||
* @return int 重复数量:0=不重复,>=0重复
|
||||
* @author csy
|
||||
* @date 2025/10/30 10:25
|
||||
*/
|
||||
int isRepeat(RejectionItemDto dto);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.mainDataBase.service.impl;
|
||||
|
||||
import com.bonus.common.domain.mainDatabase.dto.QualificationDto;
|
||||
import com.bonus.common.domain.mainDatabase.dto.RejectionItemDto;
|
||||
import com.bonus.common.domain.mainDatabase.vo.RejectionItemVo;
|
||||
import com.bonus.mainDataBase.mapper.IMDRejectionItemMapper;
|
||||
|
|
@ -152,4 +153,20 @@ public class IMDRejectionItemServiceImpl implements IMDRejectionItemService {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验废标项是否重复(同一企业下唯一)
|
||||
*/
|
||||
@Override
|
||||
public int isRepeat(RejectionItemDto dto) {
|
||||
try {
|
||||
// 调用Mapper查询重复数量,空值处理为0,避免空指针
|
||||
return Optional.ofNullable(imdRejectionItemMapper.isRepeat(dto))
|
||||
.orElse(0);
|
||||
} catch (Exception e) {
|
||||
log.error("校验证书编号重复异常,企业ID:{},废标项:{}", dto.getEnterpriseId(), dto.getItemName(), e);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -148,5 +148,17 @@
|
|||
and del_flag = '0' <!-- 排除已删除的数据 -->
|
||||
</select>
|
||||
|
||||
<select id="isRepeat" parameterType="com.bonus.common.domain.mainDatabase.dto.QualificationDto" resultType="Integer">
|
||||
select count(1)
|
||||
from tb_enterprise_rejection_item
|
||||
where del_flag = '0'
|
||||
and enterprise_id = #{enterpriseId} -- 同一企业下校验
|
||||
and item_name = #{itemName}
|
||||
<!-- 编辑时排除自身 -->
|
||||
<if test="itemId != null and itemId != ''">
|
||||
and item_id != #{itemId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -19,12 +19,16 @@
|
|||
tb.composition_id, tb.template_id, tb.composition_type,
|
||||
tb.file_name, tb.file_type
|
||||
from tb_template_composition tb
|
||||
left join tb_template_composition comp
|
||||
on tb.template_id = comp.template_id
|
||||
where tb.del_flag = '0'
|
||||
</sql>
|
||||
|
||||
<!-- 1. 根据模板ID查询组成记录 -->
|
||||
<select id="selectByTemplateId" parameterType="Long" resultMap="templateCompositionResult">
|
||||
<include refid="selectTemplateComposition"/>
|
||||
where template_id = #{templateId}
|
||||
|
||||
</select>
|
||||
|
||||
<!-- 2. 新增模板组成记录 -->
|
||||
|
|
@ -66,4 +70,18 @@
|
|||
</foreach>
|
||||
</select>
|
||||
|
||||
<!-- 6. 更新单个模板组成记录 -->
|
||||
<update id="updateTemplateComposition" parameterType="com.bonus.common.domain.template.po.TemplateComposition">
|
||||
update tb_template_composition
|
||||
<set>
|
||||
<if test="fileName != null and fileName != ''">
|
||||
file_name = #{fileName},
|
||||
</if>
|
||||
<if test="fileType != null and fileType != ''">
|
||||
file_type = #{fileType},
|
||||
</if>
|
||||
</set>
|
||||
where composition_id = #{compositionId}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateUserId" column="update_user_id" />
|
||||
<result property="updateUserName" column="update_user_name" />
|
||||
<result property="compositionName" column="file_name" />
|
||||
<result property="compositionName" column="compositionName" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
|
|
@ -38,7 +38,7 @@
|
|||
tb.update_user_name,
|
||||
tb.del_flag,
|
||||
tb.analysis_label_id,
|
||||
GROUP_CONCAT(comp.file_name SEPARATOR ',') as compositionName
|
||||
GROUP_CONCAT(comp.file_name SEPARATOR '、') as compositionName
|
||||
from tb_template tb
|
||||
left join tb_template_composition comp
|
||||
on tb.template_id = comp.template_id
|
||||
|
|
|
|||
Loading…
Reference in New Issue