Merge branch 'feature/DM/nflg-bom' of http://112.74.186.154:3000/nflj/nflg_project into feature/DM/nflg-bom
解决冲突 # Conflicts: # nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/MaterialService.java # nflg_project_dev/nflg-bom-new/src/test/java/com/nflg/product/bomnew/service/test/MaterialServiceTest.java
This commit is contained in:
commit
a99e3e5ab8
|
|
@ -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;
|
||||
|
|
@ -99,6 +100,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,6 +1,7 @@
|
|||
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.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
|
|
@ -8,6 +9,7 @@ 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;
|
||||
|
|
@ -46,7 +48,14 @@ public class MaterialService {
|
|||
// String token=SessionUtil.getSessionKey();
|
||||
HttpUtils httpUtils = new HttpUtils();
|
||||
|
||||
String s = httpUtils.doPost(NacosConfig.getNacosConfig().getAddMaterialUrl(), JSON.toJSONString(materialMainDTO), token);
|
||||
|
||||
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;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,8 +31,12 @@ public class MaterialServiceTest {
|
|||
System.out.println(data);
|
||||
// ResultVO<String> r = JSON.parseObject(data, new TypeReference<ResultVO<String>>(){});
|
||||
|
||||
<<<<<<< HEAD
|
||||
System.out.println(data);
|
||||
} catch (NflgBusinessException e) {
|
||||
=======
|
||||
} catch (Exception e) {
|
||||
>>>>>>> 3df3a2a782cdb1d2f7507543ba9e7f747f4b6821
|
||||
e.getMessage();
|
||||
} catch (IOException e) {
|
||||
e.getMessage();
|
||||
|
|
|
|||
Loading…
Reference in New Issue