属性组状态开关 商品规格状态开关 品类信息回显父类名称
parent
e6c30b5574
commit
64124b2bb2
|
@ -80,4 +80,11 @@ public class AttributeGroup extends BaseEntity {
|
|||
.build();
|
||||
}
|
||||
|
||||
public static AttributeGroup editUpdBuild(Long id,String states){
|
||||
return AttributeGroup.builder()
|
||||
.id(id)
|
||||
.states(states)
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -51,6 +51,7 @@ public class RuleInfo extends BaseEntity {
|
|||
@ApiModelProperty(name = "规格状态", value = "规格状态")
|
||||
private String status;
|
||||
|
||||
|
||||
/**
|
||||
* 查询构造器
|
||||
*/
|
||||
|
@ -82,6 +83,17 @@ public class RuleInfo extends BaseEntity {
|
|||
.build();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改规格状态构造器
|
||||
*/
|
||||
public static RuleInfo editByBuild(Long id, String status){
|
||||
return RuleInfo.builder()
|
||||
.id(id)
|
||||
.status(status)
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param ruleInfoAddModel 添加模型
|
||||
|
|
|
@ -32,6 +32,8 @@ public class RuleInfoResp extends BaseEntity {
|
|||
/** 规格状态 */
|
||||
private String status;
|
||||
|
||||
private Boolean flan=false;
|
||||
|
||||
/**
|
||||
* 规格属性集合
|
||||
*/
|
||||
|
|
|
@ -42,6 +42,10 @@ public class AttributeGroupController extends BaseController {
|
|||
@Autowired
|
||||
private AttributeGroupService attributeGroupService;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询属性组列表
|
||||
*/
|
||||
|
@ -116,4 +120,12 @@ public class AttributeGroupController extends BaseController {
|
|||
public Result<String> remove(@PathVariable List<Long> ids) {
|
||||
return toAjax(attributeGroupService.removeBatchByIds(ids));
|
||||
}
|
||||
|
||||
@RequiresPermissions("product:attributeGroup:edit")
|
||||
@Log(title = "属性组",businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/{id}/{states}")
|
||||
@ApiOperation("修改属性状态")
|
||||
public Result<String> updStates(@PathVariable Long id,@PathVariable String states){
|
||||
return toAjax(attributeGroupService.updateById(AttributeGroup.editUpdBuild(id,states)));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -105,6 +105,21 @@ public class RuleInfoController extends BaseController {
|
|||
return toAjax(ruleInfoService.updateById(RuleInfo.editBuild(id,ruleInfoUpdRes)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品规格状态
|
||||
* @param id status
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("product:rule:edit")
|
||||
@Log(title = "商品规格", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/{id}/{status}")
|
||||
@ApiOperation("/修改商品规格状态")
|
||||
public Result<String> updateById(@PathVariable Long id,@PathVariable String status){
|
||||
return toAjax(ruleInfoService.updateById(RuleInfo.editByBuild(id,status)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 删除商品规格
|
||||
*/
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.muyu.product.mapper;
|
||||
|
||||
import com.muyu.product.domain.resp.AttributeGroupUpdResp;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
|
@ -19,4 +20,6 @@ public interface AttributeGroupUpdMapper {
|
|||
* @param ids
|
||||
*/
|
||||
void attriAddGroup(@Param("id") Long id, @Param("ids") Long ids);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -56,11 +56,6 @@ public interface AttributeGroupService extends IService<AttributeGroup> {
|
|||
*/
|
||||
void updAs(Long id, AttributeGroupEditReq attributeGroupEditReq);
|
||||
|
||||
//
|
||||
// /**
|
||||
// * 修改属性组数据 自己改的
|
||||
// * @param attributeGroup
|
||||
// * @return
|
||||
// */
|
||||
// AttributeGroupUpdResp updByids(AttributeGroup attributeGroup);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -149,5 +149,4 @@ public class AttributeGroupServiceImpl extends ServiceImpl<AttributeGroupMapper,
|
|||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -362,6 +362,7 @@ public class CategoryInfoServiceImpl extends ServiceImpl<CategoryInfoMapper, Cat
|
|||
.id(byId.getId())
|
||||
.name(byId.getName())
|
||||
.start(byId.getStart())
|
||||
.introduction(byId.getIntroduction())
|
||||
.attributeGroupIdList(list)
|
||||
.attributeIdList(list1)
|
||||
.brandIdList(list2)
|
||||
|
|
|
@ -1,17 +1,21 @@
|
|||
package com.muyu.product.service.impl;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.alibaba.csp.sentinel.util.ConfigUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.muyu.common.core.text.Convert;
|
||||
import com.muyu.common.core.utils.ObjUtils;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.product.domain.ProjectInfo;
|
||||
import com.muyu.product.domain.RuleAttrInfo;
|
||||
import com.muyu.product.domain.RuleInfoUpdRes;
|
||||
import com.muyu.product.domain.model.RuleAttrAddModel;
|
||||
|
@ -21,7 +25,10 @@ import com.muyu.product.domain.req.RuleInfoQueryReq;
|
|||
import com.muyu.product.domain.resp.RuleInfoResp;
|
||||
|
||||
import com.muyu.product.mapper.RuleInfoUpdMapper;
|
||||
import com.muyu.product.service.ProjectInfoService;
|
||||
import com.muyu.product.service.RuleAttrInfoService;
|
||||
import com.mysql.cj.x.protobuf.MysqlxCrud;
|
||||
import io.jsonwebtoken.lang.Collections;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -45,7 +52,8 @@ public class RuleInfoServiceImpl extends ServiceImpl<RuleInfoMapper, RuleInfo>
|
|||
private RuleAttrInfoService ruleAttrInfoService;
|
||||
@Autowired
|
||||
private RuleInfoUpdMapper ruleInfoUpdMapper;
|
||||
|
||||
@Autowired
|
||||
private ProjectInfoService projectInfoService;
|
||||
|
||||
/**
|
||||
* 查询商品规格列表
|
||||
|
@ -109,10 +117,20 @@ public class RuleInfoServiceImpl extends ServiceImpl<RuleInfoMapper, RuleInfo>
|
|||
.toList();
|
||||
boolean isPage = ruleInfoQueryReq.getParams().get("isPage") == null || Convert.toBool(ruleInfoQueryReq.getParams().get("isPage"), true);
|
||||
|
||||
ruleInfoRespList.forEach(item->{
|
||||
LambdaQueryWrapper<ProjectInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ProjectInfo::getRuleId,item.getId());
|
||||
List<ProjectInfo> projectInfos = projectInfoService.list(queryWrapper);
|
||||
if (!Collections.isEmpty(projectInfos)){
|
||||
item.setFlan(true);
|
||||
}
|
||||
});
|
||||
|
||||
return TableDataInfo.<RuleInfoResp>builder()
|
||||
.rows(ruleInfoRespList)
|
||||
.total(isPage ? new PageInfo<>(list).getTotal() : 0)
|
||||
.build();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -125,6 +143,7 @@ public class RuleInfoServiceImpl extends ServiceImpl<RuleInfoMapper, RuleInfo>
|
|||
.id(byId.getId())
|
||||
.name(byId.getName())
|
||||
.remark(byId.getRemark())
|
||||
.status(byId.getStatus())
|
||||
.ruleAttrList(list.stream().map(RuleAttrAddModel::infoBuild).toList()).build();
|
||||
}
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
(#{id},#{ids})
|
||||
</insert>
|
||||
|
||||
|
||||
<delete id="del">
|
||||
delete from as_attribute_group where group_id=#{id}
|
||||
</delete>
|
||||
|
|
Loading…
Reference in New Issue