Commit c2ae17ce by 何文超

更新商品选择器权限

parent fd41f770
......@@ -9,6 +9,7 @@ import com.gic.commons.util.EntityUtil;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.goods.api.dto.GoodsRightsSelectorDTO;
import com.gic.goods.api.service.GoodsRightsSelectorApiService;
import com.gic.goods.api.util.Constant;
import com.gic.plug.web.qo.goods.GoodsRightsSelectorSaveQO;
import com.gic.plug.web.qo.goods.GoodsRightsSelectorUpdateQO;
import com.gic.plug.web.vo.goods.GoodsRightsSelectorVO;
......@@ -30,6 +31,9 @@ public class GoodsRightsSelectorController {
@RequestMapping("/goods-rights-selector-save")
public RestResponse goodsRightsSelectorSave(GoodsRightsSelectorSaveQO goodsRightsSelectorSaveQO) {
GoodsRightsSelectorDTO goodsRightsSelectorDTO = EntityUtil.changeEntityByOrika(GoodsRightsSelectorDTO.class, goodsRightsSelectorSaveQO);
if (goodsRightsSelectorDTO.getHasRights() == null) {
goodsRightsSelectorDTO.setHasRights(Constant.NO);
}
ServiceResponse<GoodsRightsSelectorDTO> serviceResponse = goodsRightsSelectorApiService.saveGoodsRightsSelector(goodsRightsSelectorDTO);
if (serviceResponse.isSuccess()) {
goodsRightsSelectorDTO = serviceResponse.getResult();
......
......@@ -58,6 +58,14 @@ public class GoodsSelectorController {
public RestResponse goodsSelectorSave(GoodsSelectorSaveQO goodsSelectorSaveQO) {
GoodsSelectorDTO goodsSelectorDTO = EntityUtil.changeEntityByOrika(GoodsSelectorDTO.class, goodsSelectorSaveQO);
goodsSelectorDTO.setEnterpriseId(Constant.TEST_ENTERPRISE_ID);
ServiceResponse<GoodsRightsSelectorDTO> goodsRightsSelectorDTOServiceResponse = goodsRightsSelectorApiService.getGoodsRightsSelector(46703961214504960L);
if (!goodsRightsSelectorDTOServiceResponse.isSuccess()) {
return RestResponse.failure(goodsRightsSelectorDTOServiceResponse.getCode(), goodsRightsSelectorDTOServiceResponse.getMessage());
}
GoodsRightsSelectorDTO goodsRightsSelectorDTO = goodsRightsSelectorDTOServiceResponse.getResult();
goodsSelectorDTO.setHasRights(goodsRightsSelectorDTO.getHasRights());
goodsSelectorDTO.setGoodsSearchRightValue(goodsRightsSelectorDTO.getGoodsRightsSearchValue());
goodsSelectorDTO.setGoodsSearchRightText(goodsRightsSelectorDTO.getGoodsRightsSearchText());
ServiceResponse<GoodsSelectorDTO> serviceResponse = goodsSelectorApiService.saveGoodsSelector(goodsSelectorDTO);
if (serviceResponse.isSuccess()) {
goodsSelectorDTO = serviceResponse.getResult();
......@@ -70,13 +78,20 @@ public class GoodsSelectorController {
@RequestMapping("change-goods-rights-for-selector")
public RestResponse changeGoodsRightsForSelector(Long goodsSelectorId) {
ServiceResponse<GoodsRightsSelectorDTO> goodsRightsSelectorDTOServiceResponse = goodsRightsSelectorApiService.getGoodsRightsSelector(1234L);
ServiceResponse<GoodsRightsSelectorDTO> goodsRightsSelectorDTOServiceResponse = goodsRightsSelectorApiService.getGoodsRightsSelector(48157557076766720L);
if (!goodsRightsSelectorDTOServiceResponse.isSuccess()) {
return RestResponse.failure(goodsRightsSelectorDTOServiceResponse.getCode(), goodsRightsSelectorDTOServiceResponse.getMessage());
}
if (goodsSelectorId == null) {
GoodsRightsSelectorDTO goodsRightsSelectorDTO = new GoodsRightsSelectorDTO();
goodsRightsSelectorDTO.setGoodsRightsSearchText(goodsRightsSelectorDTOServiceResponse.getResult().getGoodsRightsSearchText());
goodsRightsSelectorDTO.setGoodsRightsSearchValue(goodsRightsSelectorDTOServiceResponse.getResult().getGoodsRightsSearchValue());
goodsRightsSelectorDTO.setHasRights(goodsRightsSelectorDTOServiceResponse.getResult().getHasRights());
return RestResponse.success(goodsRightsSelectorDTO);
}
GoodsRightsSelectorDTO goodsRightsSelectorDTO = goodsRightsSelectorDTOServiceResponse.getResult();
ServiceResponse<GoodsSelectorDTO> serviceResponse = goodsSelectorApiService.updateGoodsSelectorRights(goodsSelectorId,
goodsRightsSelectorDTO.getGoodsRightsSearchText(), goodsRightsSelectorDTO.getGoodsRightsSearchValue());
goodsRightsSelectorDTO.getGoodsRightsSearchText(), goodsRightsSelectorDTO.getGoodsRightsSearchValue(), goodsRightsSelectorDTO.getHasRights());
if (!serviceResponse.isSuccess()) {
return RestResponse.failure(serviceResponse.getCode(), serviceResponse.getMessage());
}
......
......@@ -13,6 +13,11 @@ public class GoodsRightsSelectorSaveQO {
*/
private String goodsRightSearchEdit;
/**
* 是否有商品权限 0没有 1有
*/
private Integer hasRights;
public String getGoodsRightsSearchValue() {
return goodsRightsSearchValue;
}
......@@ -28,4 +33,12 @@ public class GoodsRightsSelectorSaveQO {
public void setGoodsRightSearchEdit(String goodsRightSearchEdit) {
this.goodsRightSearchEdit = goodsRightSearchEdit;
}
public Integer getHasRights() {
return hasRights;
}
public void setHasRights(Integer hasRights) {
this.hasRights = hasRights;
}
}
......@@ -13,6 +13,10 @@ public class GoodsRightsSelectorUpdateQO {
*/
private String goodsRightsSearchValue;
/**
* 是否有商品权限 0没有 1有
*/
private Integer hasRights;
/**
* 编辑回显的值
......@@ -42,4 +46,12 @@ public class GoodsRightsSelectorUpdateQO {
public void setGoodsRightSearchEdit(String goodsRightSearchEdit) {
this.goodsRightSearchEdit = goodsRightSearchEdit;
}
public Integer getHasRights() {
return hasRights;
}
public void setHasRights(Integer hasRights) {
this.hasRights = hasRights;
}
}
......@@ -53,6 +53,11 @@ public class GoodsRightsSelectorVO {
*/
private String goodsRightsBrands;
/**
* 是否有商品权限 0没有 1有
*/
private Integer hasRights;
public Long getGoodsRightsSelectorId() {
return goodsRightsSelectorId;
}
......@@ -132,4 +137,12 @@ public class GoodsRightsSelectorVO {
public void setGoodsRightsBrands(String goodsRightsBrands) {
this.goodsRightsBrands = goodsRightsBrands;
}
public Integer getHasRights() {
return hasRights;
}
public void setHasRights(Integer hasRights) {
this.hasRights = hasRights;
}
}
......@@ -24,6 +24,10 @@ public class GoodsSelectorVO {
private Long findCount;
/**
* 是否有商品权限 0没有 1有
*/
private Integer hasRights;
public Long getGoodsSelectorId() {
return goodsSelectorId;
......@@ -96,4 +100,12 @@ public class GoodsSelectorVO {
public void setFindCount(Long findCount) {
this.findCount = findCount;
}
public Integer getHasRights() {
return hasRights;
}
public void setHasRights(Integer hasRights) {
this.hasRights = hasRights;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment