Browse Source

代码修复

master
主管理员 11 months ago
parent
commit
09ef7da095
19 changed files with 2056 additions and 463 deletions
  1. +374
    -373
      admin-pc/src/mixins/JeecgListMixin.js
  2. +1
    -0
      applet-rice-api/applet-rice-api.iml
  3. +4
    -0
      applet-rice-api/pom.xml
  4. +9
    -2
      applet-rice-api/src/main/java/org/jeecg/api/controller/ApiRiceIndexController.java
  5. +5
    -1
      applet-rice-api/src/main/java/org/jeecg/api/service/ApiRiceService.java
  6. +464
    -78
      applet-rice-api/src/main/java/org/jeecg/api/service/impl/ApiRiceServiceImpl.java
  7. +1122
    -0
      applet-rice-api/src/main/java/org/jeecg/bean/HttpClientUtil.java
  8. +14
    -0
      applet-rice-api/src/main/java/org/jeecg/bean/WxQrCodeVo.java
  9. +1
    -1
      module-common/src/main/java/org/jeecg/modules/commonOrder/controller/CommonOrderController.java
  10. +6
    -1
      module-common/src/main/java/org/jeecg/modules/commonOrder/entity/CommonOrder.java
  11. +1
    -1
      module-common/src/main/java/org/jeecg/modules/commonOrder/mapper/CommonOrderMapper.java
  12. +1
    -1
      module-common/src/main/java/org/jeecg/modules/commonOrder/service/ICommonOrderService.java
  13. +1
    -1
      module-common/src/main/java/org/jeecg/modules/commonOrder/service/impl/CommonOrderServiceImpl.java
  14. +22
    -0
      module-common/src/main/java/org/jeecg/modules/commonOrder/vue/CommonOrderList.vue
  15. +5
    -0
      module-common/src/main/java/org/jeecg/modules/commonOrder/vue/modules/CommonOrderForm.vue
  16. +22
    -0
      module-common/src/main/java/org/jeecg/modules/commonOrder/vue3/CommonOrder.data.ts
  17. +1
    -1
      module-system/module-system.iml
  18. +1
    -1
      module-system/src/main/resources/application-dev.yml
  19. +2
    -2
      module-system/src/main/resources/pay_weixin.properties

+ 374
- 373
admin-pc/src/mixins/JeecgListMixin.js View File

@ -1,374 +1,375 @@
/**
* 新增修改完成调用 modalFormOk方法 编辑弹框组件ref定义为modalForm
* 高级查询按钮调用 superQuery方法 高级查询组件ref定义为superQueryModal
* data中url定义 list为查询列表 delete为删除单条记录 deleteBatch为批量删除
*/
import { filterObj } from '@/utils/util';
import { deleteAction, getAction,downFile,getFileAccessHttpUrl } from '@/api/manage'
import Vue from 'vue'
import { ACCESS_TOKEN, TENANT_ID } from "@/store/mutation-types"
import store from '@/store'
export const JeecgListMixin = {
data(){
return {
/* 查询条件-请不要在queryParam中声明非字符串值的属性 */
queryParam: {},
/* 数据源 */
dataSource:[],
/* 分页参数 */
ipagination:{
current: 1,
pageSize: 10,
pageSizeOptions: ['10', '20', '30'],
showTotal: (total, range) => {
return range[0] + "-" + range[1] + " 共" + total + "条"
},
showQuickJumper: true,
showSizeChanger: true,
total: 0
},
/* 排序参数 */
isorter:{
column: 'createTime',
order: 'desc',
},
/* 筛选参数 */
filters: {},
/* table加载状态 */
loading:false,
/* table选中keys*/
selectedRowKeys: [],
/* table选中records*/
selectionRows: [],
/* 查询折叠 */
toggleSearchStatus:false,
/* 高级查询条件生效状态 */
superQueryFlag:false,
/* 高级查询条件 */
superQueryParams: '',
/** 高级查询拼接方式 */
superQueryMatchType: 'and',
}
},
created() {
if(!this.disableMixinCreated){
console.log(' -- mixin created -- ')
this.loadData();
//初始化字典配置 在自己页面定义
this.initDictConfig();
}
},
computed: {
//token header
tokenHeader(){
let head = {'X-Access-Token': Vue.ls.get(ACCESS_TOKEN)}
let tenantid = Vue.ls.get(TENANT_ID)
if(tenantid){
head['tenant-id'] = tenantid
}
return head;
}
},
methods:{
loadData(arg) {
if(!this.url.list){
this.$message.error("请设置url.list属性!")
return
}
//加载数据 若传入参数1则加载第一页的内容
if (arg === 1) {
this.ipagination.current = 1;
}
var params = this.getQueryParams();//查询条件
this.loading = true;
getAction(this.url.list, params).then((res) => {
if (res.success) {
//update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
this.dataSource = res.result.records||res.result;
if(res.result.total)
{
this.ipagination.total = res.result.total;
}else{
this.ipagination.total = 0;
}
//update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
}else{
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
},
initDictConfig(){
console.log("--这是一个假的方法!")
},
handleSuperQuery(params, matchType) {
//高级查询方法
if(!params){
this.superQueryParams=''
this.superQueryFlag = false
}else{
this.superQueryFlag = true
this.superQueryParams=JSON.stringify(params)
this.superQueryMatchType = matchType
}
this.loadData(1)
},
getQueryParams() {
//获取查询条件
let sqp = {}
if(this.superQueryParams){
sqp['superQueryParams']=encodeURI(this.superQueryParams)
sqp['superQueryMatchType'] = this.superQueryMatchType
}
var param = Object.assign(sqp, this.queryParam, this.isorter ,this.filters);
param.field = this.getQueryField();
param.pageNo = this.ipagination.current;
param.pageSize = this.ipagination.pageSize;
return filterObj(param);
},
getQueryField() {
//TODO 字段权限控制
var str = "id,";
this.columns.forEach(function (value) {
str += "," + value.dataIndex;
});
return str;
},
onSelectChange(selectedRowKeys, selectionRows) {
this.selectedRowKeys = selectedRowKeys;
this.selectionRows = selectionRows;
},
onClearSelected() {
this.selectedRowKeys = [];
this.selectionRows = [];
},
searchQuery() {
this.loadData(1);
// 点击查询清空列表选中行
// https://gitee.com/jeecg/jeecg-boot/issues/I4KTU1
this.selectedRowKeys = []
this.selectionRows = []
},
superQuery() {
this.$refs.superQueryModal.show();
},
searchReset() {
this.queryParam = {}
this.loadData(1);
},
batchDel: function () {
if(!this.url.deleteBatch){
this.$message.error("请设置url.deleteBatch属性!")
return
}
if (this.selectedRowKeys.length <= 0) {
this.$message.warning('请选择一条记录!');
return;
} else {
var ids = "";
for (var a = 0; a < this.selectedRowKeys.length; a++) {
ids += this.selectedRowKeys[a] + ",";
}
var that = this;
this.$confirm({
title: "确认删除",
content: "是否删除选中数据?",
onOk: function () {
that.loading = true;
deleteAction(that.url.deleteBatch, {ids: ids}).then((res) => {
if (res.success) {
//重新计算分页问题
that.reCalculatePage(that.selectedRowKeys.length)
that.$message.success(res.message);
that.loadData();
that.onClearSelected();
} else {
that.$message.warning(res.message);
}
}).finally(() => {
that.loading = false;
});
}
});
}
},
handleDelete: function (id) {
if(!this.url.delete){
this.$message.error("请设置url.delete属性!")
return
}
var that = this;
deleteAction(that.url.delete, {id: id}).then((res) => {
if (res.success) {
//重新计算分页问题
that.reCalculatePage(1)
that.$message.success(res.message);
that.loadData();
} else {
that.$message.warning(res.message);
}
});
},
reCalculatePage(count){
//总数量-count
let total=this.ipagination.total-count;
//获取删除后的分页数
let currentIndex=Math.ceil(total/this.ipagination.pageSize);
//删除后的分页数<所在当前页
if(currentIndex<this.ipagination.current){
this.ipagination.current=currentIndex;
}
console.log('currentIndex',currentIndex)
},
handleEdit: function (record) {
this.$refs.modalForm.edit(record);
this.$refs.modalForm.title = "编辑";
this.$refs.modalForm.disableSubmit = false;
},
handleAdd: function () {
this.$refs.modalForm.add();
this.$refs.modalForm.title = "新增";
this.$refs.modalForm.disableSubmit = false;
},
handleTableChange(pagination, filters, sorter) {
//分页、排序、筛选变化时触发
//TODO 筛选
console.log(pagination)
if (Object.keys(sorter).length > 0) {
this.isorter.column = sorter.field;
this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
}
this.ipagination = pagination;
this.loadData();
},
handleToggleSearch(){
this.toggleSearchStatus = !this.toggleSearchStatus;
},
// 给popup查询使用(查询区域不支持回填多个字段,限制只返回一个字段)
getPopupField(fields){
return fields.split(',')[0]
},
modalFormOk() {
// 新增/修改 成功时,重载列表
this.loadData();
//清空列表选中
this.onClearSelected()
},
handleDetail:function(record){
this.$refs.modalForm.edit(record);
this.$refs.modalForm.title="详情";
this.$refs.modalForm.disableSubmit = true;
},
/* 导出 */
handleExportXls2(){
let paramsStr = encodeURI(JSON.stringify(this.getQueryParams()));
let url = `${window._CONFIG['domianURL']}/${this.url.exportXlsUrl}?paramsStr=${paramsStr}`;
window.location.href = url;
},
handleExportXls(fileName){
if(!fileName || typeof fileName != "string"){
fileName = "导出文件"
}
let param = this.getQueryParams();
if(this.selectedRowKeys && this.selectedRowKeys.length>0){
param['selections'] = this.selectedRowKeys.join(",")
}
console.log("导出参数",param)
downFile(this.url.exportXlsUrl,param).then((data)=>{
if (!data) {
this.$message.warning("文件下载失败")
return
}
if (typeof window.navigator.msSaveBlob !== 'undefined') {
window.navigator.msSaveBlob(new Blob([data],{type: 'application/vnd.ms-excel'}), fileName+'.xls')
}else{
let url = window.URL.createObjectURL(new Blob([data],{type: 'application/vnd.ms-excel'}))
let link = document.createElement('a')
link.style.display = 'none'
link.href = url
link.setAttribute('download', fileName+'.xls')
document.body.appendChild(link)
link.click()
document.body.removeChild(link); //下载完成移除元素
window.URL.revokeObjectURL(url); //释放掉blob对象
}
})
},
/* 导入 */
handleImportExcel(info){
this.loading = true;
if (info.file.status !== 'uploading') {
console.log(info.file, info.fileList);
}
if (info.file.status === 'done') {
this.loading = false;
if (info.file.response.success) {
// this.$message.success(`${info.file.name} 文件上传成功`);
if (info.file.response.code === 201) {
let { message, result: { msg, fileUrl, fileName } } = info.file.response
let href = window._CONFIG['domianURL'] + fileUrl
this.$warning({
title: message,
content: (<div>
<span>{msg}</span><br/>
<span>具体详情请 <a href={href} target="_blank" download={fileName}>点击下载</a> </span>
</div>
)
})
} else {
this.$message.success(info.file.response.message || `${info.file.name} 文件上传成功`)
}
this.loadData()
} else {
this.$message.error(`${info.file.name} ${info.file.response.message}.`);
}
} else if (info.file.status === 'error') {
this.loading = false;
if (info.file.response.status === 500) {
let data = info.file.response
const token = Vue.ls.get(ACCESS_TOKEN)
if (token && data.message.includes("Token失效")) {
this.$error({
title: '登录已过期',
content: '很抱歉,登录已过期,请重新登录',
okText: '重新登录',
mask: false,
onOk: () => {
store.dispatch('Logout').then(() => {
Vue.ls.remove(ACCESS_TOKEN)
window.location.reload();
})
}
})
}
} else {
this.$message.error(`文件上传失败: ${info.file.msg} `);
}
}
},
/* 图片预览 */
getImgView(text){
if(text && text.indexOf(",")>0){
text = text.substring(0,text.indexOf(","))
}
return getFileAccessHttpUrl(text)
},
/* 文件下载 */
// update--autor:lvdandan-----date:20200630------for:修改下载文件方法名uploadFile改为downloadFile------
downloadFile(text){
if(!text){
this.$message.warning("未知的文件")
return;
}
if(text.indexOf(",")>0){
text = text.substring(0,text.indexOf(","))
}
let url = getFileAccessHttpUrl(text)
window.open(url);
},
}
/**
* 新增修改完成调用 modalFormOk方法 编辑弹框组件ref定义为modalForm
* 高级查询按钮调用 superQuery方法 高级查询组件ref定义为superQueryModal
* data中url定义 list为查询列表 delete为删除单条记录 deleteBatch为批量删除
*/
import { filterObj } from '@/utils/util';
import { deleteAction, getAction,downFile,getFileAccessHttpUrl } from '@/api/manage'
import Vue from 'vue'
import { ACCESS_TOKEN, TENANT_ID } from "@/store/mutation-types"
import store from '@/store'
export const JeecgListMixin = {
data(){
return {
/* 查询条件-请不要在queryParam中声明非字符串值的属性 */
queryParam: {},
/* 数据源 */
dataSource:[],
/* 分页参数 */
ipagination:{
current: 1,
pageSize: 10,
pageSizeOptions: ['10', '20', '30'],
showTotal: (total, range) => {
return range[0] + "-" + range[1] + " 共" + total + "条"
},
showQuickJumper: true,
showSizeChanger: true,
total: 0
},
/* 排序参数 */
isorter:{
column: 'createTime',
order: 'desc',
},
/* 筛选参数 */
filters: {},
/* table加载状态 */
loading:false,
/* table选中keys*/
selectedRowKeys: [],
/* table选中records*/
selectionRows: [],
/* 查询折叠 */
toggleSearchStatus:false,
/* 高级查询条件生效状态 */
superQueryFlag:false,
/* 高级查询条件 */
superQueryParams: '',
/** 高级查询拼接方式 */
superQueryMatchType: 'and',
}
},
created() {
if(!this.disableMixinCreated){
console.log(' -- mixin created -- ')
this.loadData();
//初始化字典配置 在自己页面定义
this.initDictConfig();
}
},
computed: {
//token header
tokenHeader(){
let head = {'X-Access-Token': Vue.ls.get(ACCESS_TOKEN)}
let tenantid = Vue.ls.get(TENANT_ID)
if(tenantid){
head['tenant-id'] = tenantid
}
return head;
}
},
methods:{
loadData(arg) {
if(!this.url.list){
this.$message.error("请设置url.list属性!")
return
}
//加载数据 若传入参数1则加载第一页的内容
if (arg === 1) {
this.ipagination.current = 1;
}
var params = this.getQueryParams();//查询条件
this.loading = true;
getAction(this.url.list, params).then((res) => {
if (res.success) {
//update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
this.dataSource = res.result.records||res.result;
if(res.result.total)
{
this.ipagination.total = res.result.total;
}else{
this.ipagination.total = 0;
}
//update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
}else{
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
},
initDictConfig(){
console.log("--这是一个假的方法!")
},
handleSuperQuery(params, matchType) {
//高级查询方法
if(!params){
this.superQueryParams=''
this.superQueryFlag = false
}else{
this.superQueryFlag = true
this.superQueryParams=JSON.stringify(params)
this.superQueryMatchType = matchType
}
this.loadData(1)
},
getQueryParams() {
//获取查询条件
let sqp = {}
if(this.superQueryParams){
sqp['superQueryParams']=encodeURI(this.superQueryParams)
sqp['superQueryMatchType'] = this.superQueryMatchType
}
var param = Object.assign(sqp, this.queryParam, this.isorter ,this.filters);
param.field = this.getQueryField();
param.pageNo = this.ipagination.current;
param.pageSize = this.ipagination.pageSize;
return filterObj(param);
},
getQueryField() {
//TODO 字段权限控制
var str = "id,";
this.columns.forEach(function (value) {
str += "," + value.dataIndex;
});
return str;
},
onSelectChange(selectedRowKeys, selectionRows) {
this.selectedRowKeys = selectedRowKeys;
this.selectionRows = selectionRows;
},
onClearSelected() {
this.selectedRowKeys = [];
this.selectionRows = [];
},
searchQuery() {
this.loadData(1);
// 点击查询清空列表选中行
// https://gitee.com/jeecg/jeecg-boot/issues/I4KTU1
this.selectedRowKeys = []
this.selectionRows = []
},
superQuery() {
this.$refs.superQueryModal.show();
},
searchReset() {
this.queryParam = {}
this.loadData(1);
},
batchDel: function () {
if(!this.url.deleteBatch){
this.$message.error("请设置url.deleteBatch属性!")
return
}
if (this.selectedRowKeys.length <= 0) {
this.$message.warning('请选择一条记录!');
return;
} else {
var ids = "";
for (var a = 0; a < this.selectedRowKeys.length; a++) {
ids += this.selectedRowKeys[a] + ",";
}
var that = this;
this.$confirm({
title: "确认删除",
content: "是否删除选中数据?",
onOk: function () {
that.loading = true;
deleteAction(that.url.deleteBatch, {ids: ids}).then((res) => {
if (res.success) {
//重新计算分页问题
that.reCalculatePage(that.selectedRowKeys.length)
that.$message.success(res.message);
that.loadData();
that.onClearSelected();
} else {
that.$message.warning(res.message);
}
}).finally(() => {
that.loading = false;
});
}
});
}
},
handleDelete: function (id) {
if(!this.url.delete){
this.$message.error("请设置url.delete属性!")
return
}
var that = this;
deleteAction(that.url.delete, {id: id}).then((res) => {
if (res.success) {
//重新计算分页问题
that.reCalculatePage(1)
that.$message.success(res.message);
that.loadData();
} else {
that.$message.warning(res.message);
}
});
},
reCalculatePage(count){
//总数量-count
let total=this.ipagination.total-count;
//获取删除后的分页数
let currentIndex=Math.ceil(total/this.ipagination.pageSize);
//删除后的分页数<所在当前页
if(currentIndex<this.ipagination.current){
this.ipagination.current=currentIndex;
}
console.log('currentIndex',currentIndex)
},
handleEdit: function (record) {
this.$refs.modalForm.edit(record);
this.$refs.modalForm.title = "编辑";
this.$refs.modalForm.disableSubmit = false;
},
handleAdd: function () {
this.$refs.modalForm.add();
this.$refs.modalForm.title = "新增";
this.$refs.modalForm.disableSubmit = false;
},
handleTableChange(pagination, filters, sorter) {
//分页、排序、筛选变化时触发
//TODO 筛选
console.log(pagination)
if (Object.keys(sorter).length > 0) {
this.isorter.column = sorter.field;
this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
}
this.ipagination = pagination;
this.loadData();
},
handleToggleSearch(){
this.toggleSearchStatus = !this.toggleSearchStatus;
},
// 给popup查询使用(查询区域不支持回填多个字段,限制只返回一个字段)
getPopupField(fields){
return fields.split(',')[0]
},
modalFormOk() {
// 新增/修改 成功时,重载列表
this.loadData();
//清空列表选中
this.onClearSelected()
},
handleDetail:function(record){
this.$refs.modalForm.edit(record);
this.$refs.modalForm.title="详情";
this.$refs.modalForm.disableSubmit = true;
},
/* 导出 */
handleExportXls2(){
let paramsStr = encodeURI(JSON.stringify(this.getQueryParams()));
let url = `${window._CONFIG['domianURL']}/${this.url.exportXlsUrl}?paramsStr=${paramsStr}`;
window.location.href = url;
},
handleExportXls(fileName){
if(!fileName || typeof fileName != "string"){
fileName = "导出文件"
}
let param = this.getQueryParams();
if(this.selectedRowKeys && this.selectedRowKeys.length>0){
param['selections'] = this.selectedRowKeys.join(",")
}
console.log("导出参数",param)
downFile(this.url.exportXlsUrl,param).then((data)=>{
if (!data) {
this.$message.warning("文件下载失败")
return
}
if (typeof window.navigator.msSaveBlob !== 'undefined') {
window.navigator.msSaveBlob(new Blob([data],{type: 'application/vnd.ms-excel'}), fileName+'.xls')
}else{
let url = window.URL.createObjectURL(new Blob([data],{type: 'application/vnd.ms-excel'}))
let link = document.createElement('a')
link.style.display = 'none'
link.href = url
link.setAttribute('download', fileName+'.xls')
document.body.appendChild(link)
link.click()
document.body.removeChild(link); //下载完成移除元素
window.URL.revokeObjectURL(url); //释放掉blob对象
}
})
},
/* 导入 */
handleImportExcel(info){
this.loading = true;
if (info.file.status !== 'uploading') {
console.log(info.file, info.fileList);
}
if (info.file.status === 'done') {
this.loading = false;
if (info.file.response.success) {
// this.$message.success(`${info.file.name} 文件上传成功`);
if (info.file.response.code === 201) {
let { message, result: { msg, fileUrl, fileName } } = info.file.response
let href = window._CONFIG['domianURL'] + fileUrl
this.$warning({
title: message,
content: (<div>
<span>{msg}</span><br/>
<span>具体详情请 <a href={href} target="_blank" download={fileName}>点击下载</a> </span>
</div>
)
})
} else {
this.$message.success(info.file.response.message || `${info.file.name} 文件上传成功`)
}
this.loadData()
} else {
this.$message.error(`${info.file.name} ${info.file.response.message}.`);
}
} else if (info.file.status === 'error') {
this.loading = false;
if (info.file.response.status === 500) {
let data = info.file.response
const token = Vue.ls.get(ACCESS_TOKEN)
if (token && data.message.includes("Token失效")) {
this.$error({
title: '登录已过期',
content: '很抱歉,登录已过期,请重新登录',
okText: '重新登录',
mask: false,
onOk: () => {
store.dispatch('Logout').then(() => {
Vue.ls.remove(ACCESS_TOKEN)
window.location.reload();
})
}
})
}
} else {
this.$message.error(`文件上传失败: ${info.file.msg} `);
}
}
},
/* 图片预览 */
getImgView(text){
if(text && text.indexOf(",")>0){
text = text.substring(0,text.indexOf(","))
}
return getFileAccessHttpUrl(text)
},
/* 文件下载 */
// update--autor:lvdandan-----date:20200630------for:修改下载文件方法名uploadFile改为downloadFile------
downloadFile(text){
if(!text){
this.$message.warning("未知的文件")
return;
}
if(text.indexOf(",")>0){
text = text.substring(0,text.indexOf(","))
}
let url = getFileAccessHttpUrl(text)
window.open(url);
},
}
}

+ 1
- 0
applet-rice-api/applet-rice-api.iml View File

@ -263,6 +263,7 @@
<orderEntry type="library" name="Maven: org.bouncycastle:bcpkix-jdk15on:1.59" level="project" />
<orderEntry type="library" name="Maven: com.github.binarywang:weixin-java-miniapp:3.5.0" level="project" />
<orderEntry type="library" name="Maven: com.github.binarywang:weixin-java-mp:3.5.0" level="project" />
<orderEntry type="library" name="Maven: commons-fileupload:commons-fileupload:1.4" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-starter-test:2.6.6" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.6.6" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.6.6" level="project" />


+ 4
- 0
applet-rice-api/pom.xml View File

@ -48,6 +48,10 @@
<version>3.2.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
</dependency>
</dependencies>

+ 9
- 2
applet-rice-api/src/main/java/org/jeecg/api/controller/ApiRiceIndexController.java View File

@ -164,6 +164,13 @@ public class ApiRiceIndexController {
}
//创建订单
@ApiOperation(value="创建订单-再次支付", notes="创建订单-再次支付")
@GetMapping(value = "/createOrderTwo")
public Result<?> createOrderTwo(@RequestHeader("X-Access-Token") String token,String orderId) {
return apiRiceService.createOrderTwo(token,orderId);
}
//商城-加入购物车之后一次下多个订单
@ApiOperation(value="商城-加入购物车之后一次下多个订单", notes="商城-加入购物车之后一次下多个订单")
@ -177,8 +184,8 @@ public class ApiRiceIndexController {
//商城-加入购物车之后一次下多个订单 - 再次下单
@ApiOperation(value="商城-加入购物车之后一次下多个订单 - 再次下单", notes="商城-加入购物车之后一次下多个订单 - 再次下单")
@PostMapping("/createSumOrderAgain")
public Result<?> createSumOrderAgain(@RequestHeader("X-Access-Token") String token,String list,String addressId,String orderId){
return apiRiceService.createSumOrderAgain(token,list,addressId,orderId);
public Result<?> createSumOrderAgain(@RequestHeader("X-Access-Token") String token,String orderId){
return apiRiceService.createSumOrderAgain(token,orderId);
}


+ 5
- 1
applet-rice-api/src/main/java/org/jeecg/api/service/ApiRiceService.java View File

@ -49,11 +49,15 @@ public interface ApiRiceService {
Result<?> createOrder(String token,String productId,Integer num,String addressId);
//再次支付
Result<?> createOrderTwo(String token,String orderId);
//商城-立即购买多少商品
Result<?> createSumOrder(String token,String list,String addressId);
//商城-加入购物车之后一次下多个订单 - 再次下单
Result<?> createSumOrderAgain(String token,String list,String addressId,String orderId);
Result<?> createSumOrderAgain(String token,String orderId);
//商城-支付回调


+ 464
- 78
applet-rice-api/src/main/java/org/jeecg/api/service/impl/ApiRiceServiceImpl.java View File

@ -1,6 +1,9 @@
package org.jeecg.api.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
@ -9,8 +12,12 @@ import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResult;
import lombok.extern.log4j.Log4j;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.jeecg.api.service.ApiRiceService;
import org.jeecg.bean.HttpClientUtil;
import org.jeecg.bean.PageBean;
import org.jeecg.bean.WxQrCodeVo;
import org.jeecg.common.api.vo.Result;
import org.jeecg.config.shiro.ShiroRealm;
import org.jeecg.modules.commonAddress.entity.CommonAddress;
@ -21,6 +28,7 @@ import org.jeecg.modules.commonCat.entity.CommonCat;
import org.jeecg.modules.commonCat.service.ICommonCatService;
import org.jeecg.modules.commonClass.entity.CommonClass;
import org.jeecg.modules.commonClass.service.ICommonClassService;
import org.jeecg.modules.commonConfig.entity.CommonConfig;
import org.jeecg.modules.commonConfig.service.ICommonConfigService;
import org.jeecg.modules.commonIconImage.entity.CommonIconImage;
import org.jeecg.modules.commonIconImage.service.ICommonIconImageService;
@ -45,11 +53,22 @@ import org.jeecg.modules.riceNews.entity.RiceNews;
import org.jeecg.modules.riceNews.service.IRiceNewsService;
import org.jeecg.modules.riceVip.entity.RiceVip;
import org.jeecg.modules.riceVip.service.IRiceVipService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import javax.annotation.Resource;
import javax.transaction.Transactional;
import java.io.*;
import java.math.BigDecimal;
import java.util.*;
@ -205,6 +224,126 @@ public class ApiRiceServiceImpl implements ApiRiceService {
}
//再次支付
@Override
@Transactional
public Result<?> createOrderTwo(String token,String orderId){
HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token);
//查询订单是否存在
CommonOrder commonOrder = commonOrderService.getById(orderId);
if (commonOrder==null){
return Result.error("订单不存在");
}
if (commonOrder.getState()==1){
return Result.error("订单已支付");
}
//查询订单是否shopState不等于2
if (commonOrder.getShopState()==2){
return Result.error("非首页订单");
}
//根据配置列表查询每人限制数量
CommonConfig commonConfig = commonConfigService.lambdaQuery()
.eq(CommonConfig::getKeyName,"pay_num")
.one();
//得到配置的数值转为int类型
int payNum = Integer.parseInt(commonConfig.getKeyContent());
//根据商品信息是否是体验装进行判断
if (commonOrder.getShopState()==0){
//查询用户是否存在该订单
List<CommonOrder> byUserIdAndShopId = commonOrderService.lambdaQuery()
.eq(CommonOrder::getUserId,hanHaiMember.getId())
.eq(CommonOrder::getShopId,commonOrder.getShopId())
.eq(CommonOrder::getShopState,0)
.eq(CommonOrder::getState,1)
.list();
if (byUserIdAndShopId.size()+1>payNum){
return Result.error("已超过体验商品购买次数限制!请勿重复购买");
}
//查询用户是否存在该订单
List<CommonOrder> payNumList = commonOrderService.lambdaQuery()
.eq(CommonOrder::getUserId,hanHaiMember.getId())
.eq(CommonOrder::getShopId,commonOrder.getShopId())
.eq(CommonOrder::getShopState,0)
.eq(CommonOrder::getState,0)
.list();
if (payNumList.size()>1){
return Result.error("您有相同订单未付款!请先付款");
}
}
//创建订单标识
String newOrderId = IdWorker.getIdStr();
//老的订单数据复制给新创建的订单对象
CommonOrder commonOrder1 = new CommonOrder();
commonOrder1.setId(newOrderId);
commonOrder1.setShopState(commonOrder.getShopState());
commonOrder1.setUserId(hanHaiMember.getId());
commonOrder1.setTitle(commonOrder.getTitle());
commonOrder1.setImage(commonOrder.getImage());
commonOrder1.setPrice(commonOrder.getPrice());
commonOrder1.setNum(commonOrder.getNum());
commonOrder1.setShopId(commonOrder.getShopId());
commonOrder1.setPayNo(commonOrder.getPayNo());
commonOrder1.setAddressId(commonOrder.getAddressId());
commonOrder1.setAddressDetails(commonOrder.getAddressDetails());
commonOrder1.setAddress(commonOrder.getAddress());
commonOrder1.setName(commonOrder.getName());
commonOrder1.setPhone(commonOrder.getPhone());
commonOrder1.setSku(commonOrder.getSku());
commonOrder1.setCreateTime(new Date());
commonOrderService.save(commonOrder1);
//根据订单标识查询订单详情对象
CommonOrderSku commonOrderSku = new CommonOrderSku();
commonOrderSku.setOrderId(newOrderId);
commonOrderSku.setUserId(hanHaiMember.getId());
commonOrderSku.setTitle(commonOrder.getTitle());
commonOrderSku.setImage(commonOrder.getImage());
commonOrderSku.setPrice(commonOrder.getPrice());
commonOrderSku.setNum(commonOrder.getNum());
commonOrderSku.setShopId(commonOrder.getShopId());
commonOrderSku.setSku(commonOrder.getSku());
commonOrderSku.setCreateTime(new Date());
commonOrderSkuService.save(commonOrderSku);
//删除原订单
commonOrderService.removeById(orderId);
//查询订单关联的订单详情
CommonOrderSku one = commonOrderSkuService.lambdaQuery().eq(CommonOrderSku::getOrderId, orderId)
.one();
//删除该订单详情
commonOrderSkuService.removeById(one);
//吊起微信支付
String s = commonOrder1.getPrice().multiply(new BigDecimal(100)).toString();
int i1 = Double.valueOf(s).intValue();
Object appOrder = mpWxPayService.createOrder(
"购买"+ commonOrder1.getTitle() ,
"127.0.0.1",
orderId,
i1,
orderId,
hanHaiMember.getAppletOpenid(),
commonOrder.toString());
return Result.OK("支付成功",appOrder);
}
//创建订单
@Override
public Result<?> createOrder(String token,String productId,Integer num,String addressId) {
@ -232,10 +371,45 @@ public class ApiRiceServiceImpl implements ApiRiceService {
if (commonAddress==null){
return Result.error("地址不存在");
}
//根据配置列表查询每人限制数量
CommonConfig commonConfig = commonConfigService.lambdaQuery()
.eq(CommonConfig::getKeyName,"pay_num")
.one();
//得到配置的数值转为int类型
int payNum = Integer.parseInt(commonConfig.getKeyContent());
//根据商品信息是否是体验装进行判断
if (commonShop.getType()==0){
//查询用户是否存在该订单
List<CommonOrder> byUserIdAndShopId = commonOrderService.lambdaQuery()
.eq(CommonOrder::getUserId,hanHaiMember.getId())
.eq(CommonOrder::getShopId,productId)
.eq(CommonOrder::getShopState,0)
.eq(CommonOrder::getState,1)
.list();
if (byUserIdAndShopId.size()+1>payNum){
return Result.error("已超过体验商品购买次数限制!请勿重复购买");
}
//查询用户是否存在该订单
List<CommonOrder> payNumList = commonOrderService.lambdaQuery()
.eq(CommonOrder::getUserId,hanHaiMember.getId())
.eq(CommonOrder::getShopId,productId)
.eq(CommonOrder::getShopState,0)
.eq(CommonOrder::getState,0)
.list();
if (payNumList.size()>0){
return Result.error("您有相同订单未付款!请先付款");
}
}
//创建订单标识
String orderId = IdWorker.getIdStr();
//创建订单
BigDecimal price = commonShop.getPrice().multiply(new BigDecimal(num));
//生成订单信息
CommonOrder commonOrder = new CommonOrder();
@ -243,7 +417,7 @@ public class ApiRiceServiceImpl implements ApiRiceService {
commonOrder.setTitle(commonShop.getTitle());
commonOrder.setShopId(commonShop.getId());
commonOrder.setImage(commonShop.getImage());
commonOrder.setState(1);
commonOrder.setState(0);
commonOrder.setPrice(price);
commonOrder.setNum(num);
commonOrder.setSku(commonShop.getSku());
@ -251,8 +425,10 @@ public class ApiRiceServiceImpl implements ApiRiceService {
commonOrder.setPhone(commonAddress.getPhone());
commonOrder.setAddress(commonAddress.getAddress());
commonOrder.setAddressDetails(commonAddress.getAddressDetails());
commonOrder.setUserId(hanHaiMember.getId());
commonOrder.setAddressId(addressId);
commonOrder.setShopState(commonShop.getType());
commonOrderService.save(commonOrder);
//创建订单详情
@ -317,6 +493,13 @@ public class ApiRiceServiceImpl implements ApiRiceService {
//创建订单
BigDecimal price = commonShop.getPrice().multiply(new BigDecimal(sku.getNum()));
//获取vip价格
if(hanHaiMember.getIsPay() == 1){
price = commonShop.getVipPrice().multiply(new BigDecimal(sku.getNum()));
}
sku.setOrderId(orderId);
sku.setShopId(commonShop.getId());
sku.setTitle(commonShop.getTitle());
@ -349,8 +532,10 @@ public class ApiRiceServiceImpl implements ApiRiceService {
cityOrder.setName(commonAddress.getName());
cityOrder.setPhone(commonAddress.getPhone());
cityOrder.setAddressDetails(commonAddress.getAddressDetails());
cityOrder.setAddressId(addressId);
cityOrder.setName("店铺订单");
cityOrder.setPrice(totalPrice);
cityOrder.setShopState(2);
cityOrder.setImage(null);
cityOrder.setState(0);
@ -379,13 +564,18 @@ public class ApiRiceServiceImpl implements ApiRiceService {
//商城-加入购物车之后一次下多个订单 - 再次下单
@Override
public Result<?> createSumOrderAgain(String token,String list,String addressId,String order){
public Result<?> createSumOrderAgain(String token,String order){
HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token);
//根据订单标识查询订单是否存在
CommonOrder commonOrder = commonOrderService.getById(order);
if (commonOrder==null){
CommonOrder oldOrder = commonOrderService.getById(order);
if (oldOrder==null){
return Result.error("订单不存在");
}
//储存地址标识
String addressId = oldOrder.getAddressId();
//创建订单标识
String orderId = IdWorker.getIdStr();
//根据订单标识查询订单详情列表
List<CommonOrderSku> commonOrderSkuList = commonOrderSkuService.lambdaQuery()
.eq(CommonOrderSku::getOrderId,order)
@ -393,9 +583,12 @@ public class ApiRiceServiceImpl implements ApiRiceService {
if (commonOrderSkuList==null || commonOrderSkuList.size()==0){
return Result.error("订单详情不存在");
}
//循环修改订单标识
for (CommonOrderSku commonOrderSku : commonOrderSkuList) {
commonOrderSku.setOrderId(orderId);
commonOrderSkuService.updateById(commonOrderSku);
}
//如果集合存在循环删除
commonOrderSkuService.remove(new QueryWrapper<CommonOrderSku>().eq("order_id",order));
//用户地址不能为空
@ -407,83 +600,46 @@ public class ApiRiceServiceImpl implements ApiRiceService {
if (commonAddress==null){
return Result.error("地址不存在");
}
//把list转为对象 list = [{"shopId":"1","num":1},{"shopId":"2","num":2}]
List<CommonOrderSku> list1 = JSON.parseArray(list, CommonOrderSku.class);
//创建订单标识
String orderId = IdWorker.getIdStr();
if(null!=list1 && list1.size()>0){
//订单总额
BigDecimal totalPrice = new BigDecimal(0);
//订单商品数量
Integer totalNum = 0;
//创建订单详情
for (CommonOrderSku sku : list1) {
//查询商品信息
CommonShop commonShop = commonShopService.getById(sku.getShopId());
//商品不能为空
if (commonShop==null){
return Result.error("商品不存在");
}
//创建订单
BigDecimal price = commonShop.getPrice().multiply(new BigDecimal(sku.getNum()));
sku.setOrderId(orderId);
sku.setShopId(commonShop.getId());
sku.setTitle(commonShop.getTitle());
sku.setImage(commonShop.getImage());
sku.setPrice(price);
sku.setNum(sku.getNum());
sku.setSku(commonShop.getSku());
sku.setCreateTime(new Date());
sku.setPrice(price);
sku.setImage(commonShop.getImage());
sku.setCreateTime(new Date());
sku.setOrderId(orderId);
commonOrderSkuService.save(sku);
//计算总价格
totalPrice = totalPrice.add(price);
//创建主订单
CommonOrder cityOrder = new CommonOrder();
cityOrder.setId(orderId);
cityOrder.setUserId(oldOrder.getUserId());
cityOrder.setShopId(null);
cityOrder.setNum(oldOrder.getNum());
cityOrder.setAddress(oldOrder.getAddress());
cityOrder.setName(oldOrder.getName());
cityOrder.setPhone(oldOrder.getPhone());
cityOrder.setAddressDetails(oldOrder.getAddressDetails());
cityOrder.setAddressId(addressId);
cityOrder.setName("店铺订单");
totalNum = totalNum + sku.getNum();
}
cityOrder.setPrice(oldOrder.getPrice());
cityOrder.setImage(null);
cityOrder.setState(0);
cityOrder.setShopState(2);
cityOrder.setCreateTime(new Date());
//创建主订单
CommonOrder cityOrder = new CommonOrder();
cityOrder.setId(orderId);
cityOrder.setUserId(hanHaiMember.getId());
cityOrder.setShopId(null);
cityOrder.setNum(totalNum);
cityOrder.setAddress(commonAddress.getAddress());
cityOrder.setName(commonAddress.getName());
cityOrder.setPhone(commonAddress.getPhone());
cityOrder.setAddressDetails(commonAddress.getAddressDetails());
cityOrder.setName("店铺订单");
cityOrder.setPrice(totalPrice);
commonOrderService.save(cityOrder);
cityOrder.setImage(null);
cityOrder.setState(0);
cityOrder.setCreateTime(new Date());
//删除旧订单
commonOrderService.removeById(order);
commonOrderService.save(cityOrder);
//吊起微信支付
String s = oldOrder.getPrice().multiply(new BigDecimal(100)).toString();
int i1 = Double.valueOf(s).intValue();
Object appOrder = mpWxPayService.createOrder(
"购买"+ "店铺订单" ,
"127.0.0.1",
orderId,
i1,
orderId,
hanHaiMember.getAppletOpenid(),
cityOrder.toString());
//吊起微信支付
String s = totalPrice.multiply(new BigDecimal(100)).toString();
int i1 = Double.valueOf(s).intValue();
Object appOrder = mpWxPayService.createOrder(
"购买"+ "店铺订单" ,
"127.0.0.1",
orderId,
i1,
orderId,
hanHaiMember.getAppletOpenid(),
cityOrder.toString());
return Result.OK("支付成功",appOrder);
return Result.OK("支付成功",appOrder);
}
return null;
}
@ -497,8 +653,24 @@ public class ApiRiceServiceImpl implements ApiRiceService {
CommonOrder commonOrder = commonOrderService.getById(outTradeNo);
//如果订单存在则修改订单状态
if (commonOrder!=null){
commonOrder.setState(1);
commonOrderService.updateById(commonOrder);
if(commonOrder.getState()==0){
commonOrder.setState(1);
commonOrderService.updateById(commonOrder);
}
//如果这个订单是普通订单
if (commonOrder.getShopState()==2){
//获得这个订单的总价
BigDecimal price = commonOrder.getPrice();
//如果总价超过1000元则修改用户为会员
if (price.compareTo(new BigDecimal(0.01))==1){
//查询购买订单的用户信息
HanHaiMember hanHaiMember = hanHaiMemberService.getById(commonOrder.getUserId());
hanHaiMember.setIsPay(1);
hanHaiMemberService.updateById(hanHaiMember);
}
}
}
return null;
@ -656,12 +828,225 @@ public class ApiRiceServiceImpl implements ApiRiceService {
return Result.OK(page);
}
//获取个人邀请码
private String appid = "wx0839bc52e7849c13";
private String secret = "c614fd865951c5246e849501204e6f7f";
private String endpoint = "oss-cn-shenzhen.aliyuncs.com";
private String accessKey = "LTAI5tQSs47izVy8DLVdwUU9";
private String secretKey = "qHI7C3PaXYZySr84HTToviC71AYlFq";
private String bucketName = "hanhaiimage";
private static final String APP_ID = "wx0839bc52e7849c13";
private static final String APP_SECRET = "c614fd865951c5246e849501204e6f7f";
private static final String TOKEN_URL = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + APP_ID + "&secret=" + APP_SECRET;
private static final String TEMPLATE_MESSAGE_URL = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=";
//获取推广二维码
@Override
public Result<?> getInviteCode(String token){
HanHaiMember member = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token);
CommonConfig vsion = commonConfigService.lambdaQuery()
.eq(CommonConfig::getKeyName, "v_sion")
.one();
Integer vsionStr = Integer.parseInt(vsion.getKeyContent());
String trial = "release";
if(vsionStr == 0){
trial= "release";
}else if(vsionStr == 1){
trial= "trial";
}else{
trial= "develop";
}
// WxQrCodeVo o = (WxQrCodeVo)redisUtil.get("CodeImage::" + trial+ member.getId());
// if(o!=null){
//
//
// o.setName("瑶都万能墙欢迎您的加入");
// return Result.OK(o);
// }
Map<String, Object> param = new HashMap<>();
CommonConfig xcxSharePage = commonConfigService.lambdaQuery()
.eq(CommonConfig::getKeyName, "xcxSharePage")
.one();
String key = "shareId=" + member.getId();
param.put("path", xcxSharePage.getKeyContent() + "?" + key); //跳转页面
String accessToken = this.getAccessToken();
RestTemplate rest = new RestTemplate();
InputStream inputStream = null;
OutputStream outputStream = null;
File file = null;
// LambdaQueryWrapper<DbConf> configImg = new LambdaQueryWrapper<>();
// configImg.eq(DbConf::getIsDel,0).eq(DbConf::getKeyValue,"codeImg");
// DbConf oneImg = confService.getOne(configImg);
CommonConfig oneImage = commonConfigService.lambdaQuery()
.eq(CommonConfig::getKeyName, "codeImg")
.one();
String codeImg = oneImage.getKeyContent();
try{
String url = "https://api.weixin.qq.com/wxa/getwxacode?access_token=" + accessToken;
param.put("scene", member.getId());
param.put("width", 150);
param.put("auto_color", false);
param.put("env_version", trial);
Map<String, Object> line_color = new HashMap<>();
line_color.put("r", 0);
line_color.put("g", 0);
line_color.put("b", 0);
param.put("line_color", line_color);
MultiValueMap<String, String> headers = new LinkedMultiValueMap<>();
org.springframework.http.HttpEntity requestEntity = new org.springframework.http.HttpEntity(JSON.toJSONString(param), headers);
ResponseEntity<byte[]> entity = rest.exchange(url, HttpMethod.POST, requestEntity, byte[].class, new Object[0]);
byte[] result = entity.getBody();
inputStream = new ByteArrayInputStream(result);
String tempSave = codeImg;
String filePath = tempSave;
file = new File(filePath);
if (!file.exists()) {
file.createNewFile();
}
outputStream = new FileOutputStream(file);
int len = 0;
byte[] buf = new byte[1024];
while ((len = inputStream.read(buf, 0, 1024)) != -1) {
outputStream.write(buf, 0, len);
}
outputStream.flush();
/**
* 将文件上传至阿里云
*/
DiskFileItemFactory factory = new DiskFileItemFactory(16, null);
FileItem item = factory.createItem("File", "text/plain", true, file.getName());
int bytesRead = 0;
byte[] buffer = new byte[8192];
try {
FileInputStream fis = new FileInputStream(file);
OutputStream os = item.getOutputStream();
while ((bytesRead = fis.read(buffer, 0, 8192)) != -1) {
os.write(buffer, 0, bytesRead);
}
os.close();
fis.close();
} catch (IOException e) {
e.printStackTrace();
}
MultipartFile mf = new CommonsMultipartFile(item);
//返回图片下载地址
WxQrCodeVo wxCodeVo = new WxQrCodeVo();
wxCodeVo.setUrl(this.uploadAliYunOss(mf));
wxCodeVo.setName("三只青蛙欢迎您");
// redisUtil.set("CodeImage::"+trial+member.getId(),wxCodeVo);
return Result.OK(wxCodeVo);
} catch (Exception e) {
e.printStackTrace();
} finally {
if (inputStream != null) {
try {
inputStream.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if (outputStream != null) {
try {
outputStream.close();
} catch (IOException e) {
e.printStackTrace();
}
}
//删除文件
if (file.exists()) {
file.delete();
}
}
return null;
}
/**
* 获取令牌
*
* @return
*/
private String getAccessToken() {
String requestUrl = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + appid + "&secret=" + secret;
String doGet2 = HttpClientUtil.doGet2(requestUrl);
Map<String, String> map = JSON.parseObject(doGet2, new TypeReference<Map<String, String>>() {
});
return map.get("access_token");
}
/**
* 上传文件至阿里云oss
*
* @return
*/
private String uploadAliYunOss(MultipartFile mf) throws Exception {
String uploadFile = "WxCodeFile";
String fileName = new StringBuffer(mf.getOriginalFilename()).append(".jpg").toString();// 获取文件名
String dbpath = uploadFile + File.separator + fileName;
if (dbpath.contains("\\")) {
dbpath = dbpath.replace("\\", "/");
}
String endpoint = this.endpoint;
String accessKey = this.accessKey;
String secretKey = this.secretKey;
// 创建OSSClient实例
OSS ossClient = new OSSClientBuilder().build(endpoint, accessKey, secretKey);
// 上传Byte数组
byte[] content = mf.getBytes();
String bucketName = this.bucketName;
ossClient.putObject(bucketName, dbpath, new ByteArrayInputStream(content));
// 关闭OSSClient
ossClient.shutdown();
return dbpath;
}
//获取相关介绍
@Override
public Result<?> getInfoIntroduce(String type){
@ -685,6 +1070,7 @@ public class ApiRiceServiceImpl implements ApiRiceService {
@Override
public Result<?> addOrUpdateAddress(String token,CommonAddress commonAddress){
HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token);
commonAddress.setUserId(hanHaiMember.getId());
commonAddressService.saveOrUpdate(commonAddress);
return Result.OK("增加成功");
}


+ 1122
- 0
applet-rice-api/src/main/java/org/jeecg/bean/HttpClientUtil.java
File diff suppressed because it is too large
View File


+ 14
- 0
applet-rice-api/src/main/java/org/jeecg/bean/WxQrCodeVo.java View File

@ -0,0 +1,14 @@
package org.jeecg.bean;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class WxQrCodeVo {
/**图片地址*/
@ApiModelProperty(value = "图片地址")
private String url;
@ApiModelProperty(value = "加油站名称")
private String name;
}

+ 1
- 1
module-common/src/main/java/org/jeecg/modules/commonOrder/controller/CommonOrderController.java View File

@ -39,7 +39,7 @@ import org.jeecg.common.aspect.annotation.AutoLog;
/**
* @Description: 订单信息表
* @Author: jeecg-boot
* @Date: 2024-12-05
* @Date: 2024-12-06
* @Version: V1.0
*/
@Api(tags="订单信息表")


+ 6
- 1
module-common/src/main/java/org/jeecg/modules/commonOrder/entity/CommonOrder.java View File

@ -24,7 +24,7 @@ import lombok.experimental.Accessors;
/**
* @Description: 订单信息表
* @Author: jeecg-boot
* @Date: 2024-12-05
* @Date: 2024-12-06
* @Version: V1.0
*/
@Data
@ -107,6 +107,11 @@ public class CommonOrder implements Serializable {
@Excel(name = "支付编号", width = 15)
@ApiModelProperty(value = "支付编号")
private java.lang.String payNo;
/**商品类型*/
@Excel(name = "商品类型", width = 15, dicCode = "shop_type")
@Dict(dicCode = "shop_type")
@ApiModelProperty(value = "商品类型")
private java.lang.Integer shopState;
@TableField(exist = false)


+ 1
- 1
module-common/src/main/java/org/jeecg/modules/commonOrder/mapper/CommonOrderMapper.java View File

@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 订单信息表
* @Author: jeecg-boot
* @Date: 2024-12-05
* @Date: 2024-12-06
* @Version: V1.0
*/
public interface CommonOrderMapper extends BaseMapper<CommonOrder> {


+ 1
- 1
module-common/src/main/java/org/jeecg/modules/commonOrder/service/ICommonOrderService.java View File

@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 订单信息表
* @Author: jeecg-boot
* @Date: 2024-12-05
* @Date: 2024-12-06
* @Version: V1.0
*/
public interface ICommonOrderService extends IService<CommonOrder> {


+ 1
- 1
module-common/src/main/java/org/jeecg/modules/commonOrder/service/impl/CommonOrderServiceImpl.java View File

@ -10,7 +10,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 订单信息表
* @Author: jeecg-boot
* @Date: 2024-12-05
* @Date: 2024-12-06
* @Version: V1.0
*/
@Service


+ 22
- 0
module-common/src/main/java/org/jeecg/modules/commonOrder/vue/CommonOrderList.vue View File

@ -4,6 +4,21 @@
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="商品类型">
<j-dict-select-tag placeholder="请选择商品类型" v-model="queryParam.shopState" dictCode="shop_type"/>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
<a @click="handleToggleSearch" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a>
</span>
</a-col>
</a-row>
</a-form>
</div>
@ -99,6 +114,7 @@
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import CommonOrderModal from './modules/CommonOrderModal'
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
export default {
name: 'CommonOrderList',
@ -191,6 +207,11 @@
align:"center",
dataIndex: 'payNo'
},
{
title:'商品类型',
align:"center",
dataIndex: 'shopState_dictText'
},
{
title: '操作',
dataIndex: 'action',
@ -239,6 +260,7 @@
fieldList.push({type:'string',value:'addressId',text:'地址标识',dictCode:''})
fieldList.push({type:'string',value:'shopId',text:'商品标识',dictCode:''})
fieldList.push({type:'string',value:'payNo',text:'支付编号',dictCode:''})
fieldList.push({type:'string',value:'shopState',text:'商品类型',dictCode:'shop_type'})
this.superFieldList = fieldList
}
}


+ 5
- 0
module-common/src/main/java/org/jeecg/modules/commonOrder/vue/modules/CommonOrderForm.vue View File

@ -73,6 +73,11 @@
<a-input v-model="model.payNo" placeholder="请输入支付编号" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="商品类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="shopState">
<j-dict-select-tag type="list" v-model="model.shopState" dictCode="shop_type" placeholder="请选择商品类型" />
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>


+ 22
- 0
module-common/src/main/java/org/jeecg/modules/commonOrder/vue3/CommonOrder.data.ts View File

@ -74,9 +74,23 @@ export const columns: BasicColumn[] = [
align:"center",
dataIndex: 'payNo'
},
{
title: '商品类型',
align:"center",
dataIndex: 'shopState_dictText'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
{
label: "商品类型",
field: "shopState",
component: 'JDictSelectTag',
componentProps:{
dictCode:"shop_type"
},
colProps: {span: 6},
},
];
//表单数据
export const formSchema: FormSchema[] = [
@ -150,4 +164,12 @@ export const formSchema: FormSchema[] = [
field: 'payNo',
component: 'Input',
},
{
label: '商品类型',
field: 'shopState',
component: 'JDictSelectTag',
componentProps:{
dictCode:"shop_type"
},
},
];

+ 1
- 1
module-system/module-system.iml View File

@ -259,7 +259,6 @@
<orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.9.7" level="project" />
<orderEntry type="library" name="Maven: io.github.openfeign.form:feign-form-spring:3.8.0" level="project" />
<orderEntry type="library" name="Maven: io.github.openfeign.form:feign-form:3.8.0" level="project" />
<orderEntry type="library" name="Maven: commons-fileupload:commons-fileupload:1.4" level="project" />
<orderEntry type="library" name="Maven: org.projectlombok:lombok:1.18.24" level="project" />
<orderEntry type="module" module-name="module-pay" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.6.6" level="project" />
@ -300,6 +299,7 @@
<orderEntry type="library" name="Maven: io.swagger:swagger-annotations:1.5.22" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-web:5.3.18" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.3.18" level="project" />
<orderEntry type="library" name="Maven: commons-fileupload:commons-fileupload:1.4" level="project" />
<orderEntry type="module" module-name="module-common" />
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-starter-test:2.6.6" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.6.6" level="project" />


+ 1
- 1
module-system/src/main/resources/application-dev.yml View File

@ -1,5 +1,5 @@
server:
port: 8001
port: 8000
tomcat:
max-swallow-size: -1
error:


+ 2
- 2
module-system/src/main/resources/pay_weixin.properties View File

@ -2,7 +2,7 @@ pay.mchId=1700534180
pay.appId=wx0839bc52e7849c13
pay.mchKey=9bde2770a74c2a460592de2d451ce05f
pay.keyPath=classpath:apiclient_cert.pem
pay.notifyUrl=http://h5.xzaiyp.top/rice-admin/rice_index/payNotify
pay.notifyUrlDev=http://h5.xzaiyp.top/rice-admin/rice_index/payNotify
pay.notifyUrl=https://admin.szqwdgidm.com/rice-admin/rice_index/payNotify
pay.notifyUrlDev=https://admin.szqwdgidm.com/rice-admin/rice_index/payNotify

Loading…
Cancel
Save