1,申请物料编码
This commit is contained in:
parent
d990adb50c
commit
e456a257a5
|
|
@ -153,8 +153,8 @@ public class OriginalBomApi extends BaseApi {
|
|||
@ApiOperation("testaddMaterial")
|
||||
@GetMapping("新增物料")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ResultVO<String> importBom(@RequestParam("drawingNo")String drawingNo,
|
||||
@RequestParam("materialName")String materialName,
|
||||
public ResultVO<String> importBom(@RequestParam(value = "drawingNo" ,required = false)String drawingNo,
|
||||
@RequestParam(value = "materialName" ,required = false)String materialName,
|
||||
@RequestParam("materialCategoryCode")String materialCategoryCode) throws IOException {
|
||||
|
||||
materialService.addMaterial(drawingNo, materialName,materialCategoryCode);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
package com.nflg.product.bomnew.pojo.dto;
|
||||
|
||||
|
||||
import io.swagger.models.auth.In;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class AddMaterialResultDTO {
|
||||
|
||||
private String data;
|
||||
|
||||
private String msg;
|
||||
|
||||
private Integer state;
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
package com.nflg.product.bomnew.pojo.dto;
|
||||
|
||||
import com.nflg.product.bomnew.pojo.entity.OptionalEbomConfigEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
|
@ -98,6 +99,12 @@ public class MaterialMainDTO implements Serializable {
|
|||
|
||||
private List<String> attrs=new ArrayList<>();
|
||||
|
||||
private OptionalEbomConfigEntity materialTypeZeroFile=new OptionalEbomConfigEntity();
|
||||
private OptionalEbomConfigEntity materialTypeOneFile=new OptionalEbomConfigEntity();
|
||||
|
||||
private OptionalEbomConfigEntity materialTypeTwoFile=new OptionalEbomConfigEntity();
|
||||
|
||||
|
||||
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
|
|
|||
|
|
@ -1,12 +1,14 @@
|
|||
package com.nflg.product.bomnew.service;
|
||||
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.nflg.product.base.core.conmon.util.SessionUtil;
|
||||
import com.nflg.product.base.core.exception.NflgBusinessException;
|
||||
import com.nflg.product.bomnew.client.MaterialMainClient;
|
||||
import com.nflg.product.bomnew.config.NacosConfig;
|
||||
import com.nflg.product.bomnew.pojo.dto.AddMaterialResultDTO;
|
||||
import com.nflg.product.bomnew.pojo.dto.MaterialMainDTO;
|
||||
import com.nflg.product.bomnew.util.HttpUtils;
|
||||
import nflg.product.common.constant.STATE;
|
||||
|
|
@ -45,6 +47,11 @@ public class MaterialService {
|
|||
HttpUtils httpUtils=new HttpUtils();
|
||||
|
||||
String s = httpUtils.doPost(NacosConfig.getNacosConfig().getAddMaterialUrl(),JSON.toJSONString(materialMainDTO),token);
|
||||
|
||||
AddMaterialResultDTO result= JSON.parseObject(s,AddMaterialResultDTO.class);
|
||||
if(STATE.Success.getState().equals(result.getState()) ){
|
||||
return result.getData().toString();
|
||||
}
|
||||
return s;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ public class MaterialServiceTest {
|
|||
String data = materialService.addMaterial("1111", "afafafa", "1234");
|
||||
System.out.println(data);
|
||||
|
||||
} catch (NflgBusinessException e) {
|
||||
} catch (Exception e) {
|
||||
e.getMessage();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue