diff --git a/javascript/common/脚本.js b/javascript/common/脚本.js new file mode 100644 index 0000000..dffd9ee --- /dev/null +++ b/javascript/common/脚本.js @@ -0,0 +1,68 @@ +(function runJs() { + let currentYear = new Date().getFullYear(); + let currentMonth = new Date().getMonth() + 1; + let currentDate = new Date().getDate(); + + let month = prompt("请输入月份(1-12):", currentMonth); + let day = prompt("请输入日期(1-31):", currentDate); + + let dateInput = new Date(currentYear, month - 1, day); + + let year = dateInput.getFullYear(); + let formattedMonth = ("0" + (dateInput.getMonth() + 1)).slice(-2); + let formattedDay = ("0" + dateInput.getDate()).slice(-2); + + let date = year + "-" + formattedMonth + "-" + formattedDay; + + let todate = date + " 23:00"; + let fromDate = date + " 08:00"; + let wf = WeFormSDK.getWeFormInstance(); + wf.changeFieldValue("100003720000000607", {value: fromDate}); + wf.changeFieldValue("100003720000000609", {value: todate}); + wf.changeFieldValue("100003720000030038", {value: '0'}); + wf.changeFieldValue("100003720000000611", {value: "外出技术支持"}); + wf.changeFieldValue("100003720000008715", {value: '2'}); + wf.changeFieldValue("877132351682273302", {value: '1'}); + let workflowTitleObj = document.querySelector('input[weid="3rdcst_oxa9w7_i8bbvp_vc1wev_kc1m3l_r1vh81_snhw9p_3r9w93_g28s4n_abfe5k_a9abii"'); + let workflowTitle = workflowTitleObj.value; + workflowTitleObj.value = workflowTitle.substring(0, workflowTitle.length - 5) + formattedMonth + "-" + formattedDay; + const container = document.getElementById("widget_100003720000000664"); + const svgIcon = container.querySelector(".associative-search-icon svg"); + if (svgIcon) { + svgIcon.dispatchEvent(new MouseEvent('click', { + bubbles: true, + cancelable: true, + view: window + })); + } + let closeTab = window.close; + window.close = () => { + window.open('/sp/workflow/flowpage/fullCreate/100003460000000746?workflowId=100003460000000746&isCreate=1', "_blank"); + closeTab() + } +})() + +(function runJs() { + let currentYear = new Date().getFullYear(); + let currentMonth = new Date().getMonth() + 1; + let currentDate = new Date().getDate(); + let month = prompt("请输入月份(1-12):", currentMonth); + let day = prompt("请输入日期(1-31):", currentDate); + let dateInput = new Date(currentYear, month - 1, day); + let year = dateInput.getFullYear(); + let formattedMonth = ("0" + (dateInput.getMonth() + 1)).slice(-2); + let formattedDay = ("0" + dateInput.getDate()).slice(-2); + let date = year + "-" + formattedMonth + "-" + formattedDay; + let todate = date + " 23:00"; + let fromDate = date + " 08:00"; + let wf = WeFormSDK.getWeFormInstance(); + wf.changeFieldValue("100003720000000607", {value: fromDate}); + wf.changeFieldValue("100003720000000609", {value: todate}); + wf.changeFieldValue("100003720000030038", {value: '0'}); + wf.changeFieldValue("100003720000000611", {value: "外出技术支持"}); + wf.changeFieldValue("100003720000008715", {value: '4'}); + wf.changeFieldValue("877132351682273302", {value: '1'}); + let workflowTitleObj = document.querySelector('input[weid="3rdcst_oxa9w7_i8bbvp_vc1wev_kc1m3l_r1vh81_snhw9p_3r9w93_g28s4n_abfe5k_a9abii"'); + let workflowTitle = workflowTitleObj.value; + workflowTitleObj.value = workflowTitle.substring(0, workflowTitle.length - 5) + formattedMonth + "-" + formattedDay; +})() \ No newline at end of file diff --git a/src/main/java/com/api/youhong/ai/pcn/examcontrol/controller/ExamBtnControlController.java b/src/main/java/com/api/youhong/ai/pcn/examcontrol/controller/ExamBtnControlController.java new file mode 100644 index 0000000..d96336e --- /dev/null +++ b/src/main/java/com/api/youhong/ai/pcn/examcontrol/controller/ExamBtnControlController.java @@ -0,0 +1,45 @@ +package com.api.youhong.ai.pcn.examcontrol.controller; + +import aiyh.utils.ApiResult; +import aiyh.utils.Util; +import com.api.youhong.ai.pcn.examcontrol.service.ExamBtnControlService; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import org.apache.log4j.Logger; +import weaver.hrm.HrmUserVarify; +import weaver.hrm.User; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.*; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; +import java.util.Map; + +/** + *
create: 2023/7/5 16:33
+ * + * @author youHong.ai + */ +@Path("/aiyh/exam-btn/control") +public class ExamBtnControlController { + + private final Logger log = Util.getLogger(); + + private final ExamBtnControlService service = new ExamBtnControlService(); + + @Path("/is-read") + @POST + @Produces(MediaType.APPLICATION_JSON) + public String isReadDoc(@Context HttpServletRequest request, @Context HttpServletResponse response, + @RequestBody Mapcreate: 2023/7/5 16:59
+ * + * @author youHong.ai + */ +@SqlMapper +public interface ExamBtnControlMapper { + + + /** + *create: 2023/7/5 16:39
+ * + * @author youHong.ai + */ +public class ExamBtnControlService { + + private final Logger log = Util.getLogger(); + + + private final ExamBtnControlMapper mapper = Util.getMapper(ExamBtnControlMapper.class); + + + public boolean isReadDoc(User user, Map