Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -22,6 +22,7 @@ public class BaseProductDetailsVo implements Vo {
|
||||
@ApiModelProperty("对应商品sid")
|
||||
private String goodsSid; // 产品对应商品sid
|
||||
private String productName; // 产品名称
|
||||
private String productCode; // 产品编码
|
||||
@ApiModelProperty("0产出率/1配比(初加工/深加工)")
|
||||
private String rateType; // 0产出率/1配比(初加工/深加工)
|
||||
private List<BaseProductMaterialDetailsVo> list = new ArrayList<>(); //原料列表
|
||||
|
||||
@@ -22,6 +22,7 @@ public class BaseProductDto implements Dto {
|
||||
@ApiModelProperty("对应商品sid")
|
||||
private String goodsSid; // 产品对应商品sid
|
||||
private String productName; // 产品名称
|
||||
private String productCode; // 产品编码
|
||||
@ApiModelProperty("0产出率/1配比(初加工/深加工)")
|
||||
private String rateType; // 0产出率/1配比(初加工/深加工)
|
||||
private List<BaseProductMaterialDetailsVo> list = new ArrayList<>(); //原料列表
|
||||
|
||||
@@ -18,7 +18,8 @@ public interface BaseProductMapper extends BaseMapper<BaseProduct> {
|
||||
|
||||
IPage<BaseProductVo> selectPageVo(IPage<BaseProduct> page,@Param(Constants.WRAPPER) QueryWrapper<BaseProduct> qw);
|
||||
|
||||
List<BaseProductChildVo> selChildrenList(@Param("sid") String sid, @Param("cSid") String cSid);
|
||||
// List<BaseProductChildVo> selChildrenList(@Param("sid") String sid, @Param("cSid") String cSid);
|
||||
List<BaseProductChildVo> selChildrenList(@Param("sid") String sid);
|
||||
|
||||
int checkByGoodsSidAndUseOrgSid(@Param("goodsSid") String goodsSid, @Param("useOrgSid") String useOrgSid);
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
g.goodsCode AS productCode,
|
||||
p.rateType,
|
||||
m.rate,
|
||||
m.sid AS cSid
|
||||
m.sid AS cSid,
|
||||
(SELECT COUNT(*) FROM base_product_material as pm WHERE pm.productSid = p.sid) as num
|
||||
FROM
|
||||
base_product AS p
|
||||
LEFT JOIN base_product_material AS m ON p.sid = m.productSid
|
||||
@@ -43,7 +44,8 @@
|
||||
LEFT JOIN base_product_material AS m ON p.sid = m.productSid
|
||||
LEFT JOIN goods_spu AS g ON p.goodsSid = g.sid
|
||||
LEFT JOIN goods_spu AS mg ON m.materialSid = mg.sid
|
||||
WHERE p.sid = #{sid} and m.sid != #{cSid}
|
||||
WHERE p.sid = #{sid}
|
||||
-- and m.sid != #{cSid}
|
||||
|
||||
</select>
|
||||
<select id="checkByGoodsSidAndUseOrgSid" resultType="java.lang.Integer">
|
||||
|
||||
@@ -69,12 +69,21 @@ public class BaseProductService extends MybatisBaseService<BaseProductMapper, Ba
|
||||
List<BaseProductVo> records = pagging.getRecords();
|
||||
if (!records.isEmpty()) {
|
||||
for (BaseProductVo record : records) {
|
||||
String childSid = record.getCSid();
|
||||
String sid = record.getSid();
|
||||
List<BaseProductChildVo> children = baseMapper.selChildrenList(sid, childSid);
|
||||
if (!children.isEmpty()) {
|
||||
record.setChildren(children);
|
||||
String num = record.getNum();
|
||||
int i = Integer.parseInt(num);
|
||||
if (i > 1) {
|
||||
record.setProductCode("");
|
||||
record.setProductName("");
|
||||
record.setRate("");
|
||||
// String childSid = record.getCSid();
|
||||
String sid = record.getSid();
|
||||
// List<BaseProductChildVo> children = baseMapper.selChildrenList(sid, childSid);
|
||||
List<BaseProductChildVo> children = baseMapper.selChildrenList(sid);
|
||||
if (!children.isEmpty()) {
|
||||
record.setChildren(children);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
PagerVo<BaseProductVo> p = PagerUtil.pageToVo(pagging, null);
|
||||
@@ -126,6 +135,7 @@ public class BaseProductService extends MybatisBaseService<BaseProductMapper, Ba
|
||||
GoodsSpu goodsSpu = goodsSpuService.fetchBySid(goodsSid);
|
||||
if (null != goodsSpu) {
|
||||
vo.setProductName(goodsSpu.getGoodsName());
|
||||
vo.setProductCode(goodsSpu.getGoodsCode());
|
||||
}
|
||||
List<BaseProductMaterialDetailsVo> list = new ArrayList<>(); //原料列表
|
||||
List<BaseProductMaterial> ms = baseProductMaterialService.selByProductSid(sid);
|
||||
|
||||
@@ -40,6 +40,7 @@ public class BaseProductVo implements Vo {
|
||||
private String rateType;
|
||||
private String sid;
|
||||
private String cSid;
|
||||
private String num;
|
||||
private List<BaseProductChildVo> children = new ArrayList<>();
|
||||
|
||||
}
|
||||
|
||||
@@ -536,8 +536,8 @@ public class GoodsSpuService extends MybatisBaseService<GoodsSpuMapper, GoodsSpu
|
||||
if (StringUtils.isNotBlank(query.getQueryName())) {
|
||||
qw.like("goodsName", query.getQueryName());
|
||||
}
|
||||
if (StringUtils.isNotBlank(query.getUseOrgSid())) {
|
||||
qw.like("useOrgSid", query.getUseOrgSid());
|
||||
if (StringUtils.isNotBlank(query.getCreateOrgSid())) {
|
||||
qw.eq("createOrgSid", query.getCreateOrgSid());
|
||||
}
|
||||
qw.eq("isEnable" , 1);
|
||||
qw.eq("isDelete" ,0);
|
||||
|
||||
@@ -11,6 +11,6 @@ import lombok.Data;
|
||||
public class ProductGoodsQuery {
|
||||
|
||||
private String queryName;
|
||||
private String useOrgSid;
|
||||
private String createOrgSid;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user