稻花香仓库初始化
This commit is contained in:
6
seeyon/WEB-INF/cfgHome/chushihua/pluginCfg.xml
Normal file
6
seeyon/WEB-INF/cfgHome/chushihua/pluginCfg.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<plugin>
|
||||
<id>chushihua</id>
|
||||
<name>历史数据同步</name>
|
||||
<category>20231208</category>
|
||||
</plugin>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
<bean id="hsDataSyncQuartz" class="com.seeyon.apps.daohuaxiangSys.chushihua.quartz.HsDataSyncQuartz" />
|
||||
</beans>
|
||||
5
seeyon/WEB-INF/cfgHome/chushihua/spring/spring.xml
Normal file
5
seeyon/WEB-INF/cfgHome/chushihua/spring/spring.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
<bean id="hsDataPluginApi" class="com.seeyon.apps.daohuaxiangSys.chushihua.HsDataPluginApi" />
|
||||
</beans>
|
||||
28
seeyon/WEB-INF/cfgHome/daohuaxiang/jyncfile.properties
Normal file
28
seeyon/WEB-INF/cfgHome/daohuaxiang/jyncfile.properties
Normal file
@@ -0,0 +1,28 @@
|
||||
profile=prod
|
||||
prod.dowUrl=https://oa.dhx.com.cn/seeyon/rest/attachment/file
|
||||
prod.profile=prod
|
||||
prod.jyncFile=https://oa.dhx.com.cn/seeyon/dhxfile
|
||||
prod.address=https://crm.dhx9.com
|
||||
prod.newAddress=http://10.0.6.15:88
|
||||
prod.loginid=yc
|
||||
prod.pwd=yc123456
|
||||
prod.tongyongApi=/api/workflow/paService/doCreateRequest
|
||||
prod.appid=oa
|
||||
prod.workflowId=8521
|
||||
prod.newWorkflowId=2026
|
||||
prod.spk=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAymEn8vp0E8pg6op/WXJ4A67jHAYeUBtut8vJgk09t4Bw3kheWnHUjVHDBEZ8iC/iX9YyBzL76WZR+lpDqdFh2iKYk+yctHKc4dt9r0vw6HYMUWDrYmctdKJtdOGpWxz4apBr7Rc/2A3FDxwsiXzPqpG/GY+/1IHp7E3jEX0nxzuJn/YUm/SoSgfMB4NCHF9n3rrIsp4jJ5SOSwLr68nlwT3djF2f8vQcqRxmT0J7X2xKehlpeiubszQj5TeFcA+onkOBKkoKc+83G8Gg8J1IWZLsd50cjawrmg8lxl+UBEsPZHEh0AhWDHKLRG+9jyZJ94hoWaQRSgwEIdGyShNMnwIDAQAB
|
||||
prod.newSpk=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvcOew5NM41jK7CFBnirP4Zz0QIexYEweS+4LTuQOVY+BqHu2EMxlPYRsjtvzZj7Pm9SsiNiEIeGXZ3mkAMbNNqu7G7kGb10pJzpBBTE80cRCY0bHoD3PhD8cBiKjpsRXJ+1mPdwD4fGEr0IcG6bKhBM3xsCmc4JiEvsv/+nPm9G7NQgoPGEKHkZk0IgyaBF5m6F2NKah92klxuz+vWCQoVsCpCjHN1sijQioWc6lRLgP7d6IZFEbOrLL7HdlOc8yKOAOZhURd78CqiVYBc1vP0pyC1/UW0Lq0f2MFpg/7Z18VwAf1vFUb+oiIdjFYMr5dgS+i784FaMUDzKUvndDWwIDAQAB
|
||||
prod.paybillFileUrl=
|
||||
prod.generalbillUrl=
|
||||
prod.transformUrl=
|
||||
prod.xcfzCancelUrl=
|
||||
prod.sbfzCancelUrl=
|
||||
prod.restname=beian
|
||||
prod.restpassword=f1c4e761-d60b-47ff-a5ff-5953f2b9c9e0
|
||||
prod.oaTokenUrl=https://oa.dhx.com.cn/seeyon/rest/token
|
||||
prod.loginName=test11
|
||||
prod.secret=b44da0ec-6ba5-4d6e-b3d7-e0571b3bcdd6
|
||||
prod.newSecret=6553bad7-51f0-4d56-af44-3d64a8ce9814
|
||||
prod.sql=select id,departmentid,lastname from hrmresource@ecology where lastname = ?
|
||||
#prod.sql=select id,departmentid,lastname from hrmresource@ecology_new where lastname = ?
|
||||
prod.dataSql=select id, FORM_RECORDID, FORM_APPID , FORMID from col_summary cs where TEMPLETE_ID = ? and CAN_AUTOSTOPFLOW = 0 and STATE = 3
|
||||
6
seeyon/WEB-INF/cfgHome/daohuaxiang/pluginCfg.xml
Normal file
6
seeyon/WEB-INF/cfgHome/daohuaxiang/pluginCfg.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<plugin>
|
||||
<id>daohuaxiang</id>
|
||||
<name>稻花香</name>
|
||||
<category>20231206</category>
|
||||
</plugin>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
<bean id="tongYongNode" class="com.seeyon.apps.daohuaxiangSys.jkts.node.TongYongNode" />
|
||||
<bean id="newTongYongNode" class="com.seeyon.apps.daohuaxiangSys.jkts.node.NewTongYongNode" />
|
||||
</beans>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
<bean id="tongYongService" class="com.seeyon.apps.daohuaxiangSys.jkts.service.TongYongService" />
|
||||
<bean id="newTongYongService" class="com.seeyon.apps.daohuaxiangSys.jkts.service.NewTongYongService" />
|
||||
</beans>
|
||||
5
seeyon/WEB-INF/cfgHome/daohuaxiang/spring/spring.xml
Normal file
5
seeyon/WEB-INF/cfgHome/daohuaxiang/spring/spring.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
<bean id="tongYongPlugin" class="com.seeyon.apps.daohuaxiangSys.jkts.TongYongPlugin" />
|
||||
</beans>
|
||||
6
seeyon/WEB-INF/cfgHome/qrCodeForm/pluginCfg.xml
Normal file
6
seeyon/WEB-INF/cfgHome/qrCodeForm/pluginCfg.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<plugin>
|
||||
<id>qrCodeForm</id>
|
||||
<name>二维码扫码填单</name>
|
||||
<category>20220422</category>
|
||||
</plugin>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
|
||||
<beans default-autowire="byName">
|
||||
<bean name="/qrCodeForm.do" class="com.seeyon.apps.qrCodeForm.controller.QrCodeFormController"/>
|
||||
</beans>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
<bean name="qrCodeFormManager" class="com.seeyon.apps.qrCodeForm.manager.QrCodeFormManagerImpl" />
|
||||
<bean id="wechatQR" class="com.seeyon.ctp.portal.sso.SSOLoginContext">
|
||||
<property name="name" value="wechatQR"></property>
|
||||
<property name="ticketName" value="code"></property>
|
||||
|
||||
<property name="handshake">
|
||||
<bean class="com.seeyon.apps.qrCodeForm.sso.WechatQRHandShake"></bean>
|
||||
</property>
|
||||
</bean>
|
||||
</beans>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
|
||||
<bean id="qrCodeFormPluginApi" class="com.seeyon.apps.qrCodeForm.QrCodeFormPluginApi" />
|
||||
|
||||
<bean name="qrCodeForm_SystemInitializer" class="com.seeyon.apps.qrCodeForm.QrCodeFormPluginInitializer"/>
|
||||
</beans>
|
||||
6
seeyon/WEB-INF/cfgHome/src_dhxbacklog/pluginCfg.xml
Normal file
6
seeyon/WEB-INF/cfgHome/src_dhxbacklog/pluginCfg.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<plugin>
|
||||
<id>src_dhxbacklog</id>
|
||||
<name>稻花香流程平台流程待办集成</name>
|
||||
<category>20241231</category>
|
||||
</plugin>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
|
||||
<beans default-autowire="byName">
|
||||
<bean name="/dhxFlowWaitHandlesso.do" class="com.seeyon.apps.src_dhxbacklog.sso.DhxFlowWaitHandlesso" />
|
||||
</beans>
|
||||
5
seeyon/WEB-INF/cfgHome/src_dhxbacklog/spring/spring.xml
Normal file
5
seeyon/WEB-INF/cfgHome/src_dhxbacklog/spring/spring.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
<bean id="dhxBacklogPluginApi" class="com.seeyon.apps.src_dhxbacklog.DhxBacklogPluginApi" />
|
||||
</beans>
|
||||
6
seeyon/WEB-INF/cfgHome/src_dhxorganization/pluginCfg.xml
Normal file
6
seeyon/WEB-INF/cfgHome/src_dhxorganization/pluginCfg.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<plugin>
|
||||
<id>src_dhxorganization</id>
|
||||
<name>集团对接主数据平台</name>
|
||||
<category>20241223</category>
|
||||
</plugin>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
<bean id="updateHireFilesNode" class="com.seeyon.apps.src_dhxorganization.archive.node.UpdateHireFilesNode" />
|
||||
</beans>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
<bean id="dhxPluginApi" class="com.seeyon.apps.src_dhxorganization.DhxPluginApi" />
|
||||
</beans>
|
||||
11
seeyon/WEB-INF/cfgHome/src_dingding/dingding.properties
Normal file
11
seeyon/WEB-INF/cfgHome/src_dingding/dingding.properties
Normal file
@@ -0,0 +1,11 @@
|
||||
profile=prod
|
||||
prod.jdbc_driver=oracle.jdbc.driver.OracleDriver
|
||||
prod.jdbc_url=jdbc:oracle:thin:@10.0.1.12:1521:DHXOA
|
||||
prod.jdbc_user=DHXOA
|
||||
prod.jdbc_password=DHXOA-A8
|
||||
|
||||
#profile=prod
|
||||
test.jdbc_driver=oracle.jdbc.driver.OracleDriver
|
||||
test.jdbc_url=jdbc:oracle:thin:@10.0.3.32:1521:DHXOATEST
|
||||
test.jdbc_user=DHXOA
|
||||
test.jdbc_password=DHXOA_A8
|
||||
6
seeyon/WEB-INF/cfgHome/src_dingding/pluginCfg.xml
Normal file
6
seeyon/WEB-INF/cfgHome/src_dingding/pluginCfg.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<plugin>
|
||||
<id>src_dingding</id>
|
||||
<name>测试定时任务</name>
|
||||
<category>20231129</category>
|
||||
</plugin>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
|
||||
<bean name="/dingdingTask.do" class="com.seeyon.apps.src_dingding.ctrl.StartTaskController" >
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
|
||||
<bean id="dingdingDao" class="com.seeyon.apps.src_dingding.dao.DingdingDaoImpl" />
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
|
||||
<bean id="dingdingService" class="com.seeyon.apps.src_dingding.service.DingdingService" />
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
|
||||
<bean id="dingdingTask" class="com.seeyon.apps.src_dingding.task.DingdingTask" />
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<plugin>
|
||||
<id>src_mainorganization</id>
|
||||
<name>稻花香主数据同步</name>
|
||||
<category>20250418</category>
|
||||
</plugin>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
<bean id="srcEnumDao" class="com.seeyon.apps.src_mainorganization.dao.impl.SrcEnumDaoImpl"></bean>
|
||||
<bean id="srcMemberDao" class="com.seeyon.apps.src_mainorganization.dao.impl.SrcMemberDaoImpl"></bean>
|
||||
</beans>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
<bean id="departmentAddNode" class="com.seeyon.apps.src_mainorganization.node.DepartmentAddNode"></bean>
|
||||
<bean id="departmentCloseNode" class="com.seeyon.apps.src_mainorganization.node.DepartmentCloseNode"></bean>
|
||||
<bean id="postAddNode" class="com.seeyon.apps.src_mainorganization.node.PostAddNode"></bean>
|
||||
<bean id="postCloseNode" class="com.seeyon.apps.src_mainorganization.node.PostCloseNode"></bean>
|
||||
<bean id="levelAddNode" class="com.seeyon.apps.src_mainorganization.node.LevelAddNode"></bean>
|
||||
<bean id="levelCloseNode" class="com.seeyon.apps.src_mainorganization.node.LevelCloseNode"></bean>
|
||||
</beans>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
<!-- 扫描包以发现bean-->
|
||||
<bean id="receiveOrgMemberService" class="com.seeyon.apps.src_mainorganization.service.impl.ReceiveOrgMemberServiceImpl"></bean>
|
||||
</beans>
|
||||
6
seeyon/WEB-INF/cfgHome/src_membermanage/pluginCfg.xml
Normal file
6
seeyon/WEB-INF/cfgHome/src_membermanage/pluginCfg.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<plugin>
|
||||
<id>src_membermanage</id>
|
||||
<name>主数据平台人员集成管理</name>
|
||||
<category>20250310</category>
|
||||
</plugin>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
<bean id="memberManagePluginApi" class="com.seeyon.apps.src_membermanage.MemberManagePluginApi" />
|
||||
</beans>
|
||||
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
<bean id="memberBasicsNode" class="com.seeyon.apps.src_membermanage.node.MemberBasicsNode" />
|
||||
<bean id="memberBasicsOrganizationNode" class="com.seeyon.apps.src_membermanage.node.MemberBasicsOrganizationNode" />
|
||||
<bean id="memberContractNode" class="com.seeyon.apps.src_membermanage.node.MemberContractNode" />
|
||||
<bean id="memberDecruitmentNode" class="com.seeyon.apps.src_membermanage.node.MemberDecruitmentNode" />
|
||||
<bean id="memberDecruitmentOrganizationNode" class="com.seeyon.apps.src_membermanage.node.MemberDecruitmentOrganizationNode" />
|
||||
<bean id="memberDimissionNode" class="com.seeyon.apps.src_membermanage.node.MemberDimissionNode" />
|
||||
<bean id="memberDimissionOrganizationNode" class="com.seeyon.apps.src_membermanage.node.MemberDimissionOrganizationNode" />
|
||||
<bean id="memberDimissionTalentsNode" class="com.seeyon.apps.src_membermanage.node.MemberDimissionTalentsNode" />
|
||||
<bean id="memberEducationNode" class="com.seeyon.apps.src_membermanage.node.MemberEducationNode" />
|
||||
<bean id="memberEmployNode" class="com.seeyon.apps.src_membermanage.node.MemberEmployNode" />
|
||||
<bean id="memberEntryNode" class="com.seeyon.apps.src_membermanage.node.MemberEntryNode" />
|
||||
<bean id="memberEntryTalentsNode" class="com.seeyon.apps.src_membermanage.node.MemberEntryTalentsNode" />
|
||||
<bean id="memberEntryOrganizationNodeode" class="com.seeyon.apps.src_membermanage.node.MemberEntryOrganizationNode" />
|
||||
<bean id="memberFamilyNode" class="com.seeyon.apps.src_membermanage.node.MemberFamilyNode" />
|
||||
<bean id="memberHonorNode" class="com.seeyon.apps.src_membermanage.node.MemberHonorNode" />
|
||||
<bean id="memberMoveNode" class="com.seeyon.apps.src_membermanage.node.MemberMoveNode" />
|
||||
<bean id="memberMoveOrganizationNode" class="com.seeyon.apps.src_membermanage.node.MemberMoveOrganizationNode" />
|
||||
<bean id="memberRegularizationNode" class="com.seeyon.apps.src_membermanage.node.MemberRegularizationNode" />
|
||||
<bean id="memberRegularizationExtendNode" class="com.seeyon.apps.src_membermanage.node.MemberRegularizationExtendNode" />
|
||||
<bean id="memberPerformanceNode" class="com.seeyon.apps.src_membermanage.node.MemberPerformanceNode" />
|
||||
<bean id="memberRewardPunishmentNode" class="com.seeyon.apps.src_membermanage.node.MemberRewardPunishmentNode" />
|
||||
<bean id="membersMoveNode" class="com.seeyon.apps.src_membermanage.node.MembersMoveNode" />
|
||||
<bean id="membersMoveOrganizationNode" class="com.seeyon.apps.src_membermanage.node.MembersMoveOrganizationNode" />
|
||||
<bean id="memberWorkNode" class="com.seeyon.apps.src_membermanage.node.MemberWorkNode" />
|
||||
<bean id="registrationofApplicantsNode" class="com.seeyon.apps.src_membermanage.node.RegistrationofApplicantsNode" />
|
||||
<bean id="trainingRecordNode" class="com.seeyon.apps.src_membermanage.node.TrainingRecordNode" />
|
||||
<bean id="memberTryOutSummarizeNode" class="com.seeyon.apps.src_membermanage.node.MemberTryOutSummarizeNode" />
|
||||
<bean id="memberTaskFinishNode" class="com.seeyon.apps.src_membermanage.node.MemberTaskFinishNode" />
|
||||
<bean id="memberInterviewResultNode" class="com.seeyon.apps.src_membermanage.node.MemberInterviewResultNode" />
|
||||
<bean id="memberAnewEngageNode" class="com.seeyon.apps.src_membermanage.node.MemberAnewEngageNode" />
|
||||
<bean id="memberAnewEngageOrganizationNode" class="com.seeyon.apps.src_membermanage.node.MemberAnewEngageOrganizationNode" />
|
||||
<bean id="memberAccountClosureNode" class="com.seeyon.apps.src_membermanage.node.MemberAccountClosureNode" />
|
||||
<bean id="memberAccountClosureOrganizationNode" class="com.seeyon.apps.src_membermanage.node.MemberAccountClosureOrganizationNode" />
|
||||
<bean id="memberAccountClosureTalentsNode" class="com.seeyon.apps.src_membermanage.node.MemberAccountClosureTalentsNode" />
|
||||
<bean id="memberSystemAccountClosureNode" class="com.seeyon.apps.src_membermanage.node.MemberSystemAccountClosureNode" />
|
||||
<bean id="memberSystemAccountClosureOrganizationNode" class="com.seeyon.apps.src_membermanage.node.MemberSystemAccountClosureOrganizationNode" />
|
||||
<bean id="memberSystemAccountClosureTalentsNode" class="com.seeyon.apps.src_membermanage.node.MemberSystemAccountClosureTalentsNode" />
|
||||
<bean id="accountOpeningNode" class="com.seeyon.apps.src_membermanage.node.AccountOpeningNode" />
|
||||
<bean id="accountOpeningOrganizationNode" class="com.seeyon.apps.src_membermanage.node.AccountOpeningOrganizationNode" />
|
||||
<bean id="memberDieNode" class="com.seeyon.apps.src_membermanage.node.MemberDieNode" />
|
||||
<bean id="memberRetirementNode" class="com.seeyon.apps.src_membermanage.node.MemberRetirementNode" />
|
||||
<bean id="memberRetirementOrganizationNode" class="com.seeyon.apps.src_membermanage.node.MemberRetirementOrganizationNode" />
|
||||
<bean id="memberYearTaskNode" class="com.seeyon.apps.src_membermanage.node.MemberYearTaskNode" />
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<plugin>
|
||||
<id>src_organizationInitialization</id>
|
||||
<name>稻花香人员档案初始化</name>
|
||||
<category>20241126</category>
|
||||
</plugin>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
<bean id="organizationInitializationDao" class="com.seeyon.apps.src_organizationInitialization.dao.impl.OrganizationInitializationDaoImpl" />
|
||||
</beans>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
<bean id="organizationInitializationQuartz" class="com.seeyon.apps.src_organizationInitialization.quartz.OrganizationInitializationQuartz" />
|
||||
</beans>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
<bean id="organizationInitializationPluginApi" class="com.seeyon.apps.src_organizationInitialization.OrganizationInitializationPluginApi" />
|
||||
</beans>
|
||||
6
seeyon/WEB-INF/cfgHome/src_qyba/pluginCfg.xml
Normal file
6
seeyon/WEB-INF/cfgHome/src_qyba/pluginCfg.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<plugin>
|
||||
<id>src_qyba</id>
|
||||
<name>区域备案</name>
|
||||
<category>20240304</category>
|
||||
</plugin>
|
||||
6
seeyon/WEB-INF/cfgHome/src_qyba/spring/spring-dao.xml
Normal file
6
seeyon/WEB-INF/cfgHome/src_qyba/spring/spring-dao.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
<bean id="srcBeianDao" class="com.seeyon.apps.src_qyba.dao.impl.SrcBeianDao" />
|
||||
<bean id="multipleViewsPrintManager" class="com.seeyon.apps.src_qyba.manage.impl.MultipleViewsPrintManagerImpl"></bean>
|
||||
</beans>
|
||||
8
seeyon/WEB-INF/cfgHome/src_qyba/spring/spring-node.xml
Normal file
8
seeyon/WEB-INF/cfgHome/src_qyba/spring/spring-node.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
<bean id="fvNewZhengceNode" class="com.seeyon.apps.src_qyba.node.FVNewZhengceNode" />
|
||||
<bean id="fvOldZhengceNode" class="com.seeyon.apps.src_qyba.node.FVOldZhengceNode" />
|
||||
<bean id="fvNewStateReturnNode" class="com.seeyon.apps.src_qyba.node.FVNewStateReturnNode" />
|
||||
<bean id="fvOldStateReturnNode" class="com.seeyon.apps.src_qyba.node.FVOldStateReturnNode" />
|
||||
</beans>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
<bean id="fvService" class="com.seeyon.apps.src_qyba.service.FVService" />
|
||||
<bean id="fvTongyongService" class="com.seeyon.apps.src_qyba.service.FVTongyongService" />
|
||||
</beans>
|
||||
5
seeyon/WEB-INF/cfgHome/src_qyba/spring/spring.xml
Normal file
5
seeyon/WEB-INF/cfgHome/src_qyba/spring/spring.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
<bean id="qyBAPluginApi" class="com.seeyon.apps.src_qyba.QYBAPluginApi" />
|
||||
</beans>
|
||||
249
seeyon/WEB-INF/jsp/plugin/qrCodeForm/qrCodeFormIndex.jsp
Normal file
249
seeyon/WEB-INF/jsp/plugin/qrCodeForm/qrCodeFormIndex.jsp
Normal file
@@ -0,0 +1,249 @@
|
||||
<%@ page contentType="text/html; charset=UTF-8" isELIgnored="false" %>
|
||||
<%@ page language="java" import=" com.seeyon.apps.m3.skin.enums.M3StartPageCustomEnum" %>
|
||||
<!DOCTYPE html>
|
||||
<html class="h100b">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<%@ include file="/WEB-INF/jsp/common/common.jsp" %>
|
||||
<title>模板二维码生成</title>
|
||||
<style>
|
||||
body {
|
||||
background: #f1f1f1;
|
||||
}
|
||||
|
||||
#center {
|
||||
overflow: hidden;
|
||||
zoom: 1;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#sidebar-l {
|
||||
float: left;
|
||||
width: 250px;
|
||||
margin-top: 20px;
|
||||
height: calc(100% - 40px);
|
||||
overflow: hidden;
|
||||
border: 1px solid #DCDBD9;
|
||||
background: #fff;
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
|
||||
#sidebar-c {
|
||||
float: left;
|
||||
width: 250px;
|
||||
margin-top: 20px;
|
||||
height: calc(100% - 40px);
|
||||
overflow: hidden;
|
||||
border: 1px solid #DCDBD9;
|
||||
background: #fff;
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
#sidebar-r {
|
||||
margin-left: 538px;
|
||||
height: calc(100% - 40px);
|
||||
margin-top: 20px;
|
||||
overflow: auto;
|
||||
border: 1px solid #DCDBD9;
|
||||
background: #fff;
|
||||
}
|
||||
.bizDiv,.formTemDiv{
|
||||
padding-left: 15px;
|
||||
font-size: 16px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
margin-bottom: 0;
|
||||
margin-right: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.formlist_content{
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.formlist_content .current{
|
||||
background-color: #2490f8;
|
||||
}
|
||||
|
||||
|
||||
.formlist_title{
|
||||
font-size: 16px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
margin-bottom: 0;
|
||||
margin-right: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
background: #f1f1f1;
|
||||
padding-left:15px;
|
||||
}
|
||||
.qr_title{
|
||||
font-size: 16px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
background: #f1f1f1;
|
||||
padding-left: 15px;
|
||||
}
|
||||
.qr_content{
|
||||
margin-top: 50px;
|
||||
text-align:center;
|
||||
}
|
||||
.qr_address{
|
||||
width: 80%;
|
||||
padding: 15px;
|
||||
margin-top: 30px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body class="h100b">
|
||||
|
||||
<div id="center">
|
||||
<div id="sidebar-l">
|
||||
<div class="formlist_title">
|
||||
应用包
|
||||
</div>
|
||||
<div class="formlist_content">
|
||||
<c:if test="${fn:length(bizList)>0}">
|
||||
<c:forEach items="${bizList}" var="biz">
|
||||
<div class="bizDiv" bizId="${biz.id}">${ctp:toHTML(biz.name)}</div>
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
</div>
|
||||
</div>
|
||||
<div id="sidebar-c">
|
||||
<div class="formlist_title">
|
||||
应用模板
|
||||
</div>
|
||||
<div class="formlist_content">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div id="sidebar-r">
|
||||
<div id="qrcode">
|
||||
<div class="qr_title">
|
||||
模板二维码
|
||||
</div>
|
||||
<div class="qr_content">
|
||||
|
||||
</div>
|
||||
<div style="text-align: center;">
|
||||
<textarea class="qr_address" readonly></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<script type="text/javascript"
|
||||
src="${staticPath}/main/common/js/jquery.qrcode.min.js${ctp:resSuffix()}"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
$(document).ready(function () {
|
||||
bindEvent();
|
||||
defaultInit();
|
||||
});
|
||||
|
||||
function bindEvent(){
|
||||
//应用包绑定点击事件
|
||||
$('#sidebar-l .bizDiv').bind('click',function(e) {
|
||||
var _dom = $(e.target);
|
||||
var _bizId = _dom[0].getAttribute("bizId");
|
||||
$(".formlist_content .bizDiv").removeClass("current");
|
||||
_dom.addClass("current");
|
||||
if(_bizId){
|
||||
var param = {
|
||||
type : "formApp",
|
||||
bizConfigId : _bizId
|
||||
};
|
||||
callBackendMethod("qrCodeFormManager","listFormApp", param,{
|
||||
success : function(ret){
|
||||
if(ret && ret.length > 0){
|
||||
renderFormAppDom(ret);
|
||||
}
|
||||
},
|
||||
error : function(request, settings, e){
|
||||
$.alert(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function defaultInit(){
|
||||
var defaultDom = $("#sidebar-l .bizDiv");
|
||||
if(defaultDom && defaultDom.size() > 0){
|
||||
$(defaultDom[0]).trigger("click");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function renderFormAppDom(ret){
|
||||
$("#sidebar-c .formlist_content").empty();
|
||||
ret.forEach(function(e){
|
||||
var formTemDom = $("<div class='formTemDiv' onclick='qrCodeFormInfo(this,"+JSON.stringify(e)+")'>"+ e.name +"</div>");
|
||||
$("#sidebar-c .formlist_content").append(formTemDom);
|
||||
});
|
||||
|
||||
$($("#sidebar-c .formTemDiv")[0]).trigger("click");
|
||||
}
|
||||
|
||||
function qrCodeFormInfo(dom , ret){
|
||||
$(".formlist_content .formTemDiv").removeClass("current");
|
||||
$(dom).addClass("current");
|
||||
var _map = {
|
||||
templateId : ret.id,
|
||||
sourceType : ret.sourceType
|
||||
}
|
||||
if(ret.sourceType == 2){
|
||||
_map = {
|
||||
sourceType : ret.sourceType,
|
||||
formType: 'main',
|
||||
type: 'new',
|
||||
title: ret.name,
|
||||
rightId: "-1",
|
||||
moduleId: ret.id,
|
||||
formTemplateId: ret.id,
|
||||
moduleType: '42',
|
||||
operateType: '0'
|
||||
}
|
||||
}
|
||||
callBackendMethod("qrCodeFormManager","qrCodeFormUrl", _map,{
|
||||
success : function(ret){
|
||||
if(ret && ret.fillUrl){
|
||||
renderQrCode(ret.fillUrl);
|
||||
}
|
||||
},
|
||||
error : function(request, settings, e){
|
||||
$.alert(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function renderQrCode(temFormUrl){
|
||||
$("#qrcode .qr_content").empty();
|
||||
$("#qrcode .qr_address").empty();
|
||||
$("#qrcode .qr_content").qrcode({
|
||||
render: "canvas",
|
||||
width:"300",
|
||||
height:"300",
|
||||
text: temFormUrl
|
||||
});
|
||||
$("#qrcode .qr_address").html(temFormUrl);
|
||||
$.each($(".qr_address"),function(i,n){
|
||||
$(n).css("height",n.scrollHeight + 2 + "px");
|
||||
})
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
13
seeyon/common/capextend/cap4/form/utils/qrcodeform/index.js
Normal file
13
seeyon/common/capextend/cap4/form/utils/qrcodeform/index.js
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
csdk.event.on('formRendered', function(){
|
||||
|
||||
try {
|
||||
if(cmp.href.getParam().qc = "ext") {
|
||||
document.getElementById("relationBtns").style.display="none";
|
||||
document.getElementById("attachment_wrap").style.display="none";
|
||||
}
|
||||
} catch(e) {
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
@@ -0,0 +1,11 @@
|
||||
document.addEventListener('cap_form_afterFormRender', function(evt) {
|
||||
try {
|
||||
if(cmp.href.getParam().qc == "ext") {
|
||||
document.getElementById("relationBtns").style.display="none";
|
||||
document.getElementById("attachment_wrap").style.display="none";
|
||||
document.getElementsByClassName("cmp-button-left-iconContent btn-box2")[0].style.display="none";
|
||||
}
|
||||
} catch(e) {
|
||||
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.seeyon.apps.daohuaxiangSys.chushihua;
|
||||
|
||||
import com.seeyon.apps.common.plugin.api.APluginInfoApi;
|
||||
import com.seeyon.apps.common.plugin.vo.ConfigVo;
|
||||
import com.seeyon.apps.daohuaxiangSys.chushihua.constants.HsDataSyncConstants;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 功能描述:<br>
|
||||
* <pre>
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @Author: FanGaowei
|
||||
* @Date: 2023/12/8
|
||||
*/
|
||||
public class HsDataPluginApi extends APluginInfoApi {
|
||||
|
||||
@Override
|
||||
public String getPluginId() {
|
||||
return HsDataSyncConstants.getPluginId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCreateUser() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConfigVo getDefaultConfig() {
|
||||
ConfigVo configVo = new ConfigVo();
|
||||
for (HsDataSyncConstants value : HsDataSyncConstants.values()) {
|
||||
if(value != HsDataSyncConstants.plugin) {
|
||||
configVo.getDevParams().put(value.name(), value.getDefaultValue());
|
||||
configVo.getProdParams().put(value.name(), value.getDefaultValue());
|
||||
configVo.getParamMap().put(value.name(), value.getDescription());
|
||||
}
|
||||
}
|
||||
return configVo;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void registerCustomEvent(Map eventAndNodes) {
|
||||
// 如果每个模板不一样 可以采用templatemanager去读取编码配置
|
||||
eventAndNodes.put("hsdata", "历史数据推送");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.seeyon.apps.daohuaxiangSys.chushihua.constants;
|
||||
|
||||
public enum HsDataSyncConstants {
|
||||
|
||||
// 如果有其他参数 这里去新增 todo
|
||||
plugin("chushihua","插件ID"),
|
||||
temp("hsdata_", "模板前缀"),
|
||||
lastUpdate("2000-01-01 00:00:00", "最后更新时间"),
|
||||
url("", "接口地址");
|
||||
|
||||
HsDataSyncConstants(String defaultValue, String description) {
|
||||
this.defaultValue = defaultValue;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
private String defaultValue;
|
||||
private String description;
|
||||
|
||||
public String getDefaultValue() {
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public static String getPluginId() {
|
||||
return plugin.defaultValue;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,299 @@
|
||||
package com.seeyon.apps.daohuaxiangSys.chushihua.quartz;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.seeyon.apps.common.config.ICstConfigApi;
|
||||
import com.seeyon.apps.common.plugin.vo.ConfigVo;
|
||||
import com.seeyon.apps.common.workflow.util.FormDataBeanUtil;
|
||||
import com.seeyon.apps.daohuaxiangSys.chushihua.constants.HsDataSyncConstants;
|
||||
import com.seeyon.apps.daohuaxiangSys.chushihua.vo.HsDataVo;
|
||||
import com.seeyon.apps.daohuaxiangSys.jkts.util.FanWeiNewUtil;
|
||||
import com.seeyon.apps.daohuaxiangSys.jkts.util.InterfaceListUtil;
|
||||
import com.seeyon.apps.daohuaxiangSys.jkts.util.PropKit;
|
||||
import com.seeyon.apps.ext.quartz.AbstractQuartzTask;
|
||||
import com.seeyon.apps.ext.workflow.manager.CstWorkFlowTemplateManager;
|
||||
import com.seeyon.apps.ext.workflow.vo.FormDataVo;
|
||||
|
||||
import com.seeyon.cap4.form.api.FormApi4Cap4;
|
||||
import com.seeyon.cap4.form.bean.FormBean;
|
||||
import com.seeyon.cap4.form.bean.FormDataMasterBean;
|
||||
import com.seeyon.ctp.common.AppContext;
|
||||
import com.seeyon.ctp.common.SystemEnvironment;
|
||||
import com.seeyon.ctp.common.filemanager.manager.AttachmentManager;
|
||||
import com.seeyon.ctp.common.po.filemanager.Attachment;
|
||||
import com.seeyon.ctp.common.template.manager.TemplateManager;
|
||||
import com.seeyon.ctp.organization.bo.V3xOrgMember;
|
||||
import com.seeyon.ctp.organization.manager.OrgManager;
|
||||
import com.seeyon.ctp.util.JDBCAgent;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.songjian.utils.json.JSONArray;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 功能描述:<br>
|
||||
* <pre>
|
||||
* 定时同步历史数据
|
||||
* </pre>
|
||||
*
|
||||
* @Author: FanGaowei
|
||||
* @Date: 2023/12/8
|
||||
*/
|
||||
public class HsDataSyncQuartz extends AbstractQuartzTask {
|
||||
|
||||
private static final Log log = LogFactory.getLog(HsDataSyncQuartz.class);
|
||||
|
||||
|
||||
@Inject
|
||||
private ICstConfigApi cstConfigApi;
|
||||
@Inject
|
||||
private TemplateManager templateManager;
|
||||
@Inject
|
||||
private FormApi4Cap4 formApi4Cap4;
|
||||
@Inject
|
||||
private CstWorkFlowTemplateManager cstWorkFlowTemplateManager;
|
||||
|
||||
private AttachmentManager attachmentManager;
|
||||
|
||||
public void setAttachmentManager(AttachmentManager attachmentManager) {
|
||||
this.attachmentManager = attachmentManager;
|
||||
}
|
||||
|
||||
public AttachmentManager getAttachmentManagery() {
|
||||
if (attachmentManager == null) {
|
||||
attachmentManager = (AttachmentManager) AppContext.getBean("attachmentManager");
|
||||
}
|
||||
return attachmentManager;
|
||||
}
|
||||
|
||||
private OrgManager orgManager;
|
||||
|
||||
public OrgManager getOrgManager() {
|
||||
if (this.orgManager == null) {
|
||||
this.orgManager = ((OrgManager) AppContext.getBean("orgManager"));
|
||||
}
|
||||
return orgManager;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String taskRun(String tempCode) throws Exception {
|
||||
System.out.println("进入同步方法");
|
||||
final Map<String, Object> regist = FanWeiNewUtil.Regist(PropKit.getProp(PropKit.NEWADDRESS));
|
||||
System.out.println(regist);
|
||||
System.out.println("spk:" + regist.get("spk"));
|
||||
// return null;
|
||||
|
||||
//模板id
|
||||
Object templeteId = null;
|
||||
// 查询满足条件的id
|
||||
String sql = "select id from ctp_template where TEMPLETE_NUMBER = ? ";
|
||||
System.out.println(sql+tempCode);
|
||||
try(JDBCAgent agent = new JDBCAgent(true, false)) {
|
||||
List<Object> params = new ArrayList<>();
|
||||
params.add(tempCode);
|
||||
agent.execute(sql, params);
|
||||
List<Map<String, Object>> list = agent.resultSetToList();
|
||||
System.out.println(list.size());
|
||||
templeteId = list.get(0).get("id");
|
||||
System.out.println(templeteId);
|
||||
} catch (Exception e) {
|
||||
log.error("获取模板id失败:", e);
|
||||
}
|
||||
ceshi(Long.parseLong(templeteId.toString()), tempCode);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 功能描述:<br>
|
||||
* <pre>
|
||||
* 调用第三方接口推送数据
|
||||
* null 表示成功 其他为失败信息
|
||||
* </pre>
|
||||
* @param request
|
||||
* @return: java.lang.String
|
||||
* @Author: FanGaowei
|
||||
* @Date: 2023/12/8
|
||||
**/
|
||||
private String push(String request, ConfigVo configVo) {
|
||||
// todo 获取配置信息 调用接口
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void ceshi(Long tempId, String tempCode) throws IOException {
|
||||
System.out.println("进入ceshi方法");
|
||||
List<Map> datas = new ArrayList();
|
||||
Map<Long, FormBean> formBeanMap = new HashMap<>();
|
||||
|
||||
String dataSql = PropKit.getProp(PropKit.DATASQL);
|
||||
try(JDBCAgent agent = new JDBCAgent(true, false)) {
|
||||
List<Object> params = new ArrayList<>();
|
||||
params.add(tempId);
|
||||
agent.execute(dataSql, params);
|
||||
// 获取到所有的流程数据
|
||||
List<Map<String, Object>> list = agent.resultSetToList();
|
||||
if(null != list) {
|
||||
List<HsDataVo> hsData = list.stream().map(HsDataVo::new).collect(Collectors.toList());
|
||||
for (int i = 0; i < hsData.size(); i++) {
|
||||
Map data = new HashMap();
|
||||
HsDataVo hsDatum = hsData.get(i);
|
||||
FormBean formBean = formBeanMap.get(hsDatum.getFormId());
|
||||
if (null == formBean) {
|
||||
formBean = formApi4Cap4.getForm(hsDatum.getFormId());
|
||||
formBeanMap.put(hsDatum.getFormId(), formBean);
|
||||
}
|
||||
FormDataMasterBean masterBean = formApi4Cap4.getDataMasterBeanById(hsDatum.getMasterId(), formBean, null);
|
||||
// 转换数据
|
||||
FormDataVo formDataVo = FormDataBeanUtil.trans2FormDataVo(HsDataSyncConstants.getPluginId(), hsDatum.getFormId(),
|
||||
hsDatum.getSummaryId(), formBean, masterBean);
|
||||
String name = "";
|
||||
if ("formmain_9291".equals(tempCode)) {
|
||||
name = formDataVo.getFieldData("客户名称文本").getStringValue();
|
||||
} else {
|
||||
String userName = formDataVo.getFieldData("客户名称").getStringValue();
|
||||
System.out.println("userName:" + userName);
|
||||
V3xOrgMember member = getOrgManager().getMemberByLoginName(userName);
|
||||
name = member.getName();
|
||||
}
|
||||
System.out.println("判断名称是否为指定名称"+name);
|
||||
if(!("宜昌高新区盛世禾百货商行".equals(name)||"宜昌市西陵区高东云食品经营部".equals(name)||"宜昌市猇亭区明喜副食店".equals(name)||
|
||||
"湖北省馫昊商贸有限责任公司".equals(name)||"湖北省馫昊商贸有限责任公司".equals(name)||"宜昌梦泽涵商贸有限公司 ".equals(name))){
|
||||
continue;
|
||||
}
|
||||
|
||||
System.out.println("致远客户名称:" + name);
|
||||
Map userIdAndDeptId = getUserIdAndDeptId(name);
|
||||
System.out.println("人员信息:" + userIdAndDeptId.toString());
|
||||
data.put("khmc", userIdAndDeptId.get("userid"));
|
||||
data.put("fgs", userIdAndDeptId.get("deptid"));
|
||||
data.put("bt", formBean.getFormName());
|
||||
data.put("dh", formDataVo.getFieldData("流水号").getStringValue());
|
||||
data.put("sqrq", formDataVo.getFieldData("填表日期").getStringValue());
|
||||
data.put("trje", formDataVo.getFieldData("投入金额").getStringValue());
|
||||
data.put("bayj", formDataVo.getFieldData("备案意见").getStringValue());
|
||||
data.put("bajs", formDataVo.getFieldData("备案简述").getStringValue());
|
||||
data.put("ssschxsgs", formDataVo.getFieldData("分公司").getStringValue());
|
||||
data.put("jbr", formDataVo.getFieldData("经办人").getStringValue());
|
||||
data.put("lcbt", formBean.getFormName());
|
||||
|
||||
String pathId = formDataVo.getFieldData("上传附件").getStringValue();
|
||||
//附件
|
||||
JSONArray faths = null;
|
||||
if (pathId == null || "".equals(pathId)) {
|
||||
faths = new JSONArray();
|
||||
} else {
|
||||
faths = getPathUrl(pathId);
|
||||
}
|
||||
Map parm = FanWeiNewUtil.createWF2(data, faths);
|
||||
//调用新建接口
|
||||
String userId = null;
|
||||
Object userid = userIdAndDeptId.get("userid");
|
||||
if (userid == null || "".equals(userid)) {
|
||||
userId = "";
|
||||
} else {
|
||||
userId = userid.toString();
|
||||
}
|
||||
String s = FanWeiNewUtil.PostRestful(parm, userId);
|
||||
//String s = FanWeiUtil.PostRestful(parm, userId);
|
||||
System.out.println("新建推送结果" + s);
|
||||
JSONObject returnMsg = JSON.parseObject(s);
|
||||
Object code = returnMsg.get("code");
|
||||
if ("SUCCESS".equals(code.toString())) {
|
||||
System.out.println("同步成功!");
|
||||
}else {
|
||||
System.out.println("同步失败!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("同步失败:" + tempId);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取userid和deptid
|
||||
* @param userName
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public Map getUserIdAndDeptId(String userName) throws Exception {
|
||||
// 新平台指定对应关系
|
||||
Map datas = new HashMap();
|
||||
if("宜昌梦泽涵商贸有限公司".equals(userName)){
|
||||
datas.put("userid", "51");
|
||||
datas.put("deptid", "1545");
|
||||
}else if ("伍家岗区源玥酒水商行".equals(userName)){
|
||||
datas.put("userid", "50");
|
||||
datas.put("deptid", "1553");
|
||||
}else if ("湖北省馫昊商贸有限责任公司".equals(userName)){
|
||||
datas.put("userid", "49");
|
||||
datas.put("deptid", "1555");
|
||||
}else if ("宜昌市猇亭区明喜副食店".equals(userName)){
|
||||
datas.put("userid", "48");
|
||||
datas.put("deptid", "1537");
|
||||
}else if ("宜昌市西陵区高东云食品经营部".equals(userName)){
|
||||
datas.put("userid", "47");
|
||||
datas.put("deptid", "1530");
|
||||
}else if ("宜昌高新区盛世禾百货商行".equals(userName)){
|
||||
datas.put("userid", "46");
|
||||
datas.put("deptid", "1529");
|
||||
}
|
||||
// Map datas = new HashMap();
|
||||
// String sql = PropKit.getProp(PropKit.SQL);
|
||||
// try(JDBCAgent agent = new JDBCAgent(true, false)) {
|
||||
// List<Object> params = new ArrayList<>();
|
||||
// params.add(userName);
|
||||
// agent.execute(sql, params);
|
||||
// List<Map<String, Object>> list = agent.resultSetToList();
|
||||
// Map<String, Object> map = list.get(0);
|
||||
// datas.put("userid", map.get("id"));
|
||||
// datas.put("deptid", map.get("departmentid"));
|
||||
// } catch (Exception e) {
|
||||
// log.error("获取模板id失败:", e);
|
||||
// }
|
||||
return datas;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取附件路径
|
||||
* @param pathId
|
||||
* @return
|
||||
*/
|
||||
public JSONArray getPathUrl(String pathId) throws IOException {
|
||||
InterfaceListUtil interfaceListUtil = new InterfaceListUtil();
|
||||
String oatoken = interfaceListUtil.getToken(PropKit.getProp(PropKit.LOGINNAME));
|
||||
long aLong = Long.parseLong(pathId);
|
||||
final List<Long> attachmentIds = attachmentManager.getBySubReference(aLong);
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
for (int i = 0 ; i < attachmentIds.size();i++) {
|
||||
Attachment attachment = attachmentManager.getAttachmentByFileURL(attachmentIds.get(i));
|
||||
Long fileUrl = attachment.getFileUrl();
|
||||
String filename = attachment.getFilename();
|
||||
String fileType = filename.substring(filename.lastIndexOf(".")+1);
|
||||
String oaFileName = filename.substring(0,filename.lastIndexOf("."));
|
||||
//调用接口下载文件,文件存放在指定的路径下
|
||||
String dowUrl = PropKit.getProp(PropKit.DOWURL)+"/"+fileUrl+"?fileName="+fileType+"&token="+oatoken;
|
||||
String str = SystemEnvironment.getApplicationFolder();
|
||||
String dowPath = str+"/dhxfile/"+filename;
|
||||
String download = interfaceListUtil.download(dowUrl, dowPath);
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("name", filename);
|
||||
jsonObject.put("type", fileType);
|
||||
jsonObject.put("url", PropKit.getProp(PropKit.JYNCFILE)+"/"+filename);
|
||||
jsonArray.add(jsonObject);
|
||||
}
|
||||
return jsonArray;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.seeyon.apps.daohuaxiangSys.chushihua.vo;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 功能描述:<br>
|
||||
* <pre>
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @Author: FanGaowei
|
||||
* @Date: 2023/12/8
|
||||
*/
|
||||
public class HsDataVo {
|
||||
|
||||
|
||||
private Long summaryId;
|
||||
private Long formId;
|
||||
private Long masterId;
|
||||
|
||||
public HsDataVo(Map<String, Object> row) {
|
||||
this.summaryId = Convert.toLong(row.get("id"));
|
||||
this.masterId = Convert.toLong(row.get("form_recordid"));
|
||||
this.formId = Convert.toLong(row.get("form_appid"));
|
||||
}
|
||||
|
||||
public Long getSummaryId() {
|
||||
return summaryId;
|
||||
}
|
||||
|
||||
public HsDataVo setSummaryId(Long summaryId) {
|
||||
this.summaryId = summaryId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Long getFormId() {
|
||||
return formId;
|
||||
}
|
||||
|
||||
public HsDataVo setFormId(Long formId) {
|
||||
this.formId = formId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Long getMasterId() {
|
||||
return masterId;
|
||||
}
|
||||
|
||||
public HsDataVo setMasterId(Long masterId) {
|
||||
this.masterId = masterId;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
41
src/com/seeyon/apps/daohuaxiangSys/jkts/TongYongPlugin.java
Normal file
41
src/com/seeyon/apps/daohuaxiangSys/jkts/TongYongPlugin.java
Normal file
@@ -0,0 +1,41 @@
|
||||
package com.seeyon.apps.daohuaxiangSys.jkts;
|
||||
|
||||
import com.seeyon.apps.common.plugin.api.APluginInfoApi;
|
||||
import com.seeyon.apps.common.plugin.vo.ConfigVo;
|
||||
import com.seeyon.apps.daohuaxiangSys.jkts.constants.DaohuaxiangConstants;
|
||||
|
||||
/**
|
||||
* 功能描述:<br>
|
||||
* <pre>
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @Author: FanGaowei
|
||||
* @Date: 2023/10/25
|
||||
*/
|
||||
public class TongYongPlugin extends APluginInfoApi {
|
||||
|
||||
@Override
|
||||
public String getPluginId() {
|
||||
return DaohuaxiangConstants.getPluginId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCreateUser() {
|
||||
return "稻花香";
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConfigVo getDefaultConfig() {
|
||||
ConfigVo configVo = new ConfigVo();
|
||||
for (DaohuaxiangConstants value : DaohuaxiangConstants.values()) {
|
||||
if(value != DaohuaxiangConstants.plugin) {
|
||||
configVo.getDevParams().put(value.name(), value.getDefaultValue());
|
||||
configVo.getProdParams().put(value.name(), value.getDefaultValue());
|
||||
configVo.getParamMap().put(value.name(), value.getDescription());
|
||||
}
|
||||
}
|
||||
return configVo;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.seeyon.apps.daohuaxiangSys.jkts.constants;
|
||||
|
||||
|
||||
public enum DaohuaxiangConstants {
|
||||
|
||||
plugin("daohuaxiang", "插件ID"),
|
||||
url("http://localhost", "接口地址");
|
||||
|
||||
DaohuaxiangConstants(String defaultValue, String description) {
|
||||
this.defaultValue = defaultValue;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
private String defaultValue;
|
||||
private String description;
|
||||
|
||||
public String getDefaultValue() {
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public static String getPluginId() {
|
||||
return plugin.defaultValue;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.seeyon.apps.daohuaxiangSys.jkts.node;
|
||||
|
||||
import com.seeyon.apps.common.config.ICstConfigApi;
|
||||
import com.seeyon.apps.common.workflow.constants.WorkFlowType;
|
||||
import com.seeyon.apps.common.workflow.node.ACommonSuperNode;
|
||||
import com.seeyon.apps.daohuaxiangSys.jkts.constants.DaohuaxiangConstants;
|
||||
import com.seeyon.apps.daohuaxiangSys.jkts.service.NewTongYongService;
|
||||
import com.seeyon.apps.ext.workflow.vo.FormDataVo;
|
||||
import com.seeyon.apps.ext.workflow.vo.SuperNodeContext;
|
||||
import com.seeyon.cap4.form.bean.FormDataMasterBean;
|
||||
import com.seeyon.ctp.common.AppContext;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class NewTongYongNode extends ACommonSuperNode {
|
||||
|
||||
private ICstConfigApi cstConfigApi;
|
||||
|
||||
public ICstConfigApi getICstConfigApi() {
|
||||
if (cstConfigApi == null) {
|
||||
cstConfigApi = (ICstConfigApi) AppContext.getBean("cstConfigApi");
|
||||
}
|
||||
return cstConfigApi;
|
||||
}
|
||||
|
||||
@Autowired
|
||||
NewTongYongService newTongYongService;
|
||||
|
||||
@Override
|
||||
public String getPluginId() {
|
||||
return DaohuaxiangConstants.getPluginId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFormParse() {
|
||||
return "json";
|
||||
}
|
||||
|
||||
@Override
|
||||
public WorkFlowType[] getTypes() {
|
||||
return new WorkFlowType[] { WorkFlowType.superNode };
|
||||
}
|
||||
|
||||
@Override
|
||||
public SuperNodeContext proceed(String request, FormDataVo formDataVo, FormDataMasterBean formDataMasterBean) throws Exception {
|
||||
// 获取数据
|
||||
SuperNodeContext context = new SuperNodeContext();
|
||||
context.setNeedSave(true);
|
||||
Map<String, Object> map = newTongYongService.sendInter(formDataVo);
|
||||
context.setRequest(map.get("request").toString());
|
||||
context.setResponse(map.get("response").toString());
|
||||
Object code = map.get("code");
|
||||
if ("200".equals(code.toString())) {
|
||||
context.success(map.get("msg").toString(), false);
|
||||
} else {
|
||||
context.back(map.get("msg").toString());
|
||||
}
|
||||
return context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeId() {
|
||||
return "newTongYongNode";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeName() {
|
||||
return "新平台通用节点";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.seeyon.apps.daohuaxiangSys.jkts.node;
|
||||
|
||||
import com.seeyon.apps.common.config.ICstConfigApi;
|
||||
import com.seeyon.apps.common.workflow.constants.WorkFlowType;
|
||||
import com.seeyon.apps.common.workflow.node.ACommonSuperNode;
|
||||
import com.seeyon.apps.daohuaxiangSys.jkts.constants.DaohuaxiangConstants;
|
||||
import com.seeyon.apps.daohuaxiangSys.jkts.service.TongYongService;
|
||||
import com.seeyon.apps.ext.workflow.vo.FormDataVo;
|
||||
import com.seeyon.apps.ext.workflow.vo.SuperNodeContext;
|
||||
import com.seeyon.cap4.form.bean.FormDataMasterBean;
|
||||
import com.seeyon.ctp.common.AppContext;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class TongYongNode extends ACommonSuperNode {
|
||||
|
||||
private ICstConfigApi cstConfigApi;
|
||||
|
||||
public ICstConfigApi getICstConfigApi() {
|
||||
if (cstConfigApi == null) {
|
||||
cstConfigApi = (ICstConfigApi) AppContext.getBean("cstConfigApi");
|
||||
}
|
||||
return cstConfigApi;
|
||||
}
|
||||
|
||||
@Autowired
|
||||
TongYongService tongYongService;
|
||||
|
||||
@Override
|
||||
public String getPluginId() {
|
||||
return DaohuaxiangConstants.getPluginId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFormParse() {
|
||||
return "json";
|
||||
}
|
||||
|
||||
@Override
|
||||
public WorkFlowType[] getTypes() {
|
||||
return new WorkFlowType[] { WorkFlowType.superNode };
|
||||
}
|
||||
|
||||
@Override
|
||||
public SuperNodeContext proceed(String request, FormDataVo formDataVo, FormDataMasterBean formDataMasterBean) throws Exception {
|
||||
// 获取数据
|
||||
SuperNodeContext context = new SuperNodeContext();
|
||||
context.setNeedSave(true);
|
||||
Map<String, Object> map = tongYongService.sendInter(formDataVo);
|
||||
context.setRequest(map.get("request").toString());
|
||||
context.setResponse(map.get("response").toString());
|
||||
Object code = map.get("code");
|
||||
if ("200".equals(code.toString())) {
|
||||
context.success(map.get("msg").toString(), false);
|
||||
} else {
|
||||
context.back(map.get("msg").toString());
|
||||
}
|
||||
|
||||
return context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeId() {
|
||||
return "tongYongNode";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeName() {
|
||||
return "通用节点";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
package com.seeyon.apps.daohuaxiangSys.jkts.service;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.seeyon.apps.daohuaxiangSys.jkts.util.FanWeiNewUtil;
|
||||
import com.seeyon.apps.daohuaxiangSys.jkts.util.InterfaceListUtil;
|
||||
import com.seeyon.apps.daohuaxiangSys.jkts.util.PropKit;
|
||||
import com.seeyon.apps.ext.workflow.vo.FormDataVo;
|
||||
import com.seeyon.ctp.common.AppContext;
|
||||
import com.seeyon.ctp.common.SystemEnvironment;
|
||||
import com.seeyon.ctp.common.filemanager.manager.AttachmentManager;
|
||||
import com.seeyon.ctp.common.po.filemanager.Attachment;
|
||||
import org.songjian.utils.json.JSONArray;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class NewTongYongService {
|
||||
|
||||
|
||||
private AttachmentManager attachmentManager;
|
||||
|
||||
public void setAttachmentManager(AttachmentManager attachmentManager) {
|
||||
this.attachmentManager = attachmentManager;
|
||||
}
|
||||
|
||||
public AttachmentManager getAttachmentManagery() {
|
||||
if (attachmentManager == null) {
|
||||
attachmentManager = (AttachmentManager) AppContext.getBean("attachmentManager");
|
||||
}
|
||||
return attachmentManager;
|
||||
}
|
||||
|
||||
public Map<String, Object> sendInter(FormDataVo formDataVo) throws Exception {
|
||||
String pathId = formDataVo.getFieldData("上传附件").getStringValue();
|
||||
//附件
|
||||
JSONArray faths = null;
|
||||
if (pathId == null || "".equals(pathId)) {
|
||||
faths = new JSONArray();
|
||||
} else {
|
||||
faths = getPathUrl(pathId);
|
||||
}
|
||||
//封装参数
|
||||
Map parm = FanWeiNewUtil.createWF(formDataVo, faths);
|
||||
//调用新建接口
|
||||
String userid = formDataVo.getFieldData("经办人").getStringValue();
|
||||
String s = FanWeiNewUtil.PostRestful(parm, userid);
|
||||
JSONObject returnMsg = JSON.parseObject(s);
|
||||
Object code = returnMsg.get("code");
|
||||
System.out.println("新建code:" + code);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
if ("SUCCESS".equals(code.toString())) {
|
||||
//调用提交接口
|
||||
// Map data = (Map) returnMsg.get("data");
|
||||
// Object requestid = data.get("requestid");
|
||||
// String msg = FanWeiUtil.PostRestfulbyForm(requestid.toString(), userid);
|
||||
// JSONObject tiJiaoReturnMsg = JSON.parseObject(msg);
|
||||
// Object code2 = tiJiaoReturnMsg.get("code");
|
||||
// System.out.println("提交code:" + code2);
|
||||
map.put("code", "200");
|
||||
map.put("msg", "推送成功");
|
||||
map.put("request", parm.toString());
|
||||
map.put("response", s);
|
||||
} else {
|
||||
if("-1".equals(code.toString())){
|
||||
map.put("code", "300");
|
||||
map.put("msg", returnMsg.get("msg"));
|
||||
map.put("request", parm.toString());
|
||||
map.put("response", s);
|
||||
}else{
|
||||
map.put("code", "300");
|
||||
map.put("msg", "异常编号:"+code.toString()+",异常数据"+returnMsg.get("errMsg"));
|
||||
map.put("request", parm.toString());
|
||||
map.put("response", s);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取附件路径
|
||||
* @param pathId
|
||||
* @return
|
||||
*/
|
||||
public JSONArray getPathUrl(String pathId) throws IOException {
|
||||
InterfaceListUtil interfaceListUtil = new InterfaceListUtil();
|
||||
String oatoken = interfaceListUtil.getToken(PropKit.getProp(PropKit.LOGINNAME));
|
||||
long aLong = Long.parseLong(pathId);
|
||||
final List<Long> attachmentIds = attachmentManager.getBySubReference(aLong);
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
for (int i = 0 ; i < attachmentIds.size();i++) {
|
||||
Attachment attachment = attachmentManager.getAttachmentByFileURL(attachmentIds.get(i));
|
||||
Long fileUrl = attachment.getFileUrl();
|
||||
String filename = attachment.getFilename();
|
||||
String fileType = filename.substring(filename.lastIndexOf(".")+1);
|
||||
String oaFileName = filename.substring(0,filename.lastIndexOf("."));
|
||||
//调用接口下载文件,文件存放在指定的路径下
|
||||
String dowUrl = PropKit.getProp(PropKit.DOWURL)+"/"+fileUrl+"?fileName="+fileType+"&token="+oatoken;
|
||||
String str = SystemEnvironment.getApplicationFolder();
|
||||
String dowPath = str+"/dhxfile/"+filename;
|
||||
String download = interfaceListUtil.download(dowUrl, dowPath);
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("name", filename);
|
||||
jsonObject.put("type", fileType);
|
||||
jsonObject.put("url", PropKit.getProp(PropKit.JYNCFILE)+"/"+filename);
|
||||
jsonArray.add(jsonObject);
|
||||
}
|
||||
return jsonArray;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package com.seeyon.apps.daohuaxiangSys.jkts.service;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.seeyon.apps.daohuaxiangSys.jkts.util.FanWeiUtil;
|
||||
import com.seeyon.apps.daohuaxiangSys.jkts.util.InterfaceListUtil;
|
||||
import com.seeyon.apps.daohuaxiangSys.jkts.util.PropKit;
|
||||
import com.seeyon.apps.ext.workflow.vo.FormDataVo;
|
||||
import com.seeyon.ctp.common.AppContext;
|
||||
import com.seeyon.ctp.common.SystemEnvironment;
|
||||
import com.seeyon.ctp.common.filemanager.manager.AttachmentManager;
|
||||
import com.seeyon.ctp.common.po.filemanager.Attachment;
|
||||
import org.songjian.utils.json.JSONArray;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class TongYongService {
|
||||
|
||||
|
||||
private AttachmentManager attachmentManager;
|
||||
|
||||
public void setAttachmentManager(AttachmentManager attachmentManager) {
|
||||
this.attachmentManager = attachmentManager;
|
||||
}
|
||||
|
||||
public AttachmentManager getAttachmentManagery() {
|
||||
if (attachmentManager == null) {
|
||||
attachmentManager = (AttachmentManager) AppContext.getBean("attachmentManager");
|
||||
}
|
||||
return attachmentManager;
|
||||
}
|
||||
|
||||
public Map<String, Object> sendInter(FormDataVo formDataVo) throws Exception {
|
||||
String pathId = formDataVo.getFieldData("上传附件").getStringValue();
|
||||
//附件
|
||||
JSONArray faths = null;
|
||||
if (pathId == null || "".equals(pathId)) {
|
||||
faths = new JSONArray();
|
||||
} else {
|
||||
faths = getPathUrl(pathId);
|
||||
}
|
||||
//封装参数
|
||||
Map parm = FanWeiUtil.createWF(formDataVo, faths);
|
||||
//调用新建接口
|
||||
String userid = formDataVo.getFieldData("客户id").getStringValue();
|
||||
String s = FanWeiUtil.PostRestful(parm, userid);
|
||||
JSONObject returnMsg = JSON.parseObject(s);
|
||||
Object code = returnMsg.get("code");
|
||||
System.out.println("新建code:" + code);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
if ("SUCCESS".equals(code.toString())) {
|
||||
//调用提交接口
|
||||
map.put("code", "200");
|
||||
map.put("msg", "推送成功");
|
||||
map.put("request", parm.toString());
|
||||
map.put("response", s);
|
||||
} else {
|
||||
if("-1".equals(code.toString())){
|
||||
map.put("code", "300");
|
||||
map.put("msg", returnMsg.get("msg"));
|
||||
map.put("request", parm.toString());
|
||||
map.put("response", s);
|
||||
}else{
|
||||
map.put("code", "300");
|
||||
map.put("msg", "异常编号:"+code.toString()+",异常数据"+returnMsg.get("errMsg"));
|
||||
map.put("request", parm.toString());
|
||||
map.put("response", s);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取附件路径
|
||||
* @param pathId
|
||||
* @return
|
||||
*/
|
||||
public JSONArray getPathUrl(String pathId) throws IOException {
|
||||
InterfaceListUtil interfaceListUtil = new InterfaceListUtil();
|
||||
String oatoken = interfaceListUtil.getToken(PropKit.getProp(PropKit.LOGINNAME));
|
||||
long aLong = Long.parseLong(pathId);
|
||||
final List<Long> attachmentIds = attachmentManager.getBySubReference(aLong);
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
for (int i = 0 ; i < attachmentIds.size();i++) {
|
||||
Attachment attachment = attachmentManager.getAttachmentByFileURL(attachmentIds.get(i));
|
||||
Long fileUrl = attachment.getFileUrl();
|
||||
String filename = attachment.getFilename();
|
||||
String fileType = filename.substring(filename.lastIndexOf(".")+1);
|
||||
String oaFileName = filename.substring(0,filename.lastIndexOf("."));
|
||||
//调用接口下载文件,文件存放在指定的路径下
|
||||
String dowUrl = PropKit.getProp(PropKit.DOWURL)+"/"+fileUrl+"?fileName="+fileType+"&token="+oatoken;
|
||||
String str = SystemEnvironment.getApplicationFolder();
|
||||
String dowPath = str+"/dhxfile/"+filename;
|
||||
String download = interfaceListUtil.download(dowUrl, dowPath);
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("name", filename);
|
||||
jsonObject.put("type", fileType);
|
||||
jsonObject.put("url", PropKit.getProp(PropKit.JYNCFILE)+"/"+filename);
|
||||
jsonArray.add(jsonObject);
|
||||
}
|
||||
return jsonArray;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.seeyon.apps.daohuaxiangSys.jkts.util;
|
||||
|
||||
import com.seeyon.ctp.common.SystemEnvironment;
|
||||
|
||||
/**
|
||||
* Description
|
||||
* <pre>获取A8产品下面的文件夹路径</pre>
|
||||
* Copyright(c) Beijing Seeyon Software Co.,LTD
|
||||
*/
|
||||
public class A8FolderKit {
|
||||
|
||||
private static String SH_PROP = "";
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* <pre>获取到A8的安装应用目录 seeyon</pre>
|
||||
* @return
|
||||
*/
|
||||
public static String getPropFile() {
|
||||
if("".equals(SH_PROP)) {
|
||||
SH_PROP = SystemEnvironment.getApplicationFolder() + "/WEB-INF/cfgHome/plugin/daohuaxiang/jyncfile.properties";
|
||||
}
|
||||
return SH_PROP;
|
||||
}
|
||||
|
||||
}
|
||||
110
src/com/seeyon/apps/daohuaxiangSys/jkts/util/BaseUtil.java
Normal file
110
src/com/seeyon/apps/daohuaxiangSys/jkts/util/BaseUtil.java
Normal file
@@ -0,0 +1,110 @@
|
||||
package com.seeyon.apps.daohuaxiangSys.jkts.util;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
|
||||
|
||||
/**
|
||||
* sql执行工具类
|
||||
* 2021-06-08
|
||||
* @author huangzhengguo
|
||||
*
|
||||
*/
|
||||
public class BaseUtil {
|
||||
|
||||
|
||||
PreparedStatement ps = null;
|
||||
ResultSet res = null;
|
||||
Connection conn =null;
|
||||
/**
|
||||
* sql查询工具
|
||||
* @param sql sql语句
|
||||
* @param params sql参数
|
||||
* @return 结果集
|
||||
*/
|
||||
public ResultSet executeQuery(String sql, Object[] params)
|
||||
{
|
||||
conn = JdbcUtil.getConnection();
|
||||
try {
|
||||
ps = conn.prepareStatement(sql);
|
||||
for(int i = 0; i < params.length; i++){
|
||||
ps.setObject(i+1, params[i]);
|
||||
}
|
||||
res = ps.executeQuery();
|
||||
} catch (SQLException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
return res;
|
||||
}
|
||||
/**
|
||||
* sql更新工具
|
||||
* @param sql
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
public int executeUpdate(String sql, Object[] params)
|
||||
{
|
||||
int res = 0;
|
||||
conn = JdbcUtil.getConnection();
|
||||
try {
|
||||
ps = conn.prepareStatement(sql);
|
||||
for(int i = 0; i < params.length; i++)
|
||||
{
|
||||
ps.setObject(i+1, params[i]);
|
||||
}
|
||||
res = ps.executeUpdate();
|
||||
} catch (SQLException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
public void close() {
|
||||
release(res,null,conn,ps);
|
||||
}
|
||||
//定义一个释放资源的方法;
|
||||
/*
|
||||
* 定义一个方法: 释放资源: 直接将rs stmt conn 全部释放:
|
||||
*/
|
||||
public static void release(ResultSet rs ,Statement stmt , Connection conn,PreparedStatement ps){
|
||||
if(rs!=null){
|
||||
try {
|
||||
rs.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
rs=null;
|
||||
}
|
||||
if(stmt!=null){
|
||||
try {
|
||||
stmt.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
stmt=null;
|
||||
}
|
||||
if(conn!=null){
|
||||
try {
|
||||
conn.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
conn=null;
|
||||
}
|
||||
if(ps!=null){
|
||||
try {
|
||||
ps.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
ps=null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.seeyon.apps.daohuaxiangSys.jkts.util;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class DBConnection {
|
||||
// JDBC 驱动名及数据库 URL
|
||||
static final String JDBC_DRIVER = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
|
||||
static final String DB_URL = "jdbc:sqlserver://119.96.243.50:1433;databaseName=U8CLOUD";
|
||||
|
||||
// 数据库的用户名与密码,根据自己的情况修改
|
||||
static final String USER = "sa";
|
||||
static final String PASS = "Sa123456";
|
||||
|
||||
public void conn() {
|
||||
Connection conn = null;
|
||||
|
||||
try {
|
||||
// 注册 JDBC 驱动
|
||||
Class.forName(JDBC_DRIVER);
|
||||
|
||||
// 打开链接
|
||||
System.out.println("连接数据库...");
|
||||
conn = DriverManager.getConnection(DB_URL, USER, PASS);
|
||||
|
||||
|
||||
// 关闭链接
|
||||
conn.close();
|
||||
} catch (SQLException se) {
|
||||
// 处理 JDBC 错误
|
||||
se.printStackTrace();
|
||||
} catch (Exception e) {
|
||||
// 处理 Class.forName 错误
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
// 关闭资源
|
||||
try {
|
||||
if (conn != null) {
|
||||
conn.close();
|
||||
}
|
||||
} catch (SQLException se) {
|
||||
se.printStackTrace();
|
||||
}
|
||||
}
|
||||
System.out.println("完成操作");
|
||||
}
|
||||
|
||||
}
|
||||
424
src/com/seeyon/apps/daohuaxiangSys/jkts/util/FanWeiNewUtil.java
Normal file
424
src/com/seeyon/apps/daohuaxiangSys/jkts/util/FanWeiNewUtil.java
Normal file
@@ -0,0 +1,424 @@
|
||||
package com.seeyon.apps.daohuaxiangSys.jkts.util;
|
||||
|
||||
import cn.hutool.core.util.CharsetUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.crypto.asymmetric.KeyType;
|
||||
import cn.hutool.crypto.asymmetric.RSA;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.seeyon.apps.ext.workflow.vo.FormDataVo;
|
||||
import org.songjian.utils.json.JSONArray;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 描述:
|
||||
*
|
||||
* @author alexander
|
||||
* @version 1.0
|
||||
* @date 2023/8/25 09:16 星期五
|
||||
*/
|
||||
public class FanWeiNewUtil {
|
||||
/**
|
||||
* 模拟缓存服务
|
||||
*/
|
||||
private static final Map<String,String> SYSTEM_CACHE = new HashMap<>();
|
||||
|
||||
private static String privateKey = "";
|
||||
private static String publicKey = "";
|
||||
|
||||
/**
|
||||
* ecology系统发放的授权许可证(appid)
|
||||
* ce14aaca-fa08-4eb7-9f10-c2294285c4ea
|
||||
*/
|
||||
private static String APPID = "e47a15d2-95f2-4bf6-a546-8076ce445a19";
|
||||
|
||||
|
||||
/**
|
||||
* 第一步:
|
||||
*
|
||||
* 调用ecology注册接口,根据appid进行注册,将返回服务端公钥和Secret信息
|
||||
*/
|
||||
public static Map<String,Object> Regist(String address) throws IOException {
|
||||
|
||||
//调用ECOLOGY系统接口进行注册
|
||||
String data = HttpRequest.post(address + "/api/ec/dev/auth/regist")
|
||||
.header("appid",PropKit.getProp(PropKit.APPID))
|
||||
.header("cpk","123")
|
||||
.header("loginid",PropKit.getProp(PropKit.LOGINID))
|
||||
.header("pwd",PropKit.getProp(PropKit.PWD))
|
||||
.timeout(2000)
|
||||
.execute().body();
|
||||
|
||||
// 打印ECOLOGY响应信息
|
||||
System.out.println("Regist():"+data);
|
||||
Map<String,Object> datas = JSONUtil.parseObj(data);
|
||||
|
||||
//ECOLOGY返回的系统公钥
|
||||
SYSTEM_CACHE.put("SERVER_PUBLIC_KEY", StrUtil.nullToEmpty((String)datas.get("spk")));
|
||||
//ECOLOGY返回的系统密钥
|
||||
SYSTEM_CACHE.put("SERVER_SECRET",StrUtil.nullToEmpty((String)datas.get("secrit")));
|
||||
return datas;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 第二步:
|
||||
*
|
||||
* 通过第一步中注册系统返回信息进行获取token信息
|
||||
*/
|
||||
public static Map<String,Object> Getoken(String address) throws IOException {
|
||||
// 从系统缓存或者数据库中获取ECOLOGY系统公钥和Secret信息
|
||||
String secret = PropKit.getProp(PropKit.NEWSECRET);
|
||||
String spk = PropKit.getProp(PropKit.NEWSPK);
|
||||
|
||||
|
||||
// 公钥加密,所以RSA对象私钥为null
|
||||
RSA rsa = new RSA(null,spk);
|
||||
//对秘钥进行加密传输,防止篡改数据
|
||||
String encryptSecret = rsa.encryptBase64(secret, CharsetUtil.CHARSET_UTF_8, KeyType.PublicKey);
|
||||
|
||||
//调用ECOLOGY系统接口进行注册
|
||||
String data = HttpRequest.post(address+ "/api/ec/dev/auth/applytoken")
|
||||
.header("appid",PropKit.getProp(PropKit.APPID))
|
||||
.header("secret",encryptSecret)
|
||||
.header("time","3600")
|
||||
.execute().body();
|
||||
|
||||
System.out.println("Getoken():"+data);
|
||||
Map<String,Object> datas = JSONUtil.parseObj(data);
|
||||
|
||||
//ECOLOGY返回的token
|
||||
// TODO 为Token缓存设置过期时间
|
||||
SYSTEM_CACHE.put("SERVER_TOKEN",StrUtil.nullToEmpty((String)datas.get("token")));
|
||||
|
||||
return datas;
|
||||
}
|
||||
|
||||
/**
|
||||
* 第三步:
|
||||
*
|
||||
* 调用ecology系统的rest接口,请求头部带上token和用户标识认证信息
|
||||
*
|
||||
* @param params 请求参数map,创建流程之类的post接口是以模拟form表单提交的方式,其他get接口以json字符串方式提交
|
||||
*
|
||||
* 注意:ECOLOGY系统所有POST接口调用请求头请设置 "Content-Type","application/x-www-form-urlencoded; charset=utf-8"
|
||||
*/
|
||||
public static String PostRestful(Map params, String userid) throws IOException {
|
||||
//ECOLOGY返回的token
|
||||
String token = (String) Getoken(PropKit.getProp(PropKit.NEWADDRESS)).get("token");
|
||||
|
||||
//封装请求头参数
|
||||
RSA rsa = new RSA(null, PropKit.getProp(PropKit.NEWSPK));
|
||||
//对用户信息进行加密传输,暂仅支持传输OA用户ID
|
||||
String encryptUserid = rsa.encryptBase64(userid,CharsetUtil.CHARSET_UTF_8,KeyType.PublicKey);
|
||||
|
||||
//调用ECOLOGY系统接口
|
||||
String data = HttpRequest.post(PropKit.getProp(PropKit.NEWADDRESS) + PropKit.getProp(PropKit.TONGYONGAPI))
|
||||
.header("appid",PropKit.getProp(PropKit.APPID))
|
||||
.header("token",token)
|
||||
.header("userid",encryptUserid)
|
||||
// .header("skipsession", "1")
|
||||
.form(params)
|
||||
.execute().body();
|
||||
// Map headermap = new HashMap();
|
||||
// headermap.put("appid",APPID);
|
||||
// headermap.put("token",token);
|
||||
// headermap.put("userid",encryptUserid);
|
||||
// String data = HttpClientUtil.doPostFORM(address + api,headermap,params);
|
||||
System.out.println("PostRestfulby():"+data);
|
||||
return data;
|
||||
}
|
||||
|
||||
public static String PostRestfulbyForm(String requestId, String userid) throws IOException {
|
||||
|
||||
//ECOLOGY返回的token
|
||||
String token = (String) Getoken(PropKit.getProp(PropKit.NEWADDRESS)).get("token");
|
||||
|
||||
//封装请求头参数
|
||||
RSA rsa = new RSA(null, PropKit.getProp(PropKit.NEWSPK));
|
||||
//对用户信息进行加密传输,暂仅支持传输OA用户ID
|
||||
String encryptUserid = rsa.encryptBase64(userid,CharsetUtil.CHARSET_UTF_8,KeyType.PublicKey);
|
||||
|
||||
Map m = new LinkedHashMap();
|
||||
m.put("requestId", requestId);//流程ID
|
||||
|
||||
//调用ECOLOGY系统接口
|
||||
String data = HttpRequest.post(PropKit.getProp(PropKit.ADDRESS) + "/api/workflow/paService/submitRequest")
|
||||
.header("appid",PropKit.getProp(PropKit.APPID))
|
||||
.header("token",token)
|
||||
.header("userid",encryptUserid)
|
||||
// .header("skipsession", "1")
|
||||
.form(m)
|
||||
.execute().body();
|
||||
// Map headermap = new HashMap();
|
||||
// headermap.put("appid",APPID);
|
||||
// headermap.put("token",token);
|
||||
// headermap.put("userid",encryptUserid);
|
||||
// String data = HttpClientUtil.doPostFORM(address + api,headermap,params);
|
||||
System.out.println("PostRestfulbyForm():"+data);
|
||||
return data;
|
||||
}
|
||||
|
||||
// public static void getSub(){
|
||||
// String returnSTR = PostRestful("http://110.10.2.39","/api/hrm/resful/getHrmUserInfoWithPage",null,"1");
|
||||
// System.out.println(returnSTR);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 消息接口
|
||||
// */
|
||||
// private static void sendMsg(){
|
||||
// PostRestfulbyForm("http://127.0.0.1:8888","/api/ec/dev/message/sendCustomMessageSingle",sendCustomMessageSingle(),"1");
|
||||
// }
|
||||
|
||||
|
||||
/**
|
||||
* 创建流程
|
||||
*/
|
||||
public static Map createWF(FormDataVo formDataVo, JSONArray faths) throws NoSuchFieldException, IOException {
|
||||
|
||||
//主表信息
|
||||
List mainlist = new ArrayList();
|
||||
//客户名称
|
||||
Map mainmap1 = new HashMap();
|
||||
mainmap1.put("fieldName","khmc");//OA字段名-出差类型(下拉框)
|
||||
mainmap1.put("fieldValue",formDataVo.getFieldData("客户id").getStringValue());//字段值(下拉框选项值)
|
||||
mainlist.add(mainmap1);
|
||||
|
||||
//标题
|
||||
Map mainmap2 = new HashMap();
|
||||
mainmap2.put("fieldName","bt");//OA字段名-同行人员(多人力资源浏览框)
|
||||
mainmap2.put("fieldValue",formDataVo.getFieldData("表头").getStringValue());//字段值(OA人员ID,多个以英文逗号分隔)
|
||||
mainlist.add(mainmap2);
|
||||
|
||||
//单号
|
||||
Map mainmap3 = new HashMap();
|
||||
mainmap3.put("fieldName","dh");
|
||||
mainmap3.put("fieldValue",formDataVo.getFieldData("流水号").getStringValue());
|
||||
mainlist.add(mainmap3);
|
||||
|
||||
//申请日期
|
||||
Map mainmap4 = new HashMap();
|
||||
mainmap4.put("fieldName","sqrq");
|
||||
mainmap4.put("fieldValue",formDataVo.getFieldData("填表日期").getStringValue());
|
||||
mainlist.add(mainmap4);
|
||||
|
||||
//投入金额
|
||||
Map mainmap5 = new HashMap();
|
||||
mainmap5.put("fieldName","trje");
|
||||
mainmap5.put("fieldValue",formDataVo.getFieldData("投入金额").getStringValue());
|
||||
mainlist.add(mainmap5);
|
||||
|
||||
//备案意见
|
||||
Map mainmap6 = new HashMap();
|
||||
mainmap6.put("fieldName","bayj");
|
||||
mainmap6.put("fieldValue",formDataVo.getFieldData("备案意见").getStringValue());
|
||||
mainlist.add(mainmap6);
|
||||
|
||||
//备案简述
|
||||
Map mainmap9 = new HashMap();
|
||||
mainmap9.put("fieldName","bajs");
|
||||
mainmap9.put("fieldValue",formDataVo.getFieldData("备案简述").getStringValue());
|
||||
mainlist.add(mainmap9);
|
||||
|
||||
//分公司
|
||||
Map mainmap8 = new HashMap();
|
||||
mainmap8.put("fieldName","ssschxsgs");
|
||||
mainmap8.put("fieldValue",formDataVo.getFieldData("分公司").getStringValue());
|
||||
mainlist.add(mainmap8);
|
||||
|
||||
//经办人
|
||||
Map mainmap10 = new HashMap();
|
||||
mainmap10.put("fieldName","jbr");
|
||||
mainmap10.put("fieldValue",formDataVo.getFieldData("经办人").getStringValue());
|
||||
mainlist.add(mainmap10);
|
||||
|
||||
//备案类型
|
||||
Map mainmap11 = new HashMap();
|
||||
mainmap11.put("fieldName","balx");
|
||||
mainmap11.put("fieldValue","0");
|
||||
mainlist.add(mainmap11);
|
||||
|
||||
//附件
|
||||
if(faths.size() > 0) {
|
||||
Map mainmap7 = new HashMap();
|
||||
mainmap7.put("fieldName","banr");
|
||||
List fujianValue = new ArrayList();
|
||||
for (int i = 0; i < faths.size(); i++) {
|
||||
Map fath = (Map) faths.get(i);
|
||||
Map fujianMap = new HashMap();
|
||||
fujianMap.put("filePath", fath.get("url"));
|
||||
fujianMap.put("fileName", fath.get("name"));
|
||||
fujianValue.add(fujianMap);
|
||||
}
|
||||
|
||||
mainmap7.put("fieldValue",fujianValue);
|
||||
mainlist.add(mainmap7);
|
||||
}
|
||||
|
||||
//接口主参数
|
||||
Map m = new LinkedHashMap();
|
||||
//流程ID
|
||||
m.put("workflowId",PropKit.getProp(PropKit.NEWWORKFLOWID));
|
||||
//流程标题
|
||||
m.put("requestName",formDataVo.getColSummary().getSubject());
|
||||
//主表
|
||||
m.put("mainData",JSONUtil.toJsonStr(mainlist));
|
||||
return m;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建流程
|
||||
*/
|
||||
public static Map createWF2(Map data, JSONArray faths) throws NoSuchFieldException, IOException {
|
||||
|
||||
//主表信息
|
||||
List mainlist = new ArrayList();
|
||||
|
||||
//客户名称
|
||||
Map mainmap1 = new HashMap();
|
||||
mainmap1.put("fieldName","khmc");//OA字段名-出差类型(下拉框)
|
||||
mainmap1.put("fieldValue",data.get("khmc"));//字段值(下拉框选项值)
|
||||
mainlist.add(mainmap1);
|
||||
|
||||
//标题
|
||||
Map mainmap2 = new HashMap();
|
||||
mainmap2.put("fieldName","bt");//OA字段名-同行人员(多人力资源浏览框)
|
||||
mainmap2.put("fieldValue",data.get("bt"));//字段值(OA人员ID,多个以英文逗号分隔)
|
||||
mainlist.add(mainmap2);
|
||||
|
||||
//单号
|
||||
Map mainmap3 = new HashMap();
|
||||
mainmap3.put("fieldName","dh");
|
||||
mainmap3.put("fieldValue",data.get("dh"));
|
||||
mainlist.add(mainmap3);
|
||||
|
||||
//申请日期
|
||||
Map mainmap4 = new HashMap();
|
||||
mainmap4.put("fieldName","sqrq");
|
||||
mainmap4.put("fieldValue",data.get("sqrq"));
|
||||
mainlist.add(mainmap4);
|
||||
|
||||
//投入金额
|
||||
Map mainmap5 = new HashMap();
|
||||
mainmap5.put("fieldName","trje");
|
||||
mainmap5.put("fieldValue",data.get("trje"));
|
||||
mainlist.add(mainmap5);
|
||||
|
||||
//备案意见
|
||||
Map mainmap6 = new HashMap();
|
||||
mainmap6.put("fieldName","bayj");
|
||||
mainmap6.put("fieldValue",data.get("bayj"));
|
||||
mainlist.add(mainmap6);
|
||||
|
||||
//备案简述
|
||||
Map mainmap9 = new HashMap();
|
||||
mainmap9.put("fieldName","bajs");
|
||||
mainmap9.put("fieldValue",data.get("bajs"));
|
||||
mainlist.add(mainmap9);
|
||||
|
||||
//分公司
|
||||
Map mainmap8 = new HashMap();
|
||||
mainmap8.put("fieldName","ssschxsgs");
|
||||
mainmap8.put("fieldValue",data.get("ssschxsgs"));
|
||||
mainlist.add(mainmap8);
|
||||
|
||||
//经办人
|
||||
Map mainmap10 = new HashMap();
|
||||
mainmap10.put("fieldName","jbr");
|
||||
mainmap10.put("fieldValue",data.get("jbr"));
|
||||
mainlist.add(mainmap10);
|
||||
|
||||
|
||||
|
||||
//附件
|
||||
if(faths.size() > 0) {
|
||||
Map mainmap7 = new HashMap();
|
||||
mainmap7.put("fieldName","banr");
|
||||
List fujianValue = new ArrayList();
|
||||
for (int i = 0; i < faths.size(); i++) {
|
||||
Map fath = (Map) faths.get(i);
|
||||
Map fujianMap = new HashMap();
|
||||
fujianMap.put("filePath", fath.get("url"));
|
||||
fujianMap.put("fileName", fath.get("name"));
|
||||
fujianValue.add(fujianMap);
|
||||
}
|
||||
|
||||
mainmap7.put("fieldValue",fujianValue);
|
||||
mainlist.add(mainmap7);
|
||||
}
|
||||
|
||||
//接口主参数
|
||||
Map m = new LinkedHashMap();
|
||||
//流程ID
|
||||
m.put("workflowId",PropKit.getProp(PropKit.NEWWORKFLOWID));
|
||||
//流程标题
|
||||
m.put("requestName",data.get("lcbt"));
|
||||
//主表
|
||||
m.put("mainData",JSONUtil.toJsonStr(mainlist));
|
||||
|
||||
System.out.println("m:"+m);
|
||||
return m;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送消息,参数封装
|
||||
* @return
|
||||
*/
|
||||
public static Map<String,String> sendCustomMessageSingle() {
|
||||
|
||||
Map<String, String> map = new HashMap<>();
|
||||
|
||||
// map.put("code", "1149"); // 消息来源,新建消息来源获取code 请查看文档第四大点补充
|
||||
map.put("code", "1207"); // 消息来源,新建消息来源获取code 请查看文档第四大点补充
|
||||
map.put("userIdList", "1"); // userIdList参数 userIdList 接收人OA系统id / loginIdList 接收人登录名 / workCodeList 接收人编号 / lastNameList 接收人姓名(任选一个填入即可,以逗号分隔)
|
||||
// map.put("loginIdList","zhangsan,wangwu" ); //接收人登录名
|
||||
// map.put("workCodeList","WS01640,WS01641" ); //接收人编号
|
||||
// map.put("lastNameList","张三,王五" ); //接收人姓名
|
||||
map.put("creater", "1"); //creater的值 创建人OA系统id / 创建人登录名 / 创建人编号 / 创建人姓名(对应接收人所传入的形式)
|
||||
// map.put("creater","zhangsan");
|
||||
// map.put("creater","WS01640");
|
||||
// map.put("creater","张三");
|
||||
map.put("title", "接口创建的消息");
|
||||
map.put("context", "接口创建的消息,看下内容是否进来了");
|
||||
String linkUrl = "http://118.190.132.210:9999/custom_renfu.html?param=corp=ding58007d3a66cc643bacaaa37764f94726--flag=study_project" +
|
||||
"--projectId=1826492840843284480--ticket=2u+cX2Bl4KPQ89QwNOG0VC/YmAv" +
|
||||
"/Sa5pu92FXTgUfGDZlhmqdVyNLtJVcZv3Pe7teWbqGAJhufN8Y4tpIW6c1Q==";
|
||||
map.put("linkUrl", linkUrl);
|
||||
map.put("linkMobileUrl", "http://www.baidu.com");
|
||||
|
||||
// map.put("targetId","559|id22"); //消息来源code +“|”+业务id 消息需要打上已处理标记
|
||||
// map.put("bizState","0"); //0 表示消息初始状态是待处理 消息需要打上已处理标记
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
public static String getAPPID() {
|
||||
return APPID;
|
||||
}
|
||||
|
||||
public static void setAPPID(String APPID) {
|
||||
FanWeiNewUtil.APPID = APPID;
|
||||
}
|
||||
|
||||
public static String getPrivateKey() {
|
||||
return privateKey;
|
||||
}
|
||||
|
||||
public static void setPrivateKey(String privateKey) {
|
||||
FanWeiNewUtil.privateKey = privateKey;
|
||||
}
|
||||
|
||||
public static String getPublicKey() {
|
||||
return publicKey;
|
||||
}
|
||||
|
||||
public static void setPublicKey(String publicKey) {
|
||||
FanWeiNewUtil.publicKey = publicKey;
|
||||
}
|
||||
}
|
||||
415
src/com/seeyon/apps/daohuaxiangSys/jkts/util/FanWeiUtil.java
Normal file
415
src/com/seeyon/apps/daohuaxiangSys/jkts/util/FanWeiUtil.java
Normal file
@@ -0,0 +1,415 @@
|
||||
package com.seeyon.apps.daohuaxiangSys.jkts.util;
|
||||
|
||||
import cn.hutool.core.util.CharsetUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.crypto.asymmetric.KeyType;
|
||||
import cn.hutool.crypto.asymmetric.RSA;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.seeyon.apps.ext.workflow.vo.FormDataVo;
|
||||
import org.songjian.utils.json.JSONArray;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 描述:
|
||||
*
|
||||
* @author alexander
|
||||
* @version 1.0
|
||||
* @date 2023/8/25 09:16 星期五
|
||||
*/
|
||||
public class FanWeiUtil {
|
||||
/**
|
||||
* 模拟缓存服务
|
||||
*/
|
||||
private static final Map<String,String> SYSTEM_CACHE = new HashMap<>();
|
||||
|
||||
private static String privateKey = "";
|
||||
private static String publicKey = "";
|
||||
|
||||
/**
|
||||
* ecology系统发放的授权许可证(appid)
|
||||
* ce14aaca-fa08-4eb7-9f10-c2294285c4ea
|
||||
*/
|
||||
private static String APPID = "e47a15d2-95f2-4bf6-a546-8076ce445a19";
|
||||
|
||||
|
||||
/**
|
||||
* 第一步:
|
||||
*
|
||||
* 调用ecology注册接口,根据appid进行注册,将返回服务端公钥和Secret信息
|
||||
*/
|
||||
public static Map<String,Object> Regist(String address){
|
||||
|
||||
//获取当前系统RSA加密的公钥
|
||||
RSA rsa = new RSA();
|
||||
if(publicKey.equals("")) {
|
||||
publicKey = rsa.getPublicKeyBase64();
|
||||
}
|
||||
if(privateKey.equals("")) {
|
||||
privateKey = rsa.getPrivateKeyBase64();
|
||||
}
|
||||
|
||||
System.out.println("publicKey:"+publicKey+" privateKey:"+privateKey);
|
||||
// 客户端RSA私钥
|
||||
SYSTEM_CACHE.put("LOCAL_PRIVATE_KEY",privateKey);
|
||||
// 客户端RSA公钥
|
||||
SYSTEM_CACHE.put("LOCAL_PUBLIC_KEY",publicKey);
|
||||
|
||||
//调用ECOLOGY系统接口进行注册
|
||||
String data = HttpRequest.post(address + "/api/ec/dev/auth/regist")
|
||||
.header("appid",APPID)
|
||||
.header("cpk",publicKey)
|
||||
.timeout(2000)
|
||||
.execute().body();
|
||||
|
||||
// 打印ECOLOGY响应信息
|
||||
System.out.println("Regist():"+data);
|
||||
Map<String,Object> datas = JSONUtil.parseObj(data);
|
||||
|
||||
//ECOLOGY返回的系统公钥
|
||||
SYSTEM_CACHE.put("SERVER_PUBLIC_KEY", StrUtil.nullToEmpty((String)datas.get("spk")));
|
||||
//ECOLOGY返回的系统密钥
|
||||
SYSTEM_CACHE.put("SERVER_SECRET",StrUtil.nullToEmpty((String)datas.get("secrit")));
|
||||
return datas;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 第二步:
|
||||
*
|
||||
* 通过第一步中注册系统返回信息进行获取token信息
|
||||
*/
|
||||
public static Map<String,Object> Getoken(String address) throws IOException {
|
||||
// 从系统缓存或者数据库中获取ECOLOGY系统公钥和Secret信息
|
||||
String secret = PropKit.getProp(PropKit.SECRET);
|
||||
String spk = PropKit.getProp(PropKit.SPK);
|
||||
|
||||
|
||||
// 公钥加密,所以RSA对象私钥为null
|
||||
RSA rsa = new RSA(null,spk);
|
||||
//对秘钥进行加密传输,防止篡改数据
|
||||
String encryptSecret = rsa.encryptBase64(secret, CharsetUtil.CHARSET_UTF_8, KeyType.PublicKey);
|
||||
|
||||
//调用ECOLOGY系统接口进行注册
|
||||
String data = HttpRequest.post(address+ "/api/ec/dev/auth/applytoken")
|
||||
.header("appid",PropKit.getProp(PropKit.APPID))
|
||||
.header("secret",encryptSecret)
|
||||
.header("time","3600")
|
||||
.execute().body();
|
||||
|
||||
System.out.println("Getoken():"+data);
|
||||
Map<String,Object> datas = JSONUtil.parseObj(data);
|
||||
|
||||
//ECOLOGY返回的token
|
||||
// TODO 为Token缓存设置过期时间
|
||||
SYSTEM_CACHE.put("SERVER_TOKEN",StrUtil.nullToEmpty((String)datas.get("token")));
|
||||
|
||||
return datas;
|
||||
}
|
||||
|
||||
/**
|
||||
* 第三步:
|
||||
*
|
||||
* 调用ecology系统的rest接口,请求头部带上token和用户标识认证信息
|
||||
*
|
||||
* @param params 请求参数map,创建流程之类的post接口是以模拟form表单提交的方式,其他get接口以json字符串方式提交
|
||||
*
|
||||
* 注意:ECOLOGY系统所有POST接口调用请求头请设置 "Content-Type","application/x-www-form-urlencoded; charset=utf-8"
|
||||
*/
|
||||
public static String PostRestful(Map params, String userid) throws IOException {
|
||||
|
||||
//ECOLOGY返回的token
|
||||
String token = (String) Getoken(PropKit.getProp(PropKit.ADDRESS)).get("token");
|
||||
|
||||
|
||||
//封装请求头参数
|
||||
RSA rsa = new RSA(null, PropKit.getProp(PropKit.SPK));
|
||||
//对用户信息进行加密传输,暂仅支持传输OA用户ID
|
||||
String encryptUserid = rsa.encryptBase64(userid,CharsetUtil.CHARSET_UTF_8,KeyType.PublicKey);
|
||||
|
||||
//调用ECOLOGY系统接口
|
||||
String data = HttpRequest.post(PropKit.getProp(PropKit.ADDRESS) + PropKit.getProp(PropKit.TONGYONGAPI))
|
||||
.header("appid",PropKit.getProp(PropKit.APPID))
|
||||
.header("token",token)
|
||||
.header("userid",encryptUserid)
|
||||
// .header("skipsession", "1")
|
||||
.form(params)
|
||||
.execute().body();
|
||||
// Map headermap = new HashMap();
|
||||
// headermap.put("appid",APPID);
|
||||
// headermap.put("token",token);
|
||||
// headermap.put("userid",encryptUserid);
|
||||
// String data = HttpClientUtil.doPostFORM(address + api,headermap,params);
|
||||
System.out.println("PostRestfulby():"+data);
|
||||
return data;
|
||||
}
|
||||
public static String PostRestfulbyForm(String requestId, String userid) throws IOException {
|
||||
|
||||
//ECOLOGY返回的token
|
||||
String token = (String) Getoken(PropKit.getProp(PropKit.ADDRESS)).get("token");
|
||||
|
||||
//封装请求头参数
|
||||
RSA rsa = new RSA(null, PropKit.getProp(PropKit.SPK));
|
||||
//对用户信息进行加密传输,暂仅支持传输OA用户ID
|
||||
String encryptUserid = rsa.encryptBase64(userid,CharsetUtil.CHARSET_UTF_8,KeyType.PublicKey);
|
||||
|
||||
Map m = new LinkedHashMap();
|
||||
m.put("requestId", requestId);//流程ID
|
||||
|
||||
//调用ECOLOGY系统接口
|
||||
String data = HttpRequest.post(PropKit.getProp(PropKit.ADDRESS) + "/api/workflow/paService/submitRequest")
|
||||
.header("appid",PropKit.getProp(PropKit.APPID))
|
||||
.header("token",token)
|
||||
.header("userid",encryptUserid)
|
||||
// .header("skipsession", "1")
|
||||
.form(m)
|
||||
.execute().body();
|
||||
// Map headermap = new HashMap();
|
||||
// headermap.put("appid",APPID);
|
||||
// headermap.put("token",token);
|
||||
// headermap.put("userid",encryptUserid);
|
||||
// String data = HttpClientUtil.doPostFORM(address + api,headermap,params);
|
||||
System.out.println("PostRestfulbyForm():"+data);
|
||||
return data;
|
||||
}
|
||||
|
||||
// public static void getSub(){
|
||||
// String returnSTR = PostRestful("http://110.10.2.39","/api/hrm/resful/getHrmUserInfoWithPage",null,"1");
|
||||
// System.out.println(returnSTR);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 消息接口
|
||||
// */
|
||||
// private static void sendMsg(){
|
||||
// PostRestfulbyForm("http://127.0.0.1:8888","/api/ec/dev/message/sendCustomMessageSingle",sendCustomMessageSingle(),"1");
|
||||
// }
|
||||
|
||||
/**
|
||||
* 创建流程
|
||||
*/
|
||||
public static Map createWF(FormDataVo formDataVo, JSONArray faths) throws NoSuchFieldException, IOException {
|
||||
|
||||
//主表信息
|
||||
List mainlist = new ArrayList();
|
||||
//客户名称
|
||||
Map mainmap1 = new HashMap();
|
||||
mainmap1.put("fieldName","khmc");//OA字段名-出差类型(下拉框)
|
||||
mainmap1.put("fieldValue",formDataVo.getFieldData("客户id").getStringValue());//字段值(下拉框选项值)
|
||||
mainlist.add(mainmap1);
|
||||
|
||||
//标题
|
||||
Map mainmap2 = new HashMap();
|
||||
mainmap2.put("fieldName","bt");//OA字段名-同行人员(多人力资源浏览框)
|
||||
mainmap2.put("fieldValue",formDataVo.getFieldData("表头").getStringValue());//字段值(OA人员ID,多个以英文逗号分隔)
|
||||
mainlist.add(mainmap2);
|
||||
|
||||
//单号
|
||||
Map mainmap3 = new HashMap();
|
||||
mainmap3.put("fieldName","dh");
|
||||
mainmap3.put("fieldValue",formDataVo.getFieldData("流水号").getStringValue());
|
||||
mainlist.add(mainmap3);
|
||||
|
||||
//申请日期
|
||||
Map mainmap4 = new HashMap();
|
||||
mainmap4.put("fieldName","sqrq");
|
||||
mainmap4.put("fieldValue",formDataVo.getFieldData("填表日期").getStringValue());
|
||||
mainlist.add(mainmap4);
|
||||
|
||||
//投入金额
|
||||
Map mainmap5 = new HashMap();
|
||||
mainmap5.put("fieldName","trje");
|
||||
mainmap5.put("fieldValue",formDataVo.getFieldData("投入金额").getStringValue());
|
||||
mainlist.add(mainmap5);
|
||||
|
||||
//备案意见
|
||||
Map mainmap6 = new HashMap();
|
||||
mainmap6.put("fieldName","bayj");
|
||||
mainmap6.put("fieldValue",formDataVo.getFieldData("备案意见").getStringValue());
|
||||
mainlist.add(mainmap6);
|
||||
|
||||
//分公司
|
||||
Map mainmap8 = new HashMap();
|
||||
mainmap8.put("fieldName","fgs");
|
||||
mainmap8.put("fieldValue",formDataVo.getFieldData("分公司").getStringValue());
|
||||
mainlist.add(mainmap8);
|
||||
|
||||
//备案简述
|
||||
Map mainmap11 = new HashMap();
|
||||
mainmap11.put("fieldName","bajs");
|
||||
mainmap11.put("fieldValue",formDataVo.getFieldData("备案简述").getStringValue());
|
||||
mainlist.add(mainmap11);
|
||||
|
||||
//备案类型
|
||||
Map mainmap12 = new HashMap();
|
||||
mainmap12.put("fieldName","balx");
|
||||
mainmap12.put("fieldValue","0");
|
||||
mainlist.add(mainmap12);
|
||||
|
||||
//附件
|
||||
if(faths.size() > 0) {
|
||||
Map mainmap7 = new HashMap();
|
||||
mainmap7.put("fieldName","banr");
|
||||
List fujianValue = new ArrayList();
|
||||
for (int i = 0; i < faths.size(); i++) {
|
||||
Map fath = (Map) faths.get(i);
|
||||
Map fujianMap = new HashMap();
|
||||
fujianMap.put("filePath", fath.get("url"));
|
||||
fujianMap.put("fileName", fath.get("name"));
|
||||
fujianValue.add(fujianMap);
|
||||
}
|
||||
|
||||
mainmap7.put("fieldValue",fujianValue);
|
||||
mainlist.add(mainmap7);
|
||||
}
|
||||
|
||||
//接口主参数
|
||||
Map m = new LinkedHashMap();
|
||||
//流程ID
|
||||
m.put("workflowId",PropKit.getProp(PropKit.WORKFLOWID));
|
||||
//流程标题
|
||||
m.put("requestName",formDataVo.getColSummary().getSubject());
|
||||
//主表
|
||||
m.put("mainData",JSONUtil.toJsonStr(mainlist));
|
||||
return m;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 创建流程
|
||||
*/
|
||||
public static Map createWF2(Map data, JSONArray faths) throws NoSuchFieldException, IOException {
|
||||
|
||||
//主表信息
|
||||
List mainlist = new ArrayList();
|
||||
//客户名称
|
||||
Map mainmap1 = new HashMap();
|
||||
mainmap1.put("fieldName","khmc");//OA字段名-出差类型(下拉框)
|
||||
mainmap1.put("fieldValue",data.get("khmc"));//字段值(下拉框选项值)
|
||||
mainlist.add(mainmap1);
|
||||
|
||||
//标题
|
||||
Map mainmap2 = new HashMap();
|
||||
mainmap2.put("fieldName","bt");//OA字段名-同行人员(多人力资源浏览框)
|
||||
mainmap2.put("fieldValue",data.get("bt"));//字段值(OA人员ID,多个以英文逗号分隔)
|
||||
mainlist.add(mainmap2);
|
||||
|
||||
//单号
|
||||
Map mainmap3 = new HashMap();
|
||||
mainmap3.put("fieldName","dh");
|
||||
mainmap3.put("fieldValue",data.get("dh"));
|
||||
mainlist.add(mainmap3);
|
||||
|
||||
//申请日期
|
||||
Map mainmap4 = new HashMap();
|
||||
mainmap4.put("fieldName","sqrq");
|
||||
mainmap4.put("fieldValue",data.get("sqrq"));
|
||||
mainlist.add(mainmap4);
|
||||
|
||||
//投入金额
|
||||
Map mainmap5 = new HashMap();
|
||||
mainmap5.put("fieldName","trje");
|
||||
mainmap5.put("fieldValue",data.get("trje"));
|
||||
mainlist.add(mainmap5);
|
||||
|
||||
//备案意见
|
||||
Map mainmap6 = new HashMap();
|
||||
mainmap6.put("fieldName","bayj");
|
||||
mainmap6.put("fieldValue",data.get("bayj"));
|
||||
mainlist.add(mainmap6);
|
||||
|
||||
//分公司
|
||||
Map mainmap8 = new HashMap();
|
||||
mainmap8.put("fieldName","fgs");
|
||||
mainmap8.put("fieldValue",data.get("fgs"));
|
||||
mainlist.add(mainmap8);
|
||||
|
||||
//附件
|
||||
if(faths.size() > 0) {
|
||||
Map mainmap7 = new HashMap();
|
||||
mainmap7.put("fieldName","banr");
|
||||
List fujianValue = new ArrayList();
|
||||
for (int i = 0; i < faths.size(); i++) {
|
||||
Map fath = (Map) faths.get(i);
|
||||
Map fujianMap = new HashMap();
|
||||
fujianMap.put("filePath", fath.get("url"));
|
||||
fujianMap.put("fileName", fath.get("name"));
|
||||
fujianValue.add(fujianMap);
|
||||
}
|
||||
|
||||
mainmap7.put("fieldValue",fujianValue);
|
||||
mainlist.add(mainmap7);
|
||||
}
|
||||
|
||||
//接口主参数
|
||||
Map m = new LinkedHashMap();
|
||||
//流程ID
|
||||
m.put("workflowId",PropKit.getProp(PropKit.WORKFLOWID));
|
||||
//流程标题
|
||||
m.put("requestName",data.get("lcbt"));
|
||||
//主表
|
||||
m.put("mainData",JSONUtil.toJsonStr(mainlist));
|
||||
return m;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送消息,参数封装
|
||||
* @return
|
||||
*/
|
||||
public static Map<String,String> sendCustomMessageSingle() {
|
||||
|
||||
Map<String, String> map = new HashMap<>();
|
||||
|
||||
// map.put("code", "1149"); // 消息来源,新建消息来源获取code 请查看文档第四大点补充
|
||||
map.put("code", "1207"); // 消息来源,新建消息来源获取code 请查看文档第四大点补充
|
||||
map.put("userIdList", "1"); // userIdList参数 userIdList 接收人OA系统id / loginIdList 接收人登录名 / workCodeList 接收人编号 / lastNameList 接收人姓名(任选一个填入即可,以逗号分隔)
|
||||
// map.put("loginIdList","zhangsan,wangwu" ); //接收人登录名
|
||||
// map.put("workCodeList","WS01640,WS01641" ); //接收人编号
|
||||
// map.put("lastNameList","张三,王五" ); //接收人姓名
|
||||
map.put("creater", "1"); //creater的值 创建人OA系统id / 创建人登录名 / 创建人编号 / 创建人姓名(对应接收人所传入的形式)
|
||||
// map.put("creater","zhangsan");
|
||||
// map.put("creater","WS01640");
|
||||
// map.put("creater","张三");
|
||||
map.put("title", "接口创建的消息");
|
||||
map.put("context", "接口创建的消息,看下内容是否进来了");
|
||||
String linkUrl = "http://118.190.132.210:9999/custom_renfu.html?param=corp=ding58007d3a66cc643bacaaa37764f94726--flag=study_project" +
|
||||
"--projectId=1826492840843284480--ticket=2u+cX2Bl4KPQ89QwNOG0VC/YmAv" +
|
||||
"/Sa5pu92FXTgUfGDZlhmqdVyNLtJVcZv3Pe7teWbqGAJhufN8Y4tpIW6c1Q==";
|
||||
map.put("linkUrl", linkUrl);
|
||||
map.put("linkMobileUrl", "http://www.baidu.com");
|
||||
|
||||
// map.put("targetId","559|id22"); //消息来源code +“|”+业务id 消息需要打上已处理标记
|
||||
// map.put("bizState","0"); //0 表示消息初始状态是待处理 消息需要打上已处理标记
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
public static String getAPPID() {
|
||||
return APPID;
|
||||
}
|
||||
|
||||
public static void setAPPID(String APPID) {
|
||||
FanWeiUtil.APPID = APPID;
|
||||
}
|
||||
|
||||
public static String getPrivateKey() {
|
||||
return privateKey;
|
||||
}
|
||||
|
||||
public static void setPrivateKey(String privateKey) {
|
||||
FanWeiUtil.privateKey = privateKey;
|
||||
}
|
||||
|
||||
public static String getPublicKey() {
|
||||
return publicKey;
|
||||
}
|
||||
|
||||
public static void setPublicKey(String publicKey) {
|
||||
FanWeiUtil.publicKey = publicKey;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,346 @@
|
||||
package com.seeyon.apps.daohuaxiangSys.jkts.util;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.text.MessageFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.apache.commons.httpclient.Header;
|
||||
import org.apache.commons.httpclient.HttpClient;
|
||||
import org.apache.commons.httpclient.HttpException;
|
||||
import org.apache.commons.httpclient.HttpStatus;
|
||||
import org.apache.commons.httpclient.methods.PostMethod;
|
||||
import org.apache.commons.httpclient.methods.RequestEntity;
|
||||
import org.apache.commons.httpclient.methods.StringRequestEntity;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.impl.client.DefaultHttpClient;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.springframework.core.io.support.PropertiesLoaderUtils;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
/**
|
||||
* 接口调用工具类
|
||||
* 2021-06-08
|
||||
* @author huangzhengguo
|
||||
*
|
||||
*/
|
||||
public class InterfaceListUtil {
|
||||
|
||||
/**
|
||||
* 获取一个token
|
||||
*
|
||||
|
||||
* @return
|
||||
* @throws IOException
|
||||
* @throws FileNotFoundException
|
||||
*/
|
||||
public String getToken(String loginName) throws FileNotFoundException, IOException {
|
||||
String address = "";
|
||||
String token = "";
|
||||
if("".equals(loginName)) {
|
||||
address = PropKit.getProp(PropKit.OATOKENURL)+"/"+PropKit.getProp(PropKit.RESTNAME)+"/"+PropKit.getProp(PropKit.RESTPASSWORD);
|
||||
}else {
|
||||
address = PropKit.getProp(PropKit.OATOKENURL)+"/"+PropKit.getProp(PropKit.RESTNAME)+"/"+PropKit.getProp(PropKit.RESTPASSWORD)+"?loginName="+loginName;
|
||||
}
|
||||
HttpURLConnection connection = (HttpURLConnection) new URL(address).openConnection();
|
||||
connection.setRequestMethod("GET");
|
||||
int responseCode = connection.getResponseCode();
|
||||
if (responseCode == HttpURLConnection.HTTP_OK) {
|
||||
BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
|
||||
String inputLine;
|
||||
StringBuffer response = new StringBuffer();
|
||||
while ((inputLine = in.readLine()) != null) {
|
||||
response.append(inputLine);
|
||||
}
|
||||
in.close();
|
||||
String result = response.toString();
|
||||
if(result.contains("{")) {
|
||||
JSONObject jsObj = JSONObject.parseObject(result);
|
||||
System.out.println(jsObj);
|
||||
token = jsObj.get("id").toString();
|
||||
}else {
|
||||
token = result;
|
||||
}
|
||||
System.out.println(token);
|
||||
} else {
|
||||
System.out.println("GET request not worked");
|
||||
}
|
||||
return token;
|
||||
}
|
||||
|
||||
/**
|
||||
* 调用get接口
|
||||
*
|
||||
* @param par 拼接在url中的参数
|
||||
* @param strUrl 需要调用的url对应的配置文件的key
|
||||
* @return
|
||||
*/
|
||||
public String doGet(String par, String strUrl, String token) {
|
||||
String address = MessageFormat.format(getProperties(strUrl), par + "?token=") + token;
|
||||
|
||||
DefaultHttpClient client = new DefaultHttpClient();
|
||||
String result = "";
|
||||
HttpGet get = new HttpGet(address);
|
||||
try {
|
||||
HttpResponse res = client.execute(get);
|
||||
if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
|
||||
result = EntityUtils.toString(res.getEntity());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
// JSONObject jsObj = JSONObject.parseObject(result);
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 调用post接口
|
||||
*
|
||||
* @param str 调用接口传递的参数json
|
||||
* @param urlStr 需要调用的url对应的参数文件中的编码
|
||||
* @return
|
||||
*/
|
||||
public JSONObject doPost(String str, String urlStr,String token) {
|
||||
HttpURLConnection connection = null;
|
||||
InputStream is = null;
|
||||
OutputStream os = null;
|
||||
BufferedReader br = null;
|
||||
String result = null;
|
||||
try {
|
||||
// String token = getToken(getProperties("restUserName"), getProperties("restPassword"));
|
||||
URL url = new URL(getProperties(urlStr) + "?token=" + token);
|
||||
// 通过远程url连接对象打开连接
|
||||
connection = (HttpURLConnection) url.openConnection();
|
||||
// 设置连接请求方式
|
||||
connection.setRequestMethod("POST");
|
||||
// 设置连接主机服务器超时时间:15000毫秒
|
||||
connection.setConnectTimeout(15000);
|
||||
// 设置读取主机服务器返回数据超时时间:60000毫秒
|
||||
connection.setReadTimeout(60000);
|
||||
|
||||
// 默认值为:false,当向远程服务器传送数据/写数据时,需要设置为true
|
||||
connection.setDoOutput(true);
|
||||
// 默认值为:true,当前向远程服务读取数据时,设置为true,该参数可有可无
|
||||
connection.setDoInput(true);
|
||||
// 设置传入参数的格式:请求参数应该是 name1=value1&name2=value2 的形式。
|
||||
connection.setRequestProperty("Content-Type", "application/json");
|
||||
// 通过连接对象获取一个输出流
|
||||
os = connection.getOutputStream();
|
||||
// 通过输出流对象将参数写出去/传输出去,它是通过字节数组写出的
|
||||
if (!("".equals(str) || str == null)) {
|
||||
os.write(str.getBytes("UTF-8"));
|
||||
}
|
||||
// 连接对象获取一个输入流,向远程读取
|
||||
if (connection.getResponseCode() == 200) {
|
||||
|
||||
is = connection.getInputStream();
|
||||
// 对输入流对象进行包装:charset根据工作项目组的要求来设置
|
||||
br = new BufferedReader(new InputStreamReader(is, "UTF-8"));
|
||||
|
||||
StringBuffer sbf = new StringBuffer();
|
||||
String temp = null;
|
||||
// 循环遍历一行一行读取数据
|
||||
while ((temp = br.readLine()) != null) {
|
||||
sbf.append(temp);
|
||||
sbf.append("\r\n");
|
||||
}
|
||||
result = sbf.toString();
|
||||
}
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
// 关闭资源
|
||||
if (null != br) {
|
||||
try {
|
||||
br.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
if (null != os) {
|
||||
try {
|
||||
os.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
if (null != is) {
|
||||
try {
|
||||
is.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
// 断开与远程地址url的连接
|
||||
connection.disconnect();
|
||||
}
|
||||
JSONObject json = JSONObject.parseObject(result);
|
||||
return json;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定参数文件的值(pa.properties)
|
||||
*
|
||||
* @param str 参数文件中的key
|
||||
* @return
|
||||
*/
|
||||
public String getProperties(String str) {
|
||||
Properties properties = null;
|
||||
try {
|
||||
properties = PropertiesLoaderUtils.loadAllProperties("pa.properties");
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
return (String) properties.get(str);
|
||||
}
|
||||
|
||||
/**
|
||||
* 调用Soap接口 对接平台使用
|
||||
* @param action 平台接口中的方法参数名称
|
||||
* @param xml 传递平台的XML数据参数
|
||||
* @return 返回调取soap接口后接口的返回值(未处理)
|
||||
* @throws HttpException
|
||||
* @throws IOException
|
||||
*/
|
||||
public String doSoap(String action, String xml,String id) throws HttpException, IOException {
|
||||
String wsdl = "";
|
||||
if("createDepartment".equals(action)||"updateDepartment".equals(action)) {
|
||||
wsdl = getProperties("DeptWsdl");
|
||||
}else if("createPractitioner".equals(action)||"updatePractitioner".equals(action)) {
|
||||
wsdl = getProperties("MemberWsdl");
|
||||
}
|
||||
System.out.println("wsdl:"+wsdl);
|
||||
int timeout = 10000;
|
||||
|
||||
// 构造soap请求信息
|
||||
StringBuffer sb = new StringBuffer("");
|
||||
sb.append(
|
||||
"<soap:Envelope xmlns:soap=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:urn=\"urn:hl7-org:v3\">");
|
||||
sb.append("<soap:Header/>");
|
||||
sb.append("<soap:Body>");
|
||||
sb.append(" <urn:HIPMessageServer>");
|
||||
sb.append("<urn:action>" + action + "</urn:action><urn:message>" + xml + "</urn:message>");
|
||||
sb.append("</urn:HIPMessageServer>");
|
||||
sb.append("</soap:Body>");
|
||||
sb.append("</soap:Envelope>");
|
||||
|
||||
// HttpClient发送SOAP请求
|
||||
// System.out.println("HttpClient 发送SOAP请求");
|
||||
HttpClient client = new HttpClient();
|
||||
PostMethod postMethod = new PostMethod(wsdl);
|
||||
Header header = new Header();
|
||||
// 设置连接超时
|
||||
client.getHttpConnectionManager().getParams().setConnectionTimeout(timeout);
|
||||
// 设置读取时间超时
|
||||
client.getHttpConnectionManager().getParams().setSoTimeout(timeout);
|
||||
// 然后把Soap请求数据添加到PostMethod中
|
||||
RequestEntity requestEntity = null;
|
||||
try {
|
||||
requestEntity = new StringRequestEntity(sb.toString(), "text/xml", "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
// 设置请求头部,否则可能会报 “no SOAPAction header” 的错误
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Date businessTime = new Date();
|
||||
Date operationTime = new Date();
|
||||
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
Date root = new Date();
|
||||
String rootId = sdf1.format(root);
|
||||
postMethod.setRequestHeader("SOAPAction", "");
|
||||
postMethod.setRequestHeader("Content-Type", "application/fhir+json");
|
||||
postMethod.setRequestHeader("rootId", rootId);
|
||||
postMethod.setRequestHeader("token", id);
|
||||
postMethod.setRequestHeader("domain", "OA");
|
||||
postMethod.setRequestHeader("businessTime", sdf.format(businessTime));
|
||||
postMethod.setRequestHeader("key", "806c1571-35de-41a2-b3c9-06ae5474d43a");
|
||||
postMethod.setRequestHeader("operationTime", sdf.format(operationTime));
|
||||
// 设置请求体
|
||||
postMethod.setRequestEntity(requestEntity);
|
||||
int status = client.executeMethod(postMethod);
|
||||
// 打印请求状态码
|
||||
// System.out.println("status:" + status);
|
||||
// 获取响应体输入流
|
||||
InputStream is = postMethod.getResponseBodyAsStream();
|
||||
// 获取请求结果字符串
|
||||
byte[] bytes = new byte[is.available()];
|
||||
is.read(bytes);
|
||||
String result = new String(bytes);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载文件到指定目录
|
||||
* @param dowUrl:http地址
|
||||
* @param dowPath:指定目录
|
||||
* */
|
||||
public String download(String dowUrl, String dowPath){
|
||||
try {
|
||||
// log.info("下载地址是:"+dowUrl+",存储地址是:"+dowPath);
|
||||
URL url = new URL(dowUrl);
|
||||
|
||||
URLConnection urlConnection = url.openConnection();
|
||||
|
||||
HttpURLConnection httpURLConnection = (HttpURLConnection) urlConnection;// http的连接类
|
||||
|
||||
//String contentType = httpURLConnection.getContentType();//请求类型,可用来过滤请求,
|
||||
|
||||
httpURLConnection.setConnectTimeout(1000*5);//设置超时
|
||||
|
||||
httpURLConnection.setRequestMethod("GET");//设置请求方式,默认是GET
|
||||
|
||||
httpURLConnection.setRequestProperty("Charset", "UTF-8");// 设置字符编码
|
||||
|
||||
httpURLConnection.connect();// 打开连接
|
||||
|
||||
BufferedInputStream bin = new BufferedInputStream(httpURLConnection.getInputStream());
|
||||
|
||||
String path = dowPath;// 指定存放位置
|
||||
File filed = new File(path);
|
||||
|
||||
OutputStream out = new FileOutputStream(filed);
|
||||
int size = 0;
|
||||
|
||||
byte[] b = new byte[2048];
|
||||
//把输入流的文件读取到字节数据b中,然后输出到指定目录的文件
|
||||
while ((size = bin.read(b)) != -1) {
|
||||
out.write(b, 0, size);
|
||||
}
|
||||
// 关闭资源
|
||||
bin.close();
|
||||
out.close();
|
||||
return "200";
|
||||
} catch (MalformedURLException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
return "500";
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
return "400";
|
||||
}
|
||||
}
|
||||
}
|
||||
82
src/com/seeyon/apps/daohuaxiangSys/jkts/util/JdbcUtil.java
Normal file
82
src/com/seeyon/apps/daohuaxiangSys/jkts/util/JdbcUtil.java
Normal file
@@ -0,0 +1,82 @@
|
||||
package com.seeyon.apps.daohuaxiangSys.jkts.util;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
|
||||
|
||||
/**
|
||||
* jdbc工具类
|
||||
* 2021-06-08
|
||||
* @author huangzhengguo
|
||||
*
|
||||
*/
|
||||
public class JdbcUtil {
|
||||
private static String url;
|
||||
private static String user;
|
||||
private static String password;
|
||||
|
||||
static {
|
||||
// 使用properties加载属性文件
|
||||
//Properties prop = new Properties();
|
||||
//String ip = GetIP.getIp();
|
||||
try {
|
||||
//InputStream is = JdbcUtil.class.getClassLoader().getResourceAsStream("pa.properties");
|
||||
//prop.load(is);
|
||||
// 注册驱动(获取属性文件中的数据)
|
||||
String driverClassName = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
|
||||
Class.forName(driverClassName);
|
||||
// 获取属性文件中的url,username,password
|
||||
//System.out.println("ip:" + ip);
|
||||
url = "jdbc:sqlserver://192.168.0.250:1433;databaseName=U8CLOUD";
|
||||
user = "sa";
|
||||
password = "Sa123456";
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
// 获取数据库连接
|
||||
public static Connection getConnection() {
|
||||
Connection conn = null;
|
||||
try {
|
||||
conn = DriverManager.getConnection(url, user, password);
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return conn;
|
||||
}
|
||||
|
||||
// 释放资源
|
||||
public static void close(Connection conn, Statement stat, ResultSet rs) {
|
||||
close(conn, stat);
|
||||
if (rs != null) {
|
||||
try {
|
||||
rs.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 释放资源
|
||||
public static void close(Connection conn, Statement stat) {
|
||||
if (conn != null) {
|
||||
try {
|
||||
conn.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
if (stat != null) {
|
||||
try {
|
||||
stat.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
137
src/com/seeyon/apps/daohuaxiangSys/jkts/util/PropKit.java
Normal file
137
src/com/seeyon/apps/daohuaxiangSys/jkts/util/PropKit.java
Normal file
@@ -0,0 +1,137 @@
|
||||
package com.seeyon.apps.daohuaxiangSys.jkts.util;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.util.Properties;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/**
|
||||
* 读取参数
|
||||
*/
|
||||
|
||||
public class PropKit {
|
||||
|
||||
private static long lastModify;
|
||||
|
||||
private static ConcurrentHashMap<String, String> props;
|
||||
|
||||
public static final String PROFILE = "profile";
|
||||
|
||||
public static final String PAYBILLFILEURL = "paybillFileUrl";
|
||||
public static final String GENERALBILLURL = "generalbillUrl";
|
||||
public static final String TRANSFORMURL = "transformUrl";
|
||||
public static final String XCFZCANCELURL = "xcfzCancelUrl";
|
||||
public static final String SBFZCANCELURL = "sbfzCancelUrl";
|
||||
public static final String OATOKENURL = "oaTokenUrl";
|
||||
public static final String DOWURL = "dowUrl";
|
||||
public static final String JYNCFILE = "jyncFile";
|
||||
public static final String RESTNAME = "restname";
|
||||
public static final String RESTPASSWORD = "restpassword";
|
||||
public static final String ADDRESS = "address";
|
||||
public static final String TONGYONGAPI = "tongyongApi";
|
||||
public static final String APPID = "appid";
|
||||
public static final String SPK = "spk";
|
||||
public static final String WORKFLOWID = "workflowId";
|
||||
public static final String LOGINNAME = "loginName";
|
||||
public static final String SECRET = "secret";
|
||||
public static final String SQL = "sql";
|
||||
public static final String DATASQL = "dataSql";
|
||||
public static final String NEWADDRESS = "newAddress";
|
||||
public static final String NEWSPK = "newSpk";
|
||||
public static final String NEWSECRET = "newSecret";
|
||||
public static final String NEWWORKFLOWID = "newWorkflowId";
|
||||
public static final String LOGINID = "loginid";
|
||||
public static final String PWD = "pwd";
|
||||
|
||||
public static final String PROD_PAYBILLFILEURL = "prod.paybillFileUrl";
|
||||
public static final String PROD_GENERALBILLURL = "prod.generalbillUrl";
|
||||
public static final String PROD_TRANSFORMURL = "prod.transformUrl";
|
||||
public static final String PROD_XCFZCANCELURL = "prod.xcfzCancelUrl";
|
||||
public static final String PROD_SBFZCANCELURL = "prod.sbfzCancelUrl";
|
||||
public static final String PROD_OATOKENURL = "prod.oaTokenUrl";
|
||||
public static final String PROD_DOWURL = "prod.dowUrl";
|
||||
public static final String PROD_JYNCFILE = "prod.jyncFile";
|
||||
public static final String PROD_RESTNAME = "prod.restname";
|
||||
public static final String PROD_RESTPASSWORD = "prod.restpassword";
|
||||
public static final String PROD_ADDRESS = "prod.address";
|
||||
public static final String PROD_TONGYONGAPI = "prod.tongyongApi";
|
||||
public static final String PROD_APPID = "prod.appid";
|
||||
public static final String PROD_SPK = "prod.spk";
|
||||
public static final String PROD_WORKFLOWID = "prod.workflowId";
|
||||
public static final String PROD_LOGINNAME = "prod.loginName";
|
||||
public static final String PROD_SECRET = "prod.secret";
|
||||
public static final String PROD_SQL = "prod.sql";
|
||||
public static final String PROD_DATASQL = "prod.dataSql";
|
||||
public static final String PROD_NEWADDRESS = "prod.newAddress";
|
||||
public static final String PROD_NEWSPK = "prod.newSpk";
|
||||
public static final String PROD_NEWSECRET = "prod.newSecret";
|
||||
public static final String PROD_NEWWORKFLOWID = "prod.newWorkflowId";
|
||||
public static final String PROD_LOGINID = "prod.loginid";
|
||||
public static final String PROD_PWD = "prod.pwd";
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @throws IOException
|
||||
* @throws FileNotFoundException
|
||||
*/
|
||||
public static String getProp(String key) throws FileNotFoundException, IOException {
|
||||
File f = new File(A8FolderKit.getPropFile());
|
||||
if(null == props) {
|
||||
props = new ConcurrentHashMap<String, String>();
|
||||
}
|
||||
if(f.lastModified() != lastModify) {
|
||||
/**
|
||||
* huangzhengguo
|
||||
* 2022-10-18
|
||||
*/
|
||||
Properties prop = new Properties();
|
||||
prop.load(new FileInputStream(f));
|
||||
// Properties prop = PropertiesUtil.getFromFile((CtpLocalFile) f);
|
||||
/**
|
||||
* end
|
||||
*/
|
||||
String profile = prop.getProperty(PROFILE);
|
||||
if("prod".equals(profile)) {
|
||||
props.put(PAYBILLFILEURL, prop.getProperty(PROD_PAYBILLFILEURL));
|
||||
props.put(GENERALBILLURL, prop.getProperty(PROD_GENERALBILLURL));
|
||||
props.put(TRANSFORMURL, prop.getProperty(PROD_TRANSFORMURL));
|
||||
props.put(XCFZCANCELURL, prop.getProperty(PROD_XCFZCANCELURL));
|
||||
props.put(OATOKENURL, prop.getProperty(PROD_OATOKENURL));
|
||||
props.put(DOWURL, prop.getProperty(PROD_DOWURL));
|
||||
props.put(JYNCFILE, prop.getProperty(PROD_JYNCFILE));
|
||||
props.put(RESTNAME, prop.getProperty(PROD_RESTNAME));
|
||||
props.put(RESTPASSWORD, prop.getProperty(PROD_RESTPASSWORD));
|
||||
props.put(SBFZCANCELURL, prop.getProperty(PROD_SBFZCANCELURL));
|
||||
props.put(ADDRESS, prop.getProperty(PROD_ADDRESS));
|
||||
props.put(TONGYONGAPI, prop.getProperty(PROD_TONGYONGAPI));
|
||||
props.put(APPID, prop.getProperty(PROD_APPID));
|
||||
props.put(SPK, prop.getProperty(PROD_SPK));
|
||||
props.put(WORKFLOWID, prop.getProperty(PROD_WORKFLOWID));
|
||||
props.put(LOGINNAME, prop.getProperty(PROD_LOGINNAME));
|
||||
props.put(SECRET, prop.getProperty(PROD_SECRET));
|
||||
props.put(SQL, prop.getProperty(PROD_SQL));
|
||||
props.put(DATASQL, prop.getProperty(PROD_DATASQL));
|
||||
props.put(NEWADDRESS, prop.getProperty(PROD_NEWADDRESS));
|
||||
props.put(NEWSPK, prop.getProperty(PROD_NEWSPK));
|
||||
props.put(NEWSECRET, prop.getProperty(PROD_NEWSECRET));
|
||||
props.put(NEWWORKFLOWID, prop.getProperty(PROD_NEWWORKFLOWID));
|
||||
props.put(LOGINID, prop.getProperty(PROD_LOGINID));
|
||||
props.put(PWD, prop.getProperty(PROD_PWD));
|
||||
} else {
|
||||
props.put(PAYBILLFILEURL, prop.getProperty(PROD_PAYBILLFILEURL));
|
||||
props.put(GENERALBILLURL, prop.getProperty(PROD_GENERALBILLURL));
|
||||
props.put(TRANSFORMURL, prop.getProperty(PROD_TRANSFORMURL));
|
||||
props.put(XCFZCANCELURL, prop.getProperty(PROD_XCFZCANCELURL));
|
||||
props.put(OATOKENURL, prop.getProperty(PROD_OATOKENURL));
|
||||
props.put(DOWURL, prop.getProperty(PROD_DOWURL));
|
||||
props.put(JYNCFILE, prop.getProperty(PROD_JYNCFILE));
|
||||
props.put(RESTNAME, prop.getProperty(PROD_RESTNAME));
|
||||
props.put(RESTPASSWORD, prop.getProperty(PROD_RESTPASSWORD));
|
||||
}
|
||||
}
|
||||
return props.get(key);
|
||||
}
|
||||
|
||||
}
|
||||
45
src/com/seeyon/apps/qrCodeForm/QrCodeFormPluginApi.java
Normal file
45
src/com/seeyon/apps/qrCodeForm/QrCodeFormPluginApi.java
Normal file
@@ -0,0 +1,45 @@
|
||||
package com.seeyon.apps.qrCodeForm;
|
||||
|
||||
import com.seeyon.apps.common.plugin.api.APluginInfoApi;
|
||||
import com.seeyon.apps.common.plugin.vo.ConfigVo;
|
||||
import com.seeyon.apps.qrCodeForm.constant.QrCodeFormConstants;
|
||||
|
||||
/**
|
||||
* 功能描述:<br>
|
||||
* <pre>
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @Author: FanGaowei
|
||||
* @Date: 2022/8/11
|
||||
*/
|
||||
public class QrCodeFormPluginApi extends APluginInfoApi {
|
||||
|
||||
@Override
|
||||
public String getPluginId() {
|
||||
return QrCodeFormConstants.getPluginId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCreateUser() {
|
||||
return "致威互联";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return "微信扫码制单";
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConfigVo getDefaultConfig() {
|
||||
ConfigVo configVo = new ConfigVo();
|
||||
for (QrCodeFormConstants value : QrCodeFormConstants.values()) {
|
||||
if(value != QrCodeFormConstants.plugin) {
|
||||
configVo.getDevParams().put(value.name(), value.getDefaultValue());
|
||||
configVo.getProdParams().put(value.name(), value.getDefaultValue());
|
||||
configVo.getParamMap().put(value.name(), value.getDescription());
|
||||
}
|
||||
}
|
||||
return configVo;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.seeyon.apps.qrCodeForm;
|
||||
|
||||
import com.seeyon.apps.qrCodeForm.util.InitQrCodeFormUitl;
|
||||
import com.seeyon.ctp.common.AbstractSystemInitializer;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
public class QrCodeFormPluginInitializer extends AbstractSystemInitializer {
|
||||
private static Log log = LogFactory.getLog(QrCodeFormPluginInitializer.class);
|
||||
|
||||
public QrCodeFormPluginInitializer() {
|
||||
}
|
||||
|
||||
public void destroy() {
|
||||
log.info("◆二维码扫码填单插件销毁成功!");
|
||||
}
|
||||
|
||||
public void initialize() {
|
||||
InitQrCodeFormUitl.initMenu();
|
||||
log.info("◆二维码扫码填单插件初始化成功!");
|
||||
}
|
||||
}
|
||||
13
src/com/seeyon/apps/qrCodeForm/constant/Constants.java
Normal file
13
src/com/seeyon/apps/qrCodeForm/constant/Constants.java
Normal file
@@ -0,0 +1,13 @@
|
||||
package com.seeyon.apps.qrCodeForm.constant;
|
||||
|
||||
public class Constants {
|
||||
|
||||
//模拟移动端登录认证方式
|
||||
public static final String _REDIRECTURI = "/qrCodeForm.do?method=newMain&html=";
|
||||
//流程表单跳转地址
|
||||
public static final String FLOW_URL = "/seeyon/m3/apps/v5/collaboration/html/newCollaboration.html?qc=ext&templateId=";
|
||||
//无流程表单跳转地址
|
||||
public static final String UNFLOW_URL = "/seeyon/m3/apps/v5/cap4/htmls/native/form/index.html?";
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.seeyon.apps.qrCodeForm.constant;
|
||||
|
||||
public enum QrCodeFormConstants {
|
||||
|
||||
plugin("qrCodeForm","插件ID"),
|
||||
oaAddress("https://oa.dhx.com.cn", "OA地址"),
|
||||
qwAppId("", "企微APPID"),
|
||||
restId("qrcode", "rest账号"),
|
||||
restPwd("f39f8102-1c7f-423c-8e6c-57e1d19b9a6f", "rest密码"),
|
||||
qrcode_loginname("hr", "发起人账号");
|
||||
|
||||
QrCodeFormConstants(String defaultValue, String description) {
|
||||
this.defaultValue = defaultValue;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
private String defaultValue;
|
||||
private String description;
|
||||
|
||||
public String getDefaultValue() {
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public static String getPluginId() {
|
||||
return plugin.defaultValue;
|
||||
}
|
||||
|
||||
}
|
||||
31
src/com/seeyon/apps/qrCodeForm/constant/SupportTypeEnum.java
Normal file
31
src/com/seeyon/apps/qrCodeForm/constant/SupportTypeEnum.java
Normal file
@@ -0,0 +1,31 @@
|
||||
package com.seeyon.apps.qrCodeForm.constant;
|
||||
|
||||
import com.seeyon.ctp.common.code.EnumsCode;
|
||||
import com.seeyon.ctp.common.i18n.ResourceUtil;
|
||||
|
||||
public enum SupportTypeEnum implements EnumsCode {
|
||||
ALL(0, "全部"),
|
||||
FLOW(1, "仅支持流程表单"),
|
||||
UNFLOW(2, "仅支持无流程表单");
|
||||
|
||||
private int key;
|
||||
private String text;
|
||||
|
||||
private SupportTypeEnum(int key, String text) {
|
||||
this.key = key;
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return String.valueOf(this.key);
|
||||
}
|
||||
|
||||
public int getKey() {
|
||||
return this.key;
|
||||
}
|
||||
|
||||
public String getText() {
|
||||
return ResourceUtil.getString(this.text);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package com.seeyon.apps.qrCodeForm.controller;
|
||||
|
||||
import com.seeyon.apps.common.config.ICstConfigApi;
|
||||
import com.seeyon.apps.qrCodeForm.constant.QrCodeFormConstants;
|
||||
import com.seeyon.apps.qrCodeForm.manager.QrCodeFormManager;
|
||||
import com.seeyon.apps.qrCodeForm.util.LoginUtil;
|
||||
import com.seeyon.apps.weixin.util.SecurityCertUtil;
|
||||
import com.seeyon.apps.weixin.util.WeixinUtil;
|
||||
import com.seeyon.ctp.common.SystemEnvironment;
|
||||
import com.seeyon.ctp.common.constants.ProductEditionEnum;
|
||||
import com.seeyon.ctp.common.controller.BaseController;
|
||||
import com.seeyon.ctp.common.flag.SysFlag;
|
||||
import com.seeyon.ctp.common.log.CtpLogFactory;
|
||||
import com.seeyon.ctp.organization.bo.V3xOrgMember;
|
||||
import com.seeyon.ctp.organization.manager.OrgManager;
|
||||
import com.seeyon.ctp.util.Strings;
|
||||
import com.seeyon.ctp.util.annotation.Inject;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.net.URLDecoder;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class QrCodeFormController extends BaseController {
|
||||
private static Log log = CtpLogFactory.getLog(QrCodeFormController.class);
|
||||
@Inject
|
||||
private QrCodeFormManager qrCodeFormManager;
|
||||
@Inject
|
||||
private OrgManager orgManager;
|
||||
@Inject
|
||||
private ICstConfigApi cstConfigApi;
|
||||
|
||||
public ModelAndView index(HttpServletRequest request, HttpServletResponse response) {
|
||||
log.info("访问二维码生成页面!");
|
||||
ModelAndView mav = new ModelAndView("plugin/qrCodeForm/qrCodeFormIndex");
|
||||
Map map = new HashMap<String, Object>();
|
||||
map.put("bizType", "1");
|
||||
map.put("type", "owner-authed-biz");
|
||||
map.put("businessType", 0);
|
||||
map.put("activeTab", "mineapp");
|
||||
List<Map<String, Object>> bizList = qrCodeFormManager.listBusiness(map);
|
||||
mav.addObject("bizList", bizList);
|
||||
return mav;
|
||||
}
|
||||
|
||||
|
||||
public ModelAndView newMain(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
ModelAndView mav = new ModelAndView("/wechat/collaborationContent");
|
||||
String html = "";
|
||||
String type = request.getParameter("type");
|
||||
if(Strings.isNotBlank(type)) {
|
||||
html = cstConfigApi.getConfig(QrCodeFormConstants.getPluginId(), "url" + type);
|
||||
}
|
||||
if(Strings.isBlank(html)) {
|
||||
html = URLDecoder.decode(request.getParameter("html"), "UTF-8");
|
||||
}
|
||||
// String loginName = qrCodeFormManager.getLoginMember(code);
|
||||
/**
|
||||
* 客开改动,固定登录名
|
||||
*/
|
||||
//String loginName = (String) FormulaUtil.getVar("qrcode_loginname");
|
||||
String loginName = cstConfigApi.getConfig(QrCodeFormConstants.getPluginId(), QrCodeFormConstants.qrcode_loginname.name());
|
||||
log.info("登录认证获取loginName为:" + loginName);
|
||||
if(Strings.isEmpty(loginName)){
|
||||
// mav.addObject("msg", "未获取到人员信息!")b;
|
||||
// return mav;
|
||||
loginName = "seeyon";
|
||||
}
|
||||
|
||||
V3xOrgMember member = orgManager.getMemberByLoginName(loginName);
|
||||
if(member == null){
|
||||
mav.addObject("msg", "人员不存在!");
|
||||
return mav;
|
||||
}
|
||||
SecurityCertUtil.login(request, loginName);
|
||||
|
||||
Map map = LoginUtil.getToken(String.valueOf(member.getId()), member.getLoginName(), request, response);
|
||||
String success = String.valueOf(map.get("success"));
|
||||
if (success != null && "false".equals(success)) {
|
||||
// String message = map.get("message").toString();
|
||||
// if (message.contains("User not found")) {
|
||||
// mav.addObject("msg", ResourceUtil.getString("wxt.user.binding.miss")
|
||||
// + "," + ResourceUtil.getString("wxt.user.name") + wechatUser.getXtUserName() +
|
||||
// "," + ResourceUtil.getString("wxt.dingding.user.id") + wechatUser.getXtUserId());
|
||||
// } else {
|
||||
// }
|
||||
mav.addObject("msg", (String) map.get("message"));
|
||||
return mav;
|
||||
}
|
||||
|
||||
String token = (String) map.get("id");
|
||||
String suffix = (String) SysFlag.mobileEditionSuffix.getFlag();
|
||||
String edition = ProductEditionEnum.getCurrentProductEditionEnum().getValue();
|
||||
String v5timestamp = WeixinUtil.getV5Timestamp();
|
||||
String address = cstConfigApi.getConfig(QrCodeFormConstants.getPluginId(), QrCodeFormConstants.oaAddress.name());
|
||||
if (Strings.isNotBlank(html)) {
|
||||
String url = address + "" + SystemEnvironment.getContextPath() + "/H5/collaboration/index.html?token=" + token + "&edition=" + edition + "&suffix=" + suffix + "&v5timestamp=" + v5timestamp + "&loginName=" + member.getLoginName() + "&html=" + URLEncoder.encode(html, "UTF-8") + "&isAccount=&accountid=" + member.getOrgAccountId() + "&appid=";
|
||||
return new ModelAndView("redirect:" + url);
|
||||
} else {
|
||||
return new ModelAndView("redirect:" + address + "" + SystemEnvironment.getContextPath() + "/H5/collaboration/index.html?token=" + token + "&edition=" + edition + "&suffix=" + suffix + "&v5timestamp=" + v5timestamp + "&loginName=" + member.getLoginName() + "&html=&isAccount=&accountid=" + member.getOrgAccountId());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.seeyon.apps.qrCodeForm.manager;
|
||||
|
||||
import com.seeyon.cap4.form.modules.business.FormAppBO;
|
||||
import com.seeyon.ctp.util.annotation.AjaxAccess;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface QrCodeFormManager {
|
||||
@AjaxAccess
|
||||
List<Map<String, Object>> listBusiness(Map<String, Object> params);
|
||||
|
||||
@AjaxAccess
|
||||
List<FormAppBO> listFormApp(Map<String, Object> params);
|
||||
|
||||
Map<String, Object> qrCodeFormUrl(Map<String, Object> params) throws UnsupportedEncodingException;
|
||||
}
|
||||
@@ -0,0 +1,155 @@
|
||||
package com.seeyon.apps.qrCodeForm.manager;
|
||||
|
||||
import com.seeyon.apps.common.config.ICstConfigApi;
|
||||
import com.seeyon.apps.qrCodeForm.constant.Constants;
|
||||
import com.seeyon.apps.qrCodeForm.constant.QrCodeFormConstants;
|
||||
import com.seeyon.apps.weixin.manager.WechatUserManager;
|
||||
import com.seeyon.cap4.form.api.FormApi4Cap4;
|
||||
import com.seeyon.cap4.form.modules.business.BusinessSourceTypeManager;
|
||||
import com.seeyon.cap4.form.modules.business.FormAppBO;
|
||||
import com.seeyon.cap4.form.util.BizUtil;
|
||||
import com.seeyon.cap4.form.util.Enums;
|
||||
import com.seeyon.ctp.common.AppContext;
|
||||
import com.seeyon.ctp.common.SystemEnvironment;
|
||||
import com.seeyon.ctp.common.exceptions.BusinessException;
|
||||
import com.seeyon.ctp.common.log.CtpLogFactory;
|
||||
import com.seeyon.ctp.organization.manager.OrgManager;
|
||||
import com.seeyon.ctp.util.FlipInfo;
|
||||
import com.seeyon.ctp.util.ParamUtil;
|
||||
import com.seeyon.ctp.util.Strings;
|
||||
import com.seeyon.ctp.util.annotation.AjaxAccess;
|
||||
import com.seeyon.ctp.util.annotation.Inject;
|
||||
import org.apache.commons.logging.Log;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class QrCodeFormManagerImpl implements QrCodeFormManager {
|
||||
|
||||
private static Log log = CtpLogFactory.getLog(QrCodeFormManagerImpl.class);
|
||||
|
||||
@Inject
|
||||
private FormApi4Cap4 formApi4Cap4;
|
||||
@Inject
|
||||
private OrgManager orgManager;
|
||||
@Inject
|
||||
private ICstConfigApi cstConfigApi;
|
||||
@Inject
|
||||
public WechatUserManager wechatUserManager;
|
||||
|
||||
|
||||
/**
|
||||
* 获取应用包数据
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@AjaxAccess
|
||||
public List<Map<String, Object>> listBusiness(Map<String, Object> params) {
|
||||
List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>();
|
||||
try {
|
||||
FlipInfo fi = new FlipInfo(1, -1);
|
||||
Map<String, Object> resultMap = formApi4Cap4.listBusiness(fi, params);
|
||||
if (Strings.isNotEmpty(fi.getData())) {
|
||||
listMap = fi.getData();
|
||||
}
|
||||
} catch (BusinessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return listMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有的应用下的模板
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
@AjaxAccess
|
||||
@Override
|
||||
public List<FormAppBO> listFormApp(Map<String, Object> params) {
|
||||
List<FormAppBO> returnList = new ArrayList<>();
|
||||
String type = ParamUtil.getString(params, "type");
|
||||
String bizConfigId = ParamUtil.getString(params, "bizConfigId");
|
||||
BusinessSourceTypeManager sourceType = BizUtil.getSourceTypeById(type);
|
||||
Long bizConfigL = 0L;
|
||||
if (Strings.isNotBlank(bizConfigId)) {
|
||||
bizConfigL = Long.parseLong(bizConfigId);
|
||||
}
|
||||
try {
|
||||
List<FormAppBO> allList = sourceType.getFormAppBOList(AppContext.getCurrentUser(), "", "", false, bizConfigL);
|
||||
if (Strings.isNotEmpty(allList)) {
|
||||
returnList = allList.stream().filter(a -> !"PARENT".equals(a.getSourctTypeName())).collect(Collectors.toList());
|
||||
}
|
||||
} catch (BusinessException e) {
|
||||
log.error("获取所有模板异常", e);
|
||||
}
|
||||
return returnList;
|
||||
}
|
||||
|
||||
@Override
|
||||
@AjaxAccess
|
||||
public Map<String, Object> qrCodeFormUrl(Map<String, Object> params) throws UnsupportedEncodingException {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
Integer sourceType = ParamUtil.getInt(params, "sourceType");
|
||||
//String fillUrl = Constants._URLTPL.replaceAll("\\{corpId}", Constants._CORPID);
|
||||
String fillUrl;
|
||||
String _redirecturi = Constants._REDIRECTURI;
|
||||
if (sourceType == Enums.SourceType.SOURCE_TYPE_FLOWTEMPLATE.getKey()) {
|
||||
String templateId = ParamUtil.getString(params, "templateId");
|
||||
String tourl = Constants.FLOW_URL + templateId;
|
||||
try {
|
||||
// fillUrl = fillUrl + URLEncoder.encode(
|
||||
String address = cstConfigApi.getConfig(QrCodeFormConstants.getPluginId(), QrCodeFormConstants.oaAddress.name());;
|
||||
fillUrl = address + SystemEnvironment.getContextPath() + _redirecturi;
|
||||
fillUrl += URLEncoder.encode(tourl, "UTF-8");
|
||||
// "http://172.16.30.123:8081"+ SystemEnvironment.getContextPath() + _redirecturi + tourl, "UTF-8"
|
||||
// ) + Constants._FIXURL;
|
||||
result.put("fillUrl", fillUrl);
|
||||
return result;
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
log.error("地址处理异常", e);
|
||||
}
|
||||
} else if (sourceType == Enums.SourceType.SOURCE_TYPE_INFOMANAGE.getKey()) {
|
||||
String formType = ParamUtil.getString(params, "formType");
|
||||
String type = ParamUtil.getString(params, "type");
|
||||
String title = ParamUtil.getString(params, "title");
|
||||
String moduleId = ParamUtil.getString(params, "moduleId");
|
||||
String formTemplateId = ParamUtil.getString(params, "formTemplateId");
|
||||
String moduleType = ParamUtil.getString(params, "moduleType");
|
||||
String operateType = ParamUtil.getString(params, "operateType");
|
||||
String rightId = ParamUtil.getString(params, "rightId");
|
||||
//http://127.0.0.1/seeyon/qrCodeForm.do?method=newMain&html=/seeyon/m3/apps/v5/cap4/htmls/native/form/index.html?cusType=true&formTemplateId=-4624141853295951831&moduleId=-4624141853295951831&moduleType=42&formType=main&type=new&operateType=0&rightId=-1
|
||||
String tourl = Constants.UNFLOW_URL + "cusType=true"
|
||||
+ "&formTemplateId=" + formTemplateId
|
||||
+ "&moduleId=" + moduleId
|
||||
+ "&moduleType=" + moduleType
|
||||
+ "&formType=" + formType
|
||||
+ "&type=" + type
|
||||
+ "&rightId=" + rightId
|
||||
+ "&operateType=" + operateType;
|
||||
try {
|
||||
// fillUrl = fillUrl + URLEncoder.encode(
|
||||
String address = cstConfigApi.getConfig(QrCodeFormConstants.getPluginId(), QrCodeFormConstants.oaAddress.name());
|
||||
fillUrl = address + SystemEnvironment.getContextPath() + _redirecturi;
|
||||
|
||||
fillUrl += URLEncoder.encode(tourl, "UTF-8");
|
||||
// "http://172.16.30.123:80"+ SystemEnvironment.getContextPath() + _redirecturi + tourl, "UTF-8"
|
||||
// ) + Constants._FIXURL;
|
||||
log.info("生成地址为:" + fillUrl);
|
||||
result.put("fillUrl", fillUrl);
|
||||
return result;
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
log.error("地址处理异常", e);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
140
src/com/seeyon/apps/qrCodeForm/sso/WechatQRHandShake.java
Normal file
140
src/com/seeyon/apps/qrCodeForm/sso/WechatQRHandShake.java
Normal file
@@ -0,0 +1,140 @@
|
||||
package com.seeyon.apps.qrCodeForm.sso;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.seeyon.apps.weixin.manager.WechatUserManager;
|
||||
import com.seeyon.apps.weixin.po.WechatUser;
|
||||
import com.seeyon.ctp.common.AppContext;
|
||||
import com.seeyon.ctp.common.log.CtpLogFactory;
|
||||
import com.seeyon.ctp.organization.bo.V3xOrgMember;
|
||||
import com.seeyon.ctp.organization.manager.OrgManager;
|
||||
import com.seeyon.ctp.portal.sso.SSOLoginContext;
|
||||
import com.seeyon.ctp.portal.sso.SSOLoginHandshakeAbstract;
|
||||
import com.seeyon.ctp.util.HttpClientUtil;
|
||||
import com.seeyon.ctp.util.annotation.Inject;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author
|
||||
* @title: WechatQRHandShake
|
||||
* @description: 企业微信扫码发起单据
|
||||
* @date 2021/11/30 9:47
|
||||
*/
|
||||
public class WechatQRHandShake extends SSOLoginHandshakeAbstract {
|
||||
|
||||
private static final Log log = CtpLogFactory.getLog(WechatQRHandShake.class);
|
||||
//企业微信appid
|
||||
public static final String _CORPID = AppContext.getSystemProperty("qrCodeForm.corpid");
|
||||
//企业微信corpsecret
|
||||
public static final String _corpsecret = AppContext.getSystemProperty("qrCodeForm.corpsecret");
|
||||
//验证方式
|
||||
public static final String handshakeType = AppContext.getSystemProperty("qrCodeForm.handshakeType");
|
||||
|
||||
@Inject
|
||||
public WechatUserManager wechatUserManager;
|
||||
@Autowired
|
||||
private OrgManager orgManager;
|
||||
@Override
|
||||
public String handshake(String s) {
|
||||
log.info("--进入企业微信回调接口!");
|
||||
HttpServletRequest request = AppContext.getRawRequest();
|
||||
String code =request.getParameter("code");
|
||||
|
||||
String corpid =_CORPID;
|
||||
String corpsecret =_corpsecret;
|
||||
|
||||
log.info("获取access接口url:https://qyapi.weixin.qq.com/cgi-bin/gettoken?"+"corpid="+corpid+"&corpsecret="+corpsecret);
|
||||
String access = null;
|
||||
try {
|
||||
access = HttpClientUtil.getContent("https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid="+corpid+"&corpsecret="+corpsecret);
|
||||
log.info("获取access接口返回:"+access);
|
||||
if(access==null || access.equals("")){
|
||||
log.error("--未获取到access!");
|
||||
return null;
|
||||
}
|
||||
|
||||
JSONObject jsonObject = JSONObject.parseObject(access);
|
||||
if(jsonObject==null){
|
||||
log.error("--未获取到access的jsonObject!");
|
||||
return null;
|
||||
}
|
||||
|
||||
String accessToken = (String)jsonObject.get("access_token");
|
||||
if(accessToken==null || accessToken.equals("")){
|
||||
log.error("--未获取到accessToken!");
|
||||
return null;
|
||||
}
|
||||
|
||||
log.info("--获取访问用户身份接口url:https://qyapi.weixin.qq.com/cgi-bin/user/getuserinfo?"+"access_token=" + accessToken + "&code=" + code);
|
||||
String user = HttpClientUtil.getContent("https://qyapi.weixin.qq.com/cgi-bin/user/getuserinfo?access_token=" + accessToken + "&code=" + code);
|
||||
log.info("--获取访问用户身份接口返回值:" + user);
|
||||
if(user==null || user.equals("")){
|
||||
log.error("--未获取到user!");
|
||||
return null;
|
||||
}
|
||||
|
||||
JSONObject userJson = JSONObject.parseObject(user);
|
||||
if(userJson==null){
|
||||
log.error("--未获取到user的jsonObject!");
|
||||
return null;
|
||||
}
|
||||
|
||||
String userid = userJson.getString("UserId");
|
||||
if(userid==null || userid.equals("")){
|
||||
log.error("--未获取到userid!");
|
||||
return null;
|
||||
}
|
||||
String Loginname = null;
|
||||
// if("1".equals(handshakeType)){//使用标准模块的微信绑定
|
||||
if(false){ //企业微信、微协同绑定等信息存储在微协同云服务中,废弃逻辑
|
||||
WechatUser wechatUser =wechatUserManager.getWechatUserByUserIdAndcorpId(userid,corpid);
|
||||
Loginname=wechatUser.getXtLoginName();
|
||||
}else {//自定义如何根据微信得用户id获取OA的用户
|
||||
log.info("--获取成员接口url:https://qyapi.weixin.qq.com/cgi-bin/user/get?"+"access_token=" + accessToken + "&userid=" + userid);
|
||||
String member = HttpClientUtil.getContent("https://qyapi.weixin.qq.com/cgi-bin/user/get?access_token=" + accessToken + "&userid=" + userid);
|
||||
log.info("获取成员接口返回值:" + member);
|
||||
if(member==null || member.equals("")){
|
||||
log.error("--未获取到member!");
|
||||
return null;
|
||||
}
|
||||
|
||||
JSONObject memberJson = JSONObject.parseObject(member);
|
||||
if(userJson==null){
|
||||
log.error("--未获取到member的jsonObject!");
|
||||
return null;
|
||||
}
|
||||
|
||||
String mobile = memberJson.getString("mobile");
|
||||
if(mobile==null || mobile.equals("")){
|
||||
log.error("--未获取到mobile!");
|
||||
return null;
|
||||
}
|
||||
List<V3xOrgMember> memberList=orgManager.getMemberListByMobile(mobile,null);
|
||||
Loginname = memberList!=null?memberList.get(0).getLoginName():null;
|
||||
}
|
||||
if(Loginname ==null || Loginname.equals("")){
|
||||
log.error("--未获取到loginName!");
|
||||
return null;
|
||||
}
|
||||
return Loginname;
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("获取微信验证失败",e);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void logoutNotify(String s) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getToUrl(HttpServletRequest req, SSOLoginContext ssoLoginContext, String ticket) {
|
||||
return req.getParameter("tourl");
|
||||
}
|
||||
}
|
||||
111
src/com/seeyon/apps/qrCodeForm/util/InitQrCodeFormUitl.java
Normal file
111
src/com/seeyon/apps/qrCodeForm/util/InitQrCodeFormUitl.java
Normal file
@@ -0,0 +1,111 @@
|
||||
package com.seeyon.apps.qrCodeForm.util;
|
||||
|
||||
import com.seeyon.ctp.common.AppContext;
|
||||
import com.seeyon.ctp.privilege.enums.PrivMenuTypeEnums;
|
||||
import com.seeyon.ctp.privilege.manager.PrivilegeMenuManager;
|
||||
import com.seeyon.ctp.privilege.po.PrivMenu;
|
||||
import com.seeyon.ctp.util.DBAgent;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class InitQrCodeFormUitl {
|
||||
private static Log log = LogFactory.getLog(InitQrCodeFormUitl.class);
|
||||
private static PrivilegeMenuManager privilegeMenuManager = (PrivilegeMenuManager) AppContext.getBean("privilegeMenuManager");
|
||||
|
||||
public static void initMenu() {
|
||||
try {
|
||||
List<PrivMenu> listmenu = new ArrayList<PrivMenu>();
|
||||
|
||||
StringBuffer queryString = new StringBuffer(" FROM ");
|
||||
queryString.append(PrivMenu.class.getSimpleName()).append(" where ")
|
||||
.append(" path = '711' ");
|
||||
|
||||
listmenu = DBAgent.find(queryString.toString());
|
||||
if (listmenu == null || listmenu.size() < 1) {
|
||||
creatFileImportMenu();//创建菜单资源
|
||||
}
|
||||
log.info("模板二维码菜单完成");
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("模板二维码菜单失败", e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置菜单
|
||||
*
|
||||
* @return
|
||||
* @throws BusinessException
|
||||
*/
|
||||
private static void creatFileImportMenu() {
|
||||
try {
|
||||
List<PrivMenu> menus = new ArrayList<PrivMenu>();
|
||||
PrivMenu configmenu = new PrivMenu();
|
||||
configmenu.setNewId();
|
||||
configmenu.setName("模板二维码");
|
||||
configmenu.setIcon("conferencearrangemen.png");
|
||||
configmenu.setSortid(1);
|
||||
configmenu.setPath("711");
|
||||
configmenu.setExt1("0");
|
||||
configmenu.setExt2("1");
|
||||
configmenu.setExt3("");
|
||||
configmenu.setExt4(1);
|
||||
configmenu.setExt7(configmenu.getName());
|
||||
configmenu.setExt8("");
|
||||
configmenu.setExt9("");
|
||||
configmenu.setExt10("");
|
||||
configmenu.setExt11("");
|
||||
configmenu.setExt12(0);
|
||||
configmenu.setExt13(0);
|
||||
configmenu.setExt14(0);
|
||||
configmenu.setExt15(0);
|
||||
configmenu.setExt16(0);
|
||||
Date nowDate = new Date();
|
||||
configmenu.setCreatedate(nowDate);
|
||||
configmenu.setUpdatedate(nowDate);
|
||||
configmenu.setType(PrivMenuTypeEnums.systemPresetMenu.getKey());
|
||||
configmenu.setParentId(0L);
|
||||
menus.add(configmenu);
|
||||
|
||||
PrivMenu syncConfig = new PrivMenu();//二维码生成
|
||||
syncConfig.setNewId();
|
||||
syncConfig.setName("二维码生成");
|
||||
syncConfig.setIcon("b_menu_thridpartyspace.png");
|
||||
syncConfig.setTarget("mainfrm");
|
||||
syncConfig.setSortid(1);
|
||||
syncConfig.setPath("711001");
|
||||
syncConfig.setExt1("0");
|
||||
syncConfig.setExt2("2");
|
||||
syncConfig.setExt3("");
|
||||
syncConfig.setExt4(1);
|
||||
syncConfig.setExt7(syncConfig.getName());
|
||||
syncConfig.setExt8("0");
|
||||
syncConfig.setExt9("0");
|
||||
syncConfig.setExt10("0");
|
||||
syncConfig.setExt11("1");
|
||||
syncConfig.setExt19(2L);
|
||||
syncConfig.setEnterResource(1);
|
||||
syncConfig.setResourceNavurl("/qrCodeForm.do?method=index");
|
||||
syncConfig.setResourceCode("qrCodeForm");
|
||||
syncConfig.setResourceModuleid("none");
|
||||
syncConfig.setCreatedate(nowDate);
|
||||
syncConfig.setUpdatedate(nowDate);
|
||||
syncConfig.setUpdateuserid(1L);
|
||||
syncConfig.setShow(true);
|
||||
syncConfig.setControl(true);
|
||||
syncConfig.setType(PrivMenuTypeEnums.systemPresetMenu.getKey());
|
||||
syncConfig.setParentId(configmenu.getId());
|
||||
menus.add(syncConfig);
|
||||
|
||||
DBAgent.saveAll(menus);
|
||||
} catch (Exception e) {
|
||||
log.error("组织机构同步菜单异常", e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
71
src/com/seeyon/apps/qrCodeForm/util/LoginUtil.java
Normal file
71
src/com/seeyon/apps/qrCodeForm/util/LoginUtil.java
Normal file
@@ -0,0 +1,71 @@
|
||||
package com.seeyon.apps.qrCodeForm.util;
|
||||
|
||||
import cn.hutool.cache.CacheUtil;
|
||||
import cn.hutool.cache.impl.TimedCache;
|
||||
import com.seeyon.apps.common.config.ICstConfigApi;
|
||||
import com.seeyon.apps.common.plugin.vo.ConfigVo;
|
||||
import com.seeyon.apps.qrCodeForm.constant.QrCodeFormConstants;
|
||||
import com.seeyon.ctp.common.AppContext;
|
||||
import com.seeyon.ctp.common.constants.Constants;
|
||||
import com.seeyon.ctp.rest.util.TokenUtil;
|
||||
import com.seeyon.ctp.services.UserToken;
|
||||
import com.seeyon.ctp.util.Strings;
|
||||
import com.seeyon.ctp.util.TextEncoder;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class LoginUtil {
|
||||
private static Log log = LogFactory.getLog(LoginUtil.class);
|
||||
|
||||
private static ICstConfigApi cstConfigApi = (ICstConfigApi) AppContext.getBean("cstConfigApi");
|
||||
|
||||
private static TimedCache<String, String> tokenCache = CacheUtil.newTimedCache(14 * 60 * 1000);
|
||||
|
||||
//rest信息
|
||||
// public static final String restName = AppContext.getSystemProperty("qrCodeForm.restName");
|
||||
// public static final String restPassword = AppContext.getSystemProperty("qrCodeForm.restPassword");
|
||||
|
||||
|
||||
/**
|
||||
* 获取token
|
||||
*
|
||||
* @param loginName 登录名
|
||||
* @return
|
||||
*/
|
||||
public static Map getToken(String memberId, String loginName, HttpServletRequest request, HttpServletResponse response) {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String tokenId = tokenCache.get(memberId);
|
||||
if(null != tokenId) {
|
||||
map.put("id", tokenId);
|
||||
map.put("success", true);
|
||||
return map;
|
||||
}
|
||||
try {
|
||||
ConfigVo config = cstConfigApi.getConfig(QrCodeFormConstants.getPluginId());
|
||||
String userName = config.getParamVal(QrCodeFormConstants.restId.name());
|
||||
String password = config.getParamVal(QrCodeFormConstants.restPwd.name());
|
||||
password = TextEncoder.decode(password);
|
||||
Long userId = null;
|
||||
if (Strings.isNotBlank(memberId)) {
|
||||
userId = Long.parseLong(memberId);
|
||||
}
|
||||
UserToken token = TokenUtil._getToken(userName, password, userId, loginName, null, Constants.login_useragent_from.wechat.name(), request, response);
|
||||
if (token != null) {
|
||||
map.put("success", true);
|
||||
map.put("id", token.getId());
|
||||
tokenCache.put(memberId, token.getId());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("", e);
|
||||
map.put("success", false);
|
||||
map.put("message", e.getMessage());
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
}
|
||||
47
src/com/seeyon/apps/src_dhxbacklog/DhxBacklogPluginApi.java
Normal file
47
src/com/seeyon/apps/src_dhxbacklog/DhxBacklogPluginApi.java
Normal file
@@ -0,0 +1,47 @@
|
||||
package com.seeyon.apps.src_dhxbacklog;
|
||||
|
||||
import com.seeyon.apps.common.plugin.api.APluginInfoApi;
|
||||
import com.seeyon.apps.common.plugin.vo.ConfigVo;
|
||||
import com.seeyon.apps.src_dhxbacklog.constanst.DhxFlowConstants;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class DhxBacklogPluginApi extends APluginInfoApi {
|
||||
public DhxBacklogPluginApi() {
|
||||
}
|
||||
|
||||
public String getPluginId() {
|
||||
System.out.println(DhxFlowConstants.getPluginId());
|
||||
return DhxFlowConstants.getPluginId();
|
||||
}
|
||||
|
||||
public String getCreateUser() {
|
||||
return "橙阳科技";
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return "集团组织架构同步管理";
|
||||
}
|
||||
|
||||
public ConfigVo getDefaultConfig() {
|
||||
ConfigVo configVo = new ConfigVo();
|
||||
DhxFlowConstants[] var2 = DhxFlowConstants.values();
|
||||
int var3 = var2.length;
|
||||
|
||||
for(int var4 = 0; var4 < var3; ++var4) {
|
||||
DhxFlowConstants value = var2[var4];
|
||||
if (value != DhxFlowConstants.plugin) {
|
||||
configVo.getDevParams().put(value.name(), value.getDefaultValue());
|
||||
configVo.getProdParams().put(value.name(), value.getDefaultValue());
|
||||
configVo.getParamMap().put(value.name(), value.getDescription());
|
||||
}
|
||||
}
|
||||
|
||||
return configVo;
|
||||
}
|
||||
|
||||
public void registerCustomEvent(Map eventAndNodes) {
|
||||
eventAndNodes.put("propertyDispose", "集团组织架构同步管理");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.seeyon.apps.src_dhxbacklog.constanst;
|
||||
|
||||
public enum DhxFlowConstants {
|
||||
|
||||
plugin("src_dhxbacklog","插件ID"),
|
||||
flowUrl("http://10.0.1.56/seeyon","流程平台URL"),
|
||||
TokenUrl("/rest/token/","token地址"),
|
||||
flowRestUsername("gongwenpush","流程平台restname"),
|
||||
flowRestPassword("2376d7fc-1664-4fb6-8dec-66356935ddb0","流程平台restpassword"),
|
||||
dhxflowssourl("/login/sso?from=dhxflowsso&ticket=", "PC单点登录地址"),
|
||||
dhxflowssoh5url("/H5/collaboration/index.html?token=", "H5单点登录地址");
|
||||
|
||||
|
||||
DhxFlowConstants(String defaultValue, String description) {
|
||||
this.defaultValue = defaultValue;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
private String defaultValue;
|
||||
private String description;
|
||||
|
||||
public String getDefaultValue() {
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public static String getPluginId() {
|
||||
return plugin.defaultValue;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.seeyon.apps.src_dhxbacklog.sso;
|
||||
|
||||
import com.seeyon.apps.common.config.ICstConfigApi;
|
||||
import com.seeyon.apps.common.plugin.vo.ConfigVo;
|
||||
import com.seeyon.apps.src_dhxbacklog.constanst.DhxFlowConstants;
|
||||
import com.seeyon.apps.src_dhxbacklog.util.GetToken;
|
||||
import com.seeyon.ctp.common.AppContext;
|
||||
import com.seeyon.ctp.common.controller.BaseController;
|
||||
import com.seeyon.ctp.organization.manager.OrgManager;
|
||||
import com.seeyon.ctp.util.annotation.Inject;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.Date;
|
||||
|
||||
public class DhxFlowWaitHandlesso extends BaseController {
|
||||
|
||||
@Inject
|
||||
private ICstConfigApi cstConfigApi;
|
||||
|
||||
private OrgManager orgManager;
|
||||
public void setOrgManager(OrgManager orgManager) {this.orgManager = orgManager; }
|
||||
public OrgManager getOrgManager() {
|
||||
if (orgManager == null) {orgManager = (OrgManager) AppContext.getBean("orgManager");}return orgManager;
|
||||
}
|
||||
|
||||
public ConfigVo getDhxBacklogConfig() {
|
||||
return cstConfigApi.getConfig(getPluginId());
|
||||
}
|
||||
|
||||
public String getPluginId() {
|
||||
return DhxFlowConstants.getPluginId();
|
||||
}
|
||||
|
||||
public ModelAndView index(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
// System.out.println("");
|
||||
ConfigVo configVo = getDhxBacklogConfig();
|
||||
ModelAndView mv = new ModelAndView();
|
||||
// 根据当前账号获取流程平台账号
|
||||
String userLoginName = AppContext.currentUserLoginName();
|
||||
// 获取当前绑定人员登录名
|
||||
String salt = "-";
|
||||
Date date = new Date();
|
||||
String ticket = userLoginName+salt+date.getTime();
|
||||
String toUrl = request.getParameter("tourl");
|
||||
String type = request.getParameter("type");
|
||||
String toEncodeUrl = URLEncoder.encode(toUrl, "UTF-8");
|
||||
|
||||
String pathUrl = configVo.getParamVal(DhxFlowConstants.flowUrl.name())+
|
||||
configVo.getParamVal(DhxFlowConstants.dhxflowssourl.name())+ticket+"&tourl="+toEncodeUrl;
|
||||
// 判断登录是否移动端
|
||||
if("H5".equals(type)){
|
||||
String changleRestUsername = configVo.getParamVal(DhxFlowConstants.flowRestUsername.name());
|
||||
String changleRestPassword = configVo.getParamVal(DhxFlowConstants.flowRestPassword.name());
|
||||
String url = configVo.getParamVal(DhxFlowConstants.flowUrl.name())+
|
||||
configVo.getParamVal(DhxFlowConstants.TokenUrl.name());
|
||||
// 调用接口获取TOKEN信息
|
||||
String token = GetToken.changleToken(url,changleRestUsername,changleRestPassword,userLoginName);
|
||||
pathUrl = configVo.getParamVal(DhxFlowConstants.flowUrl.name())+
|
||||
configVo.getParamVal(DhxFlowConstants.dhxflowssoh5url.name())+token+"&html="+toEncodeUrl+"&loginName="+userLoginName;
|
||||
}
|
||||
System.out.println(pathUrl);
|
||||
response.sendRedirect(pathUrl);
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
23
src/com/seeyon/apps/src_dhxbacklog/util/GetToken.java
Normal file
23
src/com/seeyon/apps/src_dhxbacklog/util/GetToken.java
Normal file
@@ -0,0 +1,23 @@
|
||||
package com.seeyon.apps.src_dhxbacklog.util;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
|
||||
public class GetToken {
|
||||
public static String changleToken(String changleURL , String restName,String restPassword,String loginName){
|
||||
// String url = "http://127.0.0.1/seeyon/rest/token/" + restName + "/" + restPassword + "?loginName=" + loginName;
|
||||
String url = changleURL + restName + "/" + restPassword + "?loginName=" + loginName;
|
||||
|
||||
String msg = HttpRequestUtils.httpGet(url);
|
||||
|
||||
String token = null;
|
||||
if (msg.length()>70){
|
||||
com.alibaba.fastjson.JSONObject object = JSON.parseObject(msg);
|
||||
Object id = object.get("id");
|
||||
token = id.toString();
|
||||
}else {
|
||||
token = msg;
|
||||
}
|
||||
|
||||
return token;
|
||||
}
|
||||
}
|
||||
241
src/com/seeyon/apps/src_dhxbacklog/util/HttpRequestUtils.java
Normal file
241
src/com/seeyon/apps/src_dhxbacklog/util/HttpRequestUtils.java
Normal file
@@ -0,0 +1,241 @@
|
||||
package com.seeyon.apps.src_dhxbacklog.util;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.apache.commons.httpclient.HttpClient;
|
||||
import org.apache.commons.httpclient.HttpStatus;
|
||||
import org.apache.commons.httpclient.NameValuePair;
|
||||
import org.apache.commons.httpclient.methods.PostMethod;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.entity.StringEntity;
|
||||
import org.apache.http.impl.client.DefaultHttpClient;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.net.URLDecoder;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public class HttpRequestUtils {
|
||||
/**
|
||||
* post请求
|
||||
*
|
||||
* @param url
|
||||
* url地址
|
||||
* @param jsonParam
|
||||
* 参数
|
||||
* @param needResponse
|
||||
* 需要返回结果
|
||||
* @return
|
||||
*/
|
||||
public static String httpPost(String url, JSONObject jsonParam,
|
||||
boolean needResponse) {
|
||||
// post请求返回结果
|
||||
DefaultHttpClient httpClient = new DefaultHttpClient();
|
||||
String jsonResult = null;
|
||||
HttpPost method = new HttpPost(url);
|
||||
try {
|
||||
if (null != jsonParam) {
|
||||
// 解决中文乱码问题
|
||||
StringEntity entity = new StringEntity(jsonParam.toString(),
|
||||
"utf-8");
|
||||
entity.setContentEncoding("UTF-8");
|
||||
entity.setContentType("application/json");
|
||||
method.setEntity(entity);
|
||||
}
|
||||
HttpResponse result = httpClient.execute(method);
|
||||
url = URLDecoder.decode(url, "UTF-8");
|
||||
/** 请求发送成功,并得到响应 **/
|
||||
if (result.getStatusLine().getStatusCode() == 200) {
|
||||
String str = "";
|
||||
try {
|
||||
/** 读取服务器返回过来的json字符串数据 **/
|
||||
str = EntityUtils.toString(result.getEntity());
|
||||
if (!needResponse) {
|
||||
return null;
|
||||
}
|
||||
/** 把json字符串转换成json对象 **/
|
||||
jsonResult = str;
|
||||
} catch (Exception e) {
|
||||
System.out.println("post请求提交失败:" + url);
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
System.out.println("post请求提交失败:" + url);
|
||||
}
|
||||
return jsonResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送get请求
|
||||
*
|
||||
* @param url
|
||||
* 路径
|
||||
* @return
|
||||
*/
|
||||
public static String httpGet(String url) {
|
||||
// get请求返回结果
|
||||
JSONObject jsonObject = null;
|
||||
String strResult = "";
|
||||
try {
|
||||
DefaultHttpClient client = new DefaultHttpClient();
|
||||
// 发送get请求
|
||||
HttpGet request = new HttpGet(url);
|
||||
HttpResponse response = client.execute(request);
|
||||
/** 请求发送成功,并得到响应 **/
|
||||
if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
|
||||
/** 读取服务器返回过来的json字符串数据 **/
|
||||
strResult = EntityUtils.toString(response.getEntity());
|
||||
/** 把json字符串转换成json对象 **/
|
||||
url = URLDecoder.decode(url, "UTF-8");
|
||||
} else {
|
||||
System.out.println("get请求提交失败:" + url);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
System.out.println("get请求提交失败:" + url);
|
||||
}
|
||||
return strResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* 向指定 URL 发送POST方法的请求
|
||||
*
|
||||
* @param url
|
||||
* 发送请求的 URL
|
||||
* @param param
|
||||
* 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
|
||||
* @return 所代表远程资源的响应结果
|
||||
*/
|
||||
public static String sendPost(String url, JSONObject param) {
|
||||
PrintWriter out = null;
|
||||
BufferedReader in = null;
|
||||
String result = "";
|
||||
try {
|
||||
URL realUrl = new URL(url);
|
||||
// 打开和URL之间的连接
|
||||
URLConnection conn = realUrl.openConnection();
|
||||
// 设置通用的请求属性
|
||||
conn.setRequestProperty("accept", "*/*");
|
||||
conn.setRequestProperty("connection", "Keep-Alive");
|
||||
conn.setRequestProperty("user-agent",
|
||||
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
|
||||
// 发送POST请求必须设置如下两行
|
||||
conn.setDoOutput(true);
|
||||
conn.setDoInput(true);
|
||||
// 获取URLConnection对象对应的输出流
|
||||
out = new PrintWriter(conn.getOutputStream());
|
||||
StringEntity entity = new StringEntity(param.toString(), "utf-8");
|
||||
// 发送请求参数
|
||||
out.print(entity);
|
||||
// flush输出流的缓冲
|
||||
out.flush();
|
||||
// 定义BufferedReader输入流来读取URL的响应
|
||||
in = new BufferedReader(
|
||||
new InputStreamReader(conn.getInputStream()));
|
||||
String line;
|
||||
while ((line = in.readLine()) != null) {
|
||||
result += line;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
System.out.println("发送 POST 请求出现异常!" + e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
// 使用finally块来关闭输出流、输入流
|
||||
finally {
|
||||
try {
|
||||
if (out != null) {
|
||||
out.close();
|
||||
}
|
||||
if (in != null) {
|
||||
in.close();
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static String doPost(String url, Map<String, String> params,
|
||||
String charset) {
|
||||
StringBuffer response = new StringBuffer();
|
||||
HttpClient client = new HttpClient();
|
||||
PostMethod method = new PostMethod(url);
|
||||
// 设置Http Post数据
|
||||
method.setRequestHeader("Content-Type",
|
||||
"application/x-www-form-urlencoded;charset=" + charset);
|
||||
if (params != null) {
|
||||
Set<String> keySet = params.keySet();
|
||||
NameValuePair[] param = new NameValuePair[keySet.size()];
|
||||
int i = 0;
|
||||
for (String key : keySet) {
|
||||
param[i] = new NameValuePair(key, params.get(key));
|
||||
i++;
|
||||
}
|
||||
method.setRequestBody(param);
|
||||
}
|
||||
InputStream responseBodyStream = null;
|
||||
InputStreamReader streamReader = null;
|
||||
BufferedReader reader = null;
|
||||
try {
|
||||
client.executeMethod(method);
|
||||
if (method.getStatusCode() == HttpStatus.SC_OK) {
|
||||
responseBodyStream = method.getResponseBodyAsStream();
|
||||
streamReader = new InputStreamReader(responseBodyStream,
|
||||
charset);
|
||||
reader = new BufferedReader(streamReader);
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
response.append(line);
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
} finally {
|
||||
try {
|
||||
responseBodyStream.close();
|
||||
streamReader.close();
|
||||
reader.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
method.releaseConnection();
|
||||
}
|
||||
return response.toString();
|
||||
}
|
||||
|
||||
public static String transport(String url, String message) {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
try {
|
||||
URL urls = new URL(url);
|
||||
HttpURLConnection uc = (HttpURLConnection) urls.openConnection();
|
||||
uc.setRequestMethod("POST");
|
||||
uc.setRequestProperty("content-type",
|
||||
"application/x-www-form-urlencoded");
|
||||
uc.setRequestProperty("charset", "UTF-8");
|
||||
uc.setDoOutput(true);
|
||||
uc.setDoInput(true);
|
||||
uc.setReadTimeout(10000);
|
||||
uc.setConnectTimeout(10000);
|
||||
OutputStream os = uc.getOutputStream();
|
||||
DataOutputStream dos = new DataOutputStream(os);
|
||||
dos.write(message.getBytes("utf-8"));
|
||||
dos.flush();
|
||||
os.close();
|
||||
BufferedReader in = new BufferedReader(new InputStreamReader(
|
||||
uc.getInputStream(), "utf-8"));
|
||||
String readLine = "";
|
||||
while ((readLine = in.readLine()) != null) {
|
||||
sb.append(readLine);
|
||||
}
|
||||
in.close();
|
||||
} catch (Exception e) {
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
46
src/com/seeyon/apps/src_dhxorganization/DhxPluginApi.java
Normal file
46
src/com/seeyon/apps/src_dhxorganization/DhxPluginApi.java
Normal file
@@ -0,0 +1,46 @@
|
||||
package com.seeyon.apps.src_dhxorganization;
|
||||
|
||||
import com.seeyon.apps.common.plugin.api.APluginInfoApi;
|
||||
import com.seeyon.apps.common.plugin.vo.ConfigVo;
|
||||
import com.seeyon.apps.src_dhxorganization.constants.DhxConstants;
|
||||
|
||||
|
||||
public class DhxPluginApi extends APluginInfoApi {
|
||||
public DhxPluginApi() {
|
||||
}
|
||||
|
||||
public String getPluginId() {
|
||||
System.out.println(DhxConstants.getPluginId());
|
||||
return DhxConstants.getPluginId();
|
||||
}
|
||||
|
||||
public String getCreateUser() {
|
||||
return "橙阳科技";
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return "U8C集成管理";
|
||||
}
|
||||
|
||||
public ConfigVo getDefaultConfig() {
|
||||
ConfigVo configVo = new ConfigVo();
|
||||
DhxConstants[] var2 = DhxConstants.values();
|
||||
int var3 = var2.length;
|
||||
|
||||
for(int var4 = 0; var4 < var3; ++var4) {
|
||||
DhxConstants value = var2[var4];
|
||||
if (value != DhxConstants.plugin) {
|
||||
configVo.getDevParams().put(value.name(), value.getDefaultValue());
|
||||
configVo.getProdParams().put(value.name(), value.getDefaultValue());
|
||||
configVo.getParamMap().put(value.name(), value.getDescription());
|
||||
}
|
||||
}
|
||||
|
||||
return configVo;
|
||||
}
|
||||
|
||||
// public void registerCustomEvent(Map eventAndNodes) {
|
||||
// eventAndNodes.put("propertyDispose", "资产管理待办推送");
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
package com.seeyon.apps.src_dhxorganization.archive;
|
||||
|
||||
import cn.hutool.log.Log;
|
||||
import com.seeyon.apps.common.config.ICstConfigApi;
|
||||
import com.seeyon.apps.common.plugin.vo.ConfigVo;
|
||||
import com.seeyon.apps.common.workflow.constants.WorkFlowType;
|
||||
import com.seeyon.apps.common.workflow.node.ACommonSuperNode;
|
||||
import com.seeyon.apps.ext.workflow.vo.FieldDataVo;
|
||||
import com.seeyon.apps.ext.workflow.vo.FormDataVo;
|
||||
import com.seeyon.apps.ext.workflow.vo.SuperNodeContext;
|
||||
import com.seeyon.apps.src_dhxorganization.util.Cap4ReturnUtil;
|
||||
import com.seeyon.apps.src_dhxorganization.util.DhxHttpUtil;
|
||||
import com.seeyon.apps.src_dhxorganization.util.ParamUtil;
|
||||
import com.seeyon.apps.src_dhxorganization.constants.DhxConstants;
|
||||
import com.seeyon.apps.src_dhxorganization.vo.DhxResponse;
|
||||
import com.seeyon.cap4.form.api.FormDataApi4Cap4;
|
||||
import com.seeyon.cap4.form.bean.FormDataMasterBean;
|
||||
import com.seeyon.ctp.common.AppContext;
|
||||
|
||||
public abstract class ArchiveCommonNode extends ACommonSuperNode {
|
||||
|
||||
private static Log log = Log.get(ArchiveCommonNode.class);
|
||||
protected ICstConfigApi cstConfigApi = (ICstConfigApi) AppContext.getBean("cstConfigApi");
|
||||
|
||||
@Override
|
||||
public String getPluginId() {
|
||||
return DhxConstants.getPluginId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFormParse() {
|
||||
return "json";
|
||||
}
|
||||
|
||||
@Override
|
||||
public WorkFlowType[] getTypes() {
|
||||
return new WorkFlowType[] {WorkFlowType.superNode};
|
||||
}
|
||||
|
||||
public ConfigVo getU8cConfig() {
|
||||
return cstConfigApi.getConfig(getPluginId());
|
||||
}
|
||||
|
||||
protected FormDataApi4Cap4 formDataApi4Cap4;
|
||||
|
||||
public void setFormDataApi4Cap4(FormDataApi4Cap4 formDataApi4Cap4) {
|
||||
this.formDataApi4Cap4 = formDataApi4Cap4;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public SuperNodeContext proceed(String request, FormDataVo formDataVo, FormDataMasterBean formDataMasterBean) throws Exception {
|
||||
SuperNodeContext context = new SuperNodeContext();
|
||||
System.out.println("开始处理单据"+getNodeId());
|
||||
ParamUtil paramUtil = new ParamUtil();
|
||||
String param = paramUtil.param(request,getMethod(),formDataVo);
|
||||
Cap4ReturnUtil cap4ReturnUtil = new Cap4ReturnUtil();
|
||||
try {
|
||||
FieldDataVo fhjg = formDataVo.getFieldData("U8C-返回结果");
|
||||
String value = fhjg.getStringValue();
|
||||
if(value.startsWith("推送U8C成功")) {
|
||||
return context.success("跳过:" + value);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
context.setException(true);
|
||||
context.back("处理异常:OA跳过处理异常:" + e.getMessage());
|
||||
formDataVo.getNewFieldDataMap().put("U8C-返回结果", "处理异常:OA跳过处理异常:" + e.getMessage());
|
||||
}
|
||||
ConfigVo configVo = getU8cConfig();
|
||||
context.setNeedSave(true);
|
||||
String url = configVo.getParamVal(DhxConstants.test.name());
|
||||
url += getMethod();
|
||||
context.setRequest(param);
|
||||
context.setUrl(url);
|
||||
try {
|
||||
String u8cSystem = configVo.getParamVal(DhxConstants.test.name());
|
||||
log.info(param);
|
||||
String response = DhxHttpUtil.doPost(url, param);
|
||||
System.out.println(response);
|
||||
context.setResponse(response);
|
||||
DhxResponse u8cResponse = DhxHttpUtil.parseResponse(response);
|
||||
if(u8cResponse.isSuccess()) {
|
||||
cap4ReturnUtil.setParamReturn(getMethod(),u8cResponse,formDataVo,getNodeId());
|
||||
System.out.println("参数处理完成"+u8cResponse);
|
||||
log.info(u8cResponse.getData());
|
||||
System.out.println("推送成功显示"+u8cResponse.getStatus());
|
||||
context.success("推送U8C成功:" + u8cResponse.getStatus(), false);
|
||||
formDataVo.getNewFieldDataMap().put("返回结果", "推送成功:" + u8cResponse.getStatus());
|
||||
|
||||
} else {
|
||||
context.setErrMsg(u8cResponse.getMsg());
|
||||
context.back("推送U8C失败:" + u8cResponse.getMsg());
|
||||
formDataVo.getNewFieldDataMap().put("返回结果", "推送失败:" + u8cResponse.getMsg());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
context.setException(true);
|
||||
context.back("推送U8C失败:OA处理异常:" + e.getMessage());
|
||||
formDataVo.getNewFieldDataMap().put("返回结果", "推送失败:OA处理异常" + e.getMessage());
|
||||
}
|
||||
return context;
|
||||
}
|
||||
|
||||
|
||||
public abstract String getMethod();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.seeyon.apps.src_dhxorganization.archive.node;
|
||||
|
||||
import com.seeyon.apps.src_dhxorganization.archive.ArchiveCommonNode;
|
||||
|
||||
public class UpdateHireFilesNode extends ArchiveCommonNode {
|
||||
|
||||
|
||||
@Override
|
||||
public String getMethod() {
|
||||
return "/seeyon/rest/cap4/form/soap/batch-update";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeId() {
|
||||
return "UpdateHireFilesNode";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeName() {
|
||||
return "员工录用审批保存人才库信息";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.seeyon.apps.src_dhxorganization.constants;
|
||||
|
||||
public enum DhxConstants {
|
||||
|
||||
|
||||
plugin("ydctu8c","插件ID"),
|
||||
test("test","test");
|
||||
|
||||
DhxConstants(String defaultValue, String description) {
|
||||
this.defaultValue = defaultValue;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
private String defaultValue;
|
||||
private String description;
|
||||
|
||||
public String getDefaultValue() {
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public static String getPluginId() {
|
||||
return plugin.defaultValue;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package com.seeyon.apps.src_dhxorganization.member;
|
||||
|
||||
import cn.hutool.log.Log;
|
||||
import com.seeyon.apps.common.config.ICstConfigApi;
|
||||
import com.seeyon.apps.common.plugin.vo.ConfigVo;
|
||||
import com.seeyon.apps.common.workflow.constants.WorkFlowType;
|
||||
import com.seeyon.apps.common.workflow.node.ACommonSuperNode;
|
||||
import com.seeyon.apps.ext.workflow.vo.FieldDataVo;
|
||||
import com.seeyon.apps.ext.workflow.vo.FormDataVo;
|
||||
import com.seeyon.apps.ext.workflow.vo.SuperNodeContext;
|
||||
import com.seeyon.apps.src_dhxorganization.util.Cap4ReturnUtil;
|
||||
import com.seeyon.apps.src_dhxorganization.util.DhxHttpUtil;
|
||||
import com.seeyon.apps.src_dhxorganization.util.ParamUtil;
|
||||
import com.seeyon.apps.src_dhxorganization.constants.DhxConstants;
|
||||
import com.seeyon.apps.src_dhxorganization.vo.DhxResponse;
|
||||
import com.seeyon.cap4.form.api.FormDataApi4Cap4;
|
||||
import com.seeyon.cap4.form.bean.FormDataMasterBean;
|
||||
import com.seeyon.ctp.common.AppContext;
|
||||
|
||||
public abstract class MemberCommonNode extends ACommonSuperNode {
|
||||
|
||||
|
||||
private static Log log = Log.get(MemberCommonNode.class);
|
||||
protected ICstConfigApi cstConfigApi = (ICstConfigApi) AppContext.getBean("cstConfigApi");
|
||||
|
||||
@Override
|
||||
public String getPluginId() {
|
||||
return DhxConstants.getPluginId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFormParse() {
|
||||
return "json";
|
||||
}
|
||||
|
||||
@Override
|
||||
public WorkFlowType[] getTypes() {
|
||||
return new WorkFlowType[] {WorkFlowType.superNode};
|
||||
}
|
||||
|
||||
public ConfigVo getU8cConfig() {
|
||||
return cstConfigApi.getConfig(getPluginId());
|
||||
}
|
||||
|
||||
protected FormDataApi4Cap4 formDataApi4Cap4;
|
||||
|
||||
public void setFormDataApi4Cap4(FormDataApi4Cap4 formDataApi4Cap4) {
|
||||
this.formDataApi4Cap4 = formDataApi4Cap4;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public SuperNodeContext proceed(String request, FormDataVo formDataVo, FormDataMasterBean formDataMasterBean) throws Exception {
|
||||
SuperNodeContext context = new SuperNodeContext();
|
||||
System.out.println("开始处理单据"+getNodeId());
|
||||
ParamUtil paramUtil = new ParamUtil();
|
||||
String param = paramUtil.param(request,getMethod(),formDataVo);
|
||||
Cap4ReturnUtil cap4ReturnUtil = new Cap4ReturnUtil();
|
||||
try {
|
||||
FieldDataVo fhjg = formDataVo.getFieldData("U8C-返回结果");
|
||||
String value = fhjg.getStringValue();
|
||||
if(value.startsWith("推送U8C成功")) {
|
||||
return context.success("跳过:" + value);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
context.setException(true);
|
||||
context.back("处理异常:OA跳过处理异常:" + e.getMessage());
|
||||
formDataVo.getNewFieldDataMap().put("U8C-返回结果", "处理异常:OA跳过处理异常:" + e.getMessage());
|
||||
}
|
||||
ConfigVo configVo = getU8cConfig();
|
||||
context.setNeedSave(true);
|
||||
String url = configVo.getParamVal(DhxConstants.test.name());
|
||||
url += getMethod();
|
||||
context.setRequest(param);
|
||||
context.setUrl(url);
|
||||
try {
|
||||
String u8cSystem = configVo.getParamVal(DhxConstants.test.name());
|
||||
log.info(param);
|
||||
String response = DhxHttpUtil.doPost(url, param);
|
||||
System.out.println(response);
|
||||
context.setResponse(response);
|
||||
DhxResponse u8cResponse = DhxHttpUtil.parseResponse(response);
|
||||
if(u8cResponse.isSuccess()) {
|
||||
cap4ReturnUtil.setParamReturn(getMethod(),u8cResponse,formDataVo,getNodeId());
|
||||
System.out.println("参数处理完成"+u8cResponse);
|
||||
log.info(u8cResponse.getData());
|
||||
System.out.println("推送成功显示"+u8cResponse.getStatus());
|
||||
context.success("推送U8C成功:" + u8cResponse.getStatus(), false);
|
||||
formDataVo.getNewFieldDataMap().put("返回结果", "推送成功:" + u8cResponse.getStatus());
|
||||
|
||||
} else {
|
||||
context.setErrMsg(u8cResponse.getMsg());
|
||||
context.back("推送U8C失败:" + u8cResponse.getMsg());
|
||||
formDataVo.getNewFieldDataMap().put("返回结果", "推送失败:" + u8cResponse.getMsg());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
context.setException(true);
|
||||
context.back("推送U8C失败:OA处理异常:" + e.getMessage());
|
||||
formDataVo.getNewFieldDataMap().put("返回结果", "推送失败:OA处理异常" + e.getMessage());
|
||||
}
|
||||
return context;
|
||||
}
|
||||
|
||||
|
||||
public abstract String getMethod();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.seeyon.apps.src_dhxorganization.util;
|
||||
|
||||
|
||||
import com.seeyon.apps.ext.workflow.vo.FormDataVo;
|
||||
import com.seeyon.apps.src_dhxorganization.vo.DhxResponse;
|
||||
import com.seeyon.ctp.common.exceptions.BusinessException;
|
||||
|
||||
|
||||
public class Cap4ReturnUtil {
|
||||
|
||||
public void setParamReturn(String method, DhxResponse dhxResponse, FormDataVo formDataVo, String nodeId) throws BusinessException, NoSuchFieldException {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.seeyon.apps.src_dhxorganization.util;
|
||||
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.seeyon.apps.src_dhxorganization.vo.DhxResponse;
|
||||
import com.seeyon.ctp.util.json.JSONUtil;
|
||||
|
||||
/**
|
||||
* 功能描述:<br>
|
||||
* <pre>
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @Author: HuangZhengguo
|
||||
* @Date: 2024/4/28
|
||||
*/
|
||||
public class DhxHttpUtil {
|
||||
|
||||
private DhxHttpUtil() {
|
||||
|
||||
}
|
||||
|
||||
public static String doPost(String url, String body) throws Exception {
|
||||
|
||||
return HttpRequest.post(url).header("accept", "*/*")
|
||||
.header("connection", "")
|
||||
.body(body).execute().body();
|
||||
}
|
||||
|
||||
public static DhxResponse parseResponse(String response) throws Exception {
|
||||
try {
|
||||
JSONObject object = JSONUtil.parseJSONString(response, JSONObject.class);
|
||||
return new DhxResponse(object);
|
||||
} catch (Exception e) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("Status", "0");
|
||||
jsonObject.put("Msg", "解析json异常");
|
||||
jsonObject.put("Data", response);
|
||||
return new DhxResponse(jsonObject);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
String url = "";
|
||||
}
|
||||
|
||||
}
|
||||
10
src/com/seeyon/apps/src_dhxorganization/util/ParamUtil.java
Normal file
10
src/com/seeyon/apps/src_dhxorganization/util/ParamUtil.java
Normal file
@@ -0,0 +1,10 @@
|
||||
package com.seeyon.apps.src_dhxorganization.util;
|
||||
|
||||
import com.seeyon.apps.ext.workflow.vo.FormDataVo;
|
||||
|
||||
public class ParamUtil {
|
||||
|
||||
public String param(String request, String method , FormDataVo formDataVo){
|
||||
return "";
|
||||
}
|
||||
}
|
||||
76
src/com/seeyon/apps/src_dhxorganization/vo/DhxResponse.java
Normal file
76
src/com/seeyon/apps/src_dhxorganization/vo/DhxResponse.java
Normal file
@@ -0,0 +1,76 @@
|
||||
package com.seeyon.apps.src_dhxorganization.vo;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
/**
|
||||
* 功能描述:<br>
|
||||
* <pre>
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @Author: HuangZhengguo
|
||||
* @Date: 2024/4/28
|
||||
*/
|
||||
public class DhxResponse {
|
||||
|
||||
private boolean success;
|
||||
private int status;
|
||||
private String msg;
|
||||
private String data;
|
||||
|
||||
|
||||
public DhxResponse(JSONObject object) {
|
||||
if(object.containsKey("Status")) {
|
||||
this.status = object.getInteger("Status");
|
||||
} else {
|
||||
this.status = object.getString("status").equals("success")?1:2;
|
||||
}
|
||||
this.success = (1 == status);
|
||||
if(object.containsKey("Msg")) {
|
||||
this.msg = object.getString("Msg");
|
||||
} else {
|
||||
this.msg = object.getString("errormsg");
|
||||
}
|
||||
if(object.containsKey("Data")) {
|
||||
this.data = object.getString("Data");
|
||||
} else {
|
||||
this.data = object.getString("data");
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public DhxResponse setSuccess(boolean success) {
|
||||
this.success = success;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public DhxResponse setStatus(int status) {
|
||||
this.status = status;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public DhxResponse setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public DhxResponse setData(String data) {
|
||||
this.data = data;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
138
src/com/seeyon/apps/src_dingding/ctrl/StartTaskController.java
Normal file
138
src/com/seeyon/apps/src_dingding/ctrl/StartTaskController.java
Normal file
@@ -0,0 +1,138 @@
|
||||
package com.seeyon.apps.src_dingding.ctrl;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.seeyon.ctp.common.AppContext;
|
||||
import com.seeyon.ctp.common.controller.BaseController;
|
||||
import com.seeyon.ctp.common.exceptions.BusinessException;
|
||||
import com.seeyon.ctp.common.quartz.QuartzHolder;
|
||||
import com.seeyon.ctp.util.annotation.NeedlessCheckLogin;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.seeyon.apps.src_dingding.service.DingdingService;
|
||||
import com.seeyon.apps.src_dingding.task.DingdingTask;
|
||||
import com.taobao.api.ApiException;
|
||||
|
||||
/**
|
||||
* Description
|
||||
* <pre>定时任务控制器</pre>
|
||||
* Copyright(c) Beijing Seeyon Software Co.,LTD
|
||||
*/
|
||||
public class StartTaskController extends BaseController {
|
||||
|
||||
|
||||
private DingdingService dingdingService;
|
||||
|
||||
public DingdingService getDingdingService() {
|
||||
if (dingdingService == null) {
|
||||
dingdingService = (DingdingService) AppContext.getBean("dingdingService");
|
||||
}
|
||||
return dingdingService; }
|
||||
|
||||
public void setDingdingService(DingdingService dingdingService) {
|
||||
this.dingdingService = dingdingService;
|
||||
}
|
||||
|
||||
|
||||
@NeedlessCheckLogin
|
||||
public ModelAndView index(HttpServletRequest request, HttpServletResponse response) throws IOException, RuntimeException, ApiException, BusinessException, SQLException, InterruptedException {
|
||||
// 用于执行定时任务的开启和关闭
|
||||
String opera = request.getParameter("task");
|
||||
if("start".equals(opera)) {
|
||||
String time;
|
||||
try {
|
||||
// time = ConfigKit.getTaskTime();
|
||||
// time = automaticService.getTaskTime();
|
||||
time = request.getParameter("time");
|
||||
} catch (Exception e) {
|
||||
super.rendJavaScript(response, "alert('获取配置出错');");
|
||||
return null;
|
||||
}
|
||||
if(null == time) {
|
||||
super.rendJavaScript(response, "alert('请正確配置请求地址中的time参数,如果定时执行,启用D-开头,如D-03,15表示每天三点十五执行,如果间隔时间执行,请用I-开头,例如I-03,00表示每三个小时执行一次!');");
|
||||
return null;
|
||||
} else if(time.startsWith("D-")) {
|
||||
// D-开头,每天执行任务
|
||||
String[] arr = time.split("-");
|
||||
try {
|
||||
Integer[] itime = getTime(arr);
|
||||
DingdingTask.registerSyncTask(false, itime[0], itime[1]);
|
||||
super.rendJavaScript(response, "alert('任务注册成功,每天" + itime[0] + "点," + itime[1] + "分执行');");
|
||||
return null;
|
||||
} catch (Exception e) {
|
||||
super.rendJavaScript(response, "alert('" + e.getMessage() + "');");
|
||||
return null;
|
||||
}
|
||||
} else if(time.startsWith("I-")) {
|
||||
// i-开头,是间隔时间执行
|
||||
String[] arr = time.split("-");
|
||||
try {
|
||||
Integer[] itime = getTime(arr);
|
||||
DingdingTask.registerSyncTask(true, itime[0], itime[1]);
|
||||
super.rendJavaScript(response, "alert('任务注册成功,间隔" + itime[0] + "小时," + itime[1] + "分钟执行');");
|
||||
return null;
|
||||
} catch (Exception e) {
|
||||
super.rendJavaScript(response, "alert('" + e.getMessage() + "');");
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
super.rendJavaScript(response, "alert('请正確配置链接地址中的time参数,如果定时执行,启用D-开头,如D-03,15表示每天三点十五执行,如果间隔时间执行,请用I-开头,例如I-03,00表示每三个小时执行一次!');");
|
||||
return null;
|
||||
}
|
||||
} else if("stop".equals(opera)){
|
||||
QuartzHolder.deleteQuartzJob(DingdingTask.jobName);
|
||||
super.rendJavaScript(response, "alert('定时任务已经终止!');");
|
||||
return null;
|
||||
} else if("run".equals(opera)) {
|
||||
try{
|
||||
String datestr = request.getParameter("date");
|
||||
String ty = request.getParameter("ty");
|
||||
String msg = "";
|
||||
if("dk".equals(ty)){
|
||||
msg = getDingdingService().dingdingclockin(datestr);
|
||||
|
||||
}else if ("kq".equals(ty)){
|
||||
msg = getDingdingService().setWorkAttendance(datestr);
|
||||
// getDingdingService().setWorkAttendance1();
|
||||
}else{
|
||||
getDingdingService().dingdingattendance();
|
||||
msg = "参数输入错误请校验填写ty参数,date参数,进行数据进行数据调试";
|
||||
}
|
||||
super.rendJavaScript(response, msg);
|
||||
}catch (Exception e) {
|
||||
super.rendJavaScript(response, "alert('定时任务执行失败!"+e.getMessage()+"');");
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
} else {
|
||||
super.rendJavaScript(response, "alert('参数有误,请联系开发人员!');");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private Integer[] getTime(String[] arr) throws Exception {
|
||||
String time = arr[1];
|
||||
arr = time.split(",");
|
||||
if(arr.length != 2) {
|
||||
throw new Exception("小时和分钟请用逗号隔开");
|
||||
}
|
||||
int our = Integer.valueOf(arr[0]);
|
||||
int minute = Integer.valueOf(arr[1]);
|
||||
if(our < 0 || our >= 24) {
|
||||
throw new Exception("小时数必须在0~24之间");
|
||||
}
|
||||
if(minute < 0 || minute >= 60) {
|
||||
throw new Exception("分钟数必须在0~60之间");
|
||||
}
|
||||
return new Integer[] {our, minute};
|
||||
}
|
||||
|
||||
// public void setPushZcService(PushZcService pushZcService) {
|
||||
// this.pushZcService = pushZcService;
|
||||
// }
|
||||
|
||||
}
|
||||
825
src/com/seeyon/apps/src_dingding/dao/DingdingDaoImpl.java
Normal file
825
src/com/seeyon/apps/src_dingding/dao/DingdingDaoImpl.java
Normal file
@@ -0,0 +1,825 @@
|
||||
package com.seeyon.apps.src_dingding.dao;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.seeyon.apps.src_dingding.vo.AttendanceVo;
|
||||
import com.seeyon.apps.src_dingding.vo.CheckOnWorkAttendanceVo;
|
||||
import com.seeyon.ctp.common.exceptions.BusinessException;
|
||||
import com.seeyon.ctp.util.JDBCAgent;
|
||||
import com.seeyon.ctp.util.UUIDLong;
|
||||
import nc.vo.jcom.lang.StringUtil;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import com.seeyon.apps.src_dingding.util.BaseUtil;
|
||||
|
||||
public class DingdingDaoImpl extends BaseUtil implements IDingdingDao{
|
||||
|
||||
private final static Log log = LogFactory.getLog(DingdingDaoImpl.class);
|
||||
|
||||
private String adddept = "insert into SRC_DINGDING_OA_DEPT values (?,?,?,?,?)";
|
||||
private String updateWorkAttendance = "update SRC_CHECK_ON_WORK_ATTENDANCE set SHANGBAN1 = ? ,XIABAN1 = ? ,SHANGBAN2 = ? , XIABAN2 = ? ,STATE = ? where id = ?";
|
||||
private String addmember = "insert into SRC_DINGDING_OA_MEMBER values (?,?,?,?,?)";
|
||||
private String addCheckOnWorkAttendance = "insert into SRC_CHECK_ON_WORK_ATTENDANCE VALUES";
|
||||
private String getdeptBysuperDeptId = "select * from SRC_DINGDING_OA_DEPT where DINGDINGDEPTID = '${dingdingdeptid}'";
|
||||
private String getdeptByPathName = "select NAME,ID from ORG_UNIT where PATH like ? and NAME = ? AND IS_INTERNAL = 1 AND IS_ENABLE = 1 AND IS_DELETED = 0";
|
||||
private String getDingdingOaDept = "select * from SRC_DINGDING_OA_DEPT ";
|
||||
private String getDingdingOaMember = "SELECT * FROM (SELECT a.*, ROWNUM rnum FROM (SELECT * FROM SRC_DINGDING_OA_MEMBER ORDER BY id ) a WHERE ROWNUM <= ? ) WHERE rnum > ? ";
|
||||
private String getDingdingOaMemberNum = "select count(t.oamemberid) as num from (SELECT oamemberid,count(oamemberid) as oanum FROM SRC_DINGDING_OA_MEMBER group by oamemberid) t";
|
||||
private String getDepartmentById = "select ID,NAME,PATH from ORG_UNIT WHERE ID = ? AND IS_INTERNAL = 1 AND IS_ENABLE = 1 AND IS_DELETED = 0";
|
||||
private String getdeptsizeBydingdingid = "select count(id) as DINGDINGSIZE from src_dingding_oa_dept where dingdingdeptid = '${dingdingdeptid}'";
|
||||
private String getmembersizeBydingdingid = "select count(id) as DINGDINGSIZE from src_dingding_oa_member where dingdingmemberid = '${dingdingmemberid}'";
|
||||
private String getClockInNumBymember = "select COUNT(field0001) as num from formmain_10430 where field0001 = ? and field0006>=to_date(?,'YYYY-MM-DD') group by field0001";
|
||||
private String getClockInBymember = "select * from formson_10431 tb1 left join formmain_10430 tb2 on tb1.formmain_id = tb2.id where tb2.field0001 = ? and tb2.field0006=to_date(?,'YYYY-MM-DD')";
|
||||
private String getLeave = "select * from formmain_10368 where field0003 = ? and field0010 >= to_date(?,'YYYY-MM-DD') and field0009 <= TO_DATE(?,'YYYY-MM-DD')";
|
||||
private String getEvections = "select * from formmain_10367 where field0003 = ? and field0011 >= to_date(?,'YYYY-MM-DD') and field0010 <= to_date(?,'YYYY-MM-DD')";
|
||||
private String getWorkAttendanceByDate = "select * from SRC_CHECK_ON_WORK_ATTENDANCE where MEMBERID = ? and CHECKONWORKATTENDANCEDATE >= to_date(?,'YYYY-MM-DD HH24:MI:SS') and CHECKONWORKATTENDANCEDATE <= to_date(?,'YYYY-MM-DD HH24:MI:SS')";
|
||||
// private String getWorkAttendanceByDate = "select * from SRC_CHECK_ON_WORK_ATTENDANCE where MEMBERID = ? and CHECKONWORKATTENDANCEDATE >= ? and CHECKONWORKATTENDANCEDATE <= ?";
|
||||
private String getAdjustLeave = "select * from formmain_10363 where field0007 = ? and field0013 >= to_date(?,'YYYY-MM-DD') and field0001 <= to_date(?,'YYYY-MM-DD')";
|
||||
private String getOvertime = "select * from formson_10366 where field0033 = ? and field0030 >= to_date(?,'YYYY-MM-DD') and field0029 <= to_date(?,'YYYY-MM-DD')";
|
||||
private String getMakeCard = "select * from formmain_10369 where field0007 = ? and field0001 >= to_date(?,'YYYY-MM-DD') and field0001 <= to_date(?,'YYYY-MM-DD')";
|
||||
private String getGroupName = "select field0002 from formmain_10430 where field0001 = ? and field0002 is not null and rownum = 1";
|
||||
private String getDingdingAttendanceSize = "select COUNT(id) AS con from SRC_DINGDING_ATTENDANCE where id = ? ";
|
||||
private String addDingdingAttendance = "insert into SRC_DINGDING_ATTENDANCE(ID,GROUPID,GROUPNAME) values (?,?,?)";
|
||||
private String updateDingdingAttendance = "UPDATE SRC_DINGDING_ATTENDANCE SET GROUPNAME = ? where GROUPID = ?";
|
||||
private String getDingdingAttendanceBygroupId = "select * from SRC_DINGDING_ATTENDANCE where groupid = ?";
|
||||
|
||||
public Map<String,String> getDingdingAttendanceBygroupId(String groupid) {
|
||||
Map<String,String> ret = new HashMap<String, String>();
|
||||
JDBCAgent agent = new JDBCAgent();
|
||||
try {
|
||||
StringBuilder sql = new StringBuilder(getDingdingAttendanceBygroupId);
|
||||
List<Object> p = new ArrayList<Object>();
|
||||
p.add(groupid);
|
||||
agent.execute(sql.toString(), p);
|
||||
List<Map> list = agent.resultSetToList();
|
||||
for (Map map : list) {
|
||||
ret.put("groupid", map.get("groupid").toString());
|
||||
ret.put("groupname", map.get("groupname").toString());
|
||||
}
|
||||
} catch (BusinessException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (SQLException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}finally {
|
||||
if (agent != null) {
|
||||
agent.close();
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
public int addDingdingAttendance(AttendanceVo attendanceVo) {
|
||||
int i = 0;
|
||||
try {
|
||||
long id = UUIDLong.longUUID();
|
||||
String sql = addDingdingAttendance;
|
||||
Object[] params = null;
|
||||
params = new Object[] { id,attendanceVo.getGroupid(),attendanceVo.getGroupname() };
|
||||
i = super.executeUpdate(sql.toString(), params);
|
||||
} finally {
|
||||
super.close();
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
public int updateDingdingAttendance(AttendanceVo attendanceVo) {
|
||||
int i = 0;
|
||||
try {
|
||||
long id = UUIDLong.longUUID();
|
||||
String sql = updateDingdingAttendance;
|
||||
Object[] params = null;
|
||||
params = new Object[] { attendanceVo.getGroupname(),attendanceVo.getGroupid() };
|
||||
i = super.executeUpdate(sql.toString(), params);
|
||||
} finally {
|
||||
super.close();
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getDingdingAttendanceSize(String attendanceId) {
|
||||
int ret = 0;
|
||||
JDBCAgent agent = new JDBCAgent();
|
||||
try {
|
||||
StringBuilder sql = new StringBuilder(getDingdingAttendanceSize);
|
||||
List<Object> p = new ArrayList<Object>();
|
||||
p.add(attendanceId);
|
||||
agent.execute(sql.toString(), p);
|
||||
List<Map> list = agent.resultSetToList();
|
||||
for (Map map : list) {
|
||||
String con = map.get("con").toString();
|
||||
ret = Integer.parseInt(con);
|
||||
}
|
||||
} catch (BusinessException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (SQLException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}finally {
|
||||
if (agent != null) {
|
||||
agent.close();
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
public int adddept(Map<String, String> map) {
|
||||
int i = 0;
|
||||
try {
|
||||
long id = UUIDLong.longUUID();
|
||||
String sql = adddept;
|
||||
Object[] params = null;
|
||||
params = new Object[] { id,map.get("oadeptid"),map.get("oadeptname"),map.get("dingdingdeptid"),map.get("dingdingdeptname") };
|
||||
i = super.executeUpdate(sql.toString(), params);
|
||||
} finally {
|
||||
super.close();
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
public Map<String,Object> getdeptBysuperDeptId(String deptid) {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String sql = getdeptBysuperDeptId;
|
||||
sql = sql.replace("${dingdingdeptid}", deptid);
|
||||
Object[] params = new Object[] {};
|
||||
ResultSet rs = super.executeQuery(sql, params);
|
||||
try {
|
||||
while (rs.next()) {
|
||||
map.put("oadeptid", rs.getString("oadeptid"));
|
||||
map.put("oadeptname", rs.getString("oadeptname"));
|
||||
map.put("dingdingdeptid", rs.getString("dingdingdeptid"));
|
||||
map.put("dingdingdeptname", rs.getString("dingdingdeptname"));
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}finally {
|
||||
super.close();
|
||||
}
|
||||
return map;
|
||||
|
||||
}
|
||||
|
||||
|
||||
public Map<String,Object> getdeptByPathName(String path,String name) throws BusinessException, SQLException {
|
||||
Map<String,Object> ret = new HashMap<String, Object>();
|
||||
JDBCAgent agent = new JDBCAgent();
|
||||
try {
|
||||
StringBuilder sql = new StringBuilder(getdeptByPathName);
|
||||
List<Object> p = new ArrayList<Object>();
|
||||
p.add(path);
|
||||
p.add(name);
|
||||
agent.execute(sql.toString(), p);
|
||||
List<Map> list = agent.resultSetToList();
|
||||
if(list.size()==0) {
|
||||
return null;
|
||||
}
|
||||
for (Map map : list) {
|
||||
ret.put("name", map.get("name"));
|
||||
ret.put("id", map.get("id"));
|
||||
}
|
||||
} catch (BusinessException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (SQLException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}finally {
|
||||
if (agent != null) {
|
||||
agent.close();
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getDingdingOaDept() throws BusinessException, SQLException {
|
||||
List<Map<String,Object>> ret = new ArrayList<Map<String,Object>>();
|
||||
JDBCAgent agent = new JDBCAgent();
|
||||
try {
|
||||
StringBuilder sql = new StringBuilder(getDingdingOaDept);
|
||||
List<Object> p = new ArrayList<Object>();
|
||||
agent.execute(sql.toString(), p);
|
||||
List<Map> list = agent.resultSetToList();
|
||||
for (Map map : list) {
|
||||
Map<String,Object> m = new HashMap<String, Object>();
|
||||
m.put("dingdingdeptid", map.get("dingdingdeptid"));
|
||||
m.put("dingdingdeptname", map.get("dingdingdeptname"));
|
||||
m.put("oadeptid", map.get("oadeptid"));
|
||||
m.put("oadeptname", map.get("oadeptname"));
|
||||
ret.add(m);
|
||||
}
|
||||
} catch (BusinessException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (SQLException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}finally {
|
||||
if (agent != null) {
|
||||
agent.close();
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getDepartmentById(Long deptid) throws BusinessException, SQLException {
|
||||
JDBCAgent agent = new JDBCAgent();
|
||||
Map<String,Object> ret = new HashMap<String,Object>();
|
||||
try {
|
||||
StringBuilder sql = new StringBuilder(getDepartmentById);
|
||||
List<Object> p = new ArrayList<Object>();
|
||||
p.add(deptid);
|
||||
agent.execute(sql.toString(), p);
|
||||
List<Map> list = agent.resultSetToList();
|
||||
for (Map map : list) {
|
||||
ret.put("id", map.get("id"));
|
||||
ret.put("name", map.get("name"));
|
||||
ret.put("path", map.get("path"));
|
||||
}
|
||||
} catch (BusinessException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (SQLException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}finally {
|
||||
if (agent != null) {
|
||||
agent.close();
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int addmember(Map<String, String> map) {
|
||||
int i = 0;
|
||||
try {
|
||||
long id = UUIDLong.longUUID();
|
||||
String sql = addmember;
|
||||
Object[] params = null;
|
||||
params = new Object[] { id,map.get("oamemberid"),map.get("oamembername"),map.get("dingdingmemberid"),map.get("dingdingmembername") };
|
||||
i = super.executeUpdate(sql.toString(), params);
|
||||
} finally {
|
||||
super.close();
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getdeptsizeBydingdingid(String dingdingdeptid) {
|
||||
boolean boo = false;
|
||||
String sql = getdeptsizeBydingdingid;
|
||||
sql = sql.replace("${dingdingdeptid}", dingdingdeptid);
|
||||
Object[] params = new Object[] {};
|
||||
ResultSet rs = super.executeQuery(sql, params);
|
||||
try {
|
||||
while (rs.next()) {
|
||||
String dingdingsize = rs.getString("DINGDINGSIZE");
|
||||
int size = Integer.parseInt(dingdingsize);
|
||||
if(size>0) {
|
||||
boo = true;
|
||||
}
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}finally {
|
||||
super.close();
|
||||
}
|
||||
return boo;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean getmembersizeBydingdingid(String dingdingmemberid) {
|
||||
boolean boo = false;
|
||||
int ii = 0;
|
||||
String sql = getmembersizeBydingdingid;
|
||||
sql = sql.replace("${dingdingmemberid}", dingdingmemberid);
|
||||
Object[] params = new Object[] {};
|
||||
ResultSet rs = super.executeQuery(sql, params);
|
||||
try {
|
||||
while (rs.next()) {
|
||||
String dingdingsize = rs.getString("DINGDINGSIZE");
|
||||
int size = Integer.parseInt(dingdingsize);
|
||||
ii = size;
|
||||
if(size>0) {
|
||||
boo = true;
|
||||
}
|
||||
}
|
||||
log.info(sql+boo+ii);
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}finally {
|
||||
super.close();
|
||||
}
|
||||
return boo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getClockInNumBymember(String date, String memberId) {
|
||||
int in = 0;
|
||||
JDBCAgent agent = new JDBCAgent();
|
||||
try {
|
||||
StringBuilder sql = new StringBuilder(getClockInNumBymember);
|
||||
List<Object> p = new ArrayList<Object>();
|
||||
p.add(memberId);
|
||||
p.add(date);
|
||||
agent.execute(sql.toString(), p);
|
||||
List<Map> list = agent.resultSetToList();
|
||||
for (Map map : list) {
|
||||
in = Integer.parseInt(map.get("num").toString());
|
||||
}
|
||||
} catch (BusinessException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (SQLException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}finally {
|
||||
if (agent != null) {
|
||||
agent.close();
|
||||
}
|
||||
}
|
||||
return in;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String ,Object>> getClockInBymember(String date, String memberId) {
|
||||
List<Map<String,Object>> ret = new ArrayList<Map<String,Object>>();
|
||||
JDBCAgent agent = new JDBCAgent();
|
||||
try {
|
||||
StringBuilder sql = new StringBuilder(getClockInBymember);
|
||||
List<Object> p = new ArrayList<Object>();
|
||||
p.add(memberId);
|
||||
p.add(date);
|
||||
agent.execute(sql.toString(), p);
|
||||
List<Map> list = agent.resultSetToList();
|
||||
for (Map map : list) {
|
||||
Map<String,Object> m = new HashMap<String, Object>();
|
||||
m.put("clockInDate", map.get("field0008").toString());
|
||||
m.put("referenceDate", map.get("field0009").toString());
|
||||
m.put("groupName", map.get("field0002").toString());
|
||||
m.put("state", map.get("field0010"));
|
||||
m.put("type", map.get("field0014"));
|
||||
ret.add(m);
|
||||
}
|
||||
} catch (BusinessException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (SQLException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}finally {
|
||||
if (agent != null) {
|
||||
agent.close();
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int addCheckOnWorkAttendance(CheckOnWorkAttendanceVo checkOnWorkAttendanceVo) {
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
int i = 0 ;
|
||||
JDBCAgent agent = new JDBCAgent();
|
||||
try {
|
||||
StringBuilder sql = new StringBuilder(addCheckOnWorkAttendance);
|
||||
Object[] params = null;
|
||||
sql.append(" ('"+checkOnWorkAttendanceVo.getId()+"','"+checkOnWorkAttendanceVo.getMemberId()+"'");
|
||||
if(checkOnWorkAttendanceVo.getCheckOnWorkAttendanceDate() == null){
|
||||
sql.append(",''");
|
||||
}else{
|
||||
sql.append(",TO_DATE('"+simpleDateFormat.format(checkOnWorkAttendanceVo.getCheckOnWorkAttendanceDate())+"','YYYY-MM-DD HH24:MI:SS')");
|
||||
}
|
||||
|
||||
// 上班1
|
||||
if(checkOnWorkAttendanceVo.getShangbanDate1() == null){
|
||||
sql.append(",''");
|
||||
}else{
|
||||
sql.append(",TO_DATE('"+simpleDateFormat.format(checkOnWorkAttendanceVo.getShangbanDate1())+"','YYYY-MM-DD HH24:MI:SS')");
|
||||
}
|
||||
if(StringUtil.isEmpty(checkOnWorkAttendanceVo.getShangban1())){
|
||||
sql.append(",''");
|
||||
}else{
|
||||
sql.append(",'"+checkOnWorkAttendanceVo.getShangban1()+"'");
|
||||
}
|
||||
|
||||
// 下班1
|
||||
if(checkOnWorkAttendanceVo.getXiabanDate1() == null){
|
||||
sql.append(",''");
|
||||
}else{
|
||||
sql.append(",TO_DATE('"+simpleDateFormat.format(checkOnWorkAttendanceVo.getXiabanDate1())+"','YYYY-MM-DD HH24:MI:SS')");
|
||||
}
|
||||
if(StringUtil.isEmpty(checkOnWorkAttendanceVo.getXiaban1())){
|
||||
sql.append(",''");
|
||||
}else{
|
||||
sql.append(",'"+checkOnWorkAttendanceVo.getXiaban1()+"'");
|
||||
}
|
||||
|
||||
// 上班2
|
||||
if(checkOnWorkAttendanceVo.getShangbanDate2() == null){
|
||||
sql.append(",''");
|
||||
}else{
|
||||
sql.append(",TO_DATE('"+simpleDateFormat.format(checkOnWorkAttendanceVo.getShangbanDate2())+"','YYYY-MM-DD HH24:MI:SS')");
|
||||
}
|
||||
if(StringUtil.isEmpty(checkOnWorkAttendanceVo.getShangban2())){
|
||||
sql.append(",''");
|
||||
}else{
|
||||
sql.append(",'"+checkOnWorkAttendanceVo.getShangban2()+"'");
|
||||
}
|
||||
|
||||
// 下班2
|
||||
if(checkOnWorkAttendanceVo.getXiabanDate2() == null){
|
||||
sql.append(",''");
|
||||
}else{
|
||||
sql.append(",TO_DATE('"+simpleDateFormat.format(checkOnWorkAttendanceVo.getXiabanDate2())+"','YYYY-MM-DD HH24:MI:SS')");
|
||||
}
|
||||
if(StringUtil.isEmpty(checkOnWorkAttendanceVo.getXiaban2())){
|
||||
sql.append(",''");
|
||||
}else{
|
||||
sql.append(",'"+checkOnWorkAttendanceVo.getXiaban2()+"'");
|
||||
}
|
||||
|
||||
sql.append(",'"+checkOnWorkAttendanceVo.getState()+"'");
|
||||
sql.append(",'"+checkOnWorkAttendanceVo.getGroupName()+"')");
|
||||
List<Object> p = new ArrayList<Object>();
|
||||
i=agent.execute(sql.toString(), p);
|
||||
} catch (BusinessException e) {
|
||||
e.printStackTrace();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if (agent != null) {
|
||||
agent.close();
|
||||
}
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getLeave( String memberId,String startDate, String endDate) {
|
||||
List<Map<String,Object>> ret = new ArrayList<Map<String,Object>>();
|
||||
JDBCAgent agent = new JDBCAgent();
|
||||
try {
|
||||
StringBuilder sql = new StringBuilder(getLeave);
|
||||
List<Object> p = new ArrayList<Object>();
|
||||
p.add(memberId);
|
||||
p.add(startDate);
|
||||
p.add(endDate);
|
||||
agent.execute(sql.toString(), p);
|
||||
List<Map> list = agent.resultSetToList();
|
||||
for (Map map : list) {
|
||||
Map<String,Object> m = new HashMap<String, Object>();
|
||||
m.put("member", map.get("field0003"));
|
||||
m.put("type", map.get("field0031"));
|
||||
m.put("startDateStr", map.get("field0009"));
|
||||
m.put("endDateStr", map.get("field0010"));
|
||||
ret.add(m);
|
||||
}
|
||||
} catch (BusinessException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (SQLException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}finally {
|
||||
if (agent != null) {
|
||||
agent.close();
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<CheckOnWorkAttendanceVo> getWorkAttendanceByDate(String memberId, String startDate, String endDate) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
log.info("查询的参数"+memberId+startDate+endDate);
|
||||
List<CheckOnWorkAttendanceVo> ret = new ArrayList<CheckOnWorkAttendanceVo>();
|
||||
JDBCAgent agent = new JDBCAgent();
|
||||
try {
|
||||
StringBuilder sql = new StringBuilder(getWorkAttendanceByDate);
|
||||
List<Object> p = new ArrayList<Object>();
|
||||
p.add(memberId);
|
||||
p.add(startDate);
|
||||
p.add(endDate);
|
||||
agent.execute(sql.toString(), p);
|
||||
log.info("执行SQL");
|
||||
List<Map> list = agent.resultSetToList();
|
||||
log.info(list.size());
|
||||
for (Map map : list) {
|
||||
log.info(map);
|
||||
log.info(map.get("shangbandate1")!= null);
|
||||
CheckOnWorkAttendanceVo m = new CheckOnWorkAttendanceVo();
|
||||
m.setId(Long.parseLong( map.get("id").toString()));
|
||||
m.setMemberId(Long.parseLong(map.get("memberid").toString()));
|
||||
log.info(sdf.parse(map.get("checkonworkattendancedate").toString()));
|
||||
m.setCheckOnWorkAttendanceDate(sdf.parse(map.get("checkonworkattendancedate").toString()));
|
||||
log.info("shangban1"+map.get("shangbandate1"));
|
||||
if(map.get("shangbandate1") != null){
|
||||
m.setShangbanDate1(sdf.parse(map.get("shangbandate1").toString()));
|
||||
m.setShangban1(map.get("shangban1").toString());
|
||||
}else{
|
||||
m.setShangbanDate1(null);
|
||||
m.setShangban1("未打卡");
|
||||
}
|
||||
log.info("xiaban1"+map.get("xiabandate1"));
|
||||
if(map.get("xiabandate1") != null){
|
||||
m.setXiabanDate1(sdf.parse(map.get("xiabandate1").toString()));
|
||||
m.setXiaban1(map.get("xiaban1").toString());
|
||||
}else{
|
||||
m.setXiabanDate1(null);
|
||||
m.setXiaban1("未打卡");
|
||||
}
|
||||
log.info("shangban2"+map.get("shangbandate2"));
|
||||
if(map.get("shangbandate2") != null){
|
||||
m.setShangbanDate2(sdf.parse(map.get("shangbandate2").toString()));
|
||||
m.setShangban2(map.get("shangban2").toString());
|
||||
}else{
|
||||
m.setShangbanDate2(null);
|
||||
m.setShangban2("未打卡");
|
||||
}
|
||||
log.info("xiaban2"+map.get("xiabandate2"));
|
||||
if(map.get("xiabandate2") != null){
|
||||
m.setXiabanDate2(sdf.parse(map.get("xiabandate2").toString()));
|
||||
m.setXiaban2(map.get("xiaban2").toString());
|
||||
}else{
|
||||
m.setXiabanDate2(null);
|
||||
m.setXiaban2("未打卡");
|
||||
}
|
||||
log.info(map.get("state"));
|
||||
m.setState(map.get("state").toString());
|
||||
log.info(m.toString());
|
||||
ret.add(m);
|
||||
}
|
||||
} catch (BusinessException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (SQLException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if (agent != null) {
|
||||
agent.close();
|
||||
}
|
||||
}
|
||||
log.info(ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getEvections(String memberId, String startDate, String endDate) {
|
||||
List<Map<String, Object>> ret = new ArrayList<Map<String, Object>>();
|
||||
JDBCAgent agent = new JDBCAgent();
|
||||
try {
|
||||
StringBuilder sql = new StringBuilder(getEvections);
|
||||
List<Object> p = new ArrayList<Object>();
|
||||
p.add(memberId);
|
||||
p.add(startDate);
|
||||
p.add(endDate);
|
||||
agent.execute(sql.toString(), p);
|
||||
List<Map> list = agent.resultSetToList();
|
||||
for (Map map : list) {
|
||||
Map<String, Object> m = new HashMap<String, Object>();
|
||||
m.put("member", map.get("field0003"));
|
||||
m.put("type", "出差");
|
||||
m.put("startDateStr", map.get("field0010"));
|
||||
m.put("endDateStr", map.get("field0011"));
|
||||
ret.add(m);
|
||||
}
|
||||
} catch (BusinessException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (SQLException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if (agent != null) {
|
||||
agent.close();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getAdjustLeave(String memberId, String startDate, String endDate) {
|
||||
List<Map<String,Object>> ret = new ArrayList<Map<String,Object>>();
|
||||
JDBCAgent agent = new JDBCAgent();
|
||||
try {
|
||||
StringBuilder sql = new StringBuilder(getAdjustLeave);
|
||||
List<Object> p = new ArrayList<Object>();
|
||||
p.add(memberId);
|
||||
p.add(startDate);
|
||||
p.add(endDate);
|
||||
agent.execute(sql.toString(), p);
|
||||
List<Map> list = agent.resultSetToList();
|
||||
for (Map map : list) {
|
||||
Map<String,Object> m = new HashMap<String, Object>();
|
||||
m.put("member", map.get("field0007"));
|
||||
m.put("type", "调休");
|
||||
m.put("startDateStr", map.get("field0001"));
|
||||
m.put("endDateStr", map.get("field0013"));
|
||||
ret.add(m);
|
||||
}
|
||||
} catch (BusinessException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (SQLException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}finally {
|
||||
if (agent != null) {
|
||||
agent.close();
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getOvertime(String memberId, String startDate, String endDate) {
|
||||
List<Map<String,Object>> ret = new ArrayList<Map<String,Object>>();
|
||||
JDBCAgent agent = new JDBCAgent();
|
||||
try {
|
||||
StringBuilder sql = new StringBuilder(getOvertime);
|
||||
List<Object> p = new ArrayList<Object>();
|
||||
p.add(memberId);
|
||||
p.add(startDate);
|
||||
p.add(endDate);
|
||||
agent.execute(sql.toString(), p);
|
||||
List<Map> list = agent.resultSetToList();
|
||||
for (Map map : list) {
|
||||
log.info("加班查询数据: "+map);
|
||||
Map<String,Object> m = new HashMap<String, Object>();
|
||||
m.put("member", map.get("field0033"));
|
||||
m.put("type", "加班"+map.get("field0031")+"小时" );
|
||||
m.put("startDateStr", map.get("field0029"));
|
||||
m.put("endDateStr", map.get("field0030"));
|
||||
ret.add(m);
|
||||
}
|
||||
} catch (BusinessException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (SQLException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}finally {
|
||||
if (agent != null) {
|
||||
agent.close();
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getMakeCard(String memberId, String startDate, String endDate) {
|
||||
List<Map<String,Object>> ret = new ArrayList<Map<String,Object>>();
|
||||
JDBCAgent agent = new JDBCAgent();
|
||||
try {
|
||||
StringBuilder sql = new StringBuilder(getMakeCard);
|
||||
List<Object> p = new ArrayList<Object>();
|
||||
p.add(memberId);
|
||||
p.add(startDate);
|
||||
p.add(endDate);
|
||||
agent.execute(sql.toString(), p);
|
||||
List<Map> list = agent.resultSetToList();
|
||||
for (Map map : list) {
|
||||
Map<String,Object> m = new HashMap<String, Object>();
|
||||
m.put("member", map.get("field0007"));
|
||||
m.put("type", "补卡" );
|
||||
m.put("makeCardDateStr", map.get("field0001"));
|
||||
ret.add(m);
|
||||
}
|
||||
} catch (BusinessException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (SQLException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}finally {
|
||||
if (agent != null) {
|
||||
agent.close();
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGroupName(String memberId) {
|
||||
String ret = "";
|
||||
JDBCAgent agent = new JDBCAgent();
|
||||
try {
|
||||
StringBuilder sql = new StringBuilder(getGroupName);
|
||||
List<Object> p = new ArrayList<Object>();
|
||||
p.add(memberId);
|
||||
agent.execute(sql.toString(), p);
|
||||
List<Map> list = agent.resultSetToList();
|
||||
for (Map map : list) {
|
||||
ret = map.get("field0002").toString();
|
||||
}
|
||||
} catch (BusinessException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (SQLException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}finally {
|
||||
if (agent != null) {
|
||||
agent.close();
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDingdingOaMemberNum() {
|
||||
String ret = "";
|
||||
JDBCAgent agent = new JDBCAgent();
|
||||
try {
|
||||
StringBuilder sql = new StringBuilder(getDingdingOaMemberNum);
|
||||
List<Object> p = new ArrayList<Object>();
|
||||
agent.execute(sql.toString(), p);
|
||||
List<Map> list = agent.resultSetToList();
|
||||
for (Map map : list) {
|
||||
ret = map.get("num").toString();
|
||||
}
|
||||
} catch (BusinessException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (SQLException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}finally {
|
||||
if (agent != null) {
|
||||
agent.close();
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateWorkAttendance(CheckOnWorkAttendanceVo checkOnWorkAttendanceVo) {
|
||||
int i = 0;
|
||||
try {
|
||||
String sql = updateWorkAttendance;
|
||||
Object[] params = null;
|
||||
params = new Object[] { checkOnWorkAttendanceVo.getShangban1(),
|
||||
checkOnWorkAttendanceVo.getXiaban1(),
|
||||
checkOnWorkAttendanceVo.getShangban2(),
|
||||
checkOnWorkAttendanceVo.getXiaban2(),
|
||||
checkOnWorkAttendanceVo.getState(),checkOnWorkAttendanceVo.getId() };
|
||||
i = super.executeUpdate(sql.toString(), params);
|
||||
} finally {
|
||||
super.close();
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getDingdingOaMember(String startnum , String endnum) throws BusinessException, SQLException {
|
||||
List<Map<String,Object>> ret = new ArrayList<Map<String,Object>>();
|
||||
JDBCAgent agent = new JDBCAgent();
|
||||
try {
|
||||
StringBuilder sql = new StringBuilder(getDingdingOaMember);
|
||||
List<Object> p = new ArrayList<Object>();
|
||||
p.add(endnum);
|
||||
p.add(startnum);
|
||||
agent.execute(sql.toString(), p);
|
||||
List<Map> list = agent.resultSetToList();
|
||||
for (Map map : list) {
|
||||
Map<String,Object> m = new HashMap<String, Object>();
|
||||
m.put("dingdingmemberid", map.get("dingdingmemberid"));
|
||||
m.put("dingdingmembername", map.get("dingdingmembername"));
|
||||
m.put("oamemberid", map.get("oamemberid"));
|
||||
m.put("oamembername", map.get("oamembername"));
|
||||
ret.add(m);
|
||||
}
|
||||
} catch (BusinessException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (SQLException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}finally {
|
||||
if (agent != null) {
|
||||
agent.close();
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
}
|
||||
209
src/com/seeyon/apps/src_dingding/dao/IDingdingDao.java
Normal file
209
src/com/seeyon/apps/src_dingding/dao/IDingdingDao.java
Normal file
@@ -0,0 +1,209 @@
|
||||
package com.seeyon.apps.src_dingding.dao;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.seeyon.apps.src_dingding.vo.AttendanceVo;
|
||||
import com.seeyon.apps.src_dingding.vo.CheckOnWorkAttendanceVo;
|
||||
import com.seeyon.ctp.common.exceptions.BusinessException;
|
||||
|
||||
public interface IDingdingDao {
|
||||
|
||||
/**
|
||||
* 添加部门对照表信息
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
public int adddept(Map<String, String> map);
|
||||
|
||||
/**
|
||||
* 添加人员对照表信息
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
public int addmember(Map<String, String> map);
|
||||
|
||||
/**
|
||||
* 根据部门ID查询部门对照表中的部门信息
|
||||
* @param deptid
|
||||
* @return
|
||||
*/
|
||||
public Map<String,Object> getdeptBysuperDeptId(String deptid);
|
||||
|
||||
/**
|
||||
* 通过部门路径和部门名称查询OA系统中部门信息
|
||||
* @param path
|
||||
* @param name
|
||||
* @return
|
||||
* @throws BusinessException
|
||||
* @throws SQLException
|
||||
*/
|
||||
public Map<String,Object> getdeptByPathName(String path,String name)throws BusinessException, SQLException, BusinessException;
|
||||
|
||||
/**
|
||||
* 查询部门对照表中所有的部门信息
|
||||
* @return
|
||||
* @throws BusinessException
|
||||
* @throws SQLException
|
||||
*/
|
||||
public List<Map<String,Object>> getDingdingOaDept()throws BusinessException, SQLException;
|
||||
|
||||
/**
|
||||
* 查询分页查询所有人员信息
|
||||
* @return
|
||||
* @throws BusinessException
|
||||
* @throws SQLException
|
||||
*/
|
||||
public List<Map<String,Object>> getDingdingOaMember(String startnum , String endnum)throws BusinessException, SQLException;
|
||||
|
||||
/**
|
||||
* 根据部门ID查询OA系统中的部门信息
|
||||
* @param deptid
|
||||
* @return
|
||||
* @throws BusinessException
|
||||
* @throws SQLException
|
||||
*/
|
||||
public Map<String,Object> getDepartmentById(Long deptid)throws BusinessException, SQLException;
|
||||
|
||||
/**
|
||||
* 查询当前部门信息是否在部门对照表中存在
|
||||
* @param dingdingdeptid
|
||||
* @return
|
||||
*/
|
||||
public boolean getdeptsizeBydingdingid(String dingdingdeptid);
|
||||
|
||||
/**
|
||||
* 查询当前人员信息是否在人员对照表中存在
|
||||
* @param dingdingmemberid
|
||||
* @return
|
||||
*/
|
||||
public boolean getmembersizeBydingdingid(String dingdingmemberid);
|
||||
|
||||
/**
|
||||
* 获取指定人员近一月的打卡情况
|
||||
* @param date('yyyy-MM-dd')
|
||||
* @param memberId
|
||||
* @return
|
||||
*/
|
||||
public int getClockInNumBymember(String date,String memberId);
|
||||
|
||||
/**
|
||||
* 获取指定人员前一日打卡情况
|
||||
* @param date('yyyy-MM-dd')
|
||||
* @param memberId
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String ,Object>> getClockInBymember(String date,String memberId);
|
||||
|
||||
/**
|
||||
* 将封装的打卡信息保存到考勤表中
|
||||
* @param checkOnWorkAttendanceVo 考勤数据对象
|
||||
* @return
|
||||
*/
|
||||
public int addCheckOnWorkAttendance(CheckOnWorkAttendanceVo checkOnWorkAttendanceVo);
|
||||
|
||||
/**
|
||||
* 修改考勤表中的数据
|
||||
* @param checkOnWorkAttendanceVo 考勤数据对象
|
||||
* @return
|
||||
*/
|
||||
public int updateWorkAttendance(CheckOnWorkAttendanceVo checkOnWorkAttendanceVo);
|
||||
|
||||
/**
|
||||
* 查询规定时间之内的请假单据
|
||||
* @param memberId 人员ID
|
||||
* @param startDate 查询开始时间
|
||||
* @param endDate 查询结束时间
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String,Object>> getLeave(String memberId, String startDate,String endDate);
|
||||
|
||||
/**
|
||||
* 查询指定时间内的考勤情况
|
||||
* @param memberId 人员ID
|
||||
* @param startDate 查询开始时间
|
||||
* @param endDate 查询结束时间
|
||||
* @return
|
||||
*/
|
||||
public List<CheckOnWorkAttendanceVo> getWorkAttendanceByDate(String memberId, String startDate,String endDate);
|
||||
|
||||
/**
|
||||
* 查询规定时间之内的出差单据
|
||||
* @param memberId 人员ID
|
||||
* @param startDate 查询开始时间
|
||||
* @param endDate 查询结束时间
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String,Object>> getEvections(String memberId, String startDate,String endDate);
|
||||
|
||||
/**
|
||||
* 查询规定时间之内的调休单据
|
||||
* @param memberId 人员ID
|
||||
* @param startDate 查询开始时间
|
||||
* @param endDate 查询结束时间
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String,Object>> getAdjustLeave(String memberId, String startDate,String endDate);
|
||||
|
||||
/**
|
||||
* 查询规定时间之内的加班单据
|
||||
* @param memberId 人员ID
|
||||
* @param startDate 查询开始时间
|
||||
* @param endDate 查询结束时间
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String,Object>> getOvertime(String memberId, String startDate,String endDate);
|
||||
|
||||
/**
|
||||
* 查询规定时间之内的补卡单据
|
||||
* @param memberId 人员ID
|
||||
* @param startDate 查询开始时间
|
||||
* @param endDate 查询结束时间
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String,Object>> getMakeCard(String memberId, String startDate,String endDate);
|
||||
|
||||
/**
|
||||
* 查询规定时间之内的补卡单据
|
||||
* @param memberId 人员ID
|
||||
* @return
|
||||
*/
|
||||
public String getGroupName(String memberId);
|
||||
|
||||
/**
|
||||
* 查询规定时间之内的补卡单据
|
||||
* @return
|
||||
*/
|
||||
public String getDingdingOaMemberNum();
|
||||
|
||||
/**
|
||||
* 根据ID查询考情组是否存在
|
||||
* @param attendanceId
|
||||
* @return
|
||||
*/
|
||||
public int getDingdingAttendanceSize(String attendanceId);
|
||||
|
||||
/**
|
||||
* 添加考勤组
|
||||
* @param attendanceVo
|
||||
* @return
|
||||
*/
|
||||
public int addDingdingAttendance(AttendanceVo attendanceVo);
|
||||
|
||||
/**
|
||||
* 修改考勤组
|
||||
* @param attendanceVo
|
||||
* @return
|
||||
*/
|
||||
public int updateDingdingAttendance(AttendanceVo attendanceVo);
|
||||
|
||||
/**
|
||||
* 根据考勤组ID查询考勤组信息
|
||||
* @param groupid
|
||||
* @return
|
||||
*/
|
||||
public Map<String,String> getDingdingAttendanceBygroupId(String groupid);
|
||||
|
||||
|
||||
}
|
||||
26
src/com/seeyon/apps/src_dingding/kit/A8FolderKit.java
Normal file
26
src/com/seeyon/apps/src_dingding/kit/A8FolderKit.java
Normal file
@@ -0,0 +1,26 @@
|
||||
package com.seeyon.apps.src_dingding.kit;
|
||||
|
||||
import com.seeyon.ctp.common.SystemEnvironment;
|
||||
|
||||
/**
|
||||
* Description
|
||||
* <pre>获取A8产品下面的文件夹路径</pre>
|
||||
* Copyright(c) Beijing Seeyon Software Co.,LTD
|
||||
*/
|
||||
public class A8FolderKit {
|
||||
|
||||
private static String SH_PROP = "";
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* <pre>获取到A8的安装应用目录 seeyon</pre>
|
||||
* @return
|
||||
*/
|
||||
public static String getPropFile() {
|
||||
if("".equals(SH_PROP)) {
|
||||
SH_PROP = SystemEnvironment.getApplicationFolder() + "/WEB-INF/cfgHome/plugin/src_dingding/dingding.properties";
|
||||
}
|
||||
return SH_PROP;
|
||||
}
|
||||
|
||||
}
|
||||
70
src/com/seeyon/apps/src_dingding/kit/PropKit.java
Normal file
70
src/com/seeyon/apps/src_dingding/kit/PropKit.java
Normal file
@@ -0,0 +1,70 @@
|
||||
package com.seeyon.apps.src_dingding.kit;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.util.Properties;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/**
|
||||
* 读取参数
|
||||
*/
|
||||
|
||||
public class PropKit {
|
||||
|
||||
private static long lastModify;
|
||||
|
||||
private static ConcurrentHashMap<String, String> props;
|
||||
|
||||
public static final String PROFILE = "profile";
|
||||
|
||||
public static final String JDBCDRIVER = "jdbc_driver";
|
||||
public static final String JDBCURL = "jdbc_url";
|
||||
public static final String JDBCUSER = "jdbc_user";
|
||||
public static final String JDBCPASSWORD = "jdbc_password";
|
||||
|
||||
public static final String PROD_JDBCDRIVER = "prod.jdbc_driver";
|
||||
public static final String PROD_JDBCURL = "prod.jdbc_url";
|
||||
public static final String PROD_JDBCUSER = "prod.jdbc_user";
|
||||
public static final String PROD_JDBCPASSWORD = "prod.jdbc_password";
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @throws IOException
|
||||
* @throws FileNotFoundException
|
||||
*/
|
||||
public static String getProp(String key) throws FileNotFoundException, IOException {
|
||||
File f = new File(A8FolderKit.getPropFile());
|
||||
if(null == props) {
|
||||
props = new ConcurrentHashMap<String, String>();
|
||||
}
|
||||
if(f.lastModified() != lastModify) {
|
||||
/**
|
||||
* huangzhengguo
|
||||
* 2022-10-18
|
||||
*/
|
||||
Properties prop = new Properties();
|
||||
prop.load(new FileInputStream(f));
|
||||
// Properties prop = PropertiesUtil.getFromFile((CtpLocalFile) f);
|
||||
|
||||
/**
|
||||
* end
|
||||
*/
|
||||
String profile = prop.getProperty(PROFILE);
|
||||
if("prod".equals(profile)) {
|
||||
props.put(JDBCDRIVER, prop.getProperty(PROD_JDBCDRIVER));
|
||||
props.put(JDBCURL, prop.getProperty(PROD_JDBCURL));
|
||||
props.put(JDBCUSER, prop.getProperty(PROD_JDBCUSER));
|
||||
props.put(JDBCPASSWORD, prop.getProperty(PROD_JDBCPASSWORD));
|
||||
} else {
|
||||
props.put(JDBCDRIVER, prop.getProperty(PROD_JDBCDRIVER));
|
||||
props.put(JDBCURL, prop.getProperty(PROD_JDBCURL));
|
||||
props.put(JDBCUSER, prop.getProperty(PROD_JDBCUSER));
|
||||
props.put(JDBCPASSWORD, prop.getProperty(PROD_JDBCPASSWORD));
|
||||
}
|
||||
}
|
||||
return props.get(key);
|
||||
}
|
||||
|
||||
}
|
||||
1323
src/com/seeyon/apps/src_dingding/service/DingdingService.java
Normal file
1323
src/com/seeyon/apps/src_dingding/service/DingdingService.java
Normal file
File diff suppressed because it is too large
Load Diff
120
src/com/seeyon/apps/src_dingding/task/DingdingTask.java
Normal file
120
src/com/seeyon/apps/src_dingding/task/DingdingTask.java
Normal file
@@ -0,0 +1,120 @@
|
||||
package com.seeyon.apps.src_dingding.task;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.seeyon.ctp.common.AppContext;
|
||||
import com.seeyon.ctp.common.quartz.QuartzHolder;
|
||||
import com.seeyon.ctp.common.quartz.QuartzJob;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import com.seeyon.apps.src_dingding.service.DingdingService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 自动计算任务
|
||||
*/
|
||||
public class DingdingTask implements QuartzJob {
|
||||
|
||||
/** 日志管理器 */
|
||||
private final static Log log = LogFactory.getLog(DingdingTask.class);
|
||||
|
||||
/** 定义的任务插件ID */
|
||||
// private static String jobBeanId="pushCardTask";
|
||||
|
||||
/** 定义的任务名称 */
|
||||
// public static String jobName="QuartzPushCardTask";
|
||||
|
||||
/** 定义的任务插件ID */
|
||||
private static String jobBeanId="dingdingTask";
|
||||
|
||||
/** 定义的任务名称 */
|
||||
public static String jobName="QuartzDingdingTask";
|
||||
|
||||
// private PushZcService pushZcService;
|
||||
|
||||
private volatile boolean running;
|
||||
|
||||
private DingdingService dingdingService;
|
||||
|
||||
public DingdingService getDingdingService() {
|
||||
if (dingdingService == null) {
|
||||
dingdingService = (DingdingService) AppContext.getBean("dingdingService");
|
||||
}
|
||||
return dingdingService; }
|
||||
|
||||
public void setDingdingService(DingdingService dingdingService) {
|
||||
this.dingdingService = dingdingService;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void execute(Map<String, String> parameters) {
|
||||
if(running) {
|
||||
log.info("上次推送还在执行中,跳过本次数据推送");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
// 钉钉考勤组同步
|
||||
getDingdingService().dingdingattendance();
|
||||
// 钉钉部门同步
|
||||
getDingdingService().dingdingdept();
|
||||
// 钉钉人员同步
|
||||
getDingdingService().dingdingmember();
|
||||
// 钉钉打卡同步
|
||||
getDingdingService().dingdingclockin();
|
||||
// 钉钉考勤信息设置
|
||||
getDingdingService().setWorkAttendance();
|
||||
} catch(Exception e) {
|
||||
log.error("发生异常:", e);
|
||||
} finally {
|
||||
this.running = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* interval 如果是true,则是间隔执行
|
||||
*/
|
||||
public static void registerSyncTask(boolean interval, int our, int minute) {
|
||||
// jobBeanId = "pushCardTask";
|
||||
// jobName = "QuartzPushCardTask";
|
||||
jobBeanId = "dingdingTask";
|
||||
jobName = "QuartzDingdingTask";
|
||||
log.info("注册预算定时计算任务" + jobName + "...");
|
||||
try {
|
||||
// 先删除任务
|
||||
QuartzHolder.deleteQuartzJob(jobName);
|
||||
// 设定时间 每天同步的
|
||||
// if ("aa".length() > 5) {
|
||||
if(interval) {
|
||||
int delta = (our * 60 + minute) * 60 * 1000;
|
||||
Map<String, String> parameters = new HashMap<String, String>();
|
||||
QuartzHolder.newQuartzJob(jobName, new Date(), delta, jobBeanId, parameters);
|
||||
} else {
|
||||
Map<String, String> parameters = new HashMap<String, String>();
|
||||
// 设置时间
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(new Date()); // 年月日 也可以具体到时分秒如calendar.set(2015, 10, 12,11,32,52);
|
||||
// 每日运行,只要改动 时间即可
|
||||
calendar.set(Calendar.HOUR_OF_DAY, our);
|
||||
calendar.set(Calendar.MINUTE, minute);
|
||||
calendar.set(Calendar.SECOND, 00);
|
||||
Date date = calendar.getTime();// date就是你需要的时间
|
||||
QuartzHolder.newQuartzJobPerDay(null, jobName, date, jobBeanId, parameters);
|
||||
log.info("定时计算任务" + jobName + ",成功");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("注册定时计算任务失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
// public void setPushZcService(PushZcService pushZcService) {
|
||||
// this.pushZcService = pushZcService;
|
||||
// }
|
||||
}
|
||||
110
src/com/seeyon/apps/src_dingding/util/BaseUtil.java
Normal file
110
src/com/seeyon/apps/src_dingding/util/BaseUtil.java
Normal file
@@ -0,0 +1,110 @@
|
||||
package com.seeyon.apps.src_dingding.util;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
|
||||
|
||||
/**
|
||||
* sql执行工具类
|
||||
* 2021-06-08
|
||||
* @author huangzhengguo
|
||||
*
|
||||
*/
|
||||
public class BaseUtil {
|
||||
|
||||
|
||||
PreparedStatement ps = null;
|
||||
ResultSet res = null;
|
||||
Connection conn =null;
|
||||
/**
|
||||
* sql查询工具
|
||||
* @param sql sql语句
|
||||
* @param params sql参数
|
||||
* @return 结果集
|
||||
*/
|
||||
public ResultSet executeQuery(String sql, Object[] params)
|
||||
{
|
||||
conn = JdbcUtil.getConnection();
|
||||
try {
|
||||
ps = conn.prepareStatement(sql);
|
||||
for(int i = 0; i < params.length; i++){
|
||||
ps.setObject(i+1, params[i]);
|
||||
}
|
||||
res = ps.executeQuery();
|
||||
} catch (SQLException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
return res;
|
||||
}
|
||||
/**
|
||||
* sql更新工具
|
||||
* @param sql
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
public int executeUpdate(String sql, Object[] params)
|
||||
{
|
||||
int res = 0;
|
||||
conn = JdbcUtil.getConnection();
|
||||
try {
|
||||
ps = conn.prepareStatement(sql);
|
||||
for(int i = 0; i < params.length; i++)
|
||||
{
|
||||
ps.setObject(i+1, params[i]);
|
||||
}
|
||||
res = ps.executeUpdate();
|
||||
} catch (SQLException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
public void close() {
|
||||
release(res,null,conn,ps);
|
||||
}
|
||||
//定义一个释放资源的方法;
|
||||
/*
|
||||
* 定义一个方法: 释放资源: 直接将rs stmt conn 全部释放:
|
||||
*/
|
||||
public static void release(ResultSet rs ,Statement stmt , Connection conn,PreparedStatement ps){
|
||||
if(rs!=null){
|
||||
try {
|
||||
rs.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
rs=null;
|
||||
}
|
||||
if(stmt!=null){
|
||||
try {
|
||||
stmt.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
stmt=null;
|
||||
}
|
||||
if(conn!=null){
|
||||
try {
|
||||
conn.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
conn=null;
|
||||
}
|
||||
if(ps!=null){
|
||||
try {
|
||||
ps.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
ps=null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
126
src/com/seeyon/apps/src_dingding/util/DingtalkUtil.java
Normal file
126
src/com/seeyon/apps/src_dingding/util/DingtalkUtil.java
Normal file
@@ -0,0 +1,126 @@
|
||||
package com.seeyon.apps.src_dingding.util;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.dingtalk.api.DefaultDingTalkClient;
|
||||
import com.dingtalk.api.DingTalkClient;
|
||||
import com.dingtalk.api.request.OapiGettokenRequest;
|
||||
import com.dingtalk.api.response.OapiGettokenResponse;
|
||||
import com.taobao.api.ApiException;
|
||||
|
||||
public class DingtalkUtil {
|
||||
|
||||
public String getToken() throws RuntimeException, ApiException, FileNotFoundException, IOException {
|
||||
// DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/gettoken");
|
||||
DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/gettoken");
|
||||
OapiGettokenRequest request = new OapiGettokenRequest();
|
||||
request.setAppkey("dingtiefuskr6oycl5ah");
|
||||
request.setAppsecret("5V_zIyAXU3Fx0yl20uxGotc3zIdrAXnKERat_ciEez0u3jqaVjosQhlflu5-83St");
|
||||
request.setHttpMethod("GET");
|
||||
OapiGettokenResponse response = client.execute(request);
|
||||
JSONObject jsonObject = JSON.parseObject(response.getBody());
|
||||
String token = jsonObject.getString("access_token");
|
||||
return token;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 调用post接口
|
||||
*
|
||||
* @param str 调用接口传递的参数json
|
||||
* @param urlStr 需要调用的url对应的参数文件中的编码
|
||||
* @return
|
||||
* @throws ApiException
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public JSONObject doPost(String str, String urlStr) throws RuntimeException, ApiException {
|
||||
HttpURLConnection connection = null;
|
||||
InputStream is = null;
|
||||
OutputStream os = null;
|
||||
BufferedReader br = null;
|
||||
String result = null;
|
||||
try {
|
||||
String token = getToken();
|
||||
URL url = new URL(urlStr+"?access_token="+token);
|
||||
// 通过远程url连接对象打开连接
|
||||
connection = (HttpURLConnection) url.openConnection();
|
||||
// 设置连接请求方式
|
||||
connection.setRequestMethod("POST");
|
||||
// 设置连接主机服务器超时时间:15000毫秒
|
||||
connection.setConnectTimeout(15000);
|
||||
// 设置读取主机服务器返回数据超时时间:60000毫秒
|
||||
connection.setReadTimeout(60000);
|
||||
|
||||
// 默认值为:false,当向远程服务器传送数据/写数据时,需要设置为true
|
||||
connection.setDoOutput(true);
|
||||
// 默认值为:true,当前向远程服务读取数据时,设置为true,该参数可有可无
|
||||
connection.setDoInput(true);
|
||||
// 设置传入参数的格式:请求参数应该是 name1=value1&name2=value2 的形式。
|
||||
// connection.setRequestProperty("access_token", token);
|
||||
connection.setRequestProperty("Content-Type", "application/json; charset=UTF-8");
|
||||
// 通过连接对象获取一个输出流
|
||||
os = connection.getOutputStream();
|
||||
// 通过输出流对象将参数写出去/传输出去,它是通过字节数组写出的
|
||||
if (!("".equals(str) || str == null)) {
|
||||
os.write(str.getBytes("UTF-8"));
|
||||
}
|
||||
// 连接对象获取一个输入流,向远程读取
|
||||
if (connection.getResponseCode() == 200) {
|
||||
is = connection.getInputStream();
|
||||
// 对输入流对象进行包装:charset根据工作项目组的要求来设置
|
||||
br = new BufferedReader(new InputStreamReader(is, "UTF-8"));
|
||||
|
||||
StringBuffer sbf = new StringBuffer();
|
||||
String temp = null;
|
||||
// 循环遍历一行一行读取数据
|
||||
while ((temp = br.readLine()) != null) {
|
||||
sbf.append(temp);
|
||||
sbf.append("\r\n");
|
||||
}
|
||||
result = sbf.toString();
|
||||
}
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
// 关闭资源
|
||||
if (null != br) {
|
||||
try {
|
||||
br.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
if (null != os) {
|
||||
try {
|
||||
os.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
if (null != is) {
|
||||
try {
|
||||
is.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
// 断开与远程地址url的连接
|
||||
connection.disconnect();
|
||||
}
|
||||
JSONObject json = JSONObject.parseObject(result);
|
||||
return json;
|
||||
}
|
||||
|
||||
}
|
||||
111
src/com/seeyon/apps/src_dingding/util/FormExportUtil.java
Normal file
111
src/com/seeyon/apps/src_dingding/util/FormExportUtil.java
Normal file
@@ -0,0 +1,111 @@
|
||||
package com.seeyon.apps.src_dingding.util;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.seeyon.v3x.services.form.bean.RecordExport;
|
||||
import com.seeyon.v3x.services.form.bean.SubordinateFormExport;
|
||||
import com.seeyon.v3x.services.form.bean.ValueExport;
|
||||
|
||||
//创建无流程表单数据处理工具类
|
||||
public class FormExportUtil {
|
||||
|
||||
/**
|
||||
* 设置主表信息
|
||||
* @param map 设置主表字段。Map<主表显示名称,主表数据>
|
||||
* @return
|
||||
*/
|
||||
public List<ValueExport> setFormValue(Map<String, String> map){
|
||||
// 创建返回值对象
|
||||
List<ValueExport> valueExports = new ArrayList<ValueExport>();
|
||||
ValueExport valueExport ;
|
||||
// 获取参数信息(显示名称)
|
||||
Set<String> keys = map.keySet();
|
||||
if(keys.size()>0) {
|
||||
// 对控件赋值
|
||||
for (String key : keys) {
|
||||
valueExport = new ValueExport();
|
||||
valueExport.setDisplayName(key);
|
||||
valueExport.setValue(map.get(key));
|
||||
valueExports.add(valueExport);
|
||||
}
|
||||
}
|
||||
return valueExports;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置从表信息
|
||||
* @param lists 设置主表字段。List<Map<显示名称,数据值>>
|
||||
*/
|
||||
public List<SubordinateFormExport> setSubordinateFormValue(List<Map<String, String>> lists){
|
||||
List<SubordinateFormExport> subordinateFormExports = new ArrayList<SubordinateFormExport>();
|
||||
SubordinateFormExport subordinateFormExport = new SubordinateFormExport();
|
||||
List<RecordExport> recordExports = new ArrayList<RecordExport>();
|
||||
List<ValueExport> valueExports;
|
||||
RecordExport recordExport;
|
||||
for(int i = 0 ; i < lists.size() ; i++) {
|
||||
recordExport = new RecordExport();
|
||||
valueExports = setFormValue(lists.get(i));
|
||||
recordExport.setRecord(valueExports);
|
||||
recordExports.add(recordExport);
|
||||
}
|
||||
subordinateFormExport.setValues(recordExports);
|
||||
subordinateFormExports.add(subordinateFormExport);
|
||||
|
||||
return subordinateFormExports;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 格式转换将{"id":1,"str1":"123","str2":"asd","str3":"qwe"},{"id":2,"str1":"123","str2":"asd","str3":"qwe"},{"id":3,"str1":"123","str2":"asd","str3":"qwe"},{"id":1,"str1":"123","str2":"asd","str3":"qwe"},{"id":2,"str1":"123","str2":"asd","str3":"qwe"},{"id":3,"str1":"123","str2":"asd","str3":"qwe"}]
|
||||
有什么办法转换成
|
||||
[{"id":1,"data":[{"id":1,"str1":"123","str2":"asd","str3":"qwe"},{"id":1,"str1":"123","str2":"asd","str3":"qwe"}]}{"id":2,"data":[{"id":2,"str1":"123","str2":"asd","str3":"qwe"},{"id":2,"str1":"123","str2":"asd","str3":"qwe"}]}{"id":3,"data":[{"id":3,"str1":"123","str2":"asd","str3":"qwe"},{"id":3,"str1":"123","str2":"asd","str3":"qwe"}]}]
|
||||
* @param inputList
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> transformData(JSONArray inputList) {
|
||||
Map<String, List<Map<String, Object>>> groupedData = new HashMap<>();
|
||||
for(int i = 0 ; i < inputList.size();i++) {
|
||||
String userId = inputList.getJSONObject(i).getString("userId");
|
||||
|
||||
groupedData.computeIfAbsent(userId, k -> new ArrayList<>()).add(inputList.getJSONObject(i));
|
||||
}
|
||||
|
||||
List<Map<String, Object>> result = new ArrayList<>();
|
||||
|
||||
for (Map.Entry<String, List<Map<String, Object>>> entry : groupedData.entrySet()) {
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
resultMap.put("userId", entry.getKey());
|
||||
resultMap.put("data", entry.getValue());
|
||||
result.add(resultMap);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public JSONArray dingdingTimeSequence (JSONArray datas){
|
||||
|
||||
for (int i = 0; i < datas.size() - 1; i++) {
|
||||
for (int j = 0; j < datas.size() - i - 1; j++) {
|
||||
String value1 = datas.getJSONObject(j).getString("baseCheckTime");
|
||||
String value2 = datas.getJSONObject(j + 1).getString("baseCheckTime");
|
||||
long long1 = Long.parseLong(value1);
|
||||
long long2 = Long.parseLong(value2);
|
||||
if (long1 > long2) {
|
||||
JSONObject temp = datas.getJSONObject(j);
|
||||
datas.set(j, datas.getJSONObject(j + 1));
|
||||
datas.set(j + 1, temp);
|
||||
}
|
||||
}
|
||||
}
|
||||
return datas;
|
||||
}
|
||||
|
||||
}
|
||||
93
src/com/seeyon/apps/src_dingding/util/JdbcUtil.java
Normal file
93
src/com/seeyon/apps/src_dingding/util/JdbcUtil.java
Normal file
@@ -0,0 +1,93 @@
|
||||
package com.seeyon.apps.src_dingding.util;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.Properties;
|
||||
|
||||
import com.seeyon.apps.src_dingding.kit.PropKit;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* jdbc工具类
|
||||
* 2021-06-08
|
||||
* @author huangzhengguo
|
||||
*
|
||||
*/
|
||||
public class JdbcUtil {
|
||||
private static String url;
|
||||
private static String user;
|
||||
private static String password;
|
||||
|
||||
static {
|
||||
// 使用properties加载属性文件
|
||||
// Properties prop = new Properties();
|
||||
try {
|
||||
// InputStream is = JdbcUtil.class.getClassLoader().getResourceAsStream("jdbc.properties");
|
||||
// prop.load(is);
|
||||
// 注册驱动(获取属性文件中的数据)
|
||||
// String driverClassName = prop.getProperty("jdbc_driver");
|
||||
System.out.println(PropKit.getProp(PropKit.JDBCDRIVER));
|
||||
String driverClassName = PropKit.getProp(PropKit.JDBCDRIVER);
|
||||
Class.forName(driverClassName);
|
||||
// 获取属性文件中的url,username,password
|
||||
// url = prop.getProperty("jdbc_url");
|
||||
System.out.println(PropKit.getProp(PropKit.JDBCURL));
|
||||
url = PropKit.getProp(PropKit.JDBCURL);
|
||||
// user = prop.getProperty("jdbc_user");
|
||||
System.out.println(PropKit.getProp(PropKit.JDBCUSER));
|
||||
user = PropKit.getProp(PropKit.JDBCUSER);
|
||||
// password = prop.getProperty("jdbc_password");
|
||||
System.out.println(PropKit.getProp(PropKit.JDBCPASSWORD));
|
||||
password = PropKit.getProp(PropKit.JDBCPASSWORD);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
// 获取数据库连接
|
||||
public static Connection getConnection() {
|
||||
Connection conn = null;
|
||||
try {
|
||||
conn = DriverManager.getConnection(url, user, password);
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return conn;
|
||||
}
|
||||
|
||||
// 释放资源
|
||||
public static void close(Connection conn, Statement stat, ResultSet rs) {
|
||||
close(conn, stat);
|
||||
if (rs != null) {
|
||||
try {
|
||||
rs.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 释放资源
|
||||
public static void close(Connection conn, Statement stat) {
|
||||
if (conn != null) {
|
||||
try {
|
||||
conn.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
if (stat != null) {
|
||||
try {
|
||||
stat.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
61
src/com/seeyon/apps/src_dingding/util/TimeUtil.java
Normal file
61
src/com/seeyon/apps/src_dingding/util/TimeUtil.java
Normal file
@@ -0,0 +1,61 @@
|
||||
package com.seeyon.apps.src_dingding.util;
|
||||
|
||||
import com.seeyon.ctp.common.AppContext;
|
||||
import com.seeyon.ctp.common.ctpenumnew.manager.EnumManager;
|
||||
import com.seeyon.ctp.common.exceptions.BusinessException;
|
||||
import com.seeyon.ctp.util.JDBCAgent;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class TimeUtil {
|
||||
|
||||
private EnumManager enumManagerNew;
|
||||
public EnumManager getEnumManager() {
|
||||
if (this.enumManagerNew == null) {
|
||||
this.enumManagerNew = ((EnumManager) AppContext.getBean("enumManagerNew"));
|
||||
}
|
||||
return enumManagerNew;
|
||||
}
|
||||
|
||||
public void setEnumManagerNew(EnumManager enumManagerNew) {
|
||||
this.enumManagerNew = enumManagerNew;
|
||||
}
|
||||
|
||||
// 获取定时任务的同步频率
|
||||
public String getTime() {
|
||||
JDBCAgent agent = new JDBCAgent();
|
||||
String time = "";
|
||||
// String sqlString = "select field0001,field0002,field0003 from formmain_0067";
|
||||
String sqlString = "select field0044,field0042,field0043 from formmain_1224";
|
||||
try {
|
||||
StringBuilder sql = new StringBuilder(sqlString);
|
||||
List<Object> p = new ArrayList<Object>();
|
||||
agent.execute(sql.toString(), p);
|
||||
List<Map> list = agent.resultSetToList();
|
||||
Map map = list.get(0);
|
||||
Long enumid = Long.parseLong(map.get("field0044").toString());
|
||||
String shi = map.get("field0042").toString();
|
||||
String fen = map.get("field0043").toString();
|
||||
String str = getEnumManager().getEnumItem(enumid).getValue();
|
||||
if("0".equals(str)) {
|
||||
time = "I-"+shi+","+fen;
|
||||
}else {
|
||||
time = "D-"+shi+","+fen;
|
||||
}
|
||||
} catch (BusinessException e) {
|
||||
e.printStackTrace();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}finally {
|
||||
if (agent != null) {
|
||||
agent.close();
|
||||
}
|
||||
}
|
||||
return time;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
43
src/com/seeyon/apps/src_dingding/vo/AttendanceVo.java
Normal file
43
src/com/seeyon/apps/src_dingding/vo/AttendanceVo.java
Normal file
@@ -0,0 +1,43 @@
|
||||
package com.seeyon.apps.src_dingding.vo;
|
||||
|
||||
public class AttendanceVo {
|
||||
|
||||
// ID
|
||||
private long id;
|
||||
// 考勤组ID
|
||||
private String groupid;
|
||||
// 考勤组名称
|
||||
private String groupname;
|
||||
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getGroupid() {
|
||||
return groupid;
|
||||
}
|
||||
|
||||
public void setGroupid(String groupid) {
|
||||
this.groupid = groupid;
|
||||
}
|
||||
|
||||
public String getGroupname() {
|
||||
return groupname;
|
||||
}
|
||||
|
||||
public void setGroupname(String groupname) {
|
||||
this.groupname = groupname;
|
||||
}
|
||||
|
||||
public String toString(){
|
||||
return "("+this.groupid+":"+this.groupname+")";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
142
src/com/seeyon/apps/src_dingding/vo/CheckOnWorkAttendanceVo.java
Normal file
142
src/com/seeyon/apps/src_dingding/vo/CheckOnWorkAttendanceVo.java
Normal file
@@ -0,0 +1,142 @@
|
||||
package com.seeyon.apps.src_dingding.vo;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class CheckOnWorkAttendanceVo {
|
||||
|
||||
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Date getCheckOnWorkAttendanceDate() {
|
||||
return checkOnWorkAttendanceDate;
|
||||
}
|
||||
|
||||
public void setCheckOnWorkAttendanceDate(Date checkOnWorkAttendanceDate) {
|
||||
this.checkOnWorkAttendanceDate = checkOnWorkAttendanceDate;
|
||||
}
|
||||
|
||||
public Date getShangbanDate1() {
|
||||
return shangbanDate1;
|
||||
}
|
||||
|
||||
public void setShangbanDate1(Date shangbanDate1) {
|
||||
this.shangbanDate1 = shangbanDate1;
|
||||
}
|
||||
|
||||
public String getShangban1() {
|
||||
return shangban1;
|
||||
}
|
||||
|
||||
public void setShangban1(String shangban1) {
|
||||
this.shangban1 = shangban1;
|
||||
}
|
||||
|
||||
public Date getXiabanDate1() {
|
||||
return xiabanDate1;
|
||||
}
|
||||
|
||||
public void setXiabanDate1(Date xiabanDate1) {
|
||||
this.xiabanDate1 = xiabanDate1;
|
||||
}
|
||||
|
||||
public String getXiaban1() {
|
||||
return xiaban1;
|
||||
}
|
||||
|
||||
public void setXiaban1(String xiaban1) {
|
||||
this.xiaban1 = xiaban1;
|
||||
}
|
||||
|
||||
public Date getShangbanDate2() {
|
||||
return shangbanDate2;
|
||||
}
|
||||
|
||||
public void setShangbanDate2(Date shangbanDate2) {
|
||||
this.shangbanDate2 = shangbanDate2;
|
||||
}
|
||||
|
||||
public String getShangban2() {
|
||||
return shangban2;
|
||||
}
|
||||
|
||||
public void setShangban2(String shangban2) {
|
||||
this.shangban2 = shangban2;
|
||||
}
|
||||
|
||||
public Date getXiabanDate2() {
|
||||
return xiabanDate2;
|
||||
}
|
||||
|
||||
public void setXiabanDate2(Date xiabanDate2) {
|
||||
this.xiabanDate2 = xiabanDate2;
|
||||
}
|
||||
|
||||
public String getXiaban2() {
|
||||
return xiaban2;
|
||||
}
|
||||
|
||||
public void setXiaban2(String xiaban2) {
|
||||
this.xiaban2 = xiaban2;
|
||||
}
|
||||
|
||||
public String getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public void setState(String state) {
|
||||
this.state = state;
|
||||
}
|
||||
public String getGroupName() {
|
||||
return groupName;
|
||||
}
|
||||
|
||||
public void setGroupName(String groupName) {
|
||||
this.groupName = groupName;
|
||||
}
|
||||
|
||||
public long getMemberId() {
|
||||
return memberId;
|
||||
}
|
||||
|
||||
public void setMemberId(long memberId) {
|
||||
this.memberId = memberId;
|
||||
}
|
||||
// 数据ID
|
||||
private long id;
|
||||
// 考勤人员Id
|
||||
private long memberId;
|
||||
// 考勤日期 CHECKONWORKATTENDANCEDATE
|
||||
private Date checkOnWorkAttendanceDate;
|
||||
// 上班1基准时间
|
||||
private Date shangbanDate1;
|
||||
// 上班1打卡状态
|
||||
private String shangban1;
|
||||
// 下班1基准时间
|
||||
private Date xiabanDate1;
|
||||
// 下班1打卡状态
|
||||
private String xiaban1;
|
||||
// 上班2基准时间
|
||||
private Date shangbanDate2;
|
||||
// 上班2打卡状态
|
||||
private String shangban2;
|
||||
// 下班2基准时间
|
||||
private Date xiabanDate2;
|
||||
// 下班2打卡状态
|
||||
private String xiaban2;
|
||||
// 整体打卡状态
|
||||
private String state;
|
||||
// 考勤组
|
||||
private String groupName;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return id+","+memberId + ",上班1:"+shangban1+",上班1基准"+shangbanDate1 + ",下班1:"+xiaban1+",下班1基准"+xiabanDate1+
|
||||
",上班2:"+shangban2+",上班2基准"+shangbanDate2+",下班2:"+xiaban2+",下班2基准"+xiabanDate2+",状态:"+state+",考勤组名称:"+groupName;
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user