| | |
| | | import com.highdatas.mdm.pojo.*; |
| | | import com.highdatas.mdm.pojo.kettle.UnBigDataDataSourceInfo; |
| | | import com.highdatas.mdm.service.*; |
| | | import com.highdatas.mdm.util.Constant; |
| | | import com.highdatas.mdm.util.ContentBuilder; |
| | | import com.highdatas.mdm.util.DbUtils; |
| | | import com.highdatas.mdm.util.ExcelUtil; |
| | | import com.highdatas.mdm.util.*; |
| | | import com.highdatas.mdm.util.pool.MqEntity; |
| | | import com.highdatas.mdm.util.pool.MqMessage; |
| | | import lombok.SneakyThrows; |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.text.MessageFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | |
| | | ISysFieldService fieldService; |
| | | @Autowired |
| | | DispenseService dispenseService; |
| | | |
| | | @Autowired |
| | | RuleClient ruleClient; |
| | | @Override |
| | | public Page getInitPageInfo(String viewId) { |
| | | Page page = new Page(0); |
| | |
| | | |
| | | // change val common |
| | | changeValCommon(sysView); |
| | | sysView.setStatus(ViewStatus.working).updateById(); |
| | | |
| | | |
| | | boolean checked = checkTempData(sysView); |
| | | if (!checked) { |
| | | sysView.setStatus(ViewStatus.unChecked).updateById(); |
| | | } else { |
| | | sysView.setStatus(ViewStatus.working).updateById(); |
| | | } |
| | | |
| | | // |
| | | return true; |
| | | } |
| | | |
| | | private boolean checkTempData(SysView sysView) { |
| | | SysAssembleCheckType checkType = sysView.getCheckType(); |
| | | if (checkType == null) { |
| | | return false; |
| | | } |
| | | if (checkType.equals(SysAssembleCheckType.unlimited)) { |
| | | return true; |
| | | } |
| | | |
| | | |
| | | HashMap<String,Boolean> fieldResultSet = ruleClient.execuImmeForCollect(sysView.getViewTableName(), sysView.getUserId()); |
| | | switch (checkType){ |
| | | case successAdd: |
| | | String unSuccessFields = fieldResultSet.keySet().stream().filter(s -> !fieldResultSet.get(s)).collect(Collectors.joining(Constant.COMMA)); |
| | | if (fieldResultSet.keySet().contains(false)) { |
| | | return false; |
| | | } |
| | | break; |
| | | case partSuccessAdd: |
| | | String checkFields = sysView.getCheckField(); |
| | | String[] split = checkFields.split(Constant.SEMICOLON); |
| | | for (String s : split) { |
| | | Boolean checked = fieldResultSet.get(s); |
| | | if (checked == null || !checked) { |
| | | return false; |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | private void InsertJoin(SysView sysView) { |
| | | String userId = sysView.getUserId(); |
| | | TUser user = DbUtils.getUserById(userId); |