上传数据添加

This commit is contained in:
YY
2025-07-29 14:01:48 +08:00
parent b19d5076fe
commit 98ae056ada
7 changed files with 22 additions and 26 deletions

View File

@ -27,5 +27,7 @@ public class CoscoCategoryLibraryContain extends BaseEntity {
*/
private String deptId;
private String categoryName;
}

View File

@ -177,19 +177,6 @@ public class CoscoCategoryLibraryServiceImpl extends BaseServiceImpl<CoscoCatego
if(userById!=null){
coscoCategoryLibraryVo.setCreateName(userById.getName());
}
String categoryIds = coscoCategoryLibraryVo.getCategoryIds();
if (categoryIds != null && categoryIds.length() > 0) {
String[] split = categoryIds.split(",");
StringBuilder builder = new StringBuilder();
for (String s : split) {
String categoryNameById = coscoCategoryService.getCategoryNameById(s);
builder.append(categoryNameById);
}
coscoCategoryLibraryVo.setCategoryNames(builder.toString());
}
});
}
@ -212,12 +199,11 @@ public class CoscoCategoryLibraryServiceImpl extends BaseServiceImpl<CoscoCatego
List<String> strings = coscoCategoryLibraryContainService.selectCoscoCateGoryIdByLibraryId(id);
StringBuilder sb = new StringBuilder();
for (String s : strings) {
String categoryName = coscoCategoryService.getCategoryNameById(s);
if (sb.length() > 0) {
sb.append(",");
}
if (categoryName != null) {
sb.append(categoryName);
if (s != null) {
sb.append(s);
}
}
vo.setCategoryName(sb.toString());

View File

@ -45,8 +45,6 @@ public class CoscoCategoryLibrarySupplierApplyServiceImpl extends BaseServiceImp
@Autowired
private ICoscoCategoryLibraryContainService coscoCategoryLibraryContainService;
@Autowired
private ICoscoCategoryService coscoCategoryService;
@Autowired
private IOrgService orgService;
@Autowired
private IUserService userService;
@ -71,7 +69,7 @@ public class CoscoCategoryLibrarySupplierApplyServiceImpl extends BaseServiceImp
if (sb.length() > 0) {
sb.append(",");
}
sb.append(coscoCategoryService.getCategoryNameById(s));
sb.append(s);
}
vo.setCoscoCategoryLibrarAttachments(coscoCategoryLibrarAttachmentsService.selectCoscoCategoryLibrarAttachmentsByCategoryLibraryId(id));
vo.setCategoryName(sb.toString());

View File

@ -15,6 +15,14 @@ public class AddCategoryIdVo implements Serializable {
* 锁定类型(0.未锁定、1.锁定)
*/
private Long lockType;
/**
* 品类名称
*/
private String categoryName;
/**
* 品类类型
*/
private String categoryType;
}

View File

@ -8,10 +8,11 @@
id="CoscoCategoryLibraryContainResult">
<result property="categoryLibraryId" column="category_library_id"/>
<result property="categoryId" column="category_id"/>
<result property="categoryName" column="category_name"/>
</resultMap>
<sql id="selectCoscoCategoryLibraryContainVo">
select category_library_id, category_id
select category_library_id, category_id,category_name
from cosco_category_library_contain
</sql>
@ -44,10 +45,10 @@
</insert>
<insert id="batchCoscoCategoryLibraryContain" parameterType="java.util.List">
insert into cosco_category_library_contain
( category_library_id, category_id)
( category_library_id, category_id,category_name,category_type)
values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.categoryLibraryId}, #{item.categoryId})
( #{item.categoryLibraryId}, #{item.categoryId},#{item.categoryName},#{item.categoryType})
</foreach>
</insert>
<update id="updateCoscoCategoryLibraryContain"
@ -106,9 +107,10 @@
</update>
<select id="selectCoscoCateGoryIdByLibraryId" parameterType="string" resultType="string">
select cclc.category_id
select cclc.category_name
from cosco_category_library_contain cclc
where cclc.category_library_id = #{libraryId}
and cclc.category_type=1
</select>
<select id="selectSupplierIdByLibraryId" parameterType="string" resultType="string">

View File

@ -223,7 +223,7 @@
SELECT
ccl.id,
ccl.name,
GROUP_CONCAT(DISTINCT cclc.category_id SEPARATOR ', ') AS categoryIds,
GROUP_CONCAT(case when cclc.category_type=0 then DISTINCT cclc.category_name SEPARATOR ', ' end) AS categoryNames,
ccl.create_by,
ccl.apply_dept_id,
ccl.term_of_validity AS termOfValidity,

View File

@ -1016,7 +1016,7 @@
and cas.org_id = #{vo.orgId}
</if>
<if test="vo.categoryId!=null and vo.categoryId!=''">
and casc.categoryId like concat('%',#{vo.categoryId},'%')
and casc.category_id like concat('%',#{vo.categoryId},'%')
</if>
<if test="vo.librarySupplierIdList!=null and vo.librarySupplierIdList.size>0">