提交 d0b78e0e authored 作者: whydesc's avatar whydesc

--问题整改和计划的工作流迁移

上级 28f56f11
......@@ -226,6 +226,7 @@
formData.dataId=record.id;
formData.dataName='id';
definitionStartByDeployId(record.deployId, formData).then(res => {
console.log("计划启动----------- res",res);
handleSuccess();
})
......
package org.jeecg.modules.stm.plan.main.controller;
import java.util.Arrays;
import java.util.List;
import com.baomidou.mybatisplus.core.metadata.TableInfo;
import com.baomidou.mybatisplus.core.metadata.TableInfoHelper;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
......@@ -11,7 +15,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.modules.system.service.ISysDictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
......@@ -32,6 +38,8 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
public class StPlanManController extends JeecgController<StPlanMan, IStPlanManService> {
@Autowired
private IStPlanManService stPlanManService;
@Autowired
private ISysDictService iSysDictService;
/**
* 分页列表查询
......@@ -50,6 +58,20 @@ public class StPlanManController extends JeecgController<StPlanMan, IStPlanManSe
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
IPage<StPlanMan> pageList = stPlanManService.defPage(stPlanMan, req.getParameterMap(),pageNo,pageSize);
List<StPlanMan> list = pageList.getRecords();
if(CollectionUtils.isEmpty(list)){
}else{
for(StPlanMan stPlanManben:pageList.getRecords()){
String tableName = getTableNameByMyBatisPlus();
if(tableName!=null&&!tableName.equals("")){
//需要根据 tableName 反查DeployId
String deployId=iSysDictService.queryDictTextByKeyOfformTableName(tableName);
stPlanManben.setDeployId(deployId);
}
}
}
return Result.OK(pageList);
}
......@@ -180,4 +202,15 @@ public class StPlanManController extends JeecgController<StPlanMan, IStPlanManSe
return super.importExcel(request, response, StPlanMan.class);
}
/**
* 使用 MyBatis-Plus 的 TableInfoHelper 获取表名
*/
public String getTableNameByMyBatisPlus() {
TableInfo tableInfo = TableInfoHelper.getTableInfo(StPlanMan.class);
if (tableInfo != null) {
return tableInfo.getTableName();
}
return null;
}
}
......@@ -142,5 +142,11 @@ public class StPlanMan implements Serializable {
private java.lang.Integer exeRuleCycle;
/**流程状态*/
private String bpmStatus;
/**部署ID*/
private java.lang.String deployId;
}
......@@ -20,6 +20,6 @@ public class StPlanManVo extends StPlanMan {
private String projectTypeName;
private String optDesbak;
private java.lang.String deployId;
}
......@@ -70,8 +70,9 @@ public class StProblemCheckController extends JeecgController<StProblemCheck, IS
String tableName = getTableNameByMyBatisPlus();
if(tableName!=null&&!tableName.equals("")){
//需要根据 tableName 反查DeployId
// String deployId=iSysDictService.queryDictTextByKeyOfformTableName(tableName);
// stPlanMan.setDeployId(deployId);
String deployId=iSysDictService.queryDictTextByKeyOfformTableName(tableName);
stPlanMan.setDeployId(deployId);
}
}
......
......@@ -124,9 +124,14 @@ public class StProblemCheck implements Serializable {
private java.util.Date planEndDate;
/**流程状态*/
private String bpmStatus;
/**部署ID*/
private java.lang.String deployId;
}
......@@ -214,4 +214,11 @@ public interface SysDictMapper extends BaseMapper<SysDict> {
* @return
*/
int removeLogicDeleted(@Param("ids")List<String> ids);
/**
* 通过字典code获取字典数据
* @param code
* @return
*/
public String queryDictTextByKeyOfformTableName(@Param("code") String code);
}
......@@ -245,4 +245,13 @@
</foreach>
</delete>
<select id="queryDictTextByKeyOfformTableName" parameterType="String" resultType="String">
SELECT s.deploy_id as dict_id
FROM sys_deploy_form s,act_re_deployment d
WHERE s.deploy_id=d.ID_ and s.form_table_name=#{code}
order by s.id desc
LIMIT 1
</select>
</mapper>
......@@ -298,4 +298,6 @@ public interface ISysDictService extends IService<SysDict> {
* @param ids
*/
boolean removeLogicDeleted(List<String> ids);
public String queryDictTextByKeyOfformTableName(String code);
}
......@@ -918,4 +918,10 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
//新增子项
this.addDictItem(id,dictItemList);
}
@Override
public String queryDictTextByKeyOfformTableName(String code) {
return sysDictMapper.queryDictTextByKeyOfformTableName(code);
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论