属性组和商品规格的状态的修改
parent
11633283ce
commit
35054bdc94
|
@ -80,5 +80,14 @@ public class AttributeGroup extends BaseEntity {
|
||||||
.states(attributeGroupEditReq.getStates())
|
.states(attributeGroupEditReq.getStates())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 修改构造器
|
||||||
|
*/
|
||||||
|
public static AttributeGroup editBuilds(Long id, AttributeGroupEditReq attributeGroupEditReq){
|
||||||
|
return AttributeGroup.builder()
|
||||||
|
.id(id)
|
||||||
|
.states(attributeGroupEditReq.getStates())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,6 +82,16 @@ public class RuleInfo extends BaseEntity {
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改构造器
|
||||||
|
*/
|
||||||
|
public static RuleInfo editBuilds(Long id, RuleInfoEditReq ruleInfoEditReq){
|
||||||
|
return RuleInfo.builder()
|
||||||
|
.id(id)
|
||||||
|
.status(ruleInfoEditReq.getStatus())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param ruleInfoAddModel 添加模型
|
* @param ruleInfoAddModel 添加模型
|
||||||
|
|
|
@ -105,6 +105,19 @@ public class AttributeGroupController extends BaseController {
|
||||||
return attributeGroupService.edit(id, attributeGroupEditReq);
|
return attributeGroupService.edit(id, attributeGroupEditReq);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改属性组状态
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("product:attributeGroup:update")
|
||||||
|
@Log(title = "属性组", businessType = BusinessType.OTHER)
|
||||||
|
@PostMapping("/{id}")
|
||||||
|
@ApiOperation("删除属性组")
|
||||||
|
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = String.class, example = "1,2,3,4")
|
||||||
|
public Result<String> updateStatus(@PathVariable Long id,@RequestBody AttributeGroupEditReq attributeGroupEditReq ) {
|
||||||
|
return toAjax(attributeGroupService.updateById(AttributeGroup.editBuilds(id,attributeGroupEditReq)));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除属性组
|
* 删除属性组
|
||||||
*/
|
*/
|
||||||
|
@ -116,4 +129,6 @@ public class AttributeGroupController extends BaseController {
|
||||||
public Result<String> remove(@PathVariable List<Long> ids) {
|
public Result<String> remove(@PathVariable List<Long> ids) {
|
||||||
return toAjax(attributeGroupService.removeBatchByIds(ids));
|
return toAjax(attributeGroupService.removeBatchByIds(ids));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -108,6 +108,17 @@ public class RuleInfoController extends BaseController {
|
||||||
return Result.success();
|
return Result.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改商品规格
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("product:rule:edit")
|
||||||
|
@Log(title = "商品规格", businessType = BusinessType.OTHER)
|
||||||
|
@PostMapping("/{id}")
|
||||||
|
@ApiOperation("修改商品规格")
|
||||||
|
public Result<String> updateStatus(@PathVariable Long id, @RequestBody RuleInfoEditReq ruleInfoEditReq) {
|
||||||
|
return toAjax(ruleInfoService.updateById(RuleInfo.editBuilds(id,ruleInfoEditReq)));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除商品规格
|
* 删除商品规格
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -35,7 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
UPDATE `rule_info`
|
UPDATE `rule_info`
|
||||||
SET `name` = #{ruleInfoEditReq.name},
|
SET `name` = #{ruleInfoEditReq.name},
|
||||||
`status` = #{ruleInfoEditReq.status},
|
`status` = #{ruleInfoEditReq.status},
|
||||||
`update_time` = now()
|
`update_time` = NOW()
|
||||||
WHERE
|
WHERE
|
||||||
`id` = #{id}
|
`id` = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
|
Loading…
Reference in New Issue