bug修改
This commit is contained in:
parent
16b4638316
commit
93eda31ccb
|
|
@ -142,7 +142,7 @@ public class OptionalEbomApi extends BaseApi {
|
||||||
@ApiOperation("删除选配数据")
|
@ApiOperation("删除选配数据")
|
||||||
public ResultVO<Boolean> deleteOption(@RequestBody List<Long> rowIds) {
|
public ResultVO<Boolean> deleteOption(@RequestBody List<Long> rowIds) {
|
||||||
|
|
||||||
if (! CollectionUtil.isNotEmpty(rowIds)) {
|
if ( CollectionUtil.isEmpty(rowIds)) {
|
||||||
return ResultVO.error(STATE.ParamErr, "选择待删除数据");
|
return ResultVO.error(STATE.ParamErr, "选择待删除数据");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -169,9 +169,16 @@ public class OptionalEbomApi extends BaseApi {
|
||||||
if(dto.getPartType() == OptionalBomConstant.PartTypeEnum.PART_TYPE_RADIO.getValue() &&( dto.getParentRowId()==null || dto.getParentRowId()==0)){
|
if(dto.getPartType() == OptionalBomConstant.PartTypeEnum.PART_TYPE_RADIO.getValue() &&( dto.getParentRowId()==null || dto.getParentRowId()==0)){
|
||||||
return ResultVO.error("标配件parentRowId不能为空");
|
return ResultVO.error("标配件parentRowId不能为空");
|
||||||
}
|
}
|
||||||
|
if(dto.getPartType() == OptionalBomConstant.PartTypeEnum.PART_TYPE_CHECBOX.getValue()){
|
||||||
|
dto.setParentRowId(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(this.optionalEbomImportChildService.insertOption(dto)){
|
||||||
|
return ResultVO.success(true);
|
||||||
|
}else{
|
||||||
|
return ResultVO.error(STATE.Error,"添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
return ResultVO.success(this.optionalEbomImportChildService.insertOption(dto));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -193,16 +200,7 @@ public class OptionalEbomApi extends BaseApi {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@PostMapping("submitTmpWork")
|
|
||||||
@ApiOperation("提交生成暂存")
|
|
||||||
public ResultVO<Boolean> submitTmpWork(@RequestBody OptionalEbomConfigDTO dto) {
|
|
||||||
try {
|
|
||||||
return ResultVO.success(optionalEbomConfigService.buildTmpWork(dto));
|
|
||||||
} catch (NflgBusinessException e) {
|
|
||||||
return ResultVO.error(e.getState(), e.getMsg());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -238,10 +236,25 @@ public class OptionalEbomApi extends BaseApi {
|
||||||
return ResultVO.success(aggregOptionConfigService.tmpOptionTree(rowId));
|
return ResultVO.success(aggregOptionConfigService.tmpOptionTree(rowId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping ("submiTmpOptionTree")
|
@PostMapping ("submitTmpOptionTree")
|
||||||
@ApiOperation("变更暂存数据")
|
@ApiOperation("提交/变更暂存数据")
|
||||||
public ResultVO<Boolean> submiTmpOptionTree(OptionalEbomConfigDTO dto) {
|
public ResultVO<Boolean> submitTmpOptionTree(OptionalEbomConfigDTO dto) {
|
||||||
return ResultVO.success(aggregOptionConfigService.submiTmpOptionTree(dto));
|
|
||||||
|
if(dto.getRowId()==null) {
|
||||||
|
try{
|
||||||
|
return ResultVO.success(optionalEbomConfigService.buildTmpWork(dto));
|
||||||
|
} catch (NflgBusinessException e) {
|
||||||
|
return ResultVO.error(e.getState(), e.getMsg());
|
||||||
|
}
|
||||||
|
|
||||||
|
}else{
|
||||||
|
return ResultVO.success(aggregOptionConfigService.submitTmpOptionTree(dto));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -69,14 +69,16 @@ public class OptionalEbomMainService extends ServiceImpl<OptionalEbomMainMapper,
|
||||||
optionalEbomImportChildService.deleteByRootId(dto);
|
optionalEbomImportChildService.deleteByRootId(dto);
|
||||||
|
|
||||||
|
|
||||||
return rows > 0;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public OptionalEbomMainVO getByRowId(Long id) {
|
public OptionalEbomMainVO getByRowId(Long id) {
|
||||||
OptionalEbomMainEntity entity = this.getBaseMapper().selectById(id);
|
OptionalEbomMainEntity entity = this.getBaseMapper().selectById(id);
|
||||||
OptionalEbomMainVO vo = new OptionalEbomMainVO();
|
OptionalEbomMainVO vo = new OptionalEbomMainVO();
|
||||||
BeanUtils.copyProperties(entity, vo);
|
if(entity!=null) {
|
||||||
|
BeanUtils.copyProperties(entity, vo);
|
||||||
|
}
|
||||||
return vo;
|
return vo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,7 @@ public class AggregOptionConfigService {
|
||||||
OptionalEbomConfigAggregVO optionalEbomConfigAggregVO = new OptionalEbomConfigAggregVO();
|
OptionalEbomConfigAggregVO optionalEbomConfigAggregVO = new OptionalEbomConfigAggregVO();
|
||||||
optionalEbomConfigAggregVO.setSingleList(listParent);
|
optionalEbomConfigAggregVO.setSingleList(listParent);
|
||||||
|
|
||||||
if (CollectionUtil.isNotEmpty(mulList)) {
|
if (CollectionUtil.isEmpty(mulList)) {
|
||||||
mulList = new ArrayList<OptionalEbomImportChildVO>();
|
mulList = new ArrayList<OptionalEbomImportChildVO>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -168,6 +168,7 @@ public class AggregOptionConfigService {
|
||||||
if(CollectionUtil.isNotEmpty(dto.getOptions())){
|
if(CollectionUtil.isNotEmpty(dto.getOptions())){
|
||||||
List<OptionalEbomImportChildEntity> optionalEbomImportChildEntityList = Convert.convert(new TypeReference<List<OptionalEbomImportChildEntity>>() {
|
List<OptionalEbomImportChildEntity> optionalEbomImportChildEntityList = Convert.convert(new TypeReference<List<OptionalEbomImportChildEntity>>() {
|
||||||
}, dto.getOptions());
|
}, dto.getOptions());
|
||||||
|
|
||||||
if (CollectionUtil.isNotEmpty(optionalEbomImportChildEntityList)) {
|
if (CollectionUtil.isNotEmpty(optionalEbomImportChildEntityList)) {
|
||||||
optionalEbomImportChildEntityList.forEach(item -> {
|
optionalEbomImportChildEntityList.forEach(item -> {
|
||||||
item.setUpdatedTime(new Date());
|
item.setUpdatedTime(new Date());
|
||||||
|
|
@ -209,7 +210,7 @@ public class AggregOptionConfigService {
|
||||||
* @param dto
|
* @param dto
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Boolean submiTmpOptionTree(OptionalEbomConfigDTO dto) {
|
public Boolean submitTmpOptionTree(OptionalEbomConfigDTO dto) {
|
||||||
|
|
||||||
OptionalEbomConfigEntity entity= optionalEbomConfigService.getById(dto.getRowId());
|
OptionalEbomConfigEntity entity= optionalEbomConfigService.getById(dto.getRowId());
|
||||||
OptionalEbomConfigEntity optionalEbomConfigEntity =new OptionalEbomConfigEntity();
|
OptionalEbomConfigEntity optionalEbomConfigEntity =new OptionalEbomConfigEntity();
|
||||||
|
|
|
||||||
|
|
@ -32,19 +32,19 @@
|
||||||
from t_optional_ebom_config
|
from t_optional_ebom_config
|
||||||
<where>
|
<where>
|
||||||
|
|
||||||
<if test="deviceNo != null and deviceNo != ''">
|
<if test="query.deviceNo != null and query.deviceNo != ''">
|
||||||
device_no = #{deviceNo}
|
device_no = #{query.deviceNo}
|
||||||
</if>
|
</if>
|
||||||
<if test="createdBy != null and createdBy != ''">
|
<if test="query.createdBy != null and query.createdBy != ''">
|
||||||
and created_by = #{createdBy}
|
and created_by = #{query.createdBy}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test="editStatus != null">
|
<if test="query.editStatus != null">
|
||||||
and edit_status = #{editStatus}
|
and edit_status = #{query.editStatus}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test="startTime!= null and endTime != null">
|
<if test="query.startTime!= null and query.endTime != null">
|
||||||
<![CDATA[and created_time >= #{startTime} and created_time < #{endTime} ]]>
|
<![CDATA[and created_time >= #{query.tartTime} and created_time < #{query.endTime} ]]>
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue