wuxw
2022-07-17 ce64e667815b39efdc2f8bd52be0d43d49db8d84
service-api/src/main/java/com/java110/api/bmo/resourceStore/impl/ResourceStoreBMOImpl.java
@@ -96,12 +96,22 @@
     * @return 订单服务能够接受的报文
     */
    public void addResourceStore(JSONObject paramInJson, DataFlowContext dataFlowContext) {
        //获取物品编码
        String resCode = paramInJson.getString("resCode");
        //根据物品编码查询物品资源表
        ResourceStoreDto resourceStoreDto = new ResourceStoreDto();
        resourceStoreDto.setResCode(resCode);
        List<ResourceStoreDto> resourceStoreDtos = resourceStoreInnerServiceSMOImpl.queryResourceStores(resourceStoreDto);
        //判断资源表里是否有该物品编码,避免物品编码重复
        Assert.listIsNull(resourceStoreDtos, "物品编码重复,请重新添加!");
        JSONObject businessResourceStore = new JSONObject();
        businessResourceStore.putAll(paramInJson);
        businessResourceStore.put("resId", GenerateCodeFactory.getResId(GenerateCodeFactory.CODE_PREFIX_resId));
        businessResourceStore.put("stock", "0");
        businessResourceStore.put("miniStock", "0");
        businessResourceStore.put("createTime", new Date());
        ResourceStorePo resourceStorePo = BeanConvertUtil.covertBean(businessResourceStore, ResourceStorePo.class);
        resourceStorePo.setAveragePrice("0");
        super.insert(dataFlowContext, resourceStorePo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_RESOURCE_STORE);
        //将图片插入文件表里
        FileRelPo fileRelPo = new FileRelPo();