增加配置属性
This commit is contained in:
parent
c58aa96c9f
commit
7849348924
|
|
@ -87,4 +87,8 @@ public interface MaTypeMapper {
|
|||
List<Integer> selectParentId(@Param("typeId")Long typeId, @Param("level")Integer level);
|
||||
|
||||
Integer updateLeasePrice(@Param("typeIds")List<Integer> typeIds,@Param("leasePrice") BigDecimal leasePrice);
|
||||
|
||||
int deleteMaTypePropertyNames(@Param("typeId")Long typeId);
|
||||
|
||||
int insertMaTypePropertyNames(@Param("typeId")Long typeId, @Param("list") List<String> propertyNames);
|
||||
}
|
||||
|
|
@ -8,6 +8,8 @@ import com.bonus.material.ma.service.ITypeService;
|
|||
import com.bonus.material.ma.vo.*;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
|
@ -128,6 +130,11 @@ public class MaTypeServiceImpl implements ITypeService {
|
|||
Long typeId = maType.getTypeId();
|
||||
maType.setUpdateTime(DateUtils.getNowDate());
|
||||
int i = maTypeMapper.updateType(maType);
|
||||
//保存配置属性
|
||||
if (!CollectionUtils.isEmpty(maType.getPropertyNames())) {
|
||||
maTypeMapper.deleteMaTypePropertyNames(maType.getTypeId());
|
||||
maTypeMapper.insertMaTypePropertyNames(maType.getTypeId(), maType.getPropertyNames());
|
||||
}
|
||||
// 图片路径保存
|
||||
if (StringUtils.isNotEmpty(maType.getPhotoName()) && StringUtils.isNotEmpty(maType.getPhotoUrl())) {
|
||||
typeFileMapper.deleteMaTypeFileByTypeId(typeId, "1");
|
||||
|
|
|
|||
|
|
@ -216,4 +216,6 @@ public class MaType extends BaseEntity {
|
|||
private String intelligentCode;
|
||||
|
||||
private List<Integer> typeIds;
|
||||
|
||||
private List<String> propertyNames;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -454,4 +454,21 @@
|
|||
</foreach>
|
||||
and del_flag = 0
|
||||
</update>
|
||||
|
||||
<delete id="deleteMaTypePropertyNames">
|
||||
delete from ma_type_properties where type_id = #{typeId}
|
||||
</delete>
|
||||
|
||||
<insert id="insertMaTypePropertyNames">
|
||||
insert into
|
||||
ma_type_properties(type_id, property_name, create_time)
|
||||
values
|
||||
<foreach collection="list" item="item" index="index" separator=",">
|
||||
(
|
||||
#{typeId},
|
||||
#{item},
|
||||
now()
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue