Commit 3e75a58e authored by 高东东's avatar 高东东

添加西飞接口

parent 5bc6f759
package com.yeejoin.amos.avic.face.model;
import java.io.Serializable;
import java.util.Date;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
......@@ -11,21 +19,31 @@ import lombok.EqualsAndHashCode;
* @author 子杨
* @since 2022-03-28
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class AvicCustomPathModel extends BaseModel {
@XmlRootElement(name="AvicCustomPathModel")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(propOrder = {"id","agencyCode", "pathName", "path", "pathDesc", "sequenceNbr", "recDate", "recUserId"})
public class AvicCustomPathModel implements Serializable {
/**
*
*/
private static final long serialVersionUID = 6756323320498708828L;
private Long sequenceNbr;
private Date recDate;
private String recUserId;
private String agencyCode;
private String pathName;
private String path;
/**
* 分类编码
*/
private String desc;
private String pathDesc;
private String id;
}
package com.yeejoin.amos.avic.face.model;
import lombok.Data;
@Data
public class FileItem {
private String uid;
private String name;
private String status;
private String reponse;
private String url;
}
package com.yeejoin.amos.avic.face.model;
import java.util.List;
import lombok.Data;
@Data
public class TransferModel extends UploadFileModel{
private List<FileItem> files;
private String taskId;
private String bizId;
private String processDefinitionId;
private String result;
private String comment;
}
......@@ -16,7 +16,7 @@ import lombok.EqualsAndHashCode;
*/
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("avic_custom_path")
@TableName("idx_biz_c82t")
public class AvicCustomPath extends BaseEntity {
......@@ -29,7 +29,9 @@ public class AvicCustomPath extends BaseEntity {
/**
* 分类编码
*/
@TableField("DESC")
private String desc;
@TableField("PATH_DESC")
private String pathDesc;
@TableField("id")
private String id;
}
package com.yeejoin.amos.avic.face.service;
import java.util.List;
import org.springframework.stereotype.Component;
import org.typroject.tyboot.core.rdbms.annotation.Condition;
import org.typroject.tyboot.core.rdbms.annotation.Operator;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.avic.face.model.AvicCustomPathModel;
import com.yeejoin.amos.avic.face.orm.dao.AvicCustomPathMapper;
import com.yeejoin.amos.avic.face.orm.entity.AvicCustomPath;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.List;
/**
* <p>
......@@ -25,9 +28,10 @@ public class AvicCustomPathService extends BaseService<AvicCustomPathModel,AvicC
/**
* 分页查询
* @param string
*/
public Page<AvicCustomPathModel> queryForAvicCustomPathPage(Page page, String agencyCode) {
return this.queryForPage(page, null, false, agencyCode);
public Page<AvicCustomPathModel> queryForAvicCustomPathPage(Page<AvicCustomPathModel> page, @Condition(Operator.like) String pathName, String agencyCode) {
return this.queryForPage(page, null, false, pathName, agencyCode);
}
/**
......@@ -36,6 +40,4 @@ public class AvicCustomPathService extends BaseService<AvicCustomPathModel,AvicC
public List<AvicCustomPathModel> queryForAvicCustomPathList(String agencyCode) {
return this.queryForList("" , false, agencyCode);
}
}
......@@ -45,5 +45,5 @@ public interface FileFransferService {
* @param desc
*/
@WebMethod
public void transferPathConfig(AvicCustomPathModel model);
public void transferPathConfig(@WebParam(name="model") AvicCustomPathModel model);
}
......@@ -28,6 +28,12 @@
<artifactId>indicators-feign</artifactId>
<version>1.0.4-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.yeejoin</groupId>
<artifactId>amos-feign-systemctl</artifactId>
<version>1.7.4-SNAPSHOT</version>
</dependency>
</dependencies>
......
package com.yeejoin.amos.avic.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.avic.controller.AvicCustomPathResource;
import com.yeejoin.amos.avic.face.model.AvicCustomPathModel;
import com.yeejoin.amos.avic.face.service.AvicCustomPathService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.UUID;
import org.apache.cxf.endpoint.Client;
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
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.RestController;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.doc.TycloudResource;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.avic.face.model.AvicCustomPathModel;
import com.yeejoin.amos.avic.face.service.AvicCustomPathService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
/**
* <p>
* 前端控制器
......@@ -49,13 +58,20 @@ public class AvicCustomPathResource {
@ApiOperation(value = "创建")
@RequestMapping(value = "", method = RequestMethod.POST)
public ResponseModel<AvicCustomPathModel> create(@RequestBody AvicCustomPathModel model) {
postConfig(model);
model.setAgencyCode(RequestContext.getAgencyCode());
model.setRecDate(new Date());
model.setRecUserId(RequestContext.getExeUserId());
model.setId(String.valueOf(UUID.randomUUID().getLeastSignificantBits()));
// postConfig(model);
model = simpleService.createWithModel(model);
return ResponseHelper.buildResponse(model);
}
public void postConfig(AvicCustomPathModel model) {
JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();
// JaxWsProxyFactoryBean factoryBean = new JaxWsProxyFactoryBean();
// factoryBean.setServiceClass(AvicCustomPathModel.class);
// factoryBean.setAddress(webserviceUrl);
Client client = dcf.createClient(webserviceUrl);
try {
client.invoke("transferPathConfig", model);
......@@ -76,9 +92,12 @@ public class AvicCustomPathResource {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "删除")
@RequestMapping(value = "/{ids}", method = RequestMethod.PUT)
public ResponseModel<Boolean> delete(@PathVariable(value = "ids") List<Long> ids) {
return ResponseHelper.buildResponse(simpleService.deleteBatchSeq(ids));
@RequestMapping(value = "/{ids}", method = RequestMethod.DELETE)
public ResponseModel<Boolean> delete(@PathVariable("ids") String[] ids) {
for (String id: ids) {
simpleService.deleteBySeq(Long.parseLong(id));
}
return ResponseHelper.buildResponse(true);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
......@@ -91,19 +110,19 @@ public class AvicCustomPathResource {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "分页查询")
@RequestMapping(value = "/page", method = RequestMethod.GET)
public ResponseModel<Page> queryForPage(@RequestParam(value = "agencyCode") String agencyCode,
public ResponseModel<Page> queryForPage(@RequestParam(value = "searchValue") String pathName,
@RequestParam(value = "current") int current, @RequestParam(value = "size") int size) {
Page page = new Page();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(simpleService.queryForAvicCustomPathPage(page, agencyCode));
return ResponseHelper.buildResponse(simpleService.queryForAvicCustomPathPage(page, pathName, RequestContext.getAgencyCode()));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "列表查询")
@RequestMapping(value = "/list", method = RequestMethod.GET)
public ResponseModel selectForList(@RequestParam(value = "agencyCode") String agencyCode) {
return ResponseHelper.buildResponse(simpleService.queryForAvicCustomPathList(agencyCode));
public ResponseModel selectForList() {
return ResponseHelper.buildResponse(simpleService.queryForAvicCustomPathList(RequestContext.getAgencyCode()));
}
}
package com.yeejoin.amos;
import com.yeejoin.amos.boot.biz.common.utils.oConvertUtils;
import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......
## DB properties:
spring.datasource.url=jdbc:mysql://172.16.3.18:3306/amos_avic_biz?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.datasource.url=jdbc:mysql://172.16.3.18:3306/amos_idx_biz?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.datasource.username=root
spring.datasource.password=Yeejoin@2020
## eureka properties:
......@@ -11,4 +11,5 @@ spring.redis.host=172.16.3.18
spring.redis.port=6379
spring.redis.password=yeejoin@2020
upload.temp.dir=E:\\ftp\\
avic.webservice.path=http://localhost:8808/avic/services/fileFransfer?wsdl
\ No newline at end of file
......@@ -39,3 +39,8 @@ spring.redis.lettuce.pool.max-idle=10
spring.redis.lettuce.pool.min-idle=0
## redis失效时间
redis.cache.failure.time=10800
spring.servlet.multipart.maxFileSize=100MB
spring.servlet.multipart.maxRequestSize=100MB
spring.main.allow-bean-definition-overriding=true
\ 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