Commit 4b89e8e9 by pengwufeng

Merge branch 'develop' into 'forIDEA'

# Conflicts:
#   backend/.gitignore
#   backend/common.gradle
parents d4b13f77 5468a0e0
backend/.metadata
.metadata/
RemoteSystemsTempFiles/
......@@ -9,6 +9,7 @@ target/
.classpath
*.bak
.DS_Store
.idea/
*.iml
*.ipr
*.iws
......@@ -225,6 +225,7 @@ public class SecurityConfig {
.antMatchers("/authc/user/modifySelfPassword").permitAll()
.antMatchers("/crm/load/publicity/byAssetPackage/**").permitAll()
.antMatchers("/workflow/api/**").permitAll()
.antMatchers("/dnaserver/**").permitAll()
.anyRequest().authenticated();//listAll,modifySelfPassword,loadAuctionByAsset临时开放
http.exceptionHandling().authenticationEntryPoint(authenticationEntryPoint);
InzWebAuthenticationFilter filter = new InzWebAuthenticationFilter();
......
package com.beecode.inz.war.web;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* 往DNA系统单点登录的校验接口(DNA 系统调用该接口进行校验)
* @author Jackpot
* @date 2021-03-10
*
*/
@RestController
public class DnaOssController {
@RequestMapping("/dnaserver")
public String oss(@RequestParam String serviceId) {
//credential 凭据
//userName 用户名
return "1";
}
}
dependencies {
compile lib.bcp_import
compile lib.bcp_type
compile lib.bcp_store
compile lib.hibernate_core
compile lib.spring_web
compile lib.spring_boot_autoconfigure
compile lib.jackson_datatype_jdk8
compile lib.jackson_datatype_jsr310
compile lib.json
compile "com.beecode:bap2.participant:${aminoVersion}"
compile "com.beecode:bcp.org:${aminoVersion}"
compile "com.beecode:bap2.department:${aminoVersion}"
compile "com.beecode:bap2.staff:${aminoVersion}"
compile 'com.deepoove:poi-tl:1.5.0'
compile project(":inz.common")
compile project(":inz.query")
compile project(":inz.workflow")
compile project(":inz.basis")
testCompile lib.amino_boot_web
testCompile lib.mysql_connector
}
package com.xyst.dinas.biz.config;
public class StationConfiguration {
}
# Auto Configure
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.xyst.dinas.biz.config.OaConfiguration
\ No newline at end of file
......@@ -12,6 +12,11 @@ import com.beecode.inz.workflow.config.TriggerAction;
import com.beecode.inz.workflow.config.TriggerCondition;
import com.xyst.dinas.oa.constant.BusinessTripApplyConstant;
import com.xyst.dinas.oa.constant.SealBorrowConstant;
import com.xyst.dinas.oa.dao.SealBorrowDao;
import com.xyst.dinas.oa.internal.dao.SealBorrowDaoImpl;
import com.xyst.dinas.oa.internal.service.SealBorrowServiceImpl;
import com.xyst.dinas.oa.service.SealBorrowService;
import com.xyst.dinas.oa.web.SealBorrowController;
public class OaConfiguration {
......@@ -61,4 +66,19 @@ public class OaConfiguration {
configuration.setProcessConfiguration(processConfig);
return configuration;
}
@Bean
public SealBorrowController sealBorrowController() {
return new SealBorrowController();
}
@Bean
public SealBorrowService sealBorrowService() {
return new SealBorrowServiceImpl();
}
@Bean
public SealBorrowDao sealBorrowDao() {
return new SealBorrowDaoImpl();
}
}
package com.xyst.dinas.oa.dao;
import java.util.UUID;
import com.beecode.bcp.type.KObject;
public interface SealBorrowDao {
KObject load(UUID id);
}
package com.xyst.dinas.oa.internal.dao;
import java.util.UUID;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.hibernate5.HibernateOperations;
import com.beecode.bcp.type.KObject;
import com.xyst.dinas.oa.constant.SealBorrowConstant;
import com.xyst.dinas.oa.dao.SealBorrowDao;
public class SealBorrowDaoImpl implements SealBorrowDao, SealBorrowConstant {
@Autowired
private HibernateOperations template;
@Override
public KObject load(UUID id) {
return (KObject) template.load(ENTITY, id);
}
}
package com.xyst.dinas.oa.internal.service;
import java.util.UUID;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import com.beecode.bcp.type.KObject;
import com.beecode.inz.workflow.service.InzWorkflowService;
import com.xyst.dinas.oa.constant.SealBorrowConstant;
import com.xyst.dinas.oa.dao.SealBorrowDao;
import com.xyst.dinas.oa.service.SealBorrowService;
public class SealBorrowServiceImpl implements SealBorrowService{
@Autowired
private InzWorkflowService inzWorkflowService;
@Autowired
private SealBorrowDao sealBorrowDao;
@Override
@Transactional
public void submitFlow(UUID id) {
KObject kobject = sealBorrowDao.load(id);
if (needSubmitFlow(kobject)) {
// 调用流程接口发起流程
inzWorkflowService.startWorkflow("SUBMIT",
SealBorrowConstant.BIZ_TYPE,
kobject.getString("lendReason"), kobject);
}
}
/**
* 判断提交是否需要走流程
*
* @param data
* @return
*/
private boolean needSubmitFlow(KObject data) {
return inzWorkflowService.canStartWotkflow("SUBMIT",
SealBorrowConstant.BIZ_TYPE, data);
}
}
package com.xyst.dinas.oa.service;
import java.util.UUID;
public interface SealBorrowService {
void submitFlow(UUID id);
}
package com.xyst.dinas.oa.web;
import java.util.UUID;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import com.beecode.bcp.workflow.exception.WorkflowRuntimeException;
import com.xyst.dinas.oa.service.SealBorrowService;
@RestController
public class SealBorrowController {
private static final Logger logger = LoggerFactory.getLogger(SealBorrowController.class);
@Autowired
private SealBorrowService sealBorrowService;
@ResponseBody
@RequestMapping(value = "/oa/sealBorrow/submitFlow", method = RequestMethod.POST, consumes = "application/json")
public Object repairDealWayAccept(@RequestBody String body) {
JSONObject obj = new JSONObject(body);
UUID id = UUID.fromString(obj.getString("id"));
sealBorrowService.submitFlow(id);
return obj.toString();
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment