huangshuwen dc6dacfd67 1 | hace 4 años | |
---|---|---|
.mvn | hace 4 años | |
lib | hace 5 años | |
member-common | hace 4 años | |
member-services | hace 4 años | |
member-services-models | hace 4 años | |
member-web | hace 4 años | |
member-web-common | hace 4 años | |
member-weixin-service | hace 4 años | |
.gitignore | hace 4 años | |
README.md | hace 4 años | |
derby.log | hace 4 años | |
mvnw | hace 5 años | |
mvnw.cmd | hace 5 años | |
pom.xml | hace 4 años | |
updateAndStart.sh | hace 5 años |
使用Spring Boot + Spring-data-jpa 构建 接口文档使用swagger-ui管理, 文档url /doc.html
mvn启动命令mvn -f ./member-web/pom.xml spring-boot:run
服务器部署、启动命令:
screen -r MemberCenter (进入名为MemberCenter的screen)
(如果没有就用 screen -S MemberCenter 创建一个)
cd /usr/local/src/MemberCenter_DW/
git pull origin master
mvn clean package install
export workerid=0
export datacenterid=0
export ALL_PROXY=http://192.168.50.32:1808 #使用50.32的服务器做代理
java -Dhttps.proxyHost=192.168.50.32 -Dhttps.proxyPort=1808 -Dhttp.proxyHost=192.168.50.32 -Dhttp.proxyPort=1808 -jar member-web/target/member-web-0.0.1-SNAPSHOT.jar
ctrl + a (松开后按 d) 退出当前screen,让其后台运行
在使用新添加的sql查询导出excel的接口时,因为不知道为什么使用react框架的request来请求时,post不行,使用了blob也不行,就改成了get的方式,参数从sessionStorge里去取,然后编码提交,如下:
{
title:"测试表格",
url:{
read:"/japi/birdgird/readSql?dsId=4028b2a26daf6c2d016db34bc5ca00a5&sqlId=40288ad66df10dc9016df1101fe40001",
add:"/japi/birdgird/add?dsId=4028b2a26daf6c2d016db34bc5ca00a5&tableName=contract",
edit:"/japi/birdgird/edit?dsId=4028b2a26daf6c2d016db34bc5ca00a5&tableName=contract&pkColumn=id",
delete:"/japi/birdgird/delete?dsId=4028b2a26daf6c2d016db34bc5ca00a5&tableName=contract&pkColumn=id"
},
checkable:true,
actions:[{
name:"导出excel", onClick: function() {
let dtoStr = sessionStorage.getItem('queryDto');
dtoStr = encodeURI(dtoStr);
window.location = "http://localhost:8090/sqlExport/export?dsId=4028b2a26daf6c2d016db34bc5ca00a5&sqlId=40288a9d6e357e33016e3598b42a0000&requestStr="+dtoStr;
}
}],
columns:[
{title:"主编号", data:"t.id", type:"text",hide:true},
{title:"名称",data:"t.name", type:"text",editor: {}, query: true},
{title:"个人电话",data:"t.personal_phone", type:"text",editor: {}, query: true},
{title:"个人手机",data:"t.personal_cellphone", type:"text",editor: {}, query: true},
{title:"组名称",data:"t2.name",type:"text"},
{title:"操作",type:"command",actions:[{
name: '行内按钮',
onClick: (data) => {
console.log(data);
}
}]}
],
}
启动时需要添加proxy代理信息:
java -Dhttps.proxyHost=192.168.50.32 -Dhttps.proxyPort=1808 -Dhttp.proxyHost=192.168.50.32 -Dhttp.proxyPort=1808 -jar xxxx.jar
启动时需要添加机器编号和数据中心编号,为了使部分对象生成分布式ID
export workerid=0
export datacenterid=0
java -Dhttps.proxyHost=192.168.50.32 -Dhttps.proxyPort=1808 -Dhttp.proxyHost=192.168.50.32 -Dhttp.proxyPort=1808 -jar xxxx.jar
添加了动态请求查询参数,格式如下:
GET {url}?page=1&size=10
GET {url}?page=1&size=10&sortField=crtDate&sortDirection=DESC
sortField
是需要排序的字段 sortDirection
是升降序GET {url}?name=yourname&age=20&...
非关键字(上面两条中的)的参数,直接视为等于的操作。GET {url}?age=20&ageOperate=LessEqual&...
使用 字段名+Operate
的参数来表示判断类型:操作类型 | 说明 |
---|---|
Equal | 等于(默认) |
NotEqual | 不等于 |
Less | (数字类型)小于 |
LessEqual | (数字类型)不大于 |
Greater | (数字类型)大于 |
GreaterEqual | (数字类型)不小于 |
Contains | (字符串)包含 |
StartWith | (字符串)以开头 |
EndWith | (字符串)以结尾 |
com.liangjian.dataplatform.member.entity.token.DynamicParamGetter
取:
Service层:
//...
@Service
public class YourService extends DynamicQueryService<YourEntity> implements IYourService {
@Autowired
private YourRepository yourRepository;
@Overrive
public JpaSpecificationExecutor<YourEntity> getJpaRepository() {
return yourRepository;
}
//父类已经包含了动态查询返回Page和返回List的方法
}
Controller层:
@Controller
public class YourController {
//...
@Autowired
private IYourService iYourService;
//例子:
@GetMapping("/page")
public Page<YourEntity> page() {
var params = DynamicParamGetter.DynamicParams.get();
return iYourService.queryPageByCondition(params);
}
@GetMapping("/page")
public List<YourEntity> list() {
var params = DynamicParamGetter.DynamicParams.get();
return iYourService.queryListByCondition(params);
}
}
功能 | controller |
---|---|
标签库接口 | TagDatabaseController |
用户基本信息 | MemberextsController |
用户标签 | MemberextsController |
用户购药订单 | MemberOrderController |
用户用药信息 | MemberDrugUsageController |