Commit bf387539 by guojuxing

pmd

parent 258f273d
...@@ -74,11 +74,11 @@ public class AppletConfigGoodsController extends BaseGoodsController { ...@@ -74,11 +74,11 @@ public class AppletConfigGoodsController extends BaseGoodsController {
if (appServiceResponse.getResult() == null) { if (appServiceResponse.getResult() == null) {
return RestResponse.failure(ErrorCodeEnums.MAll_ERR.getCode(), "小程序不存在"); return RestResponse.failure(ErrorCodeEnums.MAll_ERR.getCode(), "小程序不存在");
} }
ServiceResponse<ShopDTO> shopDTOServiceResponse = shopApiService.getShopByAppletId(appServiceResponse.getResult().getAppletConfigId(), getEnterpriseId(), 1); ServiceResponse<ShopDTO> shopDtoServiceResponse = shopApiService.getShopByAppletId(appServiceResponse.getResult().getAppletConfigId(), getEnterpriseId(), 1);
if (shopDTOServiceResponse.getResult() == null) { if (shopDtoServiceResponse.getResult() == null) {
return RestResponse.failure(ErrorCodeEnums.MAll_ERR.getCode(), "不存在店铺"); return RestResponse.failure(ErrorCodeEnums.MAll_ERR.getCode(), "不存在店铺");
} }
shopId = shopDTOServiceResponse.getResult().getId(); shopId = shopDtoServiceResponse.getResult().getId();
} }
ServiceResponse<List<MallGoodsCordDTO>> listServiceResponse = mallCordApiService.listSpecCordDTO(shopId, getEnterpriseId()); ServiceResponse<List<MallGoodsCordDTO>> listServiceResponse = mallCordApiService.listSpecCordDTO(shopId, getEnterpriseId());
return RestResponse return RestResponse
...@@ -105,16 +105,16 @@ public class AppletConfigGoodsController extends BaseGoodsController { ...@@ -105,16 +105,16 @@ public class AppletConfigGoodsController extends BaseGoodsController {
return RestResponse.failure(ErrorCodeEnums.MAll_ERR.getCode(), "小程序不存在"); return RestResponse.failure(ErrorCodeEnums.MAll_ERR.getCode(), "小程序不存在");
} }
Integer shopType = 1; Integer shopType = 1;
ServiceResponse<ShopDTO> shopDTOServiceResponse = shopApiService.getShopByAppletId(appServiceResponse.getResult().getAppletConfigId(), getEnterpriseId(), shopType); ServiceResponse<ShopDTO> shopDtoServiceResponse = shopApiService.getShopByAppletId(appServiceResponse.getResult().getAppletConfigId(), getEnterpriseId(), shopType);
if (shopDTOServiceResponse.getResult() == null) { if (shopDtoServiceResponse.getResult() == null) {
return RestResponse.failure(ErrorCodeEnums.MAll_ERR.getCode(), "不存在店铺"); return RestResponse.failure(ErrorCodeEnums.MAll_ERR.getCode(), "不存在店铺");
} }
shopId = shopDTOServiceResponse.getResult().getId(); shopId = shopDtoServiceResponse.getResult().getId();
} }
if (shopId == null) { if (shopId == null) {
return RestResponse.failure(ErrorCodeEnums.MAll_ERR.getCode(), "不存在店铺"); return RestResponse.failure(ErrorCodeEnums.MAll_ERR.getCode(), "不存在店铺");
} }
JSONObject cordJSON = null; JSONObject cordJson = null;
if (cordId != null) { if (cordId != null) {
ServiceResponse<List<GoodsCordDTO>> serviceResponse = cordApiService.listChildAll(cordId, getEnterpriseId()); ServiceResponse<List<GoodsCordDTO>> serviceResponse = cordApiService.listChildAll(cordId, getEnterpriseId());
List<Long> cordList = new ArrayList<>(); List<Long> cordList = new ArrayList<>();
...@@ -122,11 +122,11 @@ public class AppletConfigGoodsController extends BaseGoodsController { ...@@ -122,11 +122,11 @@ public class AppletConfigGoodsController extends BaseGoodsController {
cordList.add(goodsCord.getSpecCordId()); cordList.add(goodsCord.getSpecCordId());
} }
cordList.add(cordId); cordList.add(cordId);
cordJSON = QueryConditionAssemblyUtil.createSimpleQueryNode("cordId", cordJson = QueryConditionAssemblyUtil.createSimpleQueryNode("cordId",
OperateEnum.OPERATE_CONTAIN, Joiner.on(" ").join(cordList)); OperateEnum.OPERATE_CONTAIN, Joiner.on(" ").join(cordList));
} }
ServiceResponse<ESResponseQueryBatchDTO> serviceResponse = searchGoods(currentPage, pageSize, null, shopId, search, ServiceResponse<ESResponseQueryBatchDTO> serviceResponse = searchGoods(currentPage, pageSize, null, shopId, search,
Constant.CHANNEL_CODE_MALL, cordJSON, 1); Constant.CHANNEL_CODE_MALL, cordJson, 1);
if (serviceResponse.isSuccess()) { if (serviceResponse.isSuccess()) {
List<Long> goodsIds = new ArrayList<>(); List<Long> goodsIds = new ArrayList<>();
if (CollectionUtils.isNotEmpty(serviceResponse.getResult().getRes())) { if (CollectionUtils.isNotEmpty(serviceResponse.getResult().getRes())) {
...@@ -211,13 +211,13 @@ public class AppletConfigGoodsController extends BaseGoodsController { ...@@ -211,13 +211,13 @@ public class AppletConfigGoodsController extends BaseGoodsController {
log.info("查不到小程序信息 appConfigId={}", appConfigId); log.info("查不到小程序信息 appConfigId={}", appConfigId);
} }
Integer shopType = 2; Integer shopType = 2;
ServiceResponse<ShopDTO> shopDTOServiceResponse = shopApiService.getShopByAppletId(appServiceResponse.getResult().getAppletConfigId(), getEnterpriseId(), shopType); ServiceResponse<ShopDTO> shopDtoServiceResponse = shopApiService.getShopByAppletId(appServiceResponse.getResult().getAppletConfigId(), getEnterpriseId(), shopType);
if (shopDTOServiceResponse.getResult() == null) { if (shopDtoServiceResponse.getResult() == null) {
log.info("查不到店铺信息 appConfigId={}", appConfigId); log.info("查不到店铺信息 appConfigId={}", appConfigId);
return null; return null;
} }
goodsDomainId = shopDTOServiceResponse.getResult().getAreaId(); goodsDomainId = shopDtoServiceResponse.getResult().getAreaId();
return goodsDomainId; return goodsDomainId;
} }
...@@ -340,11 +340,11 @@ public class AppletConfigGoodsController extends BaseGoodsController { ...@@ -340,11 +340,11 @@ public class AppletConfigGoodsController extends BaseGoodsController {
} }
if (ids != null) { if (ids != null) {
List<Long> collect = Splitter.on(",").splitToList(ids).stream().map(x -> Long.parseLong(x)).collect(Collectors.toList()); List<Long> collect = Splitter.on(",").splitToList(ids).stream().map(x -> Long.parseLong(x)).collect(Collectors.toList());
JSONObject goodsIdsJSON = QueryConditionAssemblyUtil.createSimpleQueryNode("id", OperateEnum.OPERATE_CONTAIN, Joiner.on(" ").join(collect)); JSONObject goodsIdsJson = QueryConditionAssemblyUtil.createSimpleQueryNode("id", OperateEnum.OPERATE_CONTAIN, Joiner.on(" ").join(collect));
JSONObject strategyJson = QueryConditionAssemblyUtil.createSimpleQueryNode("strategyFlag", OperateEnum.OPERATE_EQ, 0); JSONObject strategyJson = QueryConditionAssemblyUtil.createSimpleQueryNode("strategyFlag", OperateEnum.OPERATE_EQ, 0);
JSONObject strategyAndgoodsIdsJSON = QueryConditionAssemblyUtil.addQueryNodeForSiblin(goodsIdsJSON, strategyJson, OperateEnum.OPERATE_OR); JSONObject strategyAndgoodsIdsJson = QueryConditionAssemblyUtil.addQueryNodeForSiblin(goodsIdsJson, strategyJson, OperateEnum.OPERATE_OR);
json = QueryConditionAssemblyUtil.addQueryNodeForSiblin(json, strategyAndgoodsIdsJSON, OperateEnum.OPERATE_AND); json = QueryConditionAssemblyUtil.addQueryNodeForSiblin(json, strategyAndgoodsIdsJson, OperateEnum.OPERATE_AND);
jsonArray.add(strategyAndgoodsIdsJSON); jsonArray.add(strategyAndgoodsIdsJson);
}else{ }else{
JSONObject strategyJson = QueryConditionAssemblyUtil.createSimpleQueryNode("strategyFlag", OperateEnum.OPERATE_EQ, 0); JSONObject strategyJson = QueryConditionAssemblyUtil.createSimpleQueryNode("strategyFlag", OperateEnum.OPERATE_EQ, 0);
json = QueryConditionAssemblyUtil.addQueryNodeForSiblin(json, strategyJson, OperateEnum.OPERATE_AND); json = QueryConditionAssemblyUtil.addQueryNodeForSiblin(json, strategyJson, OperateEnum.OPERATE_AND);
......
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