feat: ERP商城商品详情信息接口修改

This commit is contained in:
weizhiqiang 2024-09-18 11:25:00 +08:00
parent d4345c983d
commit b02cbc1f32
3 changed files with 21 additions and 3 deletions

View file

@ -40,7 +40,7 @@ public class ShopMaterialController {
shopMaterialService.queryTransMaterialById(inputObject, outputObject);
}
@ApiOperation(id = "saveShopMaterial", value = "根据id获取商品信息用于上架商城", method = "POST", allUse = "2")
@ApiOperation(id = "saveShopMaterial", value = "ERP商品上架商城", method = "POST", allUse = "2")
@ApiImplicitParams(classBean = ShopMaterial.class)
@RequestMapping("/post/ShopMaterialController/saveShopMaterial")
public void saveShopMaterial(InputObject inputObject, OutputObject outputObject) {
@ -52,7 +52,7 @@ public class ShopMaterialController {
@ApiImplicitParam(id = "id", name = "id", value = "主键id", required = "required")})
@RequestMapping("/post/ShopMaterialController/queryShopMaterialById")
public void queryShopMaterialById(InputObject inputObject, OutputObject outputObject) {
shopMaterialService.selectById(inputObject, outputObject);
shopMaterialService.queryShopMaterialById(inputObject, outputObject);
}
@ApiOperation(id = "queryShopMaterialList", value = "获取商城商品信息列表", method = "POST", allUse = "0")

View file

@ -24,4 +24,6 @@ public interface ShopMaterialService extends SkyeyeBusinessService<ShopMaterial>
void queryShopMaterialList(InputObject inputObject, OutputObject outputObject);
void queryShopMaterialByNormsIdList(InputObject inputObject, OutputObject outputObject);
void queryShopMaterialById(InputObject inputObject, OutputObject outputObject);
}

View file

@ -7,7 +7,6 @@ package com.skyeye.shopmaterial.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
@ -22,6 +21,7 @@ import com.skyeye.common.object.OutputObject;
import com.skyeye.common.util.mybatisplus.MybatisPlusUtil;
import com.skyeye.material.classenum.MaterialShelvesState;
import com.skyeye.material.entity.Material;
import com.skyeye.material.service.MaterialNormsService;
import com.skyeye.material.service.MaterialService;
import com.skyeye.shopmaterial.dao.ShopMaterialDao;
import com.skyeye.shopmaterial.entity.ShopMaterial;
@ -51,6 +51,9 @@ public class ShopMaterialServiceImpl extends SkyeyeBusinessServiceImpl<ShopMater
@Autowired
private MaterialService materialService;
@Autowired
private MaterialNormsService materialNormsService;
@Autowired
private ShopMaterialNormsService shopMaterialNormsService;
@ -165,4 +168,17 @@ public class ShopMaterialServiceImpl extends SkyeyeBusinessServiceImpl<ShopMater
outputObject.settotal(shopMaterialNormsList.size());
}
@Override
public void queryShopMaterialById(InputObject inputObject, OutputObject outputObject) {
String id = inputObject.getParams().get("id").toString();
ShopMaterial shopMaterial = selectById(id);
shopMaterial.getMaterialMation().setMaterialNorms(null);
materialNormsService.setDataMation(shopMaterial.getShopMaterialNormsList(), ShopMaterialNorms::getNormsId);
shopMaterial.getShopMaterialNormsList().forEach(shopMaterialNorms -> {
shopMaterialNorms.setEstimatePurchasePrice(null);
});
outputObject.setBean(shopMaterial);
outputObject.settotal(CommonNumConstants.NUM_ONE);
}
}