Commit b843b0e7 by 何文超

增加goodsProperty的值

parent eac4701d
package com.gic.plug.web.controller.goods;
public class GoodsErpPropertyController {
}
package com.gic.plug.web.controller.goods;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.contants.SortType;
import com.gic.commons.util.PageHelperUtils;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.goods.api.dto.PropertyDTO;
import com.gic.goods.api.dto.PropertyValueDTO;
import com.gic.goods.api.service.PropertyApiService;
import com.gic.goods.api.service.PropertyValueApiService;
import com.gic.goods.api.util.Constant;
import com.gic.plug.web.vo.goods.GoodsPropertyVO;
import com.gic.plug.web.vo.goods.GoodsPropertyValueVO;
@RestController
public class GoodsPropertyController {
@Autowired
private PropertyApiService propertyApiService;
@Autowired
private PropertyValueApiService propertyValueApiService;
@RequestMapping("/property-list")
public RestResponse propertyList(int pageSize, int currentPage, String search, Long goodsDomainId) {
List<String> arrayList = new ArrayList<>();
arrayList.add(Constant.PROPERTY_TYPE_TEXT);
ServiceResponse<Page<PropertyDTO>> serviceResponse = propertyApiService.findPropertyExceptType(currentPage, pageSize, goodsDomainId, arrayList,search);
if (!serviceResponse.isSuccess()) {
return RestResponse.failure(serviceResponse.getCode(), serviceResponse.getMessage());
}
Page<GoodsPropertyVO> page = PageHelperUtils.changePageToCurrentPage(serviceResponse.getResult(), GoodsPropertyVO.class);
return RestResponse.success(page);
}
@RequestMapping("/property-value-list")
public RestResponse propertyValueList(int pageSize, int currentPage, String search, Long specPropertyId) {
ServiceResponse<Page<PropertyValueDTO>> serviceResponse = propertyValueApiService
.pagePropertyValue(currentPage, pageSize, specPropertyId, search, SortType.sortDescType);
if (!serviceResponse.isSuccess()) {
return RestResponse.failure(serviceResponse.getCode(), serviceResponse.getMessage());
}
Page<GoodsPropertyValueVO> page = PageHelperUtils.changePageToCurrentPage(serviceResponse.getResult(), GoodsPropertyValueVO.class);
return RestResponse.success(page);
}
}
package com.gic.plug.web.vo.goods;
import com.fasterxml.jackson.annotation.JsonFormat;
public class GoodsPropertyVO {
/**
*
*/
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long specPropertyId;
/**
* 属性名
*/
private String specPropertyName;
/**
* 属性code
*/
private String specPropertyCode;
/**
* 属性类型
*/
private String specPropertyType;
/**
* 小数点位数
*/
private Integer points;
public Long getSpecPropertyId() {
return specPropertyId;
}
public void setSpecPropertyId(Long specPropertyId) {
this.specPropertyId = specPropertyId;
}
public String getSpecPropertyName() {
return specPropertyName;
}
public void setSpecPropertyName(String specPropertyName) {
this.specPropertyName = specPropertyName;
}
public String getSpecPropertyCode() {
return specPropertyCode;
}
public void setSpecPropertyCode(String specPropertyCode) {
this.specPropertyCode = specPropertyCode;
}
public String getSpecPropertyType() {
return specPropertyType;
}
public void setSpecPropertyType(String specPropertyType) {
this.specPropertyType = specPropertyType;
}
public Integer getPoints() {
return points;
}
public void setPoints(Integer points) {
this.points = points;
}
}
package com.gic.plug.web.vo.goods;
import com.fasterxml.jackson.annotation.JsonFormat;
public class GoodsPropertyValueVO {
/**
*
*/
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long specPropertyValueId;
/**
* 属性值名称
*/
private String specPropertyValueName;
/**
* 属性值code
*/
private String specPropertyValueCode;
public Long getSpecPropertyValueId() {
return specPropertyValueId;
}
public void setSpecPropertyValueId(Long specPropertyValueId) {
this.specPropertyValueId = specPropertyValueId;
}
public String getSpecPropertyValueName() {
return specPropertyValueName;
}
public void setSpecPropertyValueName(String specPropertyValueName) {
this.specPropertyValueName = specPropertyValueName;
}
public String getSpecPropertyValueCode() {
return specPropertyValueCode;
}
public void setSpecPropertyValueCode(String specPropertyValueCode) {
this.specPropertyValueCode = specPropertyValueCode;
}
}
......@@ -38,5 +38,7 @@
<dubbo:reference interface="com.gic.goods.api.service.StandardValueApiService" id="standardValueApiService" timeout="60000" retries="0" />
<dubbo:reference interface="com.gic.goods.api.service.StandardValueGroupApiService" id="standardValueGroupApiService" timeout="60000" retries="0" />
<dubbo:reference interface="com.gic.goods.api.service.CategoryApiService" id="categoryApiService" timeout="60000" retries="0" />
<dubbo:reference interface="com.gic.goods.api.service.PropertyValueApiService" id="propertyValueApiService" timeout="60000" retries="0" />
<dubbo:reference interface="com.gic.goods.api.service.PropertyApiService" id="propertyApiService" timeout="60000" retries="0" />
<!-- -->
</beans>
\ No newline at end of file
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