| | |
| | | import com.vci.ubcs.system.vo.MdmCountConfigVO; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean saveMdmCountConfig(MdmCountConfigVO mdmCountConfigVO) throws ServiceException{ |
| | | public R saveMdmCountConfig(MdmCountConfigVO mdmCountConfigVO) throws ServiceException{ |
| | | if(Func.isEmpty(mdmCountConfigVO) || Func.isBlank(mdmCountConfigVO.getUserId().toString())){ |
| | | throw new ServiceException("主数据统计配置保存时缺少必填参数!"); |
| | | } |
| | | boolean res = false; |
| | | if (mdmCountConfigVO.getMdmNameList().isEmpty()) { |
| | | return true; |
| | | if(mdmCountConfigVO.getMdmNameList().isEmpty()) { |
| | | return R.status(false); |
| | | } |
| | | if(mdmCountConfigVO.getMdmNameList().size() > 7){ |
| | | return R.fail("显示的主数据配置项最多为8项"); |
| | | } |
| | | boolean res = false; |
| | | try { |
| | | String mdmNames = mdmCountConfigVO.getMdmNameList().stream().collect(Collectors.joining(",")); |
| | | MdmCountConfig mdmCountConfigDB = getMdmCountConfig(mdmCountConfigVO.getUserId().toString()); |
| | |
| | | }catch (Exception e){ |
| | | throw new ServiceException("配置保存失败,原因:"+e.getCause()); |
| | | } |
| | | return res; |
| | | return R.status(res); |
| | | } |
| | | |
| | | /** |