提交 78dac912 authored 作者: 李炎's avatar 李炎

测试

上级 4f5bd037
This source diff could not be displayed because it is too large. You can view the blob instead.
Manifest-Version: 1.0
Implementation-Title: jeecg-system-cloud-api
Implementation-Version: 2.3.0
Built-By: hectorli
Implementation-Vendor-Id: org.jeecgframework.boot
Build-Jdk: 1.8.0_212
Implementation-URL: https://projects.spring.io/spring-boot/#/spring-bo
ot-starter-parent/jeecg-boot-parent/jeecg-boot-base-api/jeecg-system-
cloud-api
Created-By: Maven Integration for Eclipse
#Generated by Maven Integration for Eclipse
#Sun May 16 15:43:58 HKT 2021
version=2.3.0
groupId=org.jeecgframework.boot
m2e.projectName=jeecg-system-cloud-api
m2e.projectLocation=/source/jeecg-boot/jeecg-boot/jeecg-boot-base-api/jeecg-system-cloud-api
artifactId=jeecg-system-cloud-api
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>jeecg-boot-base-api</artifactId>
<groupId>org.jeecgframework.boot</groupId>
<version>2.3.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>jeecg-system-cloud-api</artifactId>
<dependencies>
<!-- spring-cloud begin -->
<!-- nacos -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<!-- feign -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
<!-- sentinel 熔断限流 -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
</dependency>
<!-- spring-cloud end -->
</dependencies>
<dependencyManagement>
<dependencies>
<!-- spring-cloud-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Greenwich.SR3</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
<version>2.1.0.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
</project>
\ No newline at end of file
package org.jeecg.modules.iost.API.controller.test;
import org.jeecg.common.util.RedisUtil;
import org.jeecg.modules.iost.API.entity.SalesOrderApiHeard;
import org.jeecg.modules.iost.API.entity.SalesOrderApiItem;
import org.jeecg.modules.iost.API.service.ISalesOrderApiHeardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
@RestController
@RequestMapping("/API/test")
public class test {
@Autowired
ISalesOrderApiHeardService service;
@GetMapping("")
public Object test() {
ArrayList<SalesOrderApiHeard> objects = new ArrayList<>();
SalesOrderApiHeard heard = new SalesOrderApiHeard();
heard.setBuyercode("ench");
// objects.add(heard);
SalesOrderApiItem salesOrderApiItem = new SalesOrderApiItem();
salesOrderApiItem.setSubclasscode("hcne");
heard.setItemlist(new ArrayList<SalesOrderApiItem>() {{
add(salesOrderApiItem);
}});
SalesOrderApiHeard heard2 = new SalesOrderApiHeard();
heard2.setBuyercode("avcx");
heard2.setSono("xcva");
objects.add(heard2);
boolean save = service.save(heard);
System.out.println(save);
return objects;
}
}
package org.jeecg.modules.iost.API.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: production_scheduling_work_order
* @Author: jeecg-boot
* @Date: 2021-10-27
* @Version: V1.0
*/
@Data
@TableName("production_scheduling_work_order")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="production_scheduling_work_order对象", description="production_scheduling_work_order")
public class ProductionSchedulingWorkOrder implements Serializable {
private static final long serialVersionUID = 1L;
/**id*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "id")
private String id;
/**排产批次号*/
@Excel(name = "排产批次号", width = 15)
@ApiModelProperty(value = "排产批次号")
private String batchcode;
/**排产工单号*/
@Excel(name = "排产工单号", width = 15)
@ApiModelProperty(value = "排产工单号")
private String schedulewo;
/**物料编码*/
@Excel(name = "物料编码", width = 15)
@ApiModelProperty(value = "物料编码")
private String matcode;
/**物料描述*/
@Excel(name = "物料描述", width = 15)
@ApiModelProperty(value = "物料描述")
private String matdesc;
/**排产数量*/
@Excel(name = "排产数量", width = 15)
@ApiModelProperty(value = "排产数量")
private String scheduleamount;
/**计量单位*/
@Excel(name = "计量单位", width = 15)
@ApiModelProperty(value = "计量单位")
private String scheduleunit;
/**备注*/
@Excel(name = "备注", width = 15)
@ApiModelProperty(value = "备注")
private String remark;
/**排产计划ID*/
@Excel(name = "排产计划ID", width = 15)
@ApiModelProperty(value = "排产计划ID")
private String productionschedulingid;
}
package org.jeecg.modules.iost.API.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
import java.io.Serializable;
import java.util.List;
/**
* @Description: 国网销售订单API
* @Author: jeecg-boot
* @Date: 2021-07-14
* @Version: V1.0
*/
@Data
@TableName("sales_order_api_heard")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "", description = "国网销售订单API")
public class SalesOrderApiHeard implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
// @TableId(type = IdType.ASSIGN_ID)
@TableId(type = IdType.ID_WORKER)
@ApiModelProperty(value = "主键")
private String id;
// "purchaserHqCode": "SGCC",
@Excel(name = "采购方总部编码", width = 15)
@ApiModelProperty(value = "采购方总部编码")
private String purchaserhqcode;
// "soNo": "string",//add:必须推送数据;update:不可更新该字段
@Excel(name = "销售订单号", width = 15)
@ApiModelProperty(value = "销售订单号")
private String sono;
// "supplierCode": "string",//add:必须推送数据;update:不可更新该字段
@Excel(name = "供应商编码", width = 15)
@ApiModelProperty(value = "供应商编码")
private String suppliercode;
// "buyerCode": "string",
@Excel(name = "采购方公司编码", width = 15)
@ApiModelProperty(value = "采购方公司编码")
private String buyercode;
//"buyerName": "string",
@Excel(name = "采购方公司名称", width = 15)
@ApiModelProperty(value = "采购方公司名称")
private String buyername;
//"buyerProvince": "string",
@Excel(name = "采购方公司省份", width = 15)
@ApiModelProperty(value = "采购方公司省份")
private String buyerprovince;
// "categoryCode": "string",
@Excel(name = "品类编码", width = 15)
@ApiModelProperty(value = "品类编码")
private String categorycode;
// "soStatus": 1,
@Excel(name = "销售订单状态", width = 15)
@ApiModelProperty(value = "销售订单状态")
private Integer sostatus;
// "dataSource": "string",
@Excel(name = "数据来源 0:供应商, 1:网关, 2:代理", width = 15)
@ApiModelProperty(value = "数据来源 0:供应商, 1:网关, 2:代理")
private String datasource;
// "dataSourceCreateTime": "string",
@Excel(name = "来源数据创建时间", width = 15)
@ApiModelProperty(value = "来源数据创建时间")
private String datasourcecreatetime;
//"ownerId": "string",
@Excel(name = "数据拥有方", width = 15)
@ApiModelProperty(value = "数据拥有方")
private String ownerid;
//"openId": "string",
@Excel(name = "数据可见方", width = 15)
@ApiModelProperty(value = "数据可见方")
private String openid;
@TableField(exist = false)
private List<SalesOrderApiItem> itemlist;
}
package org.jeecg.modules.iost.API.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
import java.io.Serializable;
/**
* @Description: 国网销售订单API
* @Author: jeecg-boot
* @Date: 2021-07-14
* @Version: V1.0
*/
@Data
@TableName("sales_order_api_item")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "", description = "国网销售订单API")
public class SalesOrderApiItem implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private String id;
//"soItemNo": "string",
/**
* 销售订单行项目号
*/
@Excel(name = "销售订单行项目号", width = 15)
@ApiModelProperty(value = "销售订单行项目号")
private String soitemno;
// "categoryCode": "string",
/**
* 品类编码
*/
@Excel(name = "品类编码", width = 15)
@ApiModelProperty(value = "品类编码")
private String categorycode;
// "subclassCode": "string",
/**
* 种类编码
*/
@Excel(name = "种类编码", width = 15)
@ApiModelProperty(value = "种类编码")
private String subclasscode;
//"poItemId": "string",
/**
* 采购订单行项目ID
*/
@Excel(name = "采购订单行项目ID", width = 15)
@ApiModelProperty(value = "采购订单行项目ID")
private String poitemid;
// "productCode": "string",
/**
* 物资编码
*/
@Excel(name = "物资编码", width = 15)
@ApiModelProperty(value = "物资编码")
private String productcode;
// "productName": "string",
/**
* 物资名称
*/
@Excel(name = "物资名称", width = 15)
@ApiModelProperty(value = "物资名称")
private String productname;
// "productUnit": "string",
/**
* 物资单位
*/
@Excel(name = "物资单位", width = 15)
@ApiModelProperty(value = "物资单位")
private String productunit;
// "productAmount": "string",
/**
* 物资数量
*/
@Excel(name = "物资数量", width = 15)
@ApiModelProperty(value = "物资数量")
private String productamount;
//"ownerId": "string",
@Excel(name = "数据拥有方", width = 15)
@ApiModelProperty(value = "数据拥有方")
private String ownerid;
//"openId": "string",
@Excel(name = "数据可见方", width = 15)
@ApiModelProperty(value = "数据可见方")
private String openid;
//"openId": "string",
@Excel(name = "", width = 15)
@ApiModelProperty(value = "")
private String salesorderid;
}
package org.jeecg.modules.iost.API.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.iost.API.entity.ProductionSchedulingWorkOrder;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: production_scheduling_work_order
* @Author: jeecg-boot
* @Date: 2021-10-27
* @Version: V1.0
*/
public interface ProductionSchedulingWorkOrderMapper extends BaseMapper<ProductionSchedulingWorkOrder> {
}
package org.jeecg.modules.iost.API.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.iost.API.entity.SalesOrderApiHeard;
import org.springframework.stereotype.Repository;
/**
* @Description: 国网供应商重点原材料库存API
* @Author: jeecg-boot
* @Date: 2021-07-14
* @Version: V1.0
*/
@Repository
public interface SalesOrderApiHeardMapper extends BaseMapper<SalesOrderApiHeard> {
}
package org.jeecg.modules.iost.API.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.iost.API.entity.Materialinventory;
import org.jeecg.modules.iost.API.entity.SalesOrderApiItem;
import org.springframework.stereotype.Repository;
/**
* @Description: 国网供应商重点原材料库存API
* @Author: jeecg-boot
* @Date: 2021-07-14
* @Version: V1.0
*/
@Repository
public interface SalesOrderApiItemMapper extends BaseMapper<SalesOrderApiItem> {
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.iost.API.mapper.ProductionSchedulingWorkOrderMapper">
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.iost.API.mapper.SalesOrderApiHeardMapper">
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.iost.API.mapper.SalesOrderApiItemMapper">
</mapper>
\ No newline at end of file
package org.jeecg.modules.iost.API.service;
import org.jeecg.modules.iost.API.entity.ProductionSchedulingWorkOrder;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: production_scheduling_work_order
* @Author: jeecg-boot
* @Date: 2021-10-27
* @Version: V1.0
*/
public interface IProductionSchedulingWorkOrderService extends IService<ProductionSchedulingWorkOrder> {
}
package org.jeecg.modules.iost.API.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.iost.API.entity.SalesOrderApiHeard;
import org.jeecg.modules.iost.API.entity.SalesorderApi;
import java.util.Collection;
import java.util.List;
/**
* @Description: 国网销售订单API
* @Author: jeecg-boot
* @Date: 2021-07-14
* @Version: V1.0
*/
public interface ISalesOrderApiHeardService extends IService<SalesOrderApiHeard> {
public List<SalesOrderApiHeard> selectList(Wrapper<SalesOrderApiHeard> wrapper);
public boolean executeBatch(Collection<SalesOrderApiHeard> listEntity);
}
package org.jeecg.modules.iost.API.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.iost.API.entity.SalesOrderApiItem;
/**
* @Description: 国网销售订单API
* @Author: jeecg-boot
* @Date: 2021-07-14
* @Version: V1.0
*/
public interface ISalesOrderApiItemService extends IService<SalesOrderApiItem> {
}
package org.jeecg.modules.iost.API.service.impl;
import org.jeecg.modules.iost.API.entity.ProductionSchedulingWorkOrder;
import org.jeecg.modules.iost.API.mapper.ProductionSchedulingWorkOrderMapper;
import org.jeecg.modules.iost.API.service.IProductionSchedulingWorkOrderService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: production_scheduling_work_order
* @Author: jeecg-boot
* @Date: 2021-10-27
* @Version: V1.0
*/
@Service
public class ProductionSchedulingWorkOrderServiceImpl extends ServiceImpl<ProductionSchedulingWorkOrderMapper, ProductionSchedulingWorkOrder> implements IProductionSchedulingWorkOrderService {
}
package org.jeecg.modules.iost.API.service.impl;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.Getter;
import org.jeecg.modules.iost.API.entity.SalesOrderApiHeard;
import org.jeecg.modules.iost.API.entity.SalesOrderApiItem;
import org.jeecg.modules.iost.API.mapper.SalesOrderApiHeardMapper;
import org.jeecg.modules.iost.API.mapper.SalesOrderApiItemMapper;
import org.jeecg.modules.iost.API.service.ISalesOrderApiHeardService;
import org.jeecg.modules.iost.API.service.ISalesOrderApiItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import java.util.*;
/**
* @Description: 国网销售订单API
* @Author: jeecg-boot
* @Date: 2021-07-14
* @Version: V1.0
*/
@Service
public class SalesOrderApiHeardServiceImpl extends ServiceImpl<SalesOrderApiHeardMapper, SalesOrderApiHeard> implements ISalesOrderApiHeardService {
@Autowired
private SalesOrderApiHeardMapper heardMapper;
@Autowired
private SalesOrderApiItemMapper itemMapper;
@Autowired
private ISalesOrderApiItemService itemService;
@Override
public List<SalesOrderApiHeard> selectList(Wrapper<SalesOrderApiHeard> wrapper) {
List<SalesOrderApiHeard> heardList = heardMapper.selectList(wrapper);
for (SalesOrderApiHeard heard : heardList) {
Map<String, Object> map = new HashMap<>();
map.put("salesorderid", heard.getId());
List<SalesOrderApiItem> listItem = itemMapper.selectByMap(map);
heard.setItemlist(listItem);
}
return heardList;
}
@Override
@Transactional(rollbackFor = Exception.class)
public boolean save(SalesOrderApiHeard entity) {
try {
heardMapper.insert(entity);
List<SalesOrderApiItem> itemlist = entity.getItemlist();
List<SalesOrderApiItem> itemlist_dto = new ArrayList<>();
for (SalesOrderApiItem item : itemlist) {
itemlist_dto.add(item.setSalesorderid(entity.getId()));
}
itemService.saveBatch(itemlist_dto);
} catch (Exception e) {
System.out.println("error***************:" + e);
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return false;
}
return true;
}
@Override
@Transactional(rollbackFor = Exception.class)
public boolean executeBatch(Collection<SalesOrderApiHeard> listEntity) {
for (SalesOrderApiHeard entity : listEntity) {
try {
heardMapper.insert(entity);
List<SalesOrderApiItem> itemlist = entity.getItemlist();
List<SalesOrderApiItem> itemlist_dto = new ArrayList<>();
for (SalesOrderApiItem item : itemlist) {
itemlist_dto.add(item.setSalesorderid(entity.getId()));
}
itemService.saveBatch(itemlist_dto);
} catch (Exception e) {
System.out.println("error***************:" + e);
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return false;
}
}
return true;
}
}
package org.jeecg.modules.iost.API.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.iost.API.entity.SalesOrderApiHeard;
import org.jeecg.modules.iost.API.entity.SalesOrderApiItem;
import org.jeecg.modules.iost.API.mapper.SalesOrderApiHeardMapper;
import org.jeecg.modules.iost.API.mapper.SalesOrderApiItemMapper;
import org.jeecg.modules.iost.API.service.ISalesOrderApiHeardService;
import org.jeecg.modules.iost.API.service.ISalesOrderApiItemService;
import org.springframework.stereotype.Service;
/**
* @Description: 国网销售订单API
* @Author: jeecg-boot
* @Date: 2021-07-14
* @Version: V1.0
*/
@Service
public class SalesOrderApiItemServiceImpl extends ServiceImpl<SalesOrderApiItemMapper, SalesOrderApiItem> implements ISalesOrderApiItemService {
}
...@@ -127,14 +127,14 @@ spring: ...@@ -127,14 +127,14 @@ spring:
connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000 connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
datasource: datasource:
master: master:
# url: jdbc:mysql://127.0.0.1:3306/wmssystem?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai url: jdbc:mysql://127.0.0.1:3307/eipapisystem?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
# username: root
# password: root
# driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://wmssystem-mysql:13579/wmssystem?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
username: root username: root
password: gf^*i6%&9J83&(*kJ653F&L password: root
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
# url: jdbc:mysql://wmssystem-mysql:13579/wmssystem?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
# username: root
# password: gf^*i6%&9J83&(*kJ653F&L
# driver-class-name: com.mysql.cj.jdbc.Driver
# 多数据源配置 # 多数据源配置
#multi-datasource1: #multi-datasource1:
#url: jdbc:mysql://localhost:3306/jeecg-boot2?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai #url: jdbc:mysql://localhost:3306/jeecg-boot2?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
......
[users]
#用户zhang的密码是123,此用户具有role1和role2两个角色
zhang=123
\ No newline at end of file
...@@ -4,6 +4,12 @@ import cn.hutool.json.JSONObject; ...@@ -4,6 +4,12 @@ import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.UsernamePasswordToken;
import org.apache.shiro.config.IniSecurityManagerFactory;
import org.apache.shiro.mgt.SecurityManager;
import org.apache.shiro.subject.Subject;
import org.apache.shiro.util.Factory;
import org.jeecg.common.util.security.SecurityTools; import org.jeecg.common.util.security.SecurityTools;
import org.jeecg.common.util.security.entity.*; import org.jeecg.common.util.security.entity.*;
import org.jeecg.modules.iost.basedata.entity.IostDeliveryRecordPic; import org.jeecg.modules.iost.basedata.entity.IostDeliveryRecordPic;
...@@ -62,4 +68,15 @@ public class SecurityToolsTest { ...@@ -62,4 +68,15 @@ public class SecurityToolsTest {
//sucess 为验签成功失败标志 true代码验签成功,false代表失败 //sucess 为验签成功失败标志 true代码验签成功,false代表失败
System.out.println(new JSONObject(securityResp).toStringPretty()); System.out.println(new JSONObject(securityResp).toStringPretty());
} }
@Test
public void sds(){
Factory<SecurityManager> iniSecurityManagerFactory = new IniSecurityManagerFactory("classpath:shiro.ini");
SecurityManager instance = iniSecurityManagerFactory.getInstance();
SecurityUtils.setSecurityManager(instance);
Subject subject = SecurityUtils.getSubject();
UsernamePasswordToken usernamePasswordToken=new UsernamePasswordToken("zhang","123");
subject.login(usernamePasswordToken);
System.out.println(subject.isAuthenticated());
}
} }
Manifest-Version: 1.0
Implementation-Title: jeecg-cloud-gateway
Implementation-Version: 2.3.0
Built-By: hectorli
Implementation-Vendor-Id: org.jeecgframework.boot
Build-Jdk: 1.8.0_212
Implementation-URL: https://projects.spring.io/spring-boot/#/spring-bo
ot-starter-parent/jeecg-boot-parent/jeecg-cloud-module/jeecg-cloud-ga
teway
Created-By: Maven Integration for Eclipse
#Generated by Maven Integration for Eclipse
#Sun May 16 15:43:56 HKT 2021
version=2.3.0
groupId=org.jeecgframework.boot
m2e.projectName=jeecg-cloud-gateway
m2e.projectLocation=/source/jeecg-boot/jeecg-boot/jeecg-cloud-module/jeecg-cloud-gateway
artifactId=jeecg-cloud-gateway
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>jeecg-cloud-module</artifactId>
<groupId>org.jeecgframework.boot</groupId>
<version>2.3.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>jeecg-cloud-gateway</artifactId>
<properties>
<swagger2.version>2.9.2</swagger2.version>
</properties>
<dependencies>
<!-- spring-cloud-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-gateway</artifactId>
</dependency>
<!-- 熔断、降级 -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!-- 限流Redis实现 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis-reactive</artifactId>
</dependency>
<!--springboot2.X默认使用lettuce连接池,需要引入commons-pool2-->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId>
</dependency>
<!--server-api-->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
</dependency>
<!-- Swagger API文档 -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${swagger2.version}</version>
</dependency>
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>swagger-bootstrap-ui</artifactId>
<version>1.9.3</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
</project>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论