From 1d7b8a719c55a68a609d2334c865c29ba9a7d81f Mon Sep 17 00:00:00 2001 From: wuchunlei Date: Fri, 19 Dec 2025 17:50:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E8=B4=A6=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/controller/ImportController.java | 43 +++- .../common/controller/PaymentController.java | 221 ++++++++++------- .../finance/common/dao/BuyOrderMapper.java | 20 ++ .../common/dao/BuyOrderProductMapper.java | 20 ++ .../zmzm/finance/common/dao/OrdersMapper.java | 18 ++ .../finance/common/dao/PayZfbOrderMapper.java | 20 ++ .../common/dao/PaymentToOrderMapper.java | 18 ++ .../finance/common/dao/ShopProductMapper.java | 20 ++ .../finance/common/dao/TCommodityMapper.java | 20 ++ .../dao/TCurriculumCatalogueMapper.java | 20 ++ .../common/dao/TCustomerTaihuClassMapper.java | 20 ++ .../zmzm/finance/common/entity/BuyOrder.java | 224 ++++++++++++++++++ .../common/entity/BuyOrderProduct.java | 76 ++++++ .../zmzm/finance/common/entity/Import.java | 2 +- .../zmzm/finance/common/entity/Orders.java | 73 ++++++ .../finance/common/entity/PayZfbOrder.java | 97 ++++++++ .../zmzm/finance/common/entity/Payment.java | 13 + .../finance/common/entity/PaymentToOrder.java | 47 ++++ .../finance/common/entity/ShopProduct.java | 181 ++++++++++++++ .../finance/common/entity/TCommodity.java | 108 +++++++++ .../common/entity/TCurriculumCatalogue.java | 128 ++++++++++ .../common/entity/TCustomerTaihuClass.java | 67 ++++++ .../com/zmzm/finance/common/entity/User.java | 4 +- .../common/service/IBuyOrderService.java | 16 ++ .../common/service/IOrdersService.java | 18 ++ .../service/IPaymentToOrderService.java | 16 ++ .../common/service/ITCommodityService.java | 16 ++ .../service/ITCurriculumCatalogueService.java | 16 ++ .../service/ITCustomerTaihuClassService.java | 16 ++ .../service/impl/BuyOrderServiceImpl.java | 20 ++ .../service/impl/OrdersServiceImpl.java | 87 +++++++ .../impl/PaymentToOrderServiceImpl.java | 20 ++ .../service/impl/TCommodityServiceImpl.java | 20 ++ .../impl/TCurriculumCatalogueServiceImpl.java | 20 ++ .../impl/TCustomerTaihuClassServiceImpl.java | 20 ++ .../java/com/zmzm/finance/util/DataUtil.java | 168 +++++++++++++ src/main/resources/application.yml | 2 +- 37 files changed, 1825 insertions(+), 90 deletions(-) create mode 100644 src/main/java/com/zmzm/finance/common/dao/BuyOrderMapper.java create mode 100644 src/main/java/com/zmzm/finance/common/dao/BuyOrderProductMapper.java create mode 100644 src/main/java/com/zmzm/finance/common/dao/OrdersMapper.java create mode 100644 src/main/java/com/zmzm/finance/common/dao/PayZfbOrderMapper.java create mode 100644 src/main/java/com/zmzm/finance/common/dao/PaymentToOrderMapper.java create mode 100644 src/main/java/com/zmzm/finance/common/dao/ShopProductMapper.java create mode 100644 src/main/java/com/zmzm/finance/common/dao/TCommodityMapper.java create mode 100644 src/main/java/com/zmzm/finance/common/dao/TCurriculumCatalogueMapper.java create mode 100644 src/main/java/com/zmzm/finance/common/dao/TCustomerTaihuClassMapper.java create mode 100644 src/main/java/com/zmzm/finance/common/entity/BuyOrder.java create mode 100644 src/main/java/com/zmzm/finance/common/entity/BuyOrderProduct.java create mode 100644 src/main/java/com/zmzm/finance/common/entity/Orders.java create mode 100644 src/main/java/com/zmzm/finance/common/entity/PayZfbOrder.java create mode 100644 src/main/java/com/zmzm/finance/common/entity/PaymentToOrder.java create mode 100644 src/main/java/com/zmzm/finance/common/entity/ShopProduct.java create mode 100644 src/main/java/com/zmzm/finance/common/entity/TCommodity.java create mode 100644 src/main/java/com/zmzm/finance/common/entity/TCurriculumCatalogue.java create mode 100644 src/main/java/com/zmzm/finance/common/entity/TCustomerTaihuClass.java create mode 100644 src/main/java/com/zmzm/finance/common/service/IBuyOrderService.java create mode 100644 src/main/java/com/zmzm/finance/common/service/IOrdersService.java create mode 100644 src/main/java/com/zmzm/finance/common/service/IPaymentToOrderService.java create mode 100644 src/main/java/com/zmzm/finance/common/service/ITCommodityService.java create mode 100644 src/main/java/com/zmzm/finance/common/service/ITCurriculumCatalogueService.java create mode 100644 src/main/java/com/zmzm/finance/common/service/ITCustomerTaihuClassService.java create mode 100644 src/main/java/com/zmzm/finance/common/service/impl/BuyOrderServiceImpl.java create mode 100644 src/main/java/com/zmzm/finance/common/service/impl/OrdersServiceImpl.java create mode 100644 src/main/java/com/zmzm/finance/common/service/impl/PaymentToOrderServiceImpl.java create mode 100644 src/main/java/com/zmzm/finance/common/service/impl/TCommodityServiceImpl.java create mode 100644 src/main/java/com/zmzm/finance/common/service/impl/TCurriculumCatalogueServiceImpl.java create mode 100644 src/main/java/com/zmzm/finance/common/service/impl/TCustomerTaihuClassServiceImpl.java create mode 100644 src/main/java/com/zmzm/finance/util/DataUtil.java diff --git a/src/main/java/com/zmzm/finance/common/controller/ImportController.java b/src/main/java/com/zmzm/finance/common/controller/ImportController.java index a3009e1..5a14cc5 100644 --- a/src/main/java/com/zmzm/finance/common/controller/ImportController.java +++ b/src/main/java/com/zmzm/finance/common/controller/ImportController.java @@ -3,8 +3,10 @@ package com.zmzm.finance.common.controller; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.zmzm.finance.common.entity.Import; import com.zmzm.finance.common.entity.Payment; +import com.zmzm.finance.common.entity.PaymentToOrder; import com.zmzm.finance.common.service.IImportService; import com.zmzm.finance.common.service.IPaymentService; +import com.zmzm.finance.common.service.IPaymentToOrderService; import com.zmzm.finance.util.ExcelUtil; import com.zmzm.finance.util.FileUtil; import com.zmzm.finance.util.R; @@ -20,7 +22,11 @@ import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; import java.io.InputStream; import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.time.YearMonth; +import java.time.temporal.ChronoUnit; import java.util.*; +import java.util.stream.Collectors; /** *

@@ -38,10 +44,29 @@ public class ImportController { private IImportService importService; @Autowired private IPaymentService paymentService; + @Autowired + private IPaymentToOrderService paymentToOrderService; //导入文件列表 @RequestMapping("/getImportList") public R getImportList(@RequestBody Map params){ + Import alreadyImport = importService.getOne(new LambdaQueryWrapper() + .orderByDesc(Import::getYear,Import::getMonth).last("limit 1")); +// if(alreadyImport == null){ +// alreadyImport = new Import(); +// alreadyImport.setYear(2022); +// alreadyImport.setMonth(12); +// importService.save(alreadyImport); +// } +// YearMonth startMonth = YearMonth.of(alreadyImport.getYear(),alreadyImport.getMonth()); +// YearMonth endMonth = YearMonth.now(); +// long difference = ChronoUnit.MONTHS.between(startMonth, endMonth); + if(alreadyImport == null){ + Import import1 = new Import(); + import1.setYear(LocalDateTime.now().getYear()); + import1.setMonth(LocalDateTime.now().getMonthValue()); + importService.save(import1); + } List importList = importService.list(new LambdaQueryWrapper() .eq(StringUtils.isNotEmpty(params.get("year").toString()),Import::getYear,params.get("year")) .eq(StringUtils.isNotEmpty(params.get("month").toString()),Import::getMonth,params.get("month"))); @@ -57,9 +82,15 @@ public class ImportController { Import imp = importService.getOne(new LambdaQueryWrapper() .eq(Import::getYear, year).eq(Import::getMonth, month)); if(imp != null){ - List oldPayments = paymentService.list(new LambdaQueryWrapper() - .eq(Payment::getImportId,imp.getId()).eq(Payment::getType, type)); - paymentService.removeBatchByIds(oldPayments); + List oldPaymentIds = paymentService.list(new LambdaQueryWrapper() + .eq(Payment::getImportId,imp.getId()).eq(Payment::getType, type)) + .stream().map(Payment::getId).toList(); + if (!oldPaymentIds.isEmpty()) { + List ptos = paymentToOrderService.list(new LambdaQueryWrapper() + .in(PaymentToOrder::getPaymentId,oldPaymentIds)); + paymentService.removeBatchByIds(oldPaymentIds); + paymentToOrderService.removeByIds(ptos); + } }else { imp = new Import(); imp.setYear(year); @@ -97,9 +128,9 @@ public class ImportController { Payment payment = new Payment(); payment.setImportId(imp.getId()); payment.setType(map.containsKey("A"+i)?Integer.valueOf(map.get("A"+i)):0); - payment.setFinanceSn(map.getOrDefault("B" + i, "")); - payment.setTransactionSn(map.getOrDefault("C" + i, "")); - payment.setRelationSn(map.getOrDefault("D" + i, "")); + payment.setFinanceSn(map.getOrDefault("B" + i, "").replace("\t","")); + payment.setTransactionSn(map.getOrDefault("C" + i, "").replace("\t","")); + payment.setRelationSn(map.getOrDefault("D" + i, "").replace("\t","")); payment.setFee(new BigDecimal(map.get("E" + i))); payment.setCtime(DateUtils.parseDate(map.get("F"+i), new String[]{"yyyy-MM-dd HH:mm:ss"})); payment.setPaymentName(map.getOrDefault("G" + i, "")); diff --git a/src/main/java/com/zmzm/finance/common/controller/PaymentController.java b/src/main/java/com/zmzm/finance/common/controller/PaymentController.java index f30536d..948b62c 100644 --- a/src/main/java/com/zmzm/finance/common/controller/PaymentController.java +++ b/src/main/java/com/zmzm/finance/common/controller/PaymentController.java @@ -1,24 +1,26 @@ package com.zmzm.finance.common.controller; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.zmzm.finance.common.entity.Import; -import com.zmzm.finance.common.entity.Payment; -import com.zmzm.finance.common.service.IImportService; -import com.zmzm.finance.common.service.IPaymentService; -import com.zmzm.finance.util.ExcelUtil; -import com.zmzm.finance.util.FileUtil; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import com.zmzm.finance.common.dao.TCurriculumCatalogueMapper; +import com.zmzm.finance.common.entity.*; +import com.zmzm.finance.common.service.*; import com.zmzm.finance.util.R; +import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.time.DateUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; -import org.springframework.transaction.interceptor.TransactionAspectSupport; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.multipart.MultipartFile; -import java.io.InputStream; + import java.math.BigDecimal; -import java.util.*; +import java.text.ParseException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; /** *

@@ -35,75 +37,134 @@ public class PaymentController { @Autowired private IPaymentService paymentService; @Autowired - private IImportService importService; + private IPaymentToOrderService paymentToOrderService; + @Autowired + private IOrdersService ordersService; + @Autowired + private ITCustomerTaihuClassService customerTaihuClassService; + @Autowired + private ITCurriculumCatalogueService curriculumCatalogueService; + @Autowired + private ITCommodityService commodityService; - //导入数据 - @RequestMapping("/importData") - @Transactional - public R importData(@RequestParam("file") MultipartFile file,@RequestParam("type") int type, - @RequestParam("year") int year,@RequestParam("month") int month) { - //删除之前上的的数据 - Import imp = importService.getOne(new LambdaQueryWrapper() - .eq(Import::getYear, year).eq(Import::getMonth, month)); - if(imp != null){ - List oldPayments = paymentService.list(new LambdaQueryWrapper() - .eq(Payment::getImportId,imp.getId()).eq(Payment::getType, type)); - paymentService.removeBatchByIds(oldPayments); - }else { - imp = new Import(); - imp.setYear(year); - imp.setMonth(month); - } - //上传文件 - FileUtil fileUtil = new FileUtil(); - String url = fileUtil.uploadFile(file); - if(0==type){ - imp.setWechatFile(url); - }else if(1==type){ - imp.setAlipayFile(url); - }else if(2==type){ - imp.setBankFile(url); - } - importService.saveOrUpdate(imp); - //导入新数据 - int num = 0; - try (InputStream fis = file.getInputStream()) { - //解析数据 - ExcelUtil example = new ExcelUtil(); - example.processOneSheet(fis); - LinkedHashMap map = example.getRowContents(); - Iterator> it = map.entrySet().iterator(); - //处理数据 - int count = 0; - List list = new ArrayList<>(); - while (it.hasNext()) { - Map.Entry entry = it.next(); - String pos = entry.getKey(); - String rowNo = pos.replaceAll("[a-zA-Z]", ""); - count = Integer.parseInt(rowNo); - System.out.println(pos + ";" + entry.getValue()); - } - for (int i=2;i<=count;i++){ - Payment payment = new Payment(); - payment.setImportId(imp.getId()); - payment.setType(map.containsKey("A"+i)?Integer.valueOf(map.get("A"+i)):0); - payment.setFinanceSn(map.getOrDefault("B" + i, "")); - payment.setTransactionSn(map.getOrDefault("C" + i, "")); - payment.setRelationSn(map.getOrDefault("D" + i, "")); - payment.setFee(new BigDecimal(map.get("E" + i))); - payment.setCtime(DateUtils.parseDate(map.get("F"+i), new String[]{"yyyy-MM-dd HH:mm:ss"})); - payment.setPaymentName(map.getOrDefault("G" + i, "")); - payment.setPaymentType(map.getOrDefault("H" + i, "")); - payment.setRemark(map.getOrDefault("I" + i, "")); - list.add(payment); - num++; - } - paymentService.saveBatch(list); - } catch (Exception e) { - e.printStackTrace(); - TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); - return R.error(e.getMessage()); - } - return R.ok("导入成功"+num+"条"); + //账单列表 + @RequestMapping("/getPaymentList") + public R getPaymentList(@RequestBody Map params){ + Page paymentList = paymentService.page(new Page<>(Long.parseLong(params.get("page").toString()), + Long.parseLong(params.get("limit").toString())),new LambdaQueryWrapper() + .eq(params.containsKey("type")&&StringUtils.isNotEmpty(params.get("type").toString()), + Payment::getType,params.get("type").toString()) + .eq(params.containsKey("checkoff")&&StringUtils.isNotEmpty(params.get("checkoff").toString()), + Payment::getCheckoff,params.get("checkoff").toString()) + .apply(params.containsKey("year")&&StringUtils.isNotEmpty(params.get("year").toString()), + "DATE_FORMAT(ctime, '%Y') = '"+params.get("year").toString()+"'") + .apply(params.containsKey("month")&&StringUtils.isNotEmpty(params.get("month").toString()), + "DATE_FORMAT(ctime, '%m') = '"+params.get("month").toString()+"'") + .orderByDesc(Payment::getCtime)); + return R.ok().put("data",paymentList); } + + //自动对账 + @RequestMapping("/autoCheckoff") + @DSTransactional + public R autoCheckoff(@RequestBody Map params){ + //先同步吴门医述订单 + ordersService.importWumenOrder(); + //查询自动核对失败的平台流水 + List paymentList = paymentService.list(new MPJLambdaWrapper() + .leftJoin(Orders.class,on->on + .eq(Orders::getOrderSn,Payment::getRelationSn).eq(Orders::getState,0)) + .disableSubLogicDel() + .selectAll(Payment.class) + .selectAs(Orders::getId,"ordersId") + .selectAs(Orders::getOrderSn,"ordersSn") + .ne(Payment::getCheckoff,2) + .apply(params.containsKey("year")&&StringUtils.isNotEmpty(params.get("year").toString()), + "DATE_FORMAT(t.ctime, '%Y') = '"+params.get("year").toString()+"'") + .apply(params.containsKey("month")&&StringUtils.isNotEmpty(params.get("month").toString()), + "DATE_FORMAT(t.ctime, '%m') = '"+params.get("month").toString()+"'")); + List ptos = new ArrayList<>(); + List ps = new ArrayList<>(); + //自动绑定 + for (Payment payment : paymentList) { + if (StringUtils.isNotEmpty(payment.getRelationSn())&& + payment.getRelationSn().equals(payment.getOrdersSn())) { + PaymentToOrder pto = new PaymentToOrder(); + pto.setPaymentId(payment.getId()); + pto.setOrderId(payment.getOrdersId()); + ptos.add(pto); + payment.setCheckoff(2); + }else { + payment.setCheckoff(1); + } + ps.add(payment); + } + paymentService.updateBatchById(ps); + paymentToOrderService.saveBatch(ptos); + return R.ok(); + } + + //手动对账订单列表 + @RequestMapping("/manualList") + public R manualList(@RequestBody Map params){ + Payment payment = paymentService.getById(params.get("paymentId").toString()); + Page ordersList = ordersService.page(new Page<>(Long.parseLong(params.get("page").toString()), + Long.parseLong(params.get("limit").toString())), new LambdaQueryWrapper() + .notExists("select 1 from payment_to_order where order_id = orders.id and state = 0") + .eq(Orders::getFee, payment.getFee()) + .ge(Orders::getOrderTime, DateUtils.addDays(payment.getCtime(),-1)) + .le(Orders::getOrderTime, DateUtils.addDays(payment.getCtime(),3)) + .orderByAsc(Orders::getOrderTime)); + return R.ok().put("data",ordersList); + } + + //手动对账确认 + @RequestMapping("/manualCheckoff") + public R manualCheckoff(@RequestBody PaymentToOrder pto){ + Payment payment = paymentService.getById(pto.getPaymentId()); + payment.setCheckoff(2); + paymentService.updateById(payment); + paymentToOrderService.save(pto); + return R.ok(); + } + + //获取课程消费记录 + @RequestMapping("/courseBuyList") + public R courseBuyList(@RequestBody Map params) { + Payment payment = paymentService.getById(params.get("paymentId").toString()); + Page> page = customerTaihuClassService.pageMaps(new Page<>(Long.parseLong(params.get("page").toString()),Long.parseLong(params.get("limit").toString())), + new MPJLambdaWrapper() + .leftJoin(TCurriculumCatalogue.class,TCurriculumCatalogue::getOid,TCustomerTaihuClass::getTaihuclassoid) + .leftJoin(TCurriculumCatalogue.class,TCurriculumCatalogue::getOid,TCurriculumCatalogue::getPoid) + .select("t.oid,t.customerOid,t.createDate,t.studyDays,t1.courseFee,t1.title courseTitle,t2.title catalogueTitle") + .like(TCustomerTaihuClass::getDescription,"后台免费开通") + .ge(TCustomerTaihuClass::getCreatedate, payment.getCtime()) + .le(TCustomerTaihuClass::getCreatedate, DateUtils.addDays(payment.getCtime(),3)) + .orderByAsc(TCustomerTaihuClass::getCreatedate)); + return R.ok().put("data",page); + } + + //获取实物消费记录 + @RequestMapping("/physicalBuyList") + public R physicalBuyList(@RequestBody Map params) { + Payment payment = paymentService.getById(params.get("paymentId").toString()); + Page> page = commodityService.pageMaps(new Page<>(Long.parseLong(params.get("page").toString()),Long.parseLong(params.get("limit").toString())), + new MPJLambdaWrapper() + .select("t.oid,t.namecn,t.currentprice") + .eq(TCommodity::getStoreoid, "015ed7e15a9b4bcb961a8f9c4666265d") + .eq(TCommodity::getValid, 1) + .gt(TCommodity::getCurrentprice,0) + .orderByAsc(TCommodity::getCurrentprice)); + return R.ok().put("data",page); + } + + //通过添加订单核对 + @RequestMapping("/checkoffByAddOrder") + @DSTransactional + public R checkoffByAddOrder(@RequestBody Map params) { + return R.ok(); + } + + + } diff --git a/src/main/java/com/zmzm/finance/common/dao/BuyOrderMapper.java b/src/main/java/com/zmzm/finance/common/dao/BuyOrderMapper.java new file mode 100644 index 0000000..aa68a85 --- /dev/null +++ b/src/main/java/com/zmzm/finance/common/dao/BuyOrderMapper.java @@ -0,0 +1,20 @@ +package com.zmzm.finance.common.dao; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.zmzm.finance.common.entity.BuyOrder; +import org.apache.ibatis.annotations.Mapper; + +/** + *

+ * 订单表 Mapper 接口 + *

+ * + * @author baomidou + * @since 2025-12-16 + */ +@Mapper +@DS("wumen") +public interface BuyOrderMapper extends BaseMapper { + +} diff --git a/src/main/java/com/zmzm/finance/common/dao/BuyOrderProductMapper.java b/src/main/java/com/zmzm/finance/common/dao/BuyOrderProductMapper.java new file mode 100644 index 0000000..4a0c1b9 --- /dev/null +++ b/src/main/java/com/zmzm/finance/common/dao/BuyOrderProductMapper.java @@ -0,0 +1,20 @@ +package com.zmzm.finance.common.dao; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.zmzm.finance.common.entity.BuyOrderProduct; +import org.apache.ibatis.annotations.Mapper; + +/** + *

+ * Mapper 接口 + *

+ * + * @author baomidou + * @since 2025-12-16 + */ +@Mapper +@DS("wumen") +public interface BuyOrderProductMapper extends BaseMapper { + +} diff --git a/src/main/java/com/zmzm/finance/common/dao/OrdersMapper.java b/src/main/java/com/zmzm/finance/common/dao/OrdersMapper.java new file mode 100644 index 0000000..3d88032 --- /dev/null +++ b/src/main/java/com/zmzm/finance/common/dao/OrdersMapper.java @@ -0,0 +1,18 @@ +package com.zmzm.finance.common.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.zmzm.finance.common.entity.Orders; +import org.apache.ibatis.annotations.Mapper; + +/** + *

+ * 订单表,从我们各个系统读取的数据 Mapper 接口 + *

+ * + * @author baomidou + * @since 2025-12-16 + */ +@Mapper +public interface OrdersMapper extends BaseMapper { + +} diff --git a/src/main/java/com/zmzm/finance/common/dao/PayZfbOrderMapper.java b/src/main/java/com/zmzm/finance/common/dao/PayZfbOrderMapper.java new file mode 100644 index 0000000..653a610 --- /dev/null +++ b/src/main/java/com/zmzm/finance/common/dao/PayZfbOrderMapper.java @@ -0,0 +1,20 @@ +package com.zmzm.finance.common.dao; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.zmzm.finance.common.entity.PayZfbOrder; +import org.apache.ibatis.annotations.Mapper; + +/** + *

+ * 支付宝订单表 Mapper 接口 + *

+ * + * @author baomidou + * @since 2025-12-17 + */ +@Mapper +@DS("wumen") +public interface PayZfbOrderMapper extends BaseMapper { + +} diff --git a/src/main/java/com/zmzm/finance/common/dao/PaymentToOrderMapper.java b/src/main/java/com/zmzm/finance/common/dao/PaymentToOrderMapper.java new file mode 100644 index 0000000..d14d0a0 --- /dev/null +++ b/src/main/java/com/zmzm/finance/common/dao/PaymentToOrderMapper.java @@ -0,0 +1,18 @@ +package com.zmzm.finance.common.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.zmzm.finance.common.entity.PaymentToOrder; +import org.apache.ibatis.annotations.Mapper; + +/** + *

+ * Mapper 接口 + *

+ * + * @author baomidou + * @since 2025-12-16 + */ +@Mapper +public interface PaymentToOrderMapper extends BaseMapper { + +} diff --git a/src/main/java/com/zmzm/finance/common/dao/ShopProductMapper.java b/src/main/java/com/zmzm/finance/common/dao/ShopProductMapper.java new file mode 100644 index 0000000..c916e8e --- /dev/null +++ b/src/main/java/com/zmzm/finance/common/dao/ShopProductMapper.java @@ -0,0 +1,20 @@ +package com.zmzm.finance.common.dao; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.zmzm.finance.common.entity.ShopProduct; +import org.apache.ibatis.annotations.Mapper; + +/** + *

+ * 商品表 Mapper 接口 + *

+ * + * @author baomidou + * @since 2025-12-16 + */ +@Mapper +@DS("wumen") +public interface ShopProductMapper extends BaseMapper { + +} diff --git a/src/main/java/com/zmzm/finance/common/dao/TCommodityMapper.java b/src/main/java/com/zmzm/finance/common/dao/TCommodityMapper.java new file mode 100644 index 0000000..2153a72 --- /dev/null +++ b/src/main/java/com/zmzm/finance/common/dao/TCommodityMapper.java @@ -0,0 +1,20 @@ +package com.zmzm.finance.common.dao; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.zmzm.finance.common.entity.TCommodity; +import org.apache.ibatis.annotations.Mapper; + +/** + *

+ * Mapper 接口 + *

+ * + * @author baomidou + * @since 2025-12-19 + */ +@Mapper +@DS("yljk") +public interface TCommodityMapper extends BaseMapper { + +} diff --git a/src/main/java/com/zmzm/finance/common/dao/TCurriculumCatalogueMapper.java b/src/main/java/com/zmzm/finance/common/dao/TCurriculumCatalogueMapper.java new file mode 100644 index 0000000..2208530 --- /dev/null +++ b/src/main/java/com/zmzm/finance/common/dao/TCurriculumCatalogueMapper.java @@ -0,0 +1,20 @@ +package com.zmzm.finance.common.dao; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.zmzm.finance.common.entity.TCurriculumCatalogue; +import org.apache.ibatis.annotations.Mapper; + +/** + *

+ * Mapper 接口 + *

+ * + * @author baomidou + * @since 2025-12-19 + */ +@Mapper +@DS("yljk") +public interface TCurriculumCatalogueMapper extends BaseMapper { + +} diff --git a/src/main/java/com/zmzm/finance/common/dao/TCustomerTaihuClassMapper.java b/src/main/java/com/zmzm/finance/common/dao/TCustomerTaihuClassMapper.java new file mode 100644 index 0000000..c2c6a04 --- /dev/null +++ b/src/main/java/com/zmzm/finance/common/dao/TCustomerTaihuClassMapper.java @@ -0,0 +1,20 @@ +package com.zmzm.finance.common.dao; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.zmzm.finance.common.entity.TCustomerTaihuClass; +import org.apache.ibatis.annotations.Mapper; + +/** + *

+ * Mapper 接口 + *

+ * + * @author baomidou + * @since 2025-12-19 + */ +@Mapper +@DS("yljk") +public interface TCustomerTaihuClassMapper extends BaseMapper { + +} diff --git a/src/main/java/com/zmzm/finance/common/entity/BuyOrder.java b/src/main/java/com/zmzm/finance/common/entity/BuyOrder.java new file mode 100644 index 0000000..d35fd03 --- /dev/null +++ b/src/main/java/com/zmzm/finance/common/entity/BuyOrder.java @@ -0,0 +1,224 @@ +package com.zmzm.finance.common.entity; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.Date; + +/** + *

+ * 订单表 + *

+ * + * @author baomidou + * @since 2025-12-16 + */ +@Getter +@Setter +@ToString +@TableName("buy_order") +public class BuyOrder implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(value = "order_id", type = IdType.AUTO) + private Integer orderId; + + @TableLogic + private Integer delFlag; + + /** + * 订单编号 yyyymmddnnnnnnnn’ + */ + private String orderSn; + + /** + * 下单人ID + */ + private Integer userId; + + /** + * 收货人姓名 + */ + private String shippingUser; + + /** + * 省 + */ + private String province; + + /** + * 市 + */ + private String city; + + /** + * 区 + */ + private String district; + + /** + * 收货人手机号 + */ + private String userPhone; + + /** + * 地址 + */ + private String address; + + /** + * 订单来源,0疯子读书1国学众妙之门2医学吴门医述3心灵空间4太湖云医 + */ + private Integer come; + + /** + * 支付方式 1微信,2支付宝,3ios内购,4.疯币 + */ + private String paymentMethod; + + /** + * 订单金额 + */ + private BigDecimal orderMoney; + + /** + * 优惠金额 + */ + private BigDecimal districtMoney; + + /** + * vip折扣金额 + */ + private BigDecimal vipDiscountAmount; + + /** + * 实收金额 + */ + private BigDecimal realMoney; + + /** + * 运费 + */ + private BigDecimal shippingMoney; + + /** + * 积分抵扣 + */ + private BigDecimal jfDeduction; + + /** + * 物流公司名称 + */ + private String shippingCompName; + + /** + * 物流单号 + */ + private String shippingSn; + + /** + * 优惠券id + */ + private Integer couponId; + + /** + * 优惠券名称 + */ + private String couponName; + + /** + * 下单时间 + */ + private Date createTime; + + /** + * 发货时间 + */ + private Date shippingTime; + + /** + * 订单状态 0-未付款 1-待发货 2-已发货 3-交易成功 4-交易失败 5-已过期 + */ + private String orderStatus; + + /** + * 交易成功时间 + */ + private LocalDateTime successTime; + + /** + * vip order point relearn trainingClass aiVip upgradeAiVip + */ + private String orderType; + + /** + * 快递单号 + */ + private String expNo; + + /** + * 是否存在发货的商品 0:不存在,1:已存在 + */ + private String isSend; + + /** + * 地址id + */ + private Integer addressId; + + /** + * 备注 + */ + private String remark; + + /** + * 发送给快递鸟的订单编号 + */ + private String orderCode; + + /** + * 支付时间 + */ + private LocalDateTime paymentDate; + + /** + * 冲值配置表book_buy_config id + */ + private String productId; + + /** + * 会员配置表vip_buy_config id + */ + private Integer vipBuyConfigId; + + /** + * ai会员配置表ai_buy_config id + */ + private Integer aiBuyConfigId; + + /** + * 培训班id + */ + private Integer trainingClassId; + + /** + * 评价id,0 未评价,1评价,2追评 + */ + private Integer recordId; + + /** + * 是否修改过地址 + */ + private Integer addressModified; + + @TableField(exist = false) + private String tel; + @TableField(exist = false) + private String goodsType; +} diff --git a/src/main/java/com/zmzm/finance/common/entity/BuyOrderProduct.java b/src/main/java/com/zmzm/finance/common/entity/BuyOrderProduct.java new file mode 100644 index 0000000..564f1b0 --- /dev/null +++ b/src/main/java/com/zmzm/finance/common/entity/BuyOrderProduct.java @@ -0,0 +1,76 @@ +package com.zmzm.finance.common.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + *

+ * + *

+ * + * @author baomidou + * @since 2025-12-16 + */ +@Getter +@Setter +@ToString +@TableName("buy_order_product") +public class BuyOrderProduct implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 ID + */ + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 订单号 + */ + private Integer orderId; + + /** + * 商品 ID + */ + private Integer productId; + + /** + * 数量 + */ + private Integer quantity; + + /** + * 实际价格 + */ + private BigDecimal realPrice; + + /** + * 删除标识 + */ + @TableLogic + private Integer delFlag; + + /** + * 快递单号 + */ + private Integer expressOrderId; + + /** + * 评价 ID + */ + private Integer recordId; + + /** + * 是否已发货0否1是 + */ + private Integer shipped; +} diff --git a/src/main/java/com/zmzm/finance/common/entity/Import.java b/src/main/java/com/zmzm/finance/common/entity/Import.java index 8eea9cf..be5a807 100644 --- a/src/main/java/com/zmzm/finance/common/entity/Import.java +++ b/src/main/java/com/zmzm/finance/common/entity/Import.java @@ -56,5 +56,5 @@ public class Import implements Serializable { * 状态 */ @TableLogic - private Byte state; + private Integer state; } diff --git a/src/main/java/com/zmzm/finance/common/entity/Orders.java b/src/main/java/com/zmzm/finance/common/entity/Orders.java new file mode 100644 index 0000000..09ea8a1 --- /dev/null +++ b/src/main/java/com/zmzm/finance/common/entity/Orders.java @@ -0,0 +1,73 @@ +package com.zmzm.finance.common.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableLogic; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.Date; + +/** + *

+ * 订单表,从我们各个系统读取的数据 + *

+ * + * @author baomidou + * @since 2025-12-16 + */ +@Getter +@Setter +@ToString +public class Orders implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 0一路健康1吴门医述2手动添加 + */ + private Integer source; + + /** + * 原系统的订单号 + */ + private String orderSn; + + /** + * 原系统数据库表的主键id + */ + private String orderOldId; + + /** + * 电话 + */ + private String tel; + + /** + * 金额 + */ + private BigDecimal fee; + + /** + * 订单类型:0充值1vip2课3实物4培训班 + */ + private Integer type; + + /** + * 订单时间 + */ + private Date orderTime; + + /** + * 状态0初始1删除 + */ + @TableLogic + private Integer state; +} diff --git a/src/main/java/com/zmzm/finance/common/entity/PayZfbOrder.java b/src/main/java/com/zmzm/finance/common/entity/PayZfbOrder.java new file mode 100644 index 0000000..b711c47 --- /dev/null +++ b/src/main/java/com/zmzm/finance/common/entity/PayZfbOrder.java @@ -0,0 +1,97 @@ +package com.zmzm.finance.common.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + *

+ * 支付宝订单表 + *

+ * + * @author baomidou + * @since 2025-12-17 + */ +@Getter +@Setter +@ToString +@TableName("pay_zfb_order") +public class PayZfbOrder implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private String customerId; + + private String outTradeNo; + + private String tradeNo; + + private LocalDateTime notifyTime; + + private String notifyType; + + private String notifyId; + + private String appId; + + private String authAppId; + + private String charset; + + private String version; + + private String signType; + + private String sign; + + private String outBizNo; + + private String buyerId; + + private String buyerLogonId; + + private String sellerId; + + private String sellerEmail; + + private String tradeStatus; + + private String totalAmount; + + private String receiptAmount; + + private String invoiceAmount; + + private String buyerPayAmount; + + private String pointAmount; + + private String refundFee; + + private String subject; + + private String body; + + private LocalDateTime gmtCreate; + + private LocalDateTime gmtPayment; + + private LocalDateTime gmtRefund; + + private LocalDateTime gmtClose; + + private String fundBillList; + + private String voucherDetailList; + + private String relevanceoid; +} diff --git a/src/main/java/com/zmzm/finance/common/entity/Payment.java b/src/main/java/com/zmzm/finance/common/entity/Payment.java index 06ad82a..6393f41 100644 --- a/src/main/java/com/zmzm/finance/common/entity/Payment.java +++ b/src/main/java/com/zmzm/finance/common/entity/Payment.java @@ -1,6 +1,7 @@ package com.zmzm.finance.common.entity; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableLogic; import lombok.Getter; @@ -78,9 +79,21 @@ public class Payment implements Serializable { */ private Date ctime; + /** + * 核对状态 0未核对 1自动核对失败 2已核对 + */ + private Integer checkoff; + /** * 状态0初始1删除 */ @TableLogic private Integer state; + + @TableField(exist=false) + private Orders orders; + @TableField(exist=false) + private Integer ordersId; + @TableField(exist=false) + private String ordersSn; } diff --git a/src/main/java/com/zmzm/finance/common/entity/PaymentToOrder.java b/src/main/java/com/zmzm/finance/common/entity/PaymentToOrder.java new file mode 100644 index 0000000..4b5087e --- /dev/null +++ b/src/main/java/com/zmzm/finance/common/entity/PaymentToOrder.java @@ -0,0 +1,47 @@ +package com.zmzm.finance.common.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; + +import java.io.Serializable; + +/** + *

+ * + *

+ * + * @author baomidou + * @since 2025-12-16 + */ +@Getter +@Setter +@ToString +@TableName("payment_to_order") +public class PaymentToOrder implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 支付表外键 + */ + private Integer paymentId; + + /** + * 订单表外键 + */ + private Integer orderId; + + /** + * 状态0初始1删除 + */ + @TableLogic + private Integer state; +} diff --git a/src/main/java/com/zmzm/finance/common/entity/ShopProduct.java b/src/main/java/com/zmzm/finance/common/entity/ShopProduct.java new file mode 100644 index 0000000..ba23b82 --- /dev/null +++ b/src/main/java/com/zmzm/finance/common/entity/ShopProduct.java @@ -0,0 +1,181 @@ +package com.zmzm.finance.common.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + *

+ * 商品表 + *

+ * + * @author baomidou + * @since 2025-12-16 + */ +@Getter +@Setter +@ToString +@TableName("shop_product") +public class ShopProduct implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(value = "product_id", type = IdType.AUTO) + private Integer productId; + + /** + * 商品名称 + */ + private String productName; + + /** + * 商品价格 + */ + private BigDecimal price; + + /** + * 商品重量 + */ + private Double weight; + + /** + * 上架状态 + */ + private Integer publishStatus; + + /** + * 商品介绍 + */ + private String productDetails; + + /** + * 商品分类id + */ + private Integer productPid; + + /** + * 商品 类型 0 - 预售 1 - 在售 + */ + private String productType; + + /** + * 商品库存 + */ + private Integer productStock; + + /** + * 商品图首页 + */ + private String productImages; + + /** + * 商品 多图 + */ + private String productImageList; + + /** + * 商品销量 + */ + private String productSalesVolume; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 更新时间 + */ + private LocalDateTime updateTime; + + /** + * 删除标记 + */ + @TableLogic + private Integer delFlag; + + /** + * 排序 + */ + private Integer sort; + + /** + * 作者 + */ + private String author; + + /** + * 出版方 + */ + private String publisher; + + /** + * 出版时间 + */ + private String pubDate; + + /** + * 开本 + */ + private String format; + + /** + * 页数 + */ + private Integer pageNum; + + /** + * 内文用纸材质 + */ + private String quality; + + /** + * 总销量 + */ + private Integer sumSales; + + /** + * 商品类型01挂图02书籍03预售书04仪器05课程06小店商品 + */ + private String goodsType; + + /** + * 商品类型 + */ + private String goodsTypeCode; + + /** + * 是否新书上市0:否1:是 + */ + private Integer isNew; + + /** + * 活动价 + */ + private Long activityPrice; + + /** + * 是否有vip折扣0无1是 + */ + private Integer isVipPrice; + + /** + * 是否包邮 0:包邮 ,1:不包邮 + */ + private Integer isFreeMail; + + /** + * 关联book表id + */ + private String bookIds; + + private String bookidsimages; +} diff --git a/src/main/java/com/zmzm/finance/common/entity/TCommodity.java b/src/main/java/com/zmzm/finance/common/entity/TCommodity.java new file mode 100644 index 0000000..ccf0943 --- /dev/null +++ b/src/main/java/com/zmzm/finance/common/entity/TCommodity.java @@ -0,0 +1,108 @@ +package com.zmzm.finance.common.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.Date; + +/** + *

+ * + *

+ * + * @author baomidou + * @since 2025-12-19 + */ +@Getter +@Setter +@ToString +@TableName("t_commodity") +public class TCommodity implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId("oid") + private String oid; + + private String description; + + private Date invaliddate; + + private Boolean valid; + + private Integer version; + + private Date createdate; + + private Double currentprice; + + private String explains; + + private String namecn; + + private Integer orderno; + + private Double originalprice; + + private String picurl; + + private String saleflg; + + private String type; + + private String units; + + private String rollimgs; + + private String detailimgs; + + private Integer quantity; + + private BigDecimal freight; + + private String storeoid; + + private String images; + + private String hotsaleflg; + + private String classify; + + private String choicenessflg; + + private String seckillinfo; + + private String groupbuyingflg; + + private Double currentpricevip; + + private Double originalpricevip; + + private Integer backcoupon; + + private Integer backcouponvip; + + private String paymenttype; + + private String auditflg; + + private Integer salesnum; + + private String curriculumoid; + + /** + * 重量 单位kg + */ + private Double weight; + + /** + * 预售标记 + */ + private String presellflg; +} diff --git a/src/main/java/com/zmzm/finance/common/entity/TCurriculumCatalogue.java b/src/main/java/com/zmzm/finance/common/entity/TCurriculumCatalogue.java new file mode 100644 index 0000000..f199ea5 --- /dev/null +++ b/src/main/java/com/zmzm/finance/common/entity/TCurriculumCatalogue.java @@ -0,0 +1,128 @@ +package com.zmzm.finance.common.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.Date; + +/** + *

+ * + *

+ * + * @author baomidou + * @since 2025-12-19 + */ +@Getter +@Setter +@ToString +@TableName("t_curriculum_catalogue") +public class TCurriculumCatalogue implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId("oid") + private String oid; + + private String description; + + private Date invalidDate; + + private Boolean valid; + + private Integer version; + + private Date createDate; + + private Date updateDate; + + private String title; + + private String type; + + private String conditions; + + private Integer payPointByVIP; + + private Integer payPointByCommon; + + private String explainsImg; + + private String introduceTxt; + + private String voices; + + private String videos; + + private Integer classNo; + + private String releaseFlg; + + private String curriculumFlg; + + private Integer orderNo; + + private String poid; + + private String examFlg; + + /** + * 01必修;03选修 + */ + private String bxType; + + private String freeVoices; + + private String freeVideos; + + private String hotImg; + + private Integer hotLevel; + + private String adImg; + + private String newFlg; + + private String workGradeUser; + + private String jcOid; + + private String xdOid; + + private String gxyType; + + private String courseFee; + + private String yjsyType; + + private String classify; + + private String elevatedOid; + + private String correlatedOids; + + private String bindingOids; + + private String tags; + + /** + * 0:基础1:提高 + */ + private Integer imType; + + private String thumbnail; + + private String testFlg; + + private String coursefeeOld; + + /** + * 是否加精 + */ + private String choicenessType; +} diff --git a/src/main/java/com/zmzm/finance/common/entity/TCustomerTaihuClass.java b/src/main/java/com/zmzm/finance/common/entity/TCustomerTaihuClass.java new file mode 100644 index 0000000..ea53c34 --- /dev/null +++ b/src/main/java/com/zmzm/finance/common/entity/TCustomerTaihuClass.java @@ -0,0 +1,67 @@ +package com.zmzm.finance.common.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.Date; + +/** + *

+ * + *

+ * + * @author baomidou + * @since 2025-12-19 + */ +@Getter +@Setter +@ToString +@TableName("t_customer_taihu_class") +public class TCustomerTaihuClass implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId("oid") + private String oid; + + private String description; + + private Date invaliddate; + + private Boolean valid; + + private Integer version; + + private Date createdate; + + private String taihuclassoid; + + private String classno; + + private String studentno; + + private String status; + + private String customeroid; + + private String useroid; + + /** + * 当用户课程学完(所有课程都点击看过)时,更新为1 + */ + private String finishflg; + + /** + * 开始学习日期 + */ + private Date startdate; + + private Integer relearnnum; + + private Integer studydays; +} diff --git a/src/main/java/com/zmzm/finance/common/entity/User.java b/src/main/java/com/zmzm/finance/common/entity/User.java index f409f25..0625210 100644 --- a/src/main/java/com/zmzm/finance/common/entity/User.java +++ b/src/main/java/com/zmzm/finance/common/entity/User.java @@ -49,7 +49,7 @@ public class User implements Serializable { /** * 0管理员1财务 */ - private Byte role; + private Integer role; /** * 最后登录时间 @@ -60,5 +60,5 @@ public class User implements Serializable { * 状态0初始1删除 */ @TableLogic - private Byte state; + private Integer state; } diff --git a/src/main/java/com/zmzm/finance/common/service/IBuyOrderService.java b/src/main/java/com/zmzm/finance/common/service/IBuyOrderService.java new file mode 100644 index 0000000..c5b4003 --- /dev/null +++ b/src/main/java/com/zmzm/finance/common/service/IBuyOrderService.java @@ -0,0 +1,16 @@ +package com.zmzm.finance.common.service; + +import com.zmzm.finance.common.entity.BuyOrder; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 订单表 服务类 + *

+ * + * @author baomidou + * @since 2025-12-16 + */ +public interface IBuyOrderService extends IService { + +} diff --git a/src/main/java/com/zmzm/finance/common/service/IOrdersService.java b/src/main/java/com/zmzm/finance/common/service/IOrdersService.java new file mode 100644 index 0000000..892f324 --- /dev/null +++ b/src/main/java/com/zmzm/finance/common/service/IOrdersService.java @@ -0,0 +1,18 @@ +package com.zmzm.finance.common.service; + +import com.zmzm.finance.common.entity.Orders; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 订单表,从我们各个系统读取的数据 服务类 + *

+ * + * @author baomidou + * @since 2025-12-16 + */ +public interface IOrdersService extends IService { + + void importWumenOrder(); + +} diff --git a/src/main/java/com/zmzm/finance/common/service/IPaymentToOrderService.java b/src/main/java/com/zmzm/finance/common/service/IPaymentToOrderService.java new file mode 100644 index 0000000..2cc91bb --- /dev/null +++ b/src/main/java/com/zmzm/finance/common/service/IPaymentToOrderService.java @@ -0,0 +1,16 @@ +package com.zmzm.finance.common.service; + +import com.zmzm.finance.common.entity.PaymentToOrder; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 服务类 + *

+ * + * @author baomidou + * @since 2025-12-16 + */ +public interface IPaymentToOrderService extends IService { + +} diff --git a/src/main/java/com/zmzm/finance/common/service/ITCommodityService.java b/src/main/java/com/zmzm/finance/common/service/ITCommodityService.java new file mode 100644 index 0000000..804255f --- /dev/null +++ b/src/main/java/com/zmzm/finance/common/service/ITCommodityService.java @@ -0,0 +1,16 @@ +package com.zmzm.finance.common.service; + +import com.zmzm.finance.common.entity.TCommodity; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 服务类 + *

+ * + * @author baomidou + * @since 2025-12-19 + */ +public interface ITCommodityService extends IService { + +} diff --git a/src/main/java/com/zmzm/finance/common/service/ITCurriculumCatalogueService.java b/src/main/java/com/zmzm/finance/common/service/ITCurriculumCatalogueService.java new file mode 100644 index 0000000..5295946 --- /dev/null +++ b/src/main/java/com/zmzm/finance/common/service/ITCurriculumCatalogueService.java @@ -0,0 +1,16 @@ +package com.zmzm.finance.common.service; + +import com.zmzm.finance.common.entity.TCurriculumCatalogue; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 服务类 + *

+ * + * @author baomidou + * @since 2025-12-19 + */ +public interface ITCurriculumCatalogueService extends IService { + +} diff --git a/src/main/java/com/zmzm/finance/common/service/ITCustomerTaihuClassService.java b/src/main/java/com/zmzm/finance/common/service/ITCustomerTaihuClassService.java new file mode 100644 index 0000000..3f9a43d --- /dev/null +++ b/src/main/java/com/zmzm/finance/common/service/ITCustomerTaihuClassService.java @@ -0,0 +1,16 @@ +package com.zmzm.finance.common.service; + +import com.zmzm.finance.common.entity.TCustomerTaihuClass; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 服务类 + *

+ * + * @author baomidou + * @since 2025-12-19 + */ +public interface ITCustomerTaihuClassService extends IService { + +} diff --git a/src/main/java/com/zmzm/finance/common/service/impl/BuyOrderServiceImpl.java b/src/main/java/com/zmzm/finance/common/service/impl/BuyOrderServiceImpl.java new file mode 100644 index 0000000..8263752 --- /dev/null +++ b/src/main/java/com/zmzm/finance/common/service/impl/BuyOrderServiceImpl.java @@ -0,0 +1,20 @@ +package com.zmzm.finance.common.service.impl; + +import com.zmzm.finance.common.entity.BuyOrder; +import com.zmzm.finance.common.dao.BuyOrderMapper; +import com.zmzm.finance.common.service.IBuyOrderService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 订单表 服务实现类 + *

+ * + * @author baomidou + * @since 2025-12-16 + */ +@Service +public class BuyOrderServiceImpl extends ServiceImpl implements IBuyOrderService { + +} diff --git a/src/main/java/com/zmzm/finance/common/service/impl/OrdersServiceImpl.java b/src/main/java/com/zmzm/finance/common/service/impl/OrdersServiceImpl.java new file mode 100644 index 0000000..e0177b1 --- /dev/null +++ b/src/main/java/com/zmzm/finance/common/service/impl/OrdersServiceImpl.java @@ -0,0 +1,87 @@ +package com.zmzm.finance.common.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import com.zmzm.finance.common.dao.BuyOrderMapper; +import com.zmzm.finance.common.entity.*; +import com.zmzm.finance.common.dao.OrdersMapper; +import com.zmzm.finance.common.service.IOrdersService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + *

+ * 订单表,从我们各个系统读取的数据 服务实现类 + *

+ * + * @author baomidou + * @since 2025-12-16 + */ +@Service +public class OrdersServiceImpl extends ServiceImpl implements IOrdersService { + + @Autowired + private BuyOrderMapper buyOrderMapper; + + @Override + public void importWumenOrder() { + String oldBuyOrderId = "0"; + Orders orders = this.baseMapper.selectOne(new LambdaQueryWrapper() + .eq(Orders::getSource,1) + .orderByDesc(Orders::getId).last("limit 1")); + if(orders!=null){ + oldBuyOrderId = orders.getOrderOldId(); + } + List bos = buyOrderMapper.selectList(new MPJLambdaWrapper() + .disableLogicDel() + .leftJoin(WumenUser.class,WumenUser::getId,BuyOrder::getUserId) + .leftJoin(BuyOrderProduct.class,BuyOrderProduct::getOrderId,BuyOrder::getOrderId) + .leftJoin(ShopProduct.class,ShopProduct::getProductId,BuyOrderProduct::getProductId) + //支付宝需要单独查询关联号,老数据有问题 + .leftJoin(PayZfbOrder.class,PayZfbOrder::getRelevanceoid,BuyOrder::getOrderSn) + .disableSubLogicDel() + .groupBy(BuyOrder::getOrderId) + .selectAll(BuyOrder.class) + .select("if(t1.tel=''||t1.tel is null,t1.email,t1.tel) as tel") + .select("if(t4.trade_no is null,t.order_sn,t4.out_trade_no) as orderSn") + .selectAs(ShopProduct::getGoodsType,"goodsType") + .notIn(BuyOrder::getOrderStatus,0,5) + .gt(BuyOrder::getOrderId,oldBuyOrderId)); + List os = new ArrayList<>(); + for (BuyOrder bo : bos) { + Orders o = new Orders(); + o.setSource(1); + o.setOrderSn(bo.getOrderSn()); + o.setOrderOldId(bo.getOrderId()+""); + o.setTel(bo.getTel()); + o.setFee(bo.getRealMoney()); + if ("point".equals(bo.getOrderType())){ + o.setType(0); + } + if ("vip".equals(bo.getOrderType())){ + o.setType(1); + } + if ("relearn".equals(bo.getOrderType())){ + o.setType(2); + } + if ("order".equals(bo.getOrderType())){ + if ("05".equals(bo.getGoodsType())){ + o.setType(2); + }else{ + o.setType(3); + } + } + if ("trainingClass".equals(bo.getOrderType())){ + o.setType(4); + } + o.setOrderTime(bo.getCreateTime()); + os.add(o); + } + this.baseMapper.insert(os); + } + +} diff --git a/src/main/java/com/zmzm/finance/common/service/impl/PaymentToOrderServiceImpl.java b/src/main/java/com/zmzm/finance/common/service/impl/PaymentToOrderServiceImpl.java new file mode 100644 index 0000000..ba46647 --- /dev/null +++ b/src/main/java/com/zmzm/finance/common/service/impl/PaymentToOrderServiceImpl.java @@ -0,0 +1,20 @@ +package com.zmzm.finance.common.service.impl; + +import com.zmzm.finance.common.entity.PaymentToOrder; +import com.zmzm.finance.common.dao.PaymentToOrderMapper; +import com.zmzm.finance.common.service.IPaymentToOrderService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 服务实现类 + *

+ * + * @author baomidou + * @since 2025-12-16 + */ +@Service +public class PaymentToOrderServiceImpl extends ServiceImpl implements IPaymentToOrderService { + +} diff --git a/src/main/java/com/zmzm/finance/common/service/impl/TCommodityServiceImpl.java b/src/main/java/com/zmzm/finance/common/service/impl/TCommodityServiceImpl.java new file mode 100644 index 0000000..f22a8a4 --- /dev/null +++ b/src/main/java/com/zmzm/finance/common/service/impl/TCommodityServiceImpl.java @@ -0,0 +1,20 @@ +package com.zmzm.finance.common.service.impl; + +import com.zmzm.finance.common.entity.TCommodity; +import com.zmzm.finance.common.dao.TCommodityMapper; +import com.zmzm.finance.common.service.ITCommodityService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 服务实现类 + *

+ * + * @author baomidou + * @since 2025-12-19 + */ +@Service +public class TCommodityServiceImpl extends ServiceImpl implements ITCommodityService { + +} diff --git a/src/main/java/com/zmzm/finance/common/service/impl/TCurriculumCatalogueServiceImpl.java b/src/main/java/com/zmzm/finance/common/service/impl/TCurriculumCatalogueServiceImpl.java new file mode 100644 index 0000000..eda09c8 --- /dev/null +++ b/src/main/java/com/zmzm/finance/common/service/impl/TCurriculumCatalogueServiceImpl.java @@ -0,0 +1,20 @@ +package com.zmzm.finance.common.service.impl; + +import com.zmzm.finance.common.entity.TCurriculumCatalogue; +import com.zmzm.finance.common.dao.TCurriculumCatalogueMapper; +import com.zmzm.finance.common.service.ITCurriculumCatalogueService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 服务实现类 + *

+ * + * @author baomidou + * @since 2025-12-19 + */ +@Service +public class TCurriculumCatalogueServiceImpl extends ServiceImpl implements ITCurriculumCatalogueService { + +} diff --git a/src/main/java/com/zmzm/finance/common/service/impl/TCustomerTaihuClassServiceImpl.java b/src/main/java/com/zmzm/finance/common/service/impl/TCustomerTaihuClassServiceImpl.java new file mode 100644 index 0000000..33392c8 --- /dev/null +++ b/src/main/java/com/zmzm/finance/common/service/impl/TCustomerTaihuClassServiceImpl.java @@ -0,0 +1,20 @@ +package com.zmzm.finance.common.service.impl; + +import com.zmzm.finance.common.entity.TCustomerTaihuClass; +import com.zmzm.finance.common.dao.TCustomerTaihuClassMapper; +import com.zmzm.finance.common.service.ITCustomerTaihuClassService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 服务实现类 + *

+ * + * @author baomidou + * @since 2025-12-19 + */ +@Service +public class TCustomerTaihuClassServiceImpl extends ServiceImpl implements ITCustomerTaihuClassService { + +} diff --git a/src/main/java/com/zmzm/finance/util/DataUtil.java b/src/main/java/com/zmzm/finance/util/DataUtil.java new file mode 100644 index 0000000..a814a09 --- /dev/null +++ b/src/main/java/com/zmzm/finance/util/DataUtil.java @@ -0,0 +1,168 @@ +package com.zmzm.finance.util; + +import java.math.BigDecimal; +import java.sql.*; + +public class DataUtil { + + public static void main(String[] args){ +// insertOrder(); +// goods(); +// course(); +// mtRegister(); + } + public static void mtRegister(){ + try { + Connection yljkConn = DriverManager.getConnection( + "jdbc:mysql://goldorchid.mysql.rds.aliyuncs.com:3309/everhealth?", + "yljkmaster", "Wu751019!@"); + Connection financeConn = DriverManager.getConnection( + "jdbc:mysql://rm-2zev4157t67trxuu3yo.mysql.rds.aliyuncs.com:3306/finance?rewriteBatchedStatements=true", + "nuttyreading", "Wu751019!"); + PreparedStatement transactionDetailStatement = financeConn.prepareStatement( + "INSERT ignore INTO orders (source,order_sn,order_old_id,tel,fee,type,order_time) VALUES (?, ?, ?, ?, ?, ?, ?)"); + PreparedStatement statement = yljkConn.prepareStatement("select m.*,IF(m.point>0,m.point,m.money) fee,c.cellPhone " + + "from t_customer_apply_mtregister m " + + "left join t_customer c on c.oid = m.customerOid " + + "where m.valid = 1 and m.status = 50 "); + ResultSet resultSet = statement.executeQuery(); + int i=0; + while(resultSet.next()){ + i++; + transactionDetailStatement.setInt(1,0); + transactionDetailStatement.setString(2,resultSet.getString("mtRegisterID")); + transactionDetailStatement.setString(3,resultSet.getString("oid")); + transactionDetailStatement.setString(4,resultSet.getString("cellPhone")); + transactionDetailStatement.setBigDecimal(5,resultSet.getBigDecimal("fee")); + transactionDetailStatement.setInt(6,4); + transactionDetailStatement.setTimestamp(7,resultSet.getTimestamp("createDate")); + transactionDetailStatement.addBatch(); + if(i%3000==0){ + System.out.println("----"+i+"完成"); + transactionDetailStatement.executeBatch(); + } + } + transactionDetailStatement.executeBatch(); + yljkConn.close(); + financeConn.close(); + } catch (SQLException e) { + System.out.println("Error: " + e.getMessage()); + } + } + public static void course(){ + try { + Connection yljkConn = DriverManager.getConnection( + "jdbc:mysql://goldorchid.mysql.rds.aliyuncs.com:3309/everhealth?", + "yljkmaster", "Wu751019!@"); + Connection financeConn = DriverManager.getConnection( + "jdbc:mysql://rm-2zev4157t67trxuu3yo.mysql.rds.aliyuncs.com:3306/finance?rewriteBatchedStatements=true", + "nuttyreading", "Wu751019!"); + PreparedStatement transactionDetailStatement = financeConn.prepareStatement( + "INSERT ignore INTO orders (source,order_sn,order_old_id,tel,fee,type,order_time) VALUES (?, ?, ?, ?, ?, ?, ?)"); + PreparedStatement statement = yljkConn.prepareStatement("select ac.* ,IF(ac.point>0,ac.point,ac.money) fee,c.cellPhone " + + "from t_customer_apply_curriculum ac " + + "left join t_customer c on c.oid = ac.customerOid " + + "where ac.valid = 1 and ac.status = 50 and payMode != 999999999 "); + ResultSet resultSet = statement.executeQuery(); + int i=0; + while(resultSet.next()){ + i++; + transactionDetailStatement.setInt(1,0); + transactionDetailStatement.setString(2,resultSet.getString("curriculumID")); + transactionDetailStatement.setString(3,resultSet.getString("oid")); + transactionDetailStatement.setString(4,resultSet.getString("cellPhone")); + transactionDetailStatement.setBigDecimal(5,resultSet.getBigDecimal("fee")); + transactionDetailStatement.setInt(6,2); + transactionDetailStatement.setTimestamp(7,resultSet.getTimestamp("createDate")); + transactionDetailStatement.addBatch(); + if(i%3000==0){ + System.out.println("----"+i+"完成"); + transactionDetailStatement.executeBatch(); + } + } + transactionDetailStatement.executeBatch(); + yljkConn.close(); + financeConn.close(); + } catch (SQLException e) { + System.out.println("Error: " + e.getMessage()); + } + } + public static void goods(){ + try { + Connection yljkConn = DriverManager.getConnection( + "jdbc:mysql://goldorchid.mysql.rds.aliyuncs.com:3309/everhealth?", + "yljkmaster", "Wu751019!@"); + Connection financeConn = DriverManager.getConnection( + "jdbc:mysql://rm-2zev4157t67trxuu3yo.mysql.rds.aliyuncs.com:3306/finance?rewriteBatchedStatements=true", + "nuttyreading", "Wu751019!"); + PreparedStatement transactionDetailStatement = financeConn.prepareStatement( + "INSERT ignore INTO orders (source,order_sn,order_old_id,tel,fee,type,order_time) VALUES (?, ?, ?, ?, ?, ?, ?)"); + PreparedStatement statement = yljkConn.prepareStatement("select co.*,IF(co.point>0,co.point,co.money) fee,c.cellPhone " + + "from t_customer_commodity_order co " + + "left join t_customer c on c.oid = co.customerOid " + + "where co.valid = 1 and co.status in (20,50) "); + ResultSet resultSet = statement.executeQuery(); + int i=0; + while(resultSet.next()){ + i++; + transactionDetailStatement.setInt(1,0); + transactionDetailStatement.setString(2,resultSet.getString("orderID")); + transactionDetailStatement.setString(3,resultSet.getString("oid")); + transactionDetailStatement.setString(4,resultSet.getString("cellPhone")); + transactionDetailStatement.setBigDecimal(5,resultSet.getBigDecimal("fee")); + transactionDetailStatement.setInt(6,3); + transactionDetailStatement.setTimestamp(7,resultSet.getTimestamp("createDate")); + transactionDetailStatement.addBatch(); + if(i%3000==0){ + System.out.println("----"+i+"完成"); + transactionDetailStatement.executeBatch(); + } + } + transactionDetailStatement.executeBatch(); + yljkConn.close(); + financeConn.close(); + } catch (SQLException e) { + System.out.println("Error: " + e.getMessage()); + } + } + public static void insertOrder(){ + try { + Connection yljkConn = DriverManager.getConnection( + "jdbc:mysql://goldorchid.mysql.rds.aliyuncs.com:3309/everhealth?", + "yljkmaster", "Wu751019!@"); + Connection financeConn = DriverManager.getConnection( + "jdbc:mysql://rm-2zev4157t67trxuu3yo.mysql.rds.aliyuncs.com:3306/finance?rewriteBatchedStatements=true", + "nuttyreading", "Wu751019!"); + PreparedStatement transactionDetailStatement = financeConn.prepareStatement( + "INSERT ignore INTO orders (source,order_sn,order_old_id,tel,fee,type,order_time) VALUES (?, ?, ?, ?, ?, ?, ?)"); + PreparedStatement statement = yljkConn.prepareStatement("select ab.*,c.cellPhone " + + "from t_customer_apply_buy ab " + + "left join t_customer c on c.oid = ab.customerOid " + + "where ab.valid = 1 and ab.status = 50 and ab.payMode in ('1','5','01','05') and ab.money>0 "); + ResultSet resultSet = statement.executeQuery(); + int i=0; + while(resultSet.next()){ + i++; + transactionDetailStatement.setInt(1,0); + transactionDetailStatement.setString(2,resultSet.getString("buyID")); + transactionDetailStatement.setString(3,resultSet.getString("oid")); + transactionDetailStatement.setString(4,resultSet.getString("cellPhone")); + transactionDetailStatement.setBigDecimal(5,resultSet.getBigDecimal("money")); + transactionDetailStatement.setInt(6,0); + transactionDetailStatement.setTimestamp(7,resultSet.getTimestamp("createDate")); + transactionDetailStatement.addBatch(); + if(i%3000==0){ + System.out.println("----"+i+"完成"); + transactionDetailStatement.executeBatch(); + } + } + transactionDetailStatement.executeBatch(); + yljkConn.close(); + financeConn.close(); + } catch (SQLException e) { + System.out.println("Error: " + e.getMessage()); + } + } + + +} diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 004ff0f..e56ad7f 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -44,7 +44,7 @@ spring: password: Wu751019! wumen: #吴门医述数据库 driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://rm-2zev4157t67trxuu3yo.mysql.rds.aliyuncs.com:3306/e_book_test?rewriteBatchedStatements=true + url: jdbc:mysql://rm-2zev4157t67trxuu3yo.mysql.rds.aliyuncs.com:3306/e_book?rewriteBatchedStatements=true username: nuttyreading password: Wu751019! yljk: #一路健康数据库