| | |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springblade.core.cache.utils.CacheUtil; |
| | | import org.springblade.core.launch.constant.AppConstant; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import com.vci.ubcs.core.log.exception.ServiceException; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | |
| | | // cbo.setCodeclsfpath(fullPath); |
| | | cbo.setTs(new Date()); |
| | | if (!edit && StringUtils.isBlank(orderDTO.getLcStatus())) { |
| | | //先写固定,后面生命周期好了在编写 |
| | | //TODO 先写固定,后面生命周期好了在编写 |
| | | if (StringUtils.isNotBlank(cbo.getLctid())) { |
| | | // OsLifeCycleVO lifeCycleVO = lifeCycleService.getLifeCycleById(cbo.getLctid()); |
| | | // if (lifeCycleVO != null) { |
| | |
| | | .append(SPACE) |
| | | .append(QueryOptionConstant.EQUAL) |
| | | .append(SPACE) |
| | | .append(value); |
| | | .append("'") |
| | | .append(value) |
| | | .append("'"); |
| | | } |
| | | sql.append(SPACE); |
| | | return sql.toString(); |
| | |
| | | */ |
| | | @Override |
| | | public R markDataPassing(String oid, String btmName, Boolean pass) { |
| | | VciBaseUtil.alertNotNull(oid, "业务数据主键", btmName, "业务类型", pass, "标记类型"); |
| | | boolean flag = false; |
| | | try { |
| | | // QueryWrapper<CodeWupinEntity> wrapper = new QueryWrapper<>(); |
| | | // wrapper.eq("oid",oid); |
| | | CodeWupin data = baseMapper.selectById(oid); |
| | | // ClientBusinessObjectOperation operation = new ClientBusinessObjectOperation(); |
| | | // ClientBusinessObject data = operation.readBusinessObjectById(oid, btmName); |
| | | if (data == null || StringUtils.isBlank(data.getOid())) { |
| | | return R.fail(DATA_OID_NOT_EXIST); |
| | | } |
| | | data.setPassing(String.valueOf(pass)); |
| | | flag = SqlHelper.retBool(baseMapper.updateById(data)); |
| | | // flag = operation.updateBuinessObject(data); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | if (flag) { |
| | | return R.success("标记成功!"); |
| | | } else { |
| | | return R.fail("标记失败!"); |
| | | } |
| | | VciBaseUtil.alertNotNull(oid, "业务数据主键", btmName, "业务类型", pass, "标记类型"); |
| | | boolean flag = true; |
| | | try { |
| | | List<BaseModel> datas = selectByTypeAndOid(btmName, oid); |
| | | if (datas.size() == 0) { |
| | | return R.fail(DATA_OID_NOT_EXIST); |
| | | } |
| | | datas.stream().forEach(data->data.getData().put("PASSING",String.valueOf(pass))); |
| | | R r = updateBatchByBaseModel(btmName, datas); |
| | | if(!r.isSuccess()){ |
| | | flag = false; |
| | | } |
| | | } catch (Exception e) { |
| | | flag = false; |
| | | e.printStackTrace(); |
| | | } |
| | | if (flag) { |
| | | return R.success("标记成功!"); |
| | | } else { |
| | | return R.fail("标记失败!"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | executionId = executionId.substring(0, executionId.lastIndexOf(".")); |
| | | } |
| | | String sql = "select wm_concat(distinct (t.codetempattrOidArr)) codetempattroidarr\n" + |
| | | "from pl_code_wupin t\n" + |
| | | "from pl_code_clsflowtemp t\n" + |
| | | "join PLFLOWINSTANCE plfi on t.ID = plfi.PLTEMPLATEPUID\n" + |
| | | "where plfi.PLEXECUTIONID = '" + executionId + "' and t.CLASSIFYTEMPLATEOID = '" + templateOid + "' and t.CODEPROCESSUSE = '" + processUse + "'"; |
| | | // List<ClientBusinessObject> tempAttrOidArr = boService.queryByOnlySql(sql); |
| | |
| | | if (CollectionUtils.isEmpty(tempAttrOidArr) || StringUtils.isBlank((CharSequence) tempAttrOidArr.get(0).get("codetempattroidarr"))) { |
| | | return new ArrayList<>(); |
| | | } |
| | | return VciBaseUtil.str2List(tempAttrOidArr.get(0).get("codetempattroidarr").toString()); |
| | | return VciBaseUtil.str2List(tempAttrOidArr.get(0).get("CODETEMPATTROIDARR").toString()); |
| | | } |
| | | |
| | | /** |
| | |
| | | throw new VciBaseException("业务数据主键不能为空"); |
| | | } |
| | | List<String> oidList = VciBaseUtil.str2List(conditionMap.get("oid")); |
| | | Map<String, String> oidMap = new HashMap<>(); |
| | | QueryWrapper<CodeWupin> wrapper = new QueryWrapper(); |
| | | if (conditionMap.get("oid").contains(",")) { |
| | | // oidMap.put("oid", QueryOptionConstant.IN +"("+ VciBaseUtil.toInSql(oidList.toArray(new String[0])) + ")"); |
| | | wrapper.in("oid", oidList); |
| | | } else { |
| | | // oidMap.put("oid", conditionMap.get("oid")); |
| | | wrapper.in("oid", conditionMap.get("oid")); |
| | | } |
| | | if (CollectionUtils.isEmpty(oidMap)) { |
| | | throw new VciBaseException("业务数据主键不能为空"); |
| | | } |
| | | // List<ClientBusinessObject> cbos = boService.queryCBO(btmType, oidMap); |
| | | List<CodeWupin> cbos = baseMapper.selectList(wrapper); |
| | | |
| | | List<BaseModel> cbos = selectByTypeAndOid(btmType,conditionMap.get("oid")); |
| | | if (CollectionUtils.isEmpty(cbos)) { |
| | | throw new VciBaseException("未找到业务数据"); |
| | | } |
| | | CodeWupin cbo = cbos.get(0); |
| | | String templateOid = cbo.getCodetemplateoid(); |
| | | // Map<String, String> templateOidMap = new HashMap<>(); |
| | | // templateOidMap.put("oid", templateOid); |
| | | BaseModel cbo = cbos.get(0); |
| | | String templateOid = cbo.getData().get("CODETEMPLATEOID"); |
| | | |
| | | QueryWrapper<CodeClassifyTemplate> codeClassifyTemplateWrapper = new QueryWrapper<>(); |
| | | codeClassifyTemplateWrapper.eq("oid", templateOid); |
| | | List<CodeClassifyTemplate> templateDOList = templateService.list(codeClassifyTemplateWrapper); |
| | | |
| | | // List<CodeClassifyTemplate> templateDOList = boService.queryObject(CodeClassifyTemplate.class, templateOidMap); |
| | | QueryWrapper<CodeClassifyTemplateAttr> codeClassifyTemplateAttrWrapper = new QueryWrapper<>(); |
| | | QueryWrapper<CodeClassifyTemplateAttr> codeClassifyTemplateAttrWrapper = new QueryWrapper<>(); |
| | | codeClassifyTemplateAttrWrapper.eq("CLASSIFYTEMPLATEOID", templateOid); |
| | | // templateOidMap.clear(); |
| | | // templateOidMap.put("CLASSIFYTEMPLATEOID",templateOid); |
| | | |
| | | List<CodeClassifyTemplateAttr> attrDOList = codeClassifyTemplateAttrService.list(codeClassifyTemplateAttrWrapper); |
| | | // boService.queryObject(CodeClassifyTemplateAttr.class, templateOidMap); |
| | | |
| | | if (CollectionUtils.isEmpty(templateDOList)) { |
| | | logger.error("找不到业务数据关联的模板,模板主键:" + templateOid); |
| | | throw new VciBaseException("找不到业务数据关联的模板"); |
| | |
| | | */ |
| | | public BaseModel createBaseModel(String boName) { |
| | | R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(boName)); |
| | | String userName = AuthUtil.getUser().getUserName(); |
| | | String userName = String.valueOf(AuthUtil.getUser().getUserId()); |
| | | BaseModel bo = new BaseModel(); |
| | | // bo.setOid(VciBaseUtil.getPk()); |
| | | // bo.setRevisionid(VciBaseUtil.getPk()); |