| | |
| | | import com.java110.core.annotation.Java110Cmd; |
| | | import com.java110.core.annotation.Java110Transactional; |
| | | import com.java110.core.context.ICmdDataFlowContext; |
| | | import com.java110.core.event.cmd.AbstractServiceCmdListener; |
| | | import com.java110.core.event.cmd.Cmd; |
| | | import com.java110.core.event.cmd.CmdEvent; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.intf.report.IReportCustomComponentFooterV1InnerServiceSMO; |
| | | import com.java110.po.reportCustomComponentFooter.ReportCustomComponentFooterPo; |
| | | import com.java110.po.reportCustom.ReportCustomComponentFooterPo; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.Base64Convert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import com.java110.core.log.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | |
| | | /** |
| | |
| | | * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行 |
| | | */ |
| | | @Java110Cmd(serviceCode = "reportCustomComponentFooter.updateReportCustomComponentFooter") |
| | | public class UpdateReportCustomComponentFooterCmd extends AbstractServiceCmdListener { |
| | | public class UpdateReportCustomComponentFooterCmd extends Cmd { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(UpdateReportCustomComponentFooterCmd.class); |
| | | private static Logger logger = LoggerFactory.getLogger(UpdateReportCustomComponentFooterCmd.class); |
| | | |
| | | |
| | | @Autowired |
| | |
| | | @Override |
| | | public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { |
| | | Assert.hasKeyAndValue(reqJson, "footerId", "footerId不能为空"); |
| | | Assert.hasKeyAndValue(reqJson, "footerId", "footerId不能为空"); |
| | | Assert.hasKeyAndValue(reqJson, "footerId", "footerId不能为空"); |
| | | |
| | | } |
| | | |
| | |
| | | @Java110Transactional |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | |
| | | ReportCustomComponentFooterPo reportCustomComponentFooterPo = BeanConvertUtil.covertBean(reqJson, ReportCustomComponentFooterPo.class); |
| | | ReportCustomComponentFooterPo reportCustomComponentFooterPo = BeanConvertUtil.covertBean(reqJson, ReportCustomComponentFooterPo.class); |
| | | try { |
| | | if (!StringUtil.isEmpty(reportCustomComponentFooterPo.getComponentSql())) { |
| | | reportCustomComponentFooterPo.setComponentSql(Base64Convert.byteToBase64(reportCustomComponentFooterPo.getComponentSql().getBytes("UTF-8"))); |
| | | } |
| | | if (!StringUtil.isEmpty(reportCustomComponentFooterPo.getJavaScript())) { |
| | | reportCustomComponentFooterPo.setJavaScript(Base64Convert.byteToBase64(reportCustomComponentFooterPo.getJavaScript().getBytes("UTF-8"))); |
| | | } |
| | | } catch (Exception e) { |
| | | logger.error("编码失败", e); |
| | | } |
| | | int flag = reportCustomComponentFooterV1InnerServiceSMOImpl.updateReportCustomComponentFooter(reportCustomComponentFooterPo); |
| | | |
| | | if (flag < 1) { |