提交 f8acd380 authored 作者: zhoushaopan's avatar zhoushaopan

fix(配套设备库): 修改序列号

修改序列号
上级 f667c6f6
......@@ -629,7 +629,16 @@ public class MatchingDeviceController {
String model = createSeqVo.getModel();
//通过型号查询对应的id
// MatchingDeviceModel matchingDeviceModel = matchingDeviceModelService.findByModel(model);
MatchingDeviceModel matchingDeviceModel = matchingDeviceModelService.findByModelAndName(model, createSeqVo.getName());
// MatchingDeviceModel matchingDeviceModel = matchingDeviceModelService.findByModelAndName(model, createSeqVo.getName());
String style1 = createSeqVo.getStyle();
MatchingDeviceModel matchingDeviceModel;
if (style1 == null || "0".equals(style1)){
matchingDeviceModel = matchingDeviceModelService.findByModelAndNameAndStyle(model, createSeqVo.getName(),
createSeqVo.getStyle());
}else {
matchingDeviceModel = matchingDeviceModelService.findByModelAndName(model, createSeqVo.getName());
}
String idString;
if (matchingDeviceModel != null){
idString = matchingDeviceModel.getId().toString();
......@@ -656,14 +665,19 @@ public class MatchingDeviceController {
String type = "02";
String style = createSeqVo.getStyle();
String modelTypeStyle ;
if (style == null || "0".equals(style)){
modelTypeStyle= idString+type;
}else {
if (style.length()<2){
style = "0"+style;
}
modelTypeStyle = idString+type+style;
}
// if (style == null || "0".equals(style)){
// modelTypeStyle= idString+type;
// }else {
// if (style.length()<2){
// style = "0"+style;
// }
// modelTypeStyle = idString+type+style;
// }
StringBuilder stringBuilder = new StringBuilder();
......
......@@ -11,4 +11,5 @@ public interface MatchingDeviceModelDao extends JpaRepository<MatchingDeviceMode
MatchingDeviceModel findByModel(String model);
MatchingDeviceModel findByModelAndName(String model,String name);
MatchingDeviceModel findByModelAndNameAndStyle(String model,String name,String style);
}
......@@ -19,4 +19,12 @@ public interface MatchingDeviceModelService {
*/
MatchingDeviceModel findByModelAndName(String model,String name);
/**
* 通过型号和名称和形态查询
* @param model
* @param name
* @return
*/
MatchingDeviceModel findByModelAndNameAndStyle(String model,String name,String style);
}
......@@ -26,4 +26,9 @@ public class MatchingDeviceModelServiceImpl implements MatchingDeviceModelServic
public MatchingDeviceModel findByModelAndName(String model, String name) {
return matchingDeviceModelDao.findByModelAndName(model,name);
}
@Override
public MatchingDeviceModel findByModelAndNameAndStyle(String model, String name, String style) {
return matchingDeviceModelDao.findByModelAndNameAndStyle(model,name,style);
}
}
......@@ -38,6 +38,9 @@ public class MatchingDeviceModel {
@ApiModelProperty(value = "名称")
private String name;
@ApiModelProperty(value = "形态")
private String style;
/**
* delete_tag
*/
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论