package space.apps.moudules.website.services.flow; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import apps.pojo.Article; import apps.pojo.ArticleCopy; import apps.pojo.Audit; import apps.pojo.Department; import space.apps.common.ConstVars.dataStatusCode; import space.apps.moudules.website.common.ConstVars.articleStatusCode; import space.apps.moudules.website.util.ArticleUtil; import space.core.apps.bpm.bean.BpmApp; import space.core.apps.bpm.bean.StartChangeProcess; import space.core.apps.bpm.bean.StartDisableProces; import space.core.apps.bpm.bean.StartEnableProces; import space.core.apps.bpm.bean.StartProcess; import space.core.apps.bpm.utils.BpmAppUtil; import space.core.apps.bpm.utils.BpmProcessPageBeanUtil; import space.core.apps.bpm.utils.BpmProcessUtil; import space.core.apps.common.BaseTransaction; import space.core.common.utils.DateTimeUtil; import space.core.common.utils.GsonUtil; import space.core.common.utils.StringUtil; import space.core.db.bean.base.PageBean; import space.core.db.jdbc.GeneralDBAccess; import space.core.db.jdbc.SqlCommandImpl; /** * 文章流程服务类 * * @author 陈锋 * @log 2020年10月11日 上午1:14:57 * */ public class ArticleFlowService extends BaseTransaction { static Logger log = LogManager.getLogger(ArticleFlowService.class); private static final long serialVersionUID = -2593351714351810842L; /** * 获取 BPM 里的文章对象 * * @param gdba * @return * @throws Exception * @author 陈锋 * @log 2020年10月11日 */ private Article getBPMArticle(GeneralDBAccess gdba) throws Exception { Map paramMap = getBpmParamMap(); Long articleid = Long.valueOf(paramMap.get("articleid").toString()); Article article = new Article(); article.setArticleid(articleid); gdba.selectById(article); return article; } /** * 获取文章对象 * @param gdba * @param articleid * @return * @throws Exception * @author 陈锋 * @log 2020年10月11日 */ private Article getArticleById(GeneralDBAccess gdba, Long articleid) throws Exception { // 显式列查询:生产 article 表含 guest_access_flag,但 apps.pojo.Article 未同步该字段 String sql = "SELECT articleid, dcode, title, `desc`, navigationid, unitid, websiteid, ascode," + " create_pid, last_change_pid, create_time, last_change_time, content, edit_content," + " source, thumbnail, sticktop, `release`, url, read_count, ajtcode" + " FROM article WHERE articleid = :articleid"; SqlCommandImpl sqlCmd = new SqlCommandImpl(sql); sqlCmd.setString("articleid", articleid); List
list = gdba.selectAsList(sqlCmd, Article.class); if (list == null || list.isEmpty()) { throw new Exception("文章不存在"); } return list.get(0); } /** * * 获取部门负责人 * * @param gdba * @param mtCode 类别码 * @param departmentid 部门 id * @return * @throws Exception * @author 陈锋 * @log 2020年10月29日 */ private List> getDepartmentManageByMtcode(GeneralDBAccess gdba, Long mtCode, Long departmentid) throws Exception { StringBuilder sqlBuilder = new StringBuilder(); if (mtCode.equals(10030L)) { // 人员 sqlBuilder.append(" select p.personid from person p "); // 在用、并且不是离职的 sqlBuilder.append(" where p.dcode = 61 and p.pcode != 10001 and p.personid in "); } sqlBuilder.append(" (Select objectid from department_manage where departmentid = :departmentid and mtcode = :mtcode )"); SqlCommandImpl sqlCmd = new SqlCommandImpl(sqlBuilder.toString()); sqlCmd.setString("mtcode", mtCode).setString("departmentid", departmentid); return gdba.selectAsMapList(sqlCmd); } /** * 验证是否有部门负责人 * * @param gdba * @param article 文章 * @param departmentName 部门名 * @param departmentid 部门 id * @throws Exception * @author 陈锋 * @log 2020年10月31日 */ private void verifyDepartmentChargePerson(GeneralDBAccess gdba, Article article, String departmentName, Long departmentid) throws Exception { try { List> personList = getDepartmentManageByMtcode(gdba, 10030L, departmentid); if (personList.size() == 0) { throw new Exception("未找到「" + departmentName + "」部门负责人"); } } catch (Exception e) { updateArticleById(gdba, article); throw new Exception("未找到「" + departmentName + "」部门负责人"); } } /** * 更新文章为“录入”状态 * * @param gdba * @param article 文章 * @throws Exception * @author 陈锋 * @log 2020年10月31日 */ private void updateArticleById(GeneralDBAccess gdba, Article article) throws Exception { article.setDcode(dataStatusCode.INSERT.getCode()); Set updateSet = new HashSet(); updateSet.add("dcode"); gdba.updateById(article, updateSet); gdba.commit(); } /** * 验证文章是否有栏目负责人 * * @param gdba * @param article 文章 * @throws Exception * @author 陈锋 * @log 2020年10月10日 */ private void verifyNavigationPerson(GeneralDBAccess gdba, Article article) throws Exception { try { List list = ArticleUtil.getManageByWnmcode(gdba, 10020L, article.getNavigationid());// 文章负责对象,栏目 if (list.size() == 0) { throw new Exception("未找到栏目负责对象"); } } catch (Exception e) { updateArticleById(gdba, article); throw new Exception("未找到栏目负责对象"); } } /** * 启动文章变动流程的前置服务 * * @return * @throws Exception * @author 陈锋 * @log 2020年10月7日 */ public String startArticleChangeProcessBefore() throws Exception { Article article = getArticleById(getGdbaInstance(), getParameterToLong("articleid")); setBPMStartChangeProcess("article_start_change_submit",article.getArticleid(), null, article.getTitle(), article.getDesc()); return DEFAULT_FORWARD; } /** * 启动文章变动流程 * @return * @throws Exception * @author 陈锋 * @log 2020年10月7日 */ public String startArticleChangeProcess() throws Exception { GeneralDBAccess gdba = getGdbaInstance(); Article article = new Article(); try { StartChangeProcess startChangeProcess = getStartChangeProcess(); article.setArticleid(startChangeProcess.getChangeId()); gdba.selectById(article); startChangeProcess.setChangeTitle(article.getTitle()); Department department = getAppUser().getDepartment(); // 撤回当前数据未结束的流程 Map paramMap = new HashMap(); BpmProcessUtil.withdrawTaskByPageBean(gdba, article, getWebApp(), getAppUser(), paramMap); withdrawArticleCopy(gdba, article);// 收回 verifyDepartmentChargePerson(gdba, article, department.getName(), department.getDepartmentid()); verifyNavigationPerson(gdba, article); Map dcodeMap = new HashMap(); dcodeMap.put(ArticleCopy.class.getName(), "dcode"); BpmProcessUtil.startChangeProcess(getWebApp(), startChangeProcess.getChangeTitle(), "articleChange", getAppUser(), article, gdba, startChangeProcess.getChangeDescribe(), dcodeMap); gdba.commit(); setResponsePackage(getResponseSuccessMsgPackage("发起成功")); } catch (Exception e) { e.printStackTrace(); setResponsePackage(getResponseErrorMsgPackage("发起失败:" + e.getMessage())); } return DEFAULT_FORWARD; } /** * 撤回未审核的文章抄送 * * @param gdba * @param article * @throws Exception * @author 陈锋 * @log 2020年10月31日 */ private void withdrawArticleCopy(GeneralDBAccess gdba, Article article) throws Exception { String sql = "select * from article_copy where articleid = :articleid and dcode in(21, 31, 41, 51) "; SqlCommandImpl sqlCmd = new SqlCommandImpl(sql); sqlCmd.setString("articleid", article.getArticleid()); List ArticleCopyList = gdba.selectAsList(sqlCmd, ArticleCopy.class); Set updateSet = new HashSet(); updateSet.add("dcode"); for (ArticleCopy articleCopy : ArticleCopyList) { articleCopy.setDcode(dataStatusCode.INSERT_AUDIT.getCode()); gdba.updateById(articleCopy, updateSet); } } /** * 启动文章流程的前置服务 * * @return * @throws Exception * @author 陈锋 * @log 2020年2月25日 */ public String startArticleProcessBefore() throws Exception { Article article = getArticleById(getGdbaInstance(), getParameterToLong("articleid")); setBPMStartParam("article_start_submit", article.getArticleid(), article.getTitle(), article.getDesc()); return DEFAULT_FORWARD; } /** * 启动文章流程 * * @return * @throws Exception * @author 陈锋 * @log 2020年2月25日 */ public String startArticleProcess() throws Exception { try { if (getAppUser() == null) { throw new Exception("登录会话已失效,请重新登录"); } GeneralDBAccess gdba = getGdbaInstance(); StartProcess startProcess = getStartProcess(); Article article = getArticleById(gdba, startProcess.getId()); startProcess.setTitle(article.getTitle()); Department department = getAppUser().getDepartment(); if (department == null && getAppUser().getPerson() != null && getAppUser().getPerson().getDepartmentid() != null) { department = new Department(); department.setDepartmentid(getAppUser().getPerson().getDepartmentid()); gdba.selectById(department); } if (department == null) { throw new Exception("当前登录用户未关联部门,无法发起流程"); } try { verifyDepartmentChargePerson(gdba, article, department.getName(), department.getDepartmentid()); verifyNavigationPerson(gdba, article); } catch (Exception e) { throw new Exception("流程前置校验失败:" + (e.getMessage() != null ? e.getMessage() : e.getClass().getSimpleName())); } Map dcodeMap = new HashMap(); dcodeMap.put(Article.class.getName(), "dcode"); dcodeMap.put(ArticleCopy.class.getName(), "dcode"); try { // 草稿 dcode=21 时 BpmProcessPageBeanUtil 无法自动推断 startType,需显式指定 add BpmProcessUtil.startProcess(getWebApp(), startProcess.getTitle(), "articleRelease", getAppUser(), article, gdba, startProcess.getDescribe(), dcodeMap, "add", null); } catch (Exception e) { throw new Exception("BPM启动失败:" + (e.getMessage() != null ? e.getMessage() : e.getClass().getSimpleName())); } // 录入(11)/待提交(12) 发起时 BpmProcessPageBeanUtil 只会写成 21,父列表仍显示可再次申请;统一落为审核中(31) article = getArticleById(gdba, startProcess.getId()); if (!Long.valueOf(dataStatusCode.USE_AUDIT.getCode()).equals(article.getDcode())) { article.setDcode(dataStatusCode.USE_AUDIT.getCode()); Set dcodeFields = new HashSet(); dcodeFields.add("dcode"); gdba.updateById(article, dcodeFields); } gdba.commit(); setResponsePackage(getResponseSuccessMsgPackage("发起成功")); } catch (Exception e) { e.printStackTrace(); String errMsg = e.getMessage(); if (errMsg == null || errMsg.trim().isEmpty()) { errMsg = e.getClass().getSimpleName(); } setResponsePackage(getResponseErrorMsgPackage("发起失败:" + errMsg)); } return DEFAULT_FORWARD; } /** * 同意发布文章 * * @author 陈锋 * @throws Exception * @log 2020年2月25日 */ public void agree() throws Exception { try { BpmApp bpmApp = BpmAppUtil.getBpmApp(); GeneralDBAccess gdba = bpmApp.getGdba(); Map paramMap = getBpmParamMap(); Long articleid = Long.valueOf(paramMap.get("articleid").toString()); Article article = new Article(); article.setArticleid(articleid); gdba.selectById(article); article.setLastChangeTime(DateTimeUtil.getNowTimestamp()); // 定时发布 if (article.getRelease() == 1) { // 发布时间 if (StringUtil.notNull(article.getReleaseTime()) && article.getReleaseTime().getTime() <= DateTimeUtil.getCurrentTimeMillis()) { article.setAscode(articleStatusCode.HAS_RELEASE.getCode()); article.setReleaseTaskSchedulesid(null); } } else { // 没有设置定时发布,则审核完流程时,自动发布 article.setAscode(articleStatusCode.HAS_RELEASE.getCode()); if (StringUtil.isNull(article.getReleaseTime())) { article.setReleaseTime(DateTimeUtil.getNowTimestamp()); } } gdba.updateById(article); BpmProcessPageBeanUtil.updatePageBeanForAgree(gdba, article); agreeAuthorizedArticleCopy(gdba, articleid); } catch (Exception e) { // 文章里的同意失败 throw new Exception("同意发布文章失败"); } } /** * 主栏目审核通过后,自动通过“申请人本身就是抄送栏目负责人”的抄送记录。 * 其他抄送记录仍进入抄送审。 * * @param gdba 数据库 * @param articleid 文章 ID * @throws Exception */ private void agreeAuthorizedArticleCopy(GeneralDBAccess gdba, Long articleid) throws Exception { String sql = "select * from article_copy where articleid = :articleid and dcode in (21, 31, 41, 51) "; SqlCommandImpl sqlCmd = new SqlCommandImpl(sql); sqlCmd.setString("articleid", articleid); List articleCopyList = gdba.selectAsList(sqlCmd, ArticleCopy.class); Set updateSet = new HashSet(); updateSet.add("dcode"); for (ArticleCopy articleCopy : articleCopyList) { if (!ArticleUtil.isNavigationManager(gdba, 10020L, articleCopy.getNavigationid(), articleCopy.getCreatePid())) { continue; } articleCopy.setDcode(dataStatusCode.USE.getCode()); gdba.updateById(articleCopy, updateSet); } } /** * 拒绝发布文章 * * @author 陈锋 * @throws Exception * @log 2020年2月25日 */ public void reject() throws Exception { try { BpmApp bpmApp = BpmAppUtil.getBpmApp(); GeneralDBAccess gdba = bpmApp.getGdba(); Map paramMap = getBpmParamMap(); Long articleid = Long.valueOf(paramMap.get("articleid").toString()); Article article = new Article(); article.setArticleid(articleid); gdba.selectById(article); article.setLastChangeTime(DateTimeUtil.getNowTimestamp()); gdba.updateById(article); BpmProcessPageBeanUtil.updatePageBeanForReject(gdba, article); } catch (Exception e) { throw new Exception("退回发布文章失败"); } } /** * 同意抄送文章 * * @throws Exception * @author 陈锋 * @log 2020年2月25日 */ public void agreeArticleCopy() throws Exception { try { Map paramMap = getBpmParamMap(); BpmApp bpmApp = BpmAppUtil.getBpmApp(); Audit audit = bpmApp.getAudit(); Map paramAuditMap = GsonUtil.jsonToMap2(audit.getForeachVar()); String sql = "select * from article_copy WHERE navigationid = :navigationid AND articleid = :articleid ";// AND dcode = :dcode SqlCommandImpl sqlCmd = new SqlCommandImpl(sql); sqlCmd.setInt("articleid", paramMap.get("articleid")); sqlCmd.setInt("navigationid", paramAuditMap.get("navigationid")); // sqlCmd.setInt("dcode", dataStatusCode.INSERT_AUDIT.getCode()); GeneralDBAccess gdba = bpmApp.getGdba(); List pageBeanList = gdba.selectAsList(sqlCmd, ArticleCopy.class); BpmProcessPageBeanUtil.updatePageBeanForAgree(gdba, pageBeanList); } catch (Exception e) { throw new Exception("同意抄送文章失败"); } } /** * 同意直通发布文章。 * 用于“开始 -> 结束”的发布流程:没有抄送审核节点,需要在结束时同步发布主文章和抄送栏目。 * * @throws Exception */ public void agreeDirectRelease() throws Exception { try { agree(); Map paramMap = getBpmParamMap(); String sql = "select * from article_copy WHERE articleid = :articleid "; SqlCommandImpl sqlCmd = new SqlCommandImpl(sql); sqlCmd.setInt("articleid", paramMap.get("articleid")); BpmApp bpmApp = BpmAppUtil.getBpmApp(); GeneralDBAccess gdba = bpmApp.getGdba(); List pageBeanList = gdba.selectAsList(sqlCmd, ArticleCopy.class); BpmProcessPageBeanUtil.updatePageBeanForAgree(gdba, pageBeanList); } catch (Exception e) { throw new Exception("同意直通发布文章失败"); } } /** * 拒绝抄送文章 * * @throws Exception * @author 陈锋 * @log 2020年2月25日 */ public void rejectArticleCopy() throws Exception { try { Map paramMap = getBpmParamMap(); BpmApp bpmApp = BpmAppUtil.getBpmApp(); Audit audit = bpmApp.getAudit(); Map paramAuditMap = GsonUtil.jsonToMap2(audit.getForeachVar()); String sql = "select * from article_copy WHERE navigationid = :navigationid AND articleid = :articleid ";// AND dcode = :dcode SqlCommandImpl sqlCmd = new SqlCommandImpl(sql); sqlCmd.setInt("articleid", paramMap.get("articleid")); sqlCmd.setInt("navigationid", paramAuditMap.get("navigationid")); // sqlCmd.setInt("dcode", dataStatusCode.INSERT_AUDIT.getCode()); GeneralDBAccess gdba = bpmApp.getGdba(); List pageBeanList = gdba.selectAsList(sqlCmd, ArticleCopy.class); BpmProcessPageBeanUtil.updatePageBeanForReject(gdba, pageBeanList); } catch (Exception e) { throw new Exception("退回抄送文章失败"); } } /** * 启动停用文章流程的前置服务 * * @return * @throws Exception * @author 陈锋 * @log 2020年10月11日 */ public String startDisableArticleProcessBefore() throws Exception { Article article = getArticleById(getGdbaInstance(), getParameterToLong("articleid")); setBPMStartDisableProcess("article_start_disable_submit", article.getArticleid(), article.getTitle(), article.getDesc()); return DISABLE_APPLY_FORWARD; } /** * 启动停用文章流程 * * @return * @throws Exception * @author 陈锋 * @log 2020年10月11日 */ public String startDisableArticleProcess() throws Exception { try { GeneralDBAccess gdba = getGdbaInstance(); StartDisableProces startDisableProcess = getStartDisableProcess(); Article article = new Article(); article.setArticleid(startDisableProcess.getId()); gdba.selectById(article); // 停用抄送的栏目 // String sql = "select * from article_copy where articleid = :articleid "; // SqlCommandImpl sqlCmd = new SqlCommandImpl(sql); // sqlCmd.setInt("articleid", article.getArticleid()); // List articleCopyList = gdba.selectAsList(sqlCmd, ArticleCopy.class); // // Map dcodeMap = new HashMap(); // dcodeMap.put(ArticleCopy.class.getName(), "dcode");// 防止没有抄送记录 // // BpmProcessUtil.startDisableProcess(getWebApp(), startDisableProcess.getTitle(), "articleDisable", getAppUser(), article, // gdba, startDisableProcess.getDescribe(), articleCopyList, dcodeMap); // BpmProcessUtil.startDisableProcess(getWebApp(), startDisableProcess.getTitle(), "articleDisable", getAppUser(), article, // gdba, startDisableProcess.getDescribe(), null); gdba.commit(); setResponsePackage(getResponseSuccessMsgPackage("发起成功")); } catch (Exception e) { e.printStackTrace(); setResponsePackage(getResponseErrorMsgPackage("发起失败:" + e.getMessage())); } return DEFAULT_FORWARD; } /** * 同意停用文章审核 * * @return * @throws Exception * @author 陈锋 * @log 2020年10月11日 */ public String agreeDisable() throws Exception { try { BpmApp bpmApp = BpmAppUtil.getBpmApp(); GeneralDBAccess gdba = bpmApp.getGdba(); Article article = getBPMArticle(gdba); article.setLastChangeTime(DateTimeUtil.getNowTimestamp()); gdba.updateById(article); // 把抄送到的栏目全部停用 // String sql = "UPDATE article_copy SET dcode = '71' WHERE articleid = :articleid "; // SqlCommandImpl sqlCmd = new SqlCommandImpl(sql); // sqlCmd.setInt("articleid", article.getArticleid()); // gdba.modify(sqlCmd); BpmProcessPageBeanUtil.updatePageBeanForAgree(gdba, article); } catch (Exception e) { throw new Exception("同意停用文章失败"); } return DEFAULT_FORWARD; } /** * 拒绝停用文章审核 * * @return * @throws Exception * @author 陈锋 * @log 2020年10月11日 */ public String rejectDisable() throws Exception { try { BpmApp bpmApp = BpmAppUtil.getBpmApp(); GeneralDBAccess gdba = bpmApp.getGdba(); Article article = getBPMArticle(gdba); article.setLastChangeTime(DateTimeUtil.getNowTimestamp()); gdba.updateById(article); // String sql = "SELECT * FROM article_copy WHERE articleid = :articleid "; // SqlCommandImpl sqlCmd = new SqlCommandImpl(sql); // sqlCmd.setInt("articleid", article.getArticleid()); // List articleCopyList = gdba.selectAsList(sqlCmd, ArticleCopy.class); // BpmProcessPageBeanUtil.updatePageBeanForReject(gdba, articleCopyList); BpmProcessPageBeanUtil.updatePageBeanForReject(gdba, article); } catch (Exception e) { throw new Exception("退回停用文章失败"); } return DEFAULT_FORWARD; } /** * 启动启用文章流程的前置服务 * * @return * @throws Exception * @author 陈锋 * @log 2020年10月11日 */ public String startEnableArticleProcessBefore() throws Exception { Article article = getArticleById(getGdbaInstance(), getParameterToLong("articleid")); setBPMStartEnableProcess("article_start_enable_submit", article.getArticleid(), article.getTitle(), article.getDesc()); return ENABLE_APPLY_FORWARD; } /** * 启动启用文章流程 * * @return * @throws Exception * @author 陈锋 * @log 2020年10月11日 */ public String startEnableArticleProcess() throws Exception { try { GeneralDBAccess gdba = getGdbaInstance(); StartEnableProces startEnableProces = getStartEnableProcess(); Article article = getArticleById(gdba, startEnableProces.getId()); Department department = getAppUser().getDepartment(); verifyDepartmentChargePerson(gdba, article, department.getName(), department.getDepartmentid()); verifyNavigationPerson(gdba, article); // String sql = "select * from article_copy where articleid = :articleid "; // SqlCommandImpl sqlCmd = new SqlCommandImpl(sql); // sqlCmd.setInt("articleid", article.getArticleid()); // List articleCopyList = gdba.selectAsList(sqlCmd, ArticleCopy.class); // // Map dcodeMap = new HashMap(); // dcodeMap.put(ArticleCopy.class.getName(), "dcode");// 防止没有抄送记录 // // BpmProcessUtil.startEnableProcess(getWebApp(), startEnableProces.getTitle(), "articleEnable", getAppUser(), article, // gdba, startEnableProces.getDescribe(), articleCopyList, dcodeMap); // BpmProcessUtil.startEnableProcess(getWebApp(), startEnableProces.getTitle(), "articleEnable", getAppUser(), article, // gdba, startEnableProces.getDescribe(), null); gdba.commit(); setResponsePackage(getResponseSuccessMsgPackage("发起成功")); } catch (Exception e) { e.printStackTrace(); setResponsePackage(getResponseErrorMsgPackage("发起失败:" + e.getMessage())); } return DEFAULT_FORWARD; } /** * 同意启用文章审核 * * @return * @throws Exception * @author 陈锋 * @log 2020年10月11日 */ public String agreeEnable() throws Exception { try { BpmApp bpmApp = BpmAppUtil.getBpmApp(); GeneralDBAccess gdba = bpmApp.getGdba(); Article article = getBPMArticle(gdba); article.setLastChangeTime(DateTimeUtil.getNowTimestamp()); gdba.updateById(article); BpmProcessPageBeanUtil.updatePageBeanForAgree(gdba, article); // gdba.commit(); } catch (Exception e) { throw new Exception("同意启用文章失败"); } return DEFAULT_FORWARD; } /** * 拒绝启用文章审核 * * @return * @throws Exception * @author 陈锋 * @log 2020年10月11日 */ public String rejectEnable() throws Exception { try { BpmApp bpmApp = BpmAppUtil.getBpmApp(); GeneralDBAccess gdba = bpmApp.getGdba(); Article article = getBPMArticle(gdba); article.setLastChangeTime(DateTimeUtil.getNowTimestamp()); gdba.updateById(article); BpmProcessPageBeanUtil.updatePageBeanForReject(gdba, article); // gdba.commit(); } catch (Exception e) { throw new Exception("退回启用文章失败"); } return DEFAULT_FORWARD; } /** * 撤回(收回)文章流程时,改变文章抄送栏目状态,文章状态已在流程自动改了 * * @return * @author 陈锋 * @throws Exception * @log 2020年11月3日 */ public String withdrawArticleFlow() throws Exception { BpmApp bpmApp = BpmAppUtil.getBpmApp(); GeneralDBAccess gdba = bpmApp.getGdba(); Article article = getBPMArticle(gdba); article.setDcode(dataStatusCode.INSERT.getCode()); gdba.updateById(article); // 更新文章的抄送栏目为“录入”状态 String sql = "update article_copy set dcode = 21 where articleid = :articleid "; SqlCommandImpl sqlCmd = new SqlCommandImpl(sql); sqlCmd.setInt("articleid", article.getArticleid()); gdba.modify(sqlCmd); return DEFAULT_FORWARD; } }