Browse Source

报修小程序修复

master
主管理员 7 months ago
parent
commit
da457926e2
46 changed files with 1763 additions and 24 deletions
  1. +42
    -1
      han-hai-module-pay/src/main/java/org/jeecg/modules/pay/MpWxPayService.java
  2. +4
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java
  3. +1
    -1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/payOrder/controller/PayOrderController.java
  4. +5
    -1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/payOrder/entity/PayOrder.java
  5. +1
    -1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/payOrder/mapper/PayOrderMapper.java
  6. +1
    -1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/payOrder/service/IPayOrderService.java
  7. +1
    -1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/payOrder/service/impl/PayOrderServiceImpl.java
  8. +6
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/payOrder/vue/PayOrderList.vue
  9. +5
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/payOrder/vue/modules/PayOrderForm.vue
  10. +10
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/payOrder/vue3/PayOrder.data.ts
  11. +1
    -1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/payShop/controller/PayShopController.java
  12. +5
    -1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/payShop/entity/PayShop.java
  13. +1
    -1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/payShop/mapper/PayShopMapper.java
  14. +1
    -1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/payShop/service/IPayShopService.java
  15. +1
    -1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/payShop/service/impl/PayShopServiceImpl.java
  16. +6
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/payShop/vue/PayShopList.vue
  17. +5
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/payShop/vue/modules/PayShopForm.vue
  18. +10
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/payShop/vue3/PayShop.data.ts
  19. +229
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shcoolFloor/controller/ShcoolFloorController.java
  20. +63
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shcoolFloor/entity/ShcoolFloor.java
  21. +22
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shcoolFloor/mapper/ShcoolFloorMapper.java
  22. +9
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shcoolFloor/mapper/xml/ShcoolFloorMapper.xml
  23. +38
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shcoolFloor/service/IShcoolFloorService.java
  24. +191
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shcoolFloor/service/impl/ShcoolFloorServiceImpl.java
  25. +353
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shcoolFloor/vue/ShcoolFloorList.vue
  26. +156
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shcoolFloor/vue/modules/ShcoolFloorModal.vue
  27. +82
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shcoolFloor/vue3/ShcoolFloor.api.ts
  28. +38
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shcoolFloor/vue3/ShcoolFloor.data.ts
  29. +272
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shcoolFloor/vue3/ShcoolFloorList.vue
  30. +87
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shcoolFloor/vue3/components/ShcoolFloorModal.vue
  31. BIN
      jeecg-boot-base/jeecg-boot-base-core/target/classes/org/jeecg/config/shiro/ShiroConfig.class
  32. BIN
      jeecg-boot-base/jeecg-boot-base-core/target/classes/org/jeecg/modules/payOrder/entity/PayOrder.class
  33. BIN
      jeecg-boot-base/jeecg-boot-base-core/target/classes/org/jeecg/modules/payShop/entity/PayShop.class
  34. BIN
      jeecg-boot-base/jeecg-boot-base-core/target/classes/org/jeecg/modules/shcoolFloor/controller/ShcoolFloorController.class
  35. BIN
      jeecg-boot-base/jeecg-boot-base-core/target/classes/org/jeecg/modules/shcoolFloor/entity/ShcoolFloor.class
  36. BIN
      jeecg-boot-base/jeecg-boot-base-core/target/classes/org/jeecg/modules/shcoolFloor/mapper/ShcoolFloorMapper.class
  37. +9
    -0
      jeecg-boot-base/jeecg-boot-base-core/target/classes/org/jeecg/modules/shcoolFloor/mapper/xml/ShcoolFloorMapper.xml
  38. BIN
      jeecg-boot-base/jeecg-boot-base-core/target/classes/org/jeecg/modules/shcoolFloor/service/IShcoolFloorService.class
  39. BIN
      jeecg-boot-base/jeecg-boot-base-core/target/classes/org/jeecg/modules/shcoolFloor/service/impl/ShcoolFloorServiceImpl.class
  40. +7
    -0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/cheeroncontroller/CheerInfoController.java
  41. +2
    -0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/payController/PayApiIndexController.java
  42. +17
    -0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/schoolcontroller/SchoolApiController.java
  43. +8
    -0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiservice/IndexApiService.java
  44. +3
    -0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiservice/InfoApiService.java
  45. +38
    -13
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiservice/impl/IndexApiServiceImpl.java
  46. +33
    -0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiservice/impl/InfoApiServiceImpl.java

+ 42
- 1
han-hai-module-pay/src/main/java/org/jeecg/modules/pay/MpWxPayService.java View File

@ -120,7 +120,7 @@ public class MpWxPayService {
/**
* 微信吊起支付
* 微信吊起支付 -- 加油小程序
* @param productName
* @param clientIp
* @param productId
@ -161,6 +161,47 @@ public class MpWxPayService {
/**
* 微信吊起支付 -- 付费小程序
* @param productName
* @param clientIp
* @param productId
* @param price
* @param orderNo
* @param openId
* @param body
* @return
*/
public Object createOrderPay(String productName, String clientIp,
String productId, Integer price, String orderNo,
String openId, String body){
WxPayUnifiedOrderRequest request = new WxPayUnifiedOrderRequest();
request.setDeviceInfo("WEB"); //设备号
request.setTradeType("JSAPI"); //交易类型
request.setBody(productName); //商品描述
request.setOutTradeNo(orderNo); //商户订单号
request.setDetail(productName); //商品详情
request.setTotalFee(price); //总金额|分计
request.setSpbillCreateIp(clientIp); //终端IP
// request.setNotifyUrl(wxPay.notifyUrl);//设置回调路径
request.setNotifyUrl("http://h5.xzaiyp.top/a-notice-api/pay-api/info/notify");//设置回调路径
request.setProductId(productId); //商品id
request.setOpenid(openId); //JSAPI OPENID
if (dev){
request.setTotalFee(price);
// request.setNotifyUrl(wxPay.notifyUrlDev);
request.setNotifyUrl("http://h5.xzaiyp.top/a-notice-api/pay-api/info/notify");//设置回调路径
}
try {
Object order = wxPayService.createOrder(request);
return order;
} catch (WxPayException e) {
e.printStackTrace();
return e.getLocalizedMessage();
}
}


+ 4
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java View File

@ -81,8 +81,12 @@ public class ShiroConfig {
filterChainDefinitionMap.put("/api/order/**", "anon");
filterChainDefinitionMap.put("/school/login/**", "anon");
filterChainDefinitionMap.put("/school/school-api/**", "anon");
filterChainDefinitionMap.put("/pay-api/info/notify", "anon");
filterChainDefinitionMap.put("/pay-api/login/**", "anon");
filterChainDefinitionMap.put("/pay-api/info/**", "anon");


+ 1
- 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/payOrder/controller/PayOrderController.java View File

@ -39,7 +39,7 @@ import org.jeecg.common.aspect.annotation.AutoLog;
/**
* @Description: 知识付费订单表
* @Author: jeecg-boot
* @Date: 2024-08-29
* @Date: 2024-09-02
* @Version: V1.0
*/
@Api(tags="知识付费订单表")


+ 5
- 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/payOrder/entity/PayOrder.java View File

@ -20,7 +20,7 @@ import lombok.experimental.Accessors;
/**
* @Description: 知识付费订单表
* @Author: jeecg-boot
* @Date: 2024-08-29
* @Date: 2024-09-02
* @Version: V1.0
*/
@Data
@ -67,4 +67,8 @@ public class PayOrder implements Serializable {
@Excel(name = "用户", width = 15)
@ApiModelProperty(value = "用户")
private java.lang.String userId;
/**状态*/
@Excel(name = "状态", width = 15)
@ApiModelProperty(value = "状态")
private java.lang.Integer state;
}

+ 1
- 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/payOrder/mapper/PayOrderMapper.java View File

@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 知识付费订单表
* @Author: jeecg-boot
* @Date: 2024-08-29
* @Date: 2024-09-02
* @Version: V1.0
*/
public interface PayOrderMapper extends BaseMapper<PayOrder> {


+ 1
- 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/payOrder/service/IPayOrderService.java View File

@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 知识付费订单表
* @Author: jeecg-boot
* @Date: 2024-08-29
* @Date: 2024-09-02
* @Version: V1.0
*/
public interface IPayOrderService extends IService<PayOrder> {


+ 1
- 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/payOrder/service/impl/PayOrderServiceImpl.java View File

@ -10,7 +10,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 知识付费订单表
* @Author: jeecg-boot
* @Date: 2024-08-29
* @Date: 2024-09-02
* @Version: V1.0
*/
@Service


+ 6
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/payOrder/vue/PayOrderList.vue View File

@ -146,6 +146,11 @@
align:"center",
dataIndex: 'userId'
},
{
title:'状态',
align:"center",
dataIndex: 'state'
},
{
title: '操作',
dataIndex: 'action',
@ -185,6 +190,7 @@
fieldList.push({type:'BigDecimal',value:'price',text:'价格',dictCode:''})
fieldList.push({type:'int',value:'num',text:'数量',dictCode:''})
fieldList.push({type:'string',value:'userId',text:'用户',dictCode:''})
fieldList.push({type:'int',value:'state',text:'状态',dictCode:''})
this.superFieldList = fieldList
}
}


+ 5
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/payOrder/vue/modules/PayOrderForm.vue View File

@ -28,6 +28,11 @@
<a-input v-model="model.userId" placeholder="请输入用户" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="state">
<a-input-number v-model="model.state" placeholder="请输入状态" style="width: 100%" />
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>


+ 10
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/payOrder/vue3/PayOrder.data.ts View File

@ -29,6 +29,11 @@ export const columns: BasicColumn[] = [
align:"center",
dataIndex: 'userId'
},
{
title: '状态',
align:"center",
dataIndex: 'state'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
@ -60,4 +65,9 @@ export const formSchema: FormSchema[] = [
field: 'userId',
component: 'Input',
},
{
label: '状态',
field: 'state',
component: 'InputNumber',
},
];

+ 1
- 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/payShop/controller/PayShopController.java View File

@ -39,7 +39,7 @@ import org.jeecg.common.aspect.annotation.AutoLog;
/**
* @Description: 付费商品修改表
* @Author: jeecg-boot
* @Date: 2024-08-29
* @Date: 2024-09-02
* @Version: V1.0
*/
@Api(tags="付费商品修改表")


+ 5
- 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/payShop/entity/PayShop.java View File

@ -20,7 +20,7 @@ import lombok.experimental.Accessors;
/**
* @Description: 付费商品修改表
* @Author: jeecg-boot
* @Date: 2024-08-29
* @Date: 2024-09-02
* @Version: V1.0
*/
@Data
@ -79,4 +79,8 @@ public class PayShop implements Serializable {
@Excel(name = "资源介绍", width = 15)
@ApiModelProperty(value = "资源介绍")
private java.lang.String content;
/**资源实际内容*/
@Excel(name = "资源实际内容", width = 15)
@ApiModelProperty(value = "资源实际内容")
private java.lang.String conValue;
}

+ 1
- 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/payShop/mapper/PayShopMapper.java View File

@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 付费商品修改表
* @Author: jeecg-boot
* @Date: 2024-08-29
* @Date: 2024-09-02
* @Version: V1.0
*/
public interface PayShopMapper extends BaseMapper<PayShop> {


+ 1
- 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/payShop/service/IPayShopService.java View File

@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 付费商品修改表
* @Author: jeecg-boot
* @Date: 2024-08-29
* @Date: 2024-09-02
* @Version: V1.0
*/
public interface IPayShopService extends IService<PayShop> {


+ 1
- 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/payShop/service/impl/PayShopServiceImpl.java View File

@ -10,7 +10,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 付费商品修改表
* @Author: jeecg-boot
* @Date: 2024-08-29
* @Date: 2024-09-02
* @Version: V1.0
*/
@Service


+ 6
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/payShop/vue/PayShopList.vue View File

@ -157,6 +157,11 @@
align:"center",
dataIndex: 'oldPrice'
},
{
title:'资源实际内容',
align:"center",
dataIndex: 'conValue'
},
{
title: '操作',
dataIndex: 'action',
@ -199,6 +204,7 @@
fieldList.push({type:'BigDecimal',value:'price',text:'价格',dictCode:''})
fieldList.push({type:'BigDecimal',value:'oldPrice',text:'原价',dictCode:''})
fieldList.push({type:'Text',value:'content',text:'资源介绍',dictCode:''})
fieldList.push({type:'Text',value:'conValue',text:'资源实际内容',dictCode:''})
this.superFieldList = fieldList
}
}


+ 5
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/payShop/vue/modules/PayShopForm.vue View File

@ -43,6 +43,11 @@
<j-editor v-model="model.content" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="资源实际内容" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="conValue">
<a-input v-model="model.conValue" placeholder="请输入资源实际内容" ></a-input>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>


+ 10
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/payShop/vue3/PayShop.data.ts View File

@ -40,6 +40,11 @@ export const columns: BasicColumn[] = [
align:"center",
dataIndex: 'oldPrice'
},
{
title: '资源实际内容',
align:"center",
dataIndex: 'conValue'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
@ -88,4 +93,9 @@ export const formSchema: FormSchema[] = [
field: 'content',
component: 'JCodeEditor', //TODO String后缀暂未添加
},
{
label: '资源实际内容',
field: 'conValue',
component: 'Input',
},
];

+ 229
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shcoolFloor/controller/ShcoolFloorController.java View File

@ -0,0 +1,229 @@
package org.jeecg.modules.shcoolFloor.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.shcoolFloor.entity.ShcoolFloor;
import org.jeecg.modules.shcoolFloor.service.IShcoolFloorService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
/**
* @Description: 楼栋表
* @Author: jeecg-boot
* @Date: 2024-09-02
* @Version: V1.0
*/
@Api(tags="楼栋表")
@RestController
@RequestMapping("/shcoolFloor/shcoolFloor")
@Slf4j
public class ShcoolFloorController extends JeecgController<ShcoolFloor, IShcoolFloorService>{
@Autowired
private IShcoolFloorService shcoolFloorService;
/**
* 分页列表查询
*
* @param shcoolFloor
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "楼栋表-分页列表查询")
@ApiOperation(value="楼栋表-分页列表查询", notes="楼栋表-分页列表查询")
@GetMapping(value = "/rootList")
public Result<IPage<ShcoolFloor>> queryPageList(ShcoolFloor shcoolFloor,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
String hasQuery = req.getParameter("hasQuery");
if(hasQuery != null && "true".equals(hasQuery)){
QueryWrapper<ShcoolFloor> queryWrapper = QueryGenerator.initQueryWrapper(shcoolFloor, req.getParameterMap());
List<ShcoolFloor> list = shcoolFloorService.queryTreeListNoPage(queryWrapper);
IPage<ShcoolFloor> pageList = new Page<>(1, 10, list.size());
pageList.setRecords(list);
return Result.OK(pageList);
}else{
String parentId = shcoolFloor.getPid();
if (oConvertUtils.isEmpty(parentId)) {
parentId = "0";
}
shcoolFloor.setPid(null);
QueryWrapper<ShcoolFloor> queryWrapper = QueryGenerator.initQueryWrapper(shcoolFloor, req.getParameterMap());
// 使用 eq 防止模糊查询
queryWrapper.eq("pid", parentId);
Page<ShcoolFloor> page = new Page<ShcoolFloor>(pageNo, pageSize);
IPage<ShcoolFloor> pageList = shcoolFloorService.page(page, queryWrapper);
return Result.OK(pageList);
}
}
/**
* 获取子数据
* @param shcoolFloor
* @param req
* @return
*/
//@AutoLog(value = "楼栋表-获取子数据")
@ApiOperation(value="楼栋表-获取子数据", notes="楼栋表-获取子数据")
@GetMapping(value = "/childList")
public Result<IPage<ShcoolFloor>> queryPageList(ShcoolFloor shcoolFloor,HttpServletRequest req) {
QueryWrapper<ShcoolFloor> queryWrapper = QueryGenerator.initQueryWrapper(shcoolFloor, req.getParameterMap());
List<ShcoolFloor> list = shcoolFloorService.list(queryWrapper);
IPage<ShcoolFloor> pageList = new Page<>(1, 10, list.size());
pageList.setRecords(list);
return Result.OK(pageList);
}
/**
* 批量查询子节点
* @param parentIds 父ID多个采用半角逗号分割
* @return 返回 IPage
* @param parentIds
* @return
*/
//@AutoLog(value = "楼栋表-批量获取子数据")
@ApiOperation(value="楼栋表-批量获取子数据", notes="楼栋表-批量获取子数据")
@GetMapping("/getChildListBatch")
public Result getChildListBatch(@RequestParam("parentIds") String parentIds) {
try {
QueryWrapper<ShcoolFloor> queryWrapper = new QueryWrapper<>();
List<String> parentIdList = Arrays.asList(parentIds.split(","));
queryWrapper.in("pid", parentIdList);
List<ShcoolFloor> list = shcoolFloorService.list(queryWrapper);
IPage<ShcoolFloor> pageList = new Page<>(1, 10, list.size());
pageList.setRecords(list);
return Result.OK(pageList);
} catch (Exception e) {
log.error(e.getMessage(), e);
return Result.error("批量查询子节点失败:" + e.getMessage());
}
}
/**
* 添加
*
* @param shcoolFloor
* @return
*/
@AutoLog(value = "楼栋表-添加")
@ApiOperation(value="楼栋表-添加", notes="楼栋表-添加")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody ShcoolFloor shcoolFloor) {
shcoolFloorService.addShcoolFloor(shcoolFloor);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param shcoolFloor
* @return
*/
@AutoLog(value = "楼栋表-编辑")
@ApiOperation(value="楼栋表-编辑", notes="楼栋表-编辑")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody ShcoolFloor shcoolFloor) {
shcoolFloorService.updateShcoolFloor(shcoolFloor);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "楼栋表-通过id删除")
@ApiOperation(value="楼栋表-通过id删除", notes="楼栋表-通过id删除")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
shcoolFloorService.deleteShcoolFloor(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "楼栋表-批量删除")
@ApiOperation(value="楼栋表-批量删除", notes="楼栋表-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.shcoolFloorService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "楼栋表-通过id查询")
@ApiOperation(value="楼栋表-通过id查询", notes="楼栋表-通过id查询")
@GetMapping(value = "/queryById")
public Result<ShcoolFloor> queryById(@RequestParam(name="id",required=true) String id) {
ShcoolFloor shcoolFloor = shcoolFloorService.getById(id);
if(shcoolFloor==null) {
return Result.error("未找到对应数据");
}
return Result.OK(shcoolFloor);
}
/**
* 导出excel
*
* @param request
* @param shcoolFloor
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, ShcoolFloor shcoolFloor) {
return super.exportXls(request, shcoolFloor, ShcoolFloor.class, "楼栋表");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, ShcoolFloor.class);
}
}

+ 63
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shcoolFloor/entity/ShcoolFloor.java View File

@ -0,0 +1,63 @@
package org.jeecg.modules.shcoolFloor.entity;
import java.io.Serializable;
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 java.io.UnsupportedEncodingException;
/**
* @Description: 楼栋表
* @Author: jeecg-boot
* @Date: 2024-09-02
* @Version: V1.0
*/
@Data
@TableName("shcool_floor")
@ApiModel(value="shcool_floor对象", description="楼栋表")
public class ShcoolFloor implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private java.lang.String id;
/**创建人*/
@ApiModelProperty(value = "创建人")
private java.lang.String createBy;
/**创建日期*/
@ApiModelProperty(value = "创建日期")
private java.util.Date createTime;
/**更新人*/
@ApiModelProperty(value = "更新人")
private java.lang.String updateBy;
/**更新日期*/
@ApiModelProperty(value = "更新日期")
private java.util.Date updateTime;
/**名称*/
@Excel(name = "名称", width = 15)
@ApiModelProperty(value = "名称")
private java.lang.String name;
/**排序*/
@Excel(name = "排序", width = 15)
@ApiModelProperty(value = "排序")
private java.lang.Integer sort;
/**父级节点*/
@Excel(name = "父级节点", width = 15)
@ApiModelProperty(value = "父级节点")
private java.lang.String pid;
/**是否有子节点*/
@Excel(name = "是否有子节点", width = 15, dicCode = "yn")
@Dict(dicCode = "yn")
@ApiModelProperty(value = "是否有子节点")
private java.lang.String hasChild;
}

+ 22
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shcoolFloor/mapper/ShcoolFloorMapper.java View File

@ -0,0 +1,22 @@
package org.jeecg.modules.shcoolFloor.mapper;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.shcoolFloor.entity.ShcoolFloor;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 楼栋表
* @Author: jeecg-boot
* @Date: 2024-09-02
* @Version: V1.0
*/
public interface ShcoolFloorMapper extends BaseMapper<ShcoolFloor> {
/**
* 编辑节点状态
* @param id
* @param status
*/
void updateTreeNodeStatus(@Param("id") String id,@Param("status") String status);
}

+ 9
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shcoolFloor/mapper/xml/ShcoolFloorMapper.xml View File

@ -0,0 +1,9 @@
<?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.shcoolFloor.mapper.ShcoolFloorMapper">
<update id="updateTreeNodeStatus" parameterType="java.lang.String">
update shcool_floor set has_child = #{status} where id = #{id}
</update>
</mapper>

+ 38
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shcoolFloor/service/IShcoolFloorService.java View File

@ -0,0 +1,38 @@
package org.jeecg.modules.shcoolFloor.service;
import org.jeecg.modules.shcoolFloor.entity.ShcoolFloor;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.common.exception.JeecgBootException;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import java.util.List;
/**
* @Description: 楼栋表
* @Author: jeecg-boot
* @Date: 2024-09-02
* @Version: V1.0
*/
public interface IShcoolFloorService extends IService<ShcoolFloor> {
/**根节点父ID的值*/
public static final String ROOT_PID_VALUE = "0";
/**树节点有子节点状态值*/
public static final String HASCHILD = "1";
/**树节点无子节点状态值*/
public static final String NOCHILD = "0";
/**新增节点*/
void addShcoolFloor(ShcoolFloor shcoolFloor);
/**修改节点*/
void updateShcoolFloor(ShcoolFloor shcoolFloor) throws JeecgBootException;
/**删除节点*/
void deleteShcoolFloor(String id) throws JeecgBootException;
/**查询所有数据,无分页*/
List<ShcoolFloor> queryTreeListNoPage(QueryWrapper<ShcoolFloor> queryWrapper);
}

+ 191
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shcoolFloor/service/impl/ShcoolFloorServiceImpl.java View File

@ -0,0 +1,191 @@
package org.jeecg.modules.shcoolFloor.service.impl;
import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.shcoolFloor.entity.ShcoolFloor;
import org.jeecg.modules.shcoolFloor.mapper.ShcoolFloorMapper;
import org.jeecg.modules.shcoolFloor.service.IShcoolFloorService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 楼栋表
* @Author: jeecg-boot
* @Date: 2024-09-02
* @Version: V1.0
*/
@Service
public class ShcoolFloorServiceImpl extends ServiceImpl<ShcoolFloorMapper, ShcoolFloor> implements IShcoolFloorService {
@Override
public void addShcoolFloor(ShcoolFloor shcoolFloor) {
//新增时设置hasChild为0
shcoolFloor.setHasChild(IShcoolFloorService.NOCHILD);
if(oConvertUtils.isEmpty(shcoolFloor.getPid())){
shcoolFloor.setPid(IShcoolFloorService.ROOT_PID_VALUE);
}else{
//如果当前节点父ID不为空 则设置父节点的hasChildren 为1
ShcoolFloor parent = baseMapper.selectById(shcoolFloor.getPid());
if(parent!=null && !"1".equals(parent.getHasChild())){
parent.setHasChild("1");
baseMapper.updateById(parent);
}
}
baseMapper.insert(shcoolFloor);
}
@Override
public void updateShcoolFloor(ShcoolFloor shcoolFloor) {
// ShcoolFloor entity = this.getById(shcoolFloor.getId());
// if(entity==null) {
// throw new JeecgBootException("未找到对应实体");
// }
// String old_pid = entity.getPid();
// String new_pid = shcoolFloor.getPid();
// if(!old_pid.equals(new_pid)) {
// updateOldParentNode(old_pid);
// if(oConvertUtils.isEmpty(new_pid)){
// shcoolFloor.setPid(IShcoolFloorService.ROOT_PID_VALUE);
// }
// if(!IShcoolFloorService.ROOT_PID_VALUE.equals(shcoolFloor.getPid())) {
// baseMapper.updateTreeNodeStatus(shcoolFloor.getPid(), IShcoolFloorService.HASCHILD);
// }
// }
// baseMapper.updateById(shcoolFloor);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void deleteShcoolFloor(String id) throws JeecgBootException {
// //查询选中节点下所有子节点一并删除
// id = this.queryTreeChildIds(id);
// if(id.indexOf(",")>0) {
// StringBuffer sb = new StringBuffer();
// String[] idArr = id.split(",");
// for (String idVal : idArr) {
// if(idVal != null){
// ShcoolFloor shcoolFloor = this.getById(idVal);
// String pidVal = shcoolFloor.getPid();
// //查询此节点上一级是否还有其他子节点
// List<ShcoolFloor> dataList = baseMapper.selectList(new QueryWrapper<ShcoolFloor>().eq("pid", pidVal).notIn("id",Arrays.asList(idArr)));
// if((dataList == null || dataList.size()==0) && !Arrays.asList(idArr).contains(pidVal)
// && !sb.toString().contains(pidVal)){
// //如果当前节点原本有子节点 现在木有了更新状态
// sb.append(pidVal).append(",");
// }
// }
// }
// //批量删除节点
// baseMapper.deleteBatchIds(Arrays.asList(idArr));
// //修改已无子节点的标识
// String[] pidArr = sb.toString().split(",");
// for(String pid : pidArr){
// this.updateOldParentNode(pid);
// }
// }else{
// ShcoolFloor shcoolFloor = this.getById(id);
// if(shcoolFloor==null) {
// throw new JeecgBootException("未找到对应实体");
// }
// updateOldParentNode(shcoolFloor.getPid());
// baseMapper.deleteById(id);
// }
}
@Override
public List<ShcoolFloor> queryTreeListNoPage(QueryWrapper<ShcoolFloor> queryWrapper) {
List<ShcoolFloor> dataList = baseMapper.selectList(queryWrapper);
List<ShcoolFloor> mapList = new ArrayList<>();
for(ShcoolFloor data : dataList){
String pidVal = data.getPid();
//递归查询子节点的根节点
if(pidVal != null && !"0".equals(pidVal)){
ShcoolFloor rootVal = this.getTreeRoot(pidVal);
if(rootVal != null && !mapList.contains(rootVal)){
mapList.add(rootVal);
}
}else{
if(!mapList.contains(data)){
mapList.add(data);
}
}
}
return mapList;
}
// /**
// * 根据所传pid查询旧的父级节点的子节点并修改相应状态值
// * @param pid
// */
// private void updateOldParentNode(String pid) {
// if(!IShcoolFloorService.ROOT_PID_VALUE.equals(pid)) {
// Integer count = baseMapper.selectCount(new QueryWrapper<ShcoolFloor>().eq("pid", pid));
// if(count==null || count<=1) {
// baseMapper.updateTreeNodeStatus(pid, IShcoolFloorService.NOCHILD);
// }
// }
// }
/**
* 递归查询节点的根节点
* @param pidVal
* @return
*/
private ShcoolFloor getTreeRoot(String pidVal){
ShcoolFloor data = baseMapper.selectById(pidVal);
if(data != null && !"0".equals(data.getPid())){
return this.getTreeRoot(data.getPid());
}else{
return data;
}
}
/**
* 根据id查询所有子节点id
* @param ids
* @return
*/
private String queryTreeChildIds(String ids) {
//获取id数组
String[] idArr = ids.split(",");
StringBuffer sb = new StringBuffer();
for (String pidVal : idArr) {
if(pidVal != null){
if(!sb.toString().contains(pidVal)){
if(sb.toString().length() > 0){
sb.append(",");
}
sb.append(pidVal);
this.getTreeChildIds(pidVal,sb);
}
}
}
return sb.toString();
}
/**
* 递归查询所有子节点
* @param pidVal
* @param sb
* @return
*/
private StringBuffer getTreeChildIds(String pidVal,StringBuffer sb){
List<ShcoolFloor> dataList = baseMapper.selectList(new QueryWrapper<ShcoolFloor>().eq("pid", pidVal));
if(dataList != null && dataList.size()>0){
for(ShcoolFloor tree : dataList) {
if(!sb.toString().contains(tree.getId())){
sb.append(",").append(tree.getId());
}
this.getTreeChildIds(tree.getId(),sb);
}
}
return sb;
}
}

+ 353
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shcoolFloor/vue/ShcoolFloorList.vue View File

@ -0,0 +1,353 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
</a-row>
</a-form>
</div>
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('楼栋表')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload>
<!-- 高级查询区域 -->
<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
</div>
<a-table
ref="table"
size="middle"
rowKey="id"
class="j-table-force-nowrap"
:scroll="{x:true}"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:expandedRowKeys="expandedRowKeys"
@change="handleTableChange"
@expand="handleExpand"
v-bind="tableProps">
<template slot="imgSlot" slot-scope="text,record">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
<img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
</template>
<template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button
v-else
:ghost="true"
type="primary"
icon="download"
size="small"
@click="downloadFile(text)">
下载
</a-button>
</template>
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a-dropdown>
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
<a-menu slot="overlay">
<a-menu-item>
<a @click="handleAddChild(record)">添加下级</a>
</a-menu-item>
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDeleteNode(record.id)" placement="topLeft">
<a>删除</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
</div>
<shcoolFloor-modal ref="modalForm" @ok="modalFormOk"></shcoolFloor-modal>
</a-card>
</template>
<script>
import { getAction, deleteAction } from '@/api/manage'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import ShcoolFloorModal from './modules/ShcoolFloorModal'
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
import { filterObj } from '@/utils/util';
export default {
name: "ShcoolFloorList",
mixins:[JeecgListMixin],
components: {
ShcoolFloorModal
},
data () {
return {
description: '楼栋表管理页面',
//
columns: [
{
title:'名称',
align:"left",
dataIndex: 'name'
},
{
title:'排序',
align:"left",
dataIndex: 'sort'
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/shcoolFloor/shcoolFloor/rootList",
childList: "/shcoolFloor/shcoolFloor/childList",
getChildListBatch: "/shcoolFloor/shcoolFloor/getChildListBatch",
delete: "/shcoolFloor/shcoolFloor/delete",
deleteBatch: "/shcoolFloor/shcoolFloor/deleteBatch",
exportXlsUrl: "/shcoolFloor/shcoolFloor/exportXls",
importExcelUrl: "shcoolFloor/shcoolFloor/importExcel",
},
expandedRowKeys:[],
hasChildrenField:"hasChild",
pidField:"pid",
dictOptions: {},
loadParent: false,
superFieldList:[],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
tableProps() {
let _this = this
return {
//
rowSelection: {
selectedRowKeys: _this.selectedRowKeys,
onChange: (selectedRowKeys) => _this.selectedRowKeys = selectedRowKeys
}
}
}
},
methods: {
loadData(arg){
if(arg==1){
this.ipagination.current=1
}
this.loading = true
let params = this.getQueryParams()
params.hasQuery = 'true'
getAction(this.url.list,params).then(res=>{
if(res.success){
let result = res.result
if(Number(result.total)>0){
this.ipagination.total = Number(result.total)
this.dataSource = this.getDataByResult(res.result.records)
return this.loadDataByExpandedRows(this.dataSource)
}else{
this.ipagination.total=0
this.dataSource=[]
}
}else{
this.$message.warning(res.message)
}
}).finally(()=>{
this.loading = false
})
},
//
loadDataByExpandedRows(dataList) {
if (this.expandedRowKeys.length > 0) {
return getAction(this.url.getChildListBatch,{ parentIds: this.expandedRowKeys.join(',') }).then(res=>{
if (res.success && res.result.records.length>0) {
//
let records = res.result.records
const listMap = new Map();
for (let item of records) {
let pid = item[this.pidField];
if (this.expandedRowKeys.join(',').includes(pid)) {
let mapList = listMap.get(pid);
if (mapList == null) {
mapList = [];
}
mapList.push(item);
listMap.set(pid, mapList);
}
}
let childrenMap = listMap;
let fn = (list) => {
if(list) {
list.forEach(data => {
if (this.expandedRowKeys.includes(data.id)) {
data.children = this.getDataByResult(childrenMap.get(data.id))
fn(data.children)
}
})
}
}
fn(dataList)
}
})
} else {
return Promise.resolve()
}
},
getQueryParams(arg) {
//
let sqp = {}
let param = {}
if(this.superQueryParams){
sqp['superQueryParams']=encodeURI(this.superQueryParams)
sqp['superQueryMatchType'] = this.superQueryMatchType
}
if(arg){
param = Object.assign(sqp, this.isorter ,this.filters);
}else{
param = Object.assign(sqp, this.queryParam, this.isorter ,this.filters);
}
if(JSON.stringify(this.queryParam) === "{}" || arg){
param.hasQuery = 'false'
}else{
param.hasQuery = 'true'
}
param.field = this.getQueryField();
param.pageNo = this.ipagination.current;
param.pageSize = this.ipagination.pageSize;
return filterObj(param);
},
searchReset() {
//
this.expandedRowKeys = []
this.queryParam = {}
this.loadData(1);
},
getDataByResult(result){
if(result){
return result.map(item=>{
//
if(item[this.hasChildrenField]=='1'){
let loadChild = { id: item.id+'_loadChild', name: 'loading...', isLoading: true }
item.children = [loadChild]
}
return item
})
}
},
handleExpand(expanded, record){
//
if (expanded) {
this.expandedRowKeys.push(record.id)
if (record.children.length>0 && record.children[0].isLoading === true) {
let params = this.getQueryParams(1);//
params[this.pidField] = record.id
params.hasQuery = 'false'
params.superQueryParams=""
getAction(this.url.childList,params).then((res)=>{
if(res.success){
if(res.result.records){
record.children = this.getDataByResult(res.result.records)
this.dataSource = [...this.dataSource]
}else{
record.children=''
record.hasChildrenField='0'
}
}else{
this.$message.warning(res.message)
}
})
}
}else{
let keyIndex = this.expandedRowKeys.indexOf(record.id)
if(keyIndex>=0){
this.expandedRowKeys.splice(keyIndex, 1);
}
}
},
handleAddChild(record){
this.loadParent = true
let obj = {}
obj[this.pidField] = record['id']
this.$refs.modalForm.add(obj);
},
handleDeleteNode(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.loadData(1)
} else {
that.$message.warning(res.message);
}
});
},
batchDel(){
if(this.selectedRowKeys.length<=0){
this.$message.warning('请选择一条记录!');
return false;
}else{
let ids = "";
let that = this;
that.selectedRowKeys.forEach(function(val) {
ids+=val+",";
});
that.$confirm({
title:"确认删除",
content:"是否删除选中数据?",
onOk: function(){
that.handleDeleteNode(ids)
that.onClearSelected();
}
});
}
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'string',value:'name',text:'名称',dictCode:''})
fieldList.push({type:'int',value:'sort',text:'排序',dictCode:''})
fieldList.push({type:'string',value:'pid',text:'父级节点',dictCode:''})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

+ 156
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shcoolFloor/vue/modules/ShcoolFloorModal.vue View File

@ -0,0 +1,156 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
:confirmLoading="confirmLoading"
switchFullscreen
@ok="handleOk"
@cancel="handleCancel"
cancelText="关闭">
<a-spin :spinning="confirmLoading">
<a-form-model ref="form" :model="model" :rules="validatorRules">
<a-form-model-item label="名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="name">
<a-input v-model="model.name" placeholder="请输入名称" ></a-input>
</a-form-model-item>
<a-form-model-item label="排序" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sort">
<a-input-number v-model="model.sort" placeholder="请输入排序" style="width: 100%" />
</a-form-model-item>
<a-form-model-item label="父级节点" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pid">
<j-tree-select
ref="treeSelect"
placeholder="请选择父级节点"
v-model="model.pid"
dict="shcool_floor,name,id"
pidField="pid"
pidValue="0"
hasChildField="has_child"
>
</j-tree-select>
</a-form-model-item>
</a-form-model>
</a-spin>
</j-modal>
</template>
<script>
import { httpAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
export default {
name: "ShcoolFloorModal",
components: {
},
data () {
return {
title:"操作",
width:800,
visible: false,
model:{
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
},
url: {
add: "/shcoolFloor/shcoolFloor/add",
edit: "/shcoolFloor/shcoolFloor/edit",
},
expandedRowKeys:[],
pidField:"pid"
}
},
created () {
//model
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add (obj) {
this.modelDefault.pid=''
this.edit(Object.assign(this.modelDefault , obj));
},
edit (record) {
this.model = Object.assign({}, record);
this.visible = true;
},
close () {
this.$emit('close');
this.visible = false;
this.$refs.form.clearValidate()
},
handleOk () {
const that = this;
//
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if(!this.model.id){
httpurl+=this.url.add;
method = 'post';
}else{
httpurl+=this.url.edit;
method = 'put';
}
if(this.model.id && this.model.id === this.model[this.pidField]){
that.$message.warning("父级节点不能选择自己");
that.confirmLoading = false;
return;
}
httpAction(httpurl,this.model,method).then((res)=>{
if(res.success){
that.$message.success(res.message);
this.$emit('ok');
}else{
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
that.close();
})
}else{
return false
}
})
},
handleCancel () {
this.close()
},
submitSuccess(formData,flag){
if(!formData.id){
let treeData = this.$refs.treeSelect.getCurrTreeData()
this.expandedRowKeys=[]
this.getExpandKeysByPid(formData[this.pidField],treeData,treeData)
this.$emit('ok',formData,this.expandedRowKeys.reverse());
}else{
this.$emit('ok',formData,flag);
}
},
getExpandKeysByPid(pid,arr,all){
if(pid && arr && arr.length>0){
for(let i=0;i<arr.length;i++){
if(arr[i].key==pid){
this.expandedRowKeys.push(arr[i].key)
this.getExpandKeysByPid(arr[i]['parentId'],all,all)
}else{
this.getExpandKeysByPid(pid,arr[i].children,all)
}
}
}
}
}
}
</script>

+ 82
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shcoolFloor/vue3/ShcoolFloor.api.ts View File

@ -0,0 +1,82 @@
import {defHttp} from "/@/utils/http/axios";
import {Modal} from 'ant-design-vue';
enum Api {
list = '/shcoolFloor/shcoolFloor/rootList',
save='/shcoolFloor/shcoolFloor/add',
edit='/shcoolFloor/shcoolFloor/edit',
deleteShcoolFloor = '/sys/shcoolFloor/delete',
deleteBatch = '/shcoolFloor/shcoolFloor/deleteBatch',
importExcel = '/shcoolFloor/shcoolFloor/importExcel',
exportXls = '/shcoolFloor/shcoolFloor/exportXls',
loadTreeData = '/shcoolFloor/shcoolFloor/loadTreeRoot',
getChildList = '/shcoolFloor/shcoolFloor/childList',
getChildListBatch = '/shcoolFloor/shcoolFloor/getChildListBatch',
}
/**
* api
* @param params
*/
export const getExportUrl = Api.exportXls;
/**
* api
* @param params
*/
export const getImportUrl = Api.importExcel;
/**
*
* @param params
*/
export const list = (params) =>
defHttp.get({url: Api.list, params});
/**
*
*/
export const deleteShcoolFloor = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteShcoolFloor, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
/**
*
* @param params
*/
export const batchDeleteShcoolFloor = (params, handleSuccess) => {
Modal.confirm({
title: '确认删除',
content: '是否删除选中数据',
okText: '确认',
cancelText: '取消',
onOk: () => {
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
});
}
/**
*
* @param params
*/
export const saveOrUpdateDict = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({url: url, params});
}
/**
*
* @param params
*/
export const loadTreeData = (params) =>
defHttp.get({url: Api.loadTreeData,params});
/**
*
* @param params
*/
export const getChildList = (params) =>
defHttp.get({url: Api.getChildList, params});
/**
*
* @param params
*/
export const getChildListBatch = (params) =>
defHttp.get({url: Api.getChildListBatch, params},{isTransformResponse:false});

+ 38
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shcoolFloor/vue3/ShcoolFloor.data.ts View File

@ -0,0 +1,38 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '名称',
align:"center",
dataIndex: 'name'
},
{
title: '排序',
align:"center",
dataIndex: 'sort'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '名称',
field: 'name',
component: 'Input',
},
{
label: '排序',
field: 'sort',
component: 'InputNumber',
},
{
label: '父级节点',
field: 'pid',
component: 'Input',
},
];

+ 272
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shcoolFloor/vue3/ShcoolFloorList.vue View File

@ -0,0 +1,272 @@
<template>
<div class="p-4">
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection" :expandedRowKeys="expandedRowKeys" @expand="handleExpand" @fetch-success="onFetchSuccess">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" @click="handleCreate" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete">
<Icon icon="ant-design:delete-outlined"></Icon>
删除
</a-menu-item>
</a-menu>
</template>
<a-button>批量操作
<Icon icon="ant-design:down-outlined"></Icon>
</a-button>
</a-dropdown>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)"/>
</template>
</BasicTable>
<!--字典弹窗-->
<ShcoolFloorModal @register="registerModal" @success="handleSuccess"/>
</div>
</template>
<script lang="ts" name="shcoolFloor-shcoolFloor" setup>
//ts
import {ref, computed, unref, toRaw, nextTick} from 'vue';
import {BasicTable, useTable, TableAction} from '/src/components/Table';
import {useModal} from '/src/components/Modal';
import { useListPage } from '/@/hooks/system/useListPage'
import ShcoolFloorModal from './components/ShcoolFloorModal.vue';
import {columns} from './ShcoolFloor.data';
import {list, deleteShcoolFloor, batchDeleteShcoolFloor, getExportUrl,getImportUrl, getChildList,getChildListBatch} from './ShcoolFloor.api';
const expandedRowKeys = ref([]);
//model
const [registerModal, {openModal}] = useModal();
//table
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
tableProps:{
title: '楼栋表',
columns,
canResize:false,
actionColumn: {
width: 120,
},
},
exportConfig: {
name:"楼栋表",
url: getExportUrl,
},
importConfig: {
url: getImportUrl,
success: importSuccess
},
})
const [registerTable, {reload, collapseAll, updateTableDataRecord, findTableDataRecord,getDataSource},{ rowSelection, selectedRowKeys }] = tableContext
/**
* 新增事件
*/
function handleCreate() {
openModal(true, {
isUpdate: false,
});
}
/**
* 编辑事件
*/
async function handleEdit(record) {
openModal(true, {
record,
isUpdate: true,
});
}
/**
* 详情
*/
async function handleDetail(record) {
openModal(true, {
record,
isUpdate: true,
hideFooter: true,
});
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteShcoolFloor({id: record.id}, importSuccess);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
const ids = selectedRowKeys.value.filter(item => !item.includes('loading'))
await batchDeleteShcoolFloor({ids: ids}, importSuccess);
}
/**
* 导入
*/
function importSuccess() {
reload() && (expandedRowKeys.value = []);
}
/**
* 添加下级
*/
function handleAddSub(record) {
openModal(true, {
record,
isUpdate: false,
});
}
/**
* 成功回调
*/
async function handleSuccess({isUpdate, values, expandedArr}) {
if (isUpdate) {
//
updateTableDataRecord(values.id, values);
} else {
if(!values['pid']){
//
reload();
}else{
//
expandedRowKeys.value = [];
for (let key of unref(expandedArr)) {
await expandTreeNode(key)
}
}
}
}
/**
* 接口请求成功后回调
*/
function onFetchSuccess(result) {
getDataByResult(result.items)&&loadDataByExpandedRows();
}
/**
* 根据已展开的行查询数据用于保存后刷新时异步加载子级的数据
*/
async function loadDataByExpandedRows() {
if (unref(expandedRowKeys).length > 0) {
const res = await getChildListBatch({ parentIds: unref(expandedRowKeys).join(',')});
if (res.success && res.result.records.length>0) {
//
let records = res.result.records
const listMap = new Map();
for (let item of records) {
let pid = item['pid'];
if (unref(expandedRowKeys).includes(pid)) {
let mapList = listMap.get(pid);
if (mapList == null) {
mapList = [];
}
mapList.push(item);
listMap.set(pid, mapList);
}
}
let childrenMap = listMap;
let fn = (list) => {
if(list) {
list.forEach(data => {
if (unref(expandedRowKeys).includes(data.id)) {
data.children = getDataByResult(childrenMap.get(data.id))
fn(data.children)
}
})
}
};
fn(getDataSource())
}
}
}
/**
* 处理数据集
*/
function getDataByResult(result){
if(result && result.length>0){
return result.map(item=>{
//
if(item["hasChild"]=='1'){
let loadChild = { id: item.id+'_loadChild', name: 'loading...', isLoading: true }
item.children = [loadChild]
}
return item
})
}
}
/**
*树节点展开合并
* */
async function handleExpand(expanded, record) {
// (expanded)(children)(isLoading)
if (expanded) {
expandedRowKeys.value.push(record.id)
if (record.children.length > 0 && !!record.children[0].isLoading) {
let result = await getChildList({pid: record.id});
result=result.records?result.records:result;
if (result && result.length > 0) {
record.children = getDataByResult(result);
} else {
record.children = null
record.hasChild = '0'
}
}
} else {
let keyIndex = expandedRowKeys.value.indexOf(record.id)
if (keyIndex >= 0) {
expandedRowKeys.value.splice(keyIndex, 1);
}
}
}
/**
*操作表格后处理树节点展开合并
* */
async function expandTreeNode(key) {
let record = findTableDataRecord(key)
expandedRowKeys.value.push(key);
let result = await getChildList({pid: key});
if (result && result.length > 0) {
record.children = getDataByResult(result);
} else {
record.children = null
record.hasChild = '0'
}
updateTableDataRecord(key, record);
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
},
{
label: '删除',
popConfirm: {
title: '确定删除吗?',
confirm: handleDelete.bind(null, record),
},
},
{
label: '添加下级',
onClick: handleAddSub.bind(null, {pid: record.id}),
}
]
}
</script>
<style scoped>
</style>

+ 87
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/shcoolFloor/vue3/components/ShcoolFloorModal.vue View File

@ -0,0 +1,87 @@
<template>
<BasicModal v-bind="$attrs" @register="registerModal" :title="getTitle" @ok="handleSubmit">
<BasicForm @register="registerForm"/>
</BasicModal>
</template>
<script lang="ts" setup>
import {ref, computed, unref} from 'vue';
import {BasicModal, useModalInner} from '/src/components/Modal';
import {BasicForm, useForm} from '/src/components/Form';
import {formSchema} from '../shcoolFloor.data';
import {loadTreeData, saveOrUpdateDict} from '../shcoolFloor.api';
// emit
const emit = defineEmits(['register', 'success']);
const isUpdate = ref(true);
const expandedRowKeys = ref([]);
const treeData = ref([]);
//
const [registerForm, {resetFields, setFieldsValue, validate, updateSchema}] = useForm({
schemas: formSchema,
showActionButtonGroup: false,
labelCol: {
xs: { span: 24 },
sm: { span: 4 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 18 },
},
});
//
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
//
await resetFields();
expandedRowKeys.value = [];
setModalProps({confirmLoading: false, minHeight: 80});
isUpdate.value = !!data?.isUpdate;
if (data?.record) {
//
await setFieldsValue({
...data.record,
});
}
//
treeData.value = await loadTreeData({'async': false,'pcode':''});
updateSchema({
field: 'pid',
componentProps: {treeData},
});
});
//
const getTitle = computed(() => (!unref(isUpdate) ? '新增字典' : '编辑字典'));
/**
* 根据pid获取展开的节点
* @param pid
* @param arr
*/
function getExpandKeysByPid(pid,arr){
if(pid && arr && arr.length>0){
for(let i=0;i<arr.length;i++){
if(arr[i].key==pid && unref(expandedRowKeys).indexOf(pid)<0){
expandedRowKeys.value.push(arr[i].key);
getExpandKeysByPid(arr[i]['parentId'],unref(treeData))
}else{
getExpandKeysByPid(pid,arr[i].children)
}
}
}
}
//
async function handleSubmit() {
try {
let values = await validate();
setModalProps({confirmLoading: true});
//
await saveOrUpdateDict(values, isUpdate.value);
//
closeModal();
//
await getExpandKeysByPid(values['pid'],unref(treeData))
//(isUpdate:;values:;expandedArr:)
emit('success', {isUpdate: unref(isUpdate), values:{...values},expandedArr: unref(expandedRowKeys).reverse()});
} finally {
setModalProps({confirmLoading: false});
}
}
</script>

BIN
jeecg-boot-base/jeecg-boot-base-core/target/classes/org/jeecg/config/shiro/ShiroConfig.class View File


BIN
jeecg-boot-base/jeecg-boot-base-core/target/classes/org/jeecg/modules/payOrder/entity/PayOrder.class View File


BIN
jeecg-boot-base/jeecg-boot-base-core/target/classes/org/jeecg/modules/payShop/entity/PayShop.class View File


BIN
jeecg-boot-base/jeecg-boot-base-core/target/classes/org/jeecg/modules/shcoolFloor/controller/ShcoolFloorController.class View File


BIN
jeecg-boot-base/jeecg-boot-base-core/target/classes/org/jeecg/modules/shcoolFloor/entity/ShcoolFloor.class View File


BIN
jeecg-boot-base/jeecg-boot-base-core/target/classes/org/jeecg/modules/shcoolFloor/mapper/ShcoolFloorMapper.class View File


+ 9
- 0
jeecg-boot-base/jeecg-boot-base-core/target/classes/org/jeecg/modules/shcoolFloor/mapper/xml/ShcoolFloorMapper.xml View File

@ -0,0 +1,9 @@
<?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.shcoolFloor.mapper.ShcoolFloorMapper">
<update id="updateTreeNodeStatus" parameterType="java.lang.String">
update shcool_floor set has_child = #{status} where id = #{id}
</update>
</mapper>

BIN
jeecg-boot-base/jeecg-boot-base-core/target/classes/org/jeecg/modules/shcoolFloor/service/IShcoolFloorService.class View File


BIN
jeecg-boot-base/jeecg-boot-base-core/target/classes/org/jeecg/modules/shcoolFloor/service/impl/ShcoolFloorServiceImpl.class View File


+ 7
- 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/cheeroncontroller/CheerInfoController.java View File

@ -91,4 +91,11 @@ public class CheerInfoController {
return Result.OK("打印成功");
}
//支付回调
@PostMapping("/notify")
public Object createNotify(@RequestBody String requestBody){
return infoApiService.createNotify(requestBody);
}
}

+ 2
- 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/payController/PayApiIndexController.java View File

@ -35,6 +35,8 @@ public class PayApiIndexController {
@GetMapping("/getInfo")
public Result<?> getInfo(@RequestHeader("X-Access-Token") String token)
{
System.out.println("没有劲来"+token);
return infoApiService.getInfo(token);
}


+ 17
- 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/schoolcontroller/SchoolApiController.java View File

@ -56,5 +56,22 @@ public class SchoolApiController {
return indexApiService.getSchoolOrderPage(state,bean);
}
//获取楼栋
@ApiOperation(value="小程序-获取楼栋", notes="小程序-获取楼栋")
@GetMapping("/getFloorList")
public Result<?> getFloorList(){
return indexApiService.getFloorList();
}
//获取室号
@ApiOperation(value="小程序-获取楼栋", notes="小程序-获取楼栋")
@GetMapping("/getActorGoList")
public Result<?> getActorGoList(String id){
return indexApiService.getRoomList(id);
}
}

+ 8
- 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiservice/IndexApiService.java View File

@ -65,4 +65,12 @@ public interface IndexApiService {
Object createNotify(String requestBody);
//获取楼栋
Result<?> getFloorList();
//获取室号
Result<?> getRoomList(String floorId);
}

+ 3
- 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiservice/InfoApiService.java View File

@ -70,4 +70,7 @@ public interface InfoApiService {
//获取配置信息折扣客户电话客户微信
Result<?> getConfig(String keyValue);
//支付回调
Object createNotify(String requestBody);
}

+ 38
- 13
jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiservice/impl/IndexApiServiceImpl.java View File

@ -35,6 +35,8 @@ import org.jeecg.modules.payOrder.entity.PayOrder;
import org.jeecg.modules.payOrder.service.IPayOrderService;
import org.jeecg.modules.payShop.entity.PayShop;
import org.jeecg.modules.payShop.service.IPayShopService;
import org.jeecg.modules.shcoolFloor.entity.ShcoolFloor;
import org.jeecg.modules.shcoolFloor.service.IShcoolFloorService;
import org.jeecg.modules.shcoolSub.entity.ShcoolSub;
import org.jeecg.modules.shcoolSub.service.IShcoolSubService;
import org.springframework.beans.factory.annotation.Autowired;
@ -84,6 +86,9 @@ public class IndexApiServiceImpl implements IndexApiService {
//加油小程序
@Resource
private ICheerWaterService cheerWaterService;
//获取楼栋
@Resource
private IShcoolFloorService shcoolFloorService;
@ -175,6 +180,7 @@ public class IndexApiServiceImpl implements IndexApiService {
Page<PayOrder> pageList = payOrderService
.lambdaQuery()
.orderByDesc(PayOrder::getCreateTime)
.eq(PayOrder::getState,1)
.eq(PayOrder::getUserId,hanHaiMember.getId())
.page(page);
return Result.OK("订单列表",pageList);
@ -214,7 +220,7 @@ public class IndexApiServiceImpl implements IndexApiService {
//吊起微信支付
String s = new BigDecimal(0.01).multiply(new BigDecimal(100)).toString();
int i1 = Double.valueOf(s).intValue();
Object appOrder = mpWxPayService.createOrder(
Object appOrder = mpWxPayService.createOrderPay(
"购买"+order.getTitle() ,
"127.0.0.1",
order.getId(),
@ -292,25 +298,44 @@ public class IndexApiServiceImpl implements IndexApiService {
String outTradeNo = notify.getOutTradeNo();
//开始处理业务逻辑
CheerWater byId = cheerWaterService.getById(outTradeNo);
PayOrder byId = payOrderService.getById(outTradeNo);
if(byId!=null){
if(!byId.getState().equals("1")){
cheerWaterService.lambdaUpdate()
.set(CheerWater::getState,"1")
.eq(CheerWater::getId,outTradeNo)
if(byId.getState() != 1){
payOrderService.lambdaUpdate()
.set(PayOrder::getState,1)
.eq(PayOrder::getId,outTradeNo)
.update();
//拼接打印信息
String content = printUtil.spellMessage();
//客户要求打印两次
printUtil.printBill(content);
printUtil.printBill(content);
}
}
return null;
}
//获取楼栋
@Override
public Result<?> getFloorList(){
List<ShcoolFloor> list = shcoolFloorService
.lambdaQuery()
.isNull(ShcoolFloor::getPid)
.orderByDesc(ShcoolFloor::getSort)
.list();
return Result.OK("楼栋列表",list);
}
//获取室号
@Override
public Result<?> getRoomList(String floorId){
List<ShcoolFloor> list = shcoolFloorService
.lambdaQuery()
.eq(ShcoolFloor::getPid, floorId)
.orderByDesc(ShcoolFloor::getSort)
.list();
return Result.OK("楼栋列表",list);
}
}

+ 33
- 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiservice/impl/InfoApiServiceImpl.java View File

@ -1,10 +1,12 @@
package org.jeecg.modules.apiservice.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResult;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.util.RedisUtil;
import org.jeecg.config.shiro.ShiroRealm;
import org.jeecg.modules.apiBean.*;
import org.jeecg.modules.apiUtils.printUtil;
import org.jeecg.modules.apiservice.InfoApiService;
import org.jeecg.modules.atPerformer.entity.AtPerformer;
import org.jeecg.modules.atPerformer.service.IAtPerformerService;
@ -452,4 +454,35 @@ public class InfoApiServiceImpl implements InfoApiService {
return Result.OK("配置信息", one);
}
//支付回调
@Override
public Object createNotify(String requestBody){
WxPayOrderNotifyResult notify = mpWxPayService.notify(requestBody);
String outTradeNo = notify.getOutTradeNo();
//开始处理业务逻辑
CheerWater byId = cheerWaterService.getById(outTradeNo);
if(byId!=null){
if(!byId.getState().equals("1")){
cheerWaterService.lambdaUpdate()
.set(CheerWater::getState,"1")
.eq(CheerWater::getId,outTradeNo)
.update();
//拼接打印信息
String content = printUtil.spellMessage();
//客户要求打印两次
printUtil.printBill(content);
printUtil.printBill(content);
}
}
return null;
}
}

Loading…
Cancel
Save