diff --git a/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/car/controller/AppCarTreeController.java b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/car/controller/AppCarTreeController.java similarity index 92% rename from jeecg-module-demo/src/main/java/org/jeecg/modules/demo/car/controller/AppCarTreeController.java rename to jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/car/controller/AppCarTreeController.java index 1cc1d02..bda1477 100644 --- a/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/car/controller/AppCarTreeController.java +++ b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/car/controller/AppCarTreeController.java @@ -1,38 +1,25 @@ -package org.jeecg.modules.demo.car.controller; +package org.jeecg.modules.sysMiniapp.car.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.common.system.vo.SelectTreeModel; -import org.jeecg.modules.demo.car.entity.AppCarTree; -import org.jeecg.modules.demo.car.service.IAppCarTreeService; +import org.jeecg.modules.sysMiniapp.car.entity.AppCarTree; +import org.jeecg.modules.sysMiniapp.car.service.IAppCarTreeService; 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; @@ -192,7 +179,7 @@ public class AppCarTreeController extends JeecgController - + update app_car_tree set has_child = #{status} where id = #{id} @@ -22,4 +22,4 @@ - \ No newline at end of file + diff --git a/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/car/service/IAppCarTreeService.java b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/car/service/IAppCarTreeService.java similarity index 93% rename from jeecg-module-demo/src/main/java/org/jeecg/modules/demo/car/service/IAppCarTreeService.java rename to jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/car/service/IAppCarTreeService.java index 125438f..4c6fe42 100644 --- a/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/car/service/IAppCarTreeService.java +++ b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/car/service/IAppCarTreeService.java @@ -1,7 +1,7 @@ -package org.jeecg.modules.demo.car.service; +package org.jeecg.modules.sysMiniapp.car.service; import org.jeecg.common.system.vo.SelectTreeModel; -import org.jeecg.modules.demo.car.entity.AppCarTree; +import org.jeecg.modules.sysMiniapp.car.entity.AppCarTree; import com.baomidou.mybatisplus.extension.service.IService; import org.jeecg.common.exception.JeecgBootException; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; @@ -17,10 +17,10 @@ public interface IAppCarTreeService extends IService { /**根节点父ID的值*/ public static final String ROOT_PID_VALUE = "0"; - + /**树节点有子节点状态值*/ public static final String HASCHILD = "1"; - + /**树节点无子节点状态值*/ public static final String NOCHILD = "0"; @@ -30,7 +30,7 @@ public interface IAppCarTreeService extends IService { * @param appCarTree */ void addAppCarTree(AppCarTree appCarTree); - + /** * 修改节点 * @@ -38,7 +38,7 @@ public interface IAppCarTreeService extends IService { * @throws JeecgBootException */ void updateAppCarTree(AppCarTree appCarTree) throws JeecgBootException; - + /** * 删除节点 * diff --git a/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/car/service/impl/AppCarTreeServiceImpl.java b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/car/service/impl/AppCarTreeServiceImpl.java similarity index 96% rename from jeecg-module-demo/src/main/java/org/jeecg/modules/demo/car/service/impl/AppCarTreeServiceImpl.java rename to jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/car/service/impl/AppCarTreeServiceImpl.java index a604695..282d232 100644 --- a/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/car/service/impl/AppCarTreeServiceImpl.java +++ b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/car/service/impl/AppCarTreeServiceImpl.java @@ -1,12 +1,12 @@ -package org.jeecg.modules.demo.car.service.impl; +package org.jeecg.modules.sysMiniapp.car.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import org.jeecg.common.exception.JeecgBootException; import org.jeecg.common.util.oConvertUtils; import org.jeecg.common.system.vo.SelectTreeModel; -import org.jeecg.modules.demo.car.entity.AppCarTree; -import org.jeecg.modules.demo.car.mapper.AppCarTreeMapper; -import org.jeecg.modules.demo.car.service.IAppCarTreeService; +import org.jeecg.modules.sysMiniapp.car.entity.AppCarTree; +import org.jeecg.modules.sysMiniapp.car.mapper.AppCarTreeMapper; +import org.jeecg.modules.sysMiniapp.car.service.IAppCarTreeService; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import org.springframework.transaction.annotation.Transactional; @@ -41,7 +41,7 @@ public class AppCarTreeServiceImpl extends ServiceImpl queryTreeListNoPage(QueryWrapper queryWrapper) { List dataList = baseMapper.selectList(queryWrapper); diff --git a/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/car/vue3/AppCarTree.api.ts b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/car/vue3/AppCarTree.api.ts similarity index 100% rename from jeecg-module-demo/src/main/java/org/jeecg/modules/demo/car/vue3/AppCarTree.api.ts rename to jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/car/vue3/AppCarTree.api.ts diff --git a/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/car/vue3/AppCarTree.data.ts b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/car/vue3/AppCarTree.data.ts similarity index 100% rename from jeecg-module-demo/src/main/java/org/jeecg/modules/demo/car/vue3/AppCarTree.data.ts rename to jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/car/vue3/AppCarTree.data.ts diff --git a/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/car/vue3/AppCarTreeList.vue b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/car/vue3/AppCarTreeList.vue similarity index 100% rename from jeecg-module-demo/src/main/java/org/jeecg/modules/demo/car/vue3/AppCarTreeList.vue rename to jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/car/vue3/AppCarTreeList.vue diff --git a/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/car/vue3/V20250219_1__menu_insert_AppCarTree.sql b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/car/vue3/V20250219_1__menu_insert_AppCarTree.sql similarity index 100% rename from jeecg-module-demo/src/main/java/org/jeecg/modules/demo/car/vue3/V20250219_1__menu_insert_AppCarTree.sql rename to jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/car/vue3/V20250219_1__menu_insert_AppCarTree.sql diff --git a/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/car/vue3/components/AppCarTreeForm.vue b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/car/vue3/components/AppCarTreeForm.vue similarity index 100% rename from jeecg-module-demo/src/main/java/org/jeecg/modules/demo/car/vue3/components/AppCarTreeForm.vue rename to jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/car/vue3/components/AppCarTreeForm.vue diff --git a/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/car/vue3/components/AppCarTreeModal.vue b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/car/vue3/components/AppCarTreeModal.vue similarity index 100% rename from jeecg-module-demo/src/main/java/org/jeecg/modules/demo/car/vue3/components/AppCarTreeModal.vue rename to jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/car/vue3/components/AppCarTreeModal.vue diff --git a/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/controller/AppOrderController.java b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/controller/AppOrderController.java new file mode 100644 index 0000000..cb9bf68 --- /dev/null +++ b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/controller/AppOrderController.java @@ -0,0 +1,309 @@ +package org.jeecg.modules.sysMiniapp.order.controller; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.HashMap; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.jeecg.modules.sysMiniapp.order.entity.AppOrder; +import org.jeecg.modules.sysMiniapp.order.entity.AppOrderCar; +import org.jeecg.modules.sysMiniapp.order.entity.AppOrderFinance; +import org.jeecg.modules.sysMiniapp.order.entity.AppOrderVoucher; +import org.jeecg.modules.sysMiniapp.order.vo.AppOrderPage; +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.vo.LoginUser; +import org.apache.shiro.SecurityUtils; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.system.query.QueryGenerator; +import org.jeecg.common.system.query.QueryRuleEnum; +import org.jeecg.common.util.oConvertUtils; +import org.jeecg.modules.sysMiniapp.order.service.IAppOrderService; +import org.jeecg.modules.sysMiniapp.order.service.IAppOrderCarService; +import org.jeecg.modules.sysMiniapp.order.service.IAppOrderVoucherService; +import org.jeecg.modules.sysMiniapp.order.service.IAppOrderFinanceService; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.servlet.ModelAndView; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.MultipartHttpServletRequest; +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 io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.jeecg.common.aspect.annotation.AutoLog; +import org.apache.shiro.authz.annotation.RequiresPermissions; + + + /** + * @Description: 合同订单表 + * @Author: jeecg-boot + * @Date: 2025-02-20 + * @Version: V1.0 + */ +@Api(tags="合同订单表") +@RestController +@RequestMapping("/order/appOrder") +@Slf4j +public class AppOrderController { + @Autowired + private IAppOrderService appOrderService; + @Autowired + private IAppOrderCarService appOrderCarService; + @Autowired + private IAppOrderVoucherService appOrderVoucherService; + @Autowired + private IAppOrderFinanceService appOrderFinanceService; + + /** + * 分页列表查询 + * + * @param appOrder + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "合同订单表-分页列表查询") + @ApiOperation(value="合同订单表-分页列表查询", notes="合同订单表-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(AppOrder appOrder, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + // 自定义查询规则 + Map customeRuleMap = new HashMap<>(); + // 自定义多选的查询规则为:LIKE_WITH_OR + customeRuleMap.put("salePort", QueryRuleEnum.LIKE_WITH_OR); + customeRuleMap.put("custType", QueryRuleEnum.LIKE_WITH_OR); + customeRuleMap.put("status", QueryRuleEnum.LIKE_WITH_OR); + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(appOrder, req.getParameterMap(),customeRuleMap); + Page page = new Page(pageNo, pageSize); + IPage pageList = appOrderService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param appOrderPage + * @return + */ + @AutoLog(value = "合同订单表-添加") + @ApiOperation(value="合同订单表-添加", notes="合同订单表-添加") + @RequiresPermissions("order:app_order:add") + @PostMapping(value = "/add") + public Result add(@RequestBody AppOrderPage appOrderPage) { + AppOrder appOrder = new AppOrder(); + BeanUtils.copyProperties(appOrderPage, appOrder); + appOrderService.saveMain(appOrder, appOrderPage.getAppOrderCarList(),appOrderPage.getAppOrderVoucherList(),appOrderPage.getAppOrderFinanceList()); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param appOrderPage + * @return + */ + @AutoLog(value = "合同订单表-编辑") + @ApiOperation(value="合同订单表-编辑", notes="合同订单表-编辑") + @RequiresPermissions("order:app_order:edit") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) + public Result edit(@RequestBody AppOrderPage appOrderPage) { + AppOrder appOrder = new AppOrder(); + BeanUtils.copyProperties(appOrderPage, appOrder); + AppOrder appOrderEntity = appOrderService.getById(appOrder.getId()); + if(appOrderEntity==null) { + return Result.error("未找到对应数据"); + } + appOrderService.updateMain(appOrder, appOrderPage.getAppOrderCarList(),appOrderPage.getAppOrderVoucherList(),appOrderPage.getAppOrderFinanceList()); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "合同订单表-通过id删除") + @ApiOperation(value="合同订单表-通过id删除", notes="合同订单表-通过id删除") + @RequiresPermissions("order:app_order:delete") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name="id",required=true) String id) { + appOrderService.delMain(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "合同订单表-批量删除") + @ApiOperation(value="合同订单表-批量删除", notes="合同订单表-批量删除") + @RequiresPermissions("order:app_order:deleteBatch") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { + this.appOrderService.delBatchMain(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + //@AutoLog(value = "合同订单表-通过id查询") + @ApiOperation(value="合同订单表-通过id查询", notes="合同订单表-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name="id",required=true) String id) { + AppOrder appOrder = appOrderService.getById(id); + if(appOrder==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(appOrder); + + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + //@AutoLog(value = "订单车辆信息通过主表ID查询") + @ApiOperation(value="订单车辆信息主表ID查询", notes="订单车辆信息-通主表ID查询") + @GetMapping(value = "/queryAppOrderCarByMainId") + public Result> queryAppOrderCarListByMainId(@RequestParam(name="id",required=true) String id) { + List appOrderCarList = appOrderCarService.selectByMainId(id); + return Result.OK(appOrderCarList); + } + /** + * 通过id查询 + * + * @param id + * @return + */ + //@AutoLog(value = "订单凭证信息通过主表ID查询") + @ApiOperation(value="订单凭证信息主表ID查询", notes="订单凭证信息-通主表ID查询") + @GetMapping(value = "/queryAppOrderVoucherByMainId") + public Result> queryAppOrderVoucherListByMainId(@RequestParam(name="id",required=true) String id) { + List appOrderVoucherList = appOrderVoucherService.selectByMainId(id); + return Result.OK(appOrderVoucherList); + } + /** + * 通过id查询 + * + * @param id + * @return + */ + //@AutoLog(value = "订单金融信息通过主表ID查询") + @ApiOperation(value="订单金融信息主表ID查询", notes="订单金融信息-通主表ID查询") + @GetMapping(value = "/queryAppOrderFinanceByMainId") + public Result> queryAppOrderFinanceListByMainId(@RequestParam(name="id",required=true) String id) { + List appOrderFinanceList = appOrderFinanceService.selectByMainId(id); + return Result.OK(appOrderFinanceList); + } + + /** + * 导出excel + * + * @param request + * @param appOrder + */ + @RequiresPermissions("order:app_order:exportXls") + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, AppOrder appOrder) { + // Step.1 组装查询条件查询数据 + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(appOrder, request.getParameterMap()); + LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + + //配置选中数据查询条件 + String selections = request.getParameter("selections"); + if(oConvertUtils.isNotEmpty(selections)) { + List selectionList = Arrays.asList(selections.split(",")); + queryWrapper.in("id",selectionList); + } + //Step.2 获取导出数据 + List appOrderList = appOrderService.list(queryWrapper); + + // Step.3 组装pageList + List pageList = new ArrayList(); + for (AppOrder main : appOrderList) { + AppOrderPage vo = new AppOrderPage(); + BeanUtils.copyProperties(main, vo); + List appOrderCarList = appOrderCarService.selectByMainId(main.getId()); + vo.setAppOrderCarList(appOrderCarList); + List appOrderVoucherList = appOrderVoucherService.selectByMainId(main.getId()); + vo.setAppOrderVoucherList(appOrderVoucherList); + List appOrderFinanceList = appOrderFinanceService.selectByMainId(main.getId()); + vo.setAppOrderFinanceList(appOrderFinanceList); + pageList.add(vo); + } + + // Step.4 AutoPoi 导出Excel + ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); + mv.addObject(NormalExcelConstants.FILE_NAME, "合同订单表列表"); + mv.addObject(NormalExcelConstants.CLASS, AppOrderPage.class); + mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("合同订单表数据", "导出人:"+sysUser.getRealname(), "合同订单表")); + mv.addObject(NormalExcelConstants.DATA_LIST, pageList); + return mv; + } + + /** + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ + @RequiresPermissions("order:app_order:importExcel") + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result importExcel(HttpServletRequest request, HttpServletResponse response) { + MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; + Map fileMap = multipartRequest.getFileMap(); + for (Map.Entry entity : fileMap.entrySet()) { + // 获取上传文件对象 + MultipartFile file = entity.getValue(); + ImportParams params = new ImportParams(); + params.setTitleRows(2); + params.setHeadRows(1); + params.setNeedSave(true); + try { + List list = ExcelImportUtil.importExcel(file.getInputStream(), AppOrderPage.class, params); + for (AppOrderPage page : list) { + AppOrder po = new AppOrder(); + BeanUtils.copyProperties(page, po); + appOrderService.saveMain(po, page.getAppOrderCarList(),page.getAppOrderVoucherList(),page.getAppOrderFinanceList()); + } + return Result.OK("文件导入成功!数据行数:" + list.size()); + } catch (Exception e) { + log.error(e.getMessage(),e); + return Result.error("文件导入失败:"+e.getMessage()); + } finally { + try { + file.getInputStream().close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + return Result.OK("文件导入失败!"); + } + +} diff --git a/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/entity/AppOrder.java b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/entity/AppOrder.java new file mode 100644 index 0000000..ca53df0 --- /dev/null +++ b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/entity/AppOrder.java @@ -0,0 +1,147 @@ +package org.jeecg.modules.sysMiniapp.order.entity; + +import java.io.Serializable; +import java.io.UnsupportedEncodingException; +import java.util.Date; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableLogic; +import org.jeecg.common.constant.ProvinceCityArea; +import org.jeecg.common.util.SpringContextUtils; +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; + +/** + * @Description: 合同订单表 + * @Author: jeecg-boot + * @Date: 2025-02-20 + * @Version: V1.0 + */ +@ApiModel(value="app_order对象", description="合同订单表") +@Data +@TableName("app_order") +public class AppOrder implements Serializable { + private static final long serialVersionUID = 1L; + + /**主键*/ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "主键") + private java.lang.String id; + /**产品服务名称*/ + @Excel(name = "产品服务名称", width = 15) + @ApiModelProperty(value = "产品服务名称") + private java.lang.String productName; + /**服务年限*/ + @Excel(name = "服务年限", width = 15) + @ApiModelProperty(value = "服务年限") + private java.lang.String productServiceYear; + /**销售金额*/ + @Excel(name = "销售金额", width = 15) + @ApiModelProperty(value = "销售金额") + private java.math.BigDecimal productMoney; + /**经销商*/ + @Excel(name = "经销商", width = 15) + @ApiModelProperty(value = "经销商") + private java.lang.String storeName; + /**客户姓名*/ + @Excel(name = "客户姓名", width = 15) + @ApiModelProperty(value = "客户姓名") + private java.lang.String custName; + /**客户地址*/ + @Excel(name = "客户地址", width = 15) + @ApiModelProperty(value = "客户地址") + private java.lang.String custAddress; + /**客户证件号*/ + @Excel(name = "客户证件号", width = 15) + @ApiModelProperty(value = "客户证件号") + private java.lang.String custCardNo; + /**客户联系电话*/ + @Excel(name = "客户联系电话", width = 15) + @ApiModelProperty(value = "客户联系电话") + private java.lang.String custPhone; + /**销售端口*/ + @Excel(name = "销售端口", width = 15, dicCode = "order_sale_port") + @Dict(dicCode = "order_sale_port") + @ApiModelProperty(value = "销售端口") + private java.lang.String salePort; + /**创建人*/ + @ApiModelProperty(value = "创建人") + private java.lang.String createBy; + /**销售顾问*/ + @Excel(name = "销售顾问", width = 15) + @ApiModelProperty(value = "销售顾问") + private java.lang.String saleName; + /**付款方式*/ + @Excel(name = "付款方式", width = 15) + @ApiModelProperty(value = "付款方式") + private java.lang.String payType; + /**客户类型*/ + @Excel(name = "客户类型", width = 15, dicCode = "customer_type") + @Dict(dicCode = "customer_type") + @ApiModelProperty(value = "客户类型") + private java.lang.Integer custType; + /**身份证正面照*/ + @Excel(name = "身份证正面照", width = 15) + @ApiModelProperty(value = "身份证正面照") + private java.lang.String certFront; + /**身份证反面照*/ + @Excel(name = "身份证反面照", width = 15) + @ApiModelProperty(value = "身份证反面照") + private java.lang.String certBack; + /**车辆合格证*/ + @Excel(name = "车辆合格证", width = 15) + @ApiModelProperty(value = "车辆合格证") + private java.lang.String carPic; + /**营业执照*/ + @Excel(name = "营业执照", width = 15) + @ApiModelProperty(value = "营业执照") + private java.lang.String busLicense; + /**创建日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "创建日期") + private java.util.Date createTime; + /**更新人*/ + @ApiModelProperty(value = "更新人") + private java.lang.String updateBy; + /**更新日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "更新日期") + private java.util.Date updateTime; + /**所属部门*/ + @ApiModelProperty(value = "所属部门") + private java.lang.String sysOrgCode; + /**订单状态*/ + @Excel(name = "订单状态", width = 15) + @ApiModelProperty(value = "订单状态") + private java.lang.Integer status; + /**订单合同*/ + @Excel(name = "订单合同", width = 15) + @ApiModelProperty(value = "订单合同") + private java.lang.String contractUrl; + /**收款方*/ + @Excel(name = "收款方", width = 15) + @ApiModelProperty(value = "收款方") + private java.lang.String payee; + /**收款时间*/ + @Excel(name = "收款时间", width = 20, format = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "收款时间") + private java.util.Date payeeTime; + /**支付凭证*/ + @Excel(name = "支付凭证", width = 15) + @ApiModelProperty(value = "支付凭证") + private java.lang.String payVoucherUrl; + /**订单编号*/ + @Excel(name = "订单编号", width = 15) + @ApiModelProperty(value = "订单编号") + private java.lang.String orderNum; +} diff --git a/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/entity/AppOrderCar.java b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/entity/AppOrderCar.java new file mode 100644 index 0000000..2e830b7 --- /dev/null +++ b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/entity/AppOrderCar.java @@ -0,0 +1,107 @@ +package org.jeecg.modules.sysMiniapp.order.entity; + +import java.io.Serializable; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableLogic; +import org.jeecg.common.constant.ProvinceCityArea; +import org.jeecg.common.util.SpringContextUtils; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import java.util.Date; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.UnsupportedEncodingException; + +/** + * @Description: 订单车辆信息 + * @Author: jeecg-boot + * @Date: 2025-02-20 + * @Version: V1.0 + */ +@ApiModel(value="app_order_car对象", description="订单车辆信息") +@Data +@TableName("app_order_car") +public class AppOrderCar implements Serializable { + private static final long serialVersionUID = 1L; + + /**主键*/ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "主键") + private java.lang.String id; + /**车牌车系*/ + @Excel(name = "车牌车系", width = 15) + @ApiModelProperty(value = "车牌车系") + private java.lang.String carSeries; + /**车架号*/ + @Excel(name = "车架号", width = 15) + @ApiModelProperty(value = "车架号") + private java.lang.String vin; + /**车辆类型*/ + @Excel(name = "车辆类型", width = 15) + @ApiModelProperty(value = "车辆类型") + private java.lang.String carType; + /**使用性质*/ + @Excel(name = "使用性质", width = 15) + @ApiModelProperty(value = "使用性质") + private java.lang.String useType; + /**是否新车*/ + @Excel(name = "是否新车", width = 15) + @ApiModelProperty(value = "是否新车") + private java.lang.Integer newCar; + /**车辆型号*/ + @Excel(name = "车辆型号", width = 15) + @ApiModelProperty(value = "车辆型号") + private java.lang.String carModel; + /**车牌号*/ + @Excel(name = "车牌号", width = 15) + @ApiModelProperty(value = "车牌号") + private java.lang.String carNo; + /**发动机号*/ + @Excel(name = "发动机号", width = 15) + @ApiModelProperty(value = "发动机号") + private java.lang.String engineNo; + /**里程*/ + @Excel(name = "里程", width = 15) + @ApiModelProperty(value = "里程") + private java.lang.String mileage; + /**购车时间*/ + @Excel(name = "购车时间", width = 20, format = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "购车时间") + private java.util.Date buyTime; + /**车辆购置价*/ + @Excel(name = "车辆购置价", width = 15) + @ApiModelProperty(value = "车辆购置价") + private java.math.BigDecimal buyMoney; + /**车辆购置税*/ + @Excel(name = "车辆购置税", width = 15) + @ApiModelProperty(value = "车辆购置税") + private java.math.BigDecimal buyTax; + /**订单外键*/ + @ApiModelProperty(value = "订单外键") + private java.lang.String orderFkId; + /**更新人*/ + @ApiModelProperty(value = "更新人") + private java.lang.String updateBy; + /**创建日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "创建日期") + private java.util.Date createTime; + /**更新日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "更新日期") + private java.util.Date updateTime; + /**所属部门*/ + @ApiModelProperty(value = "所属部门") + private java.lang.String sysOrgCode; + /**创建人*/ + @ApiModelProperty(value = "创建人") + private java.lang.String createBy; +} diff --git a/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/entity/AppOrderFinance.java b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/entity/AppOrderFinance.java new file mode 100644 index 0000000..6744180 --- /dev/null +++ b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/entity/AppOrderFinance.java @@ -0,0 +1,69 @@ +package org.jeecg.modules.sysMiniapp.order.entity; + +import java.io.Serializable; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableLogic; +import org.jeecg.common.constant.ProvinceCityArea; +import org.jeecg.common.util.SpringContextUtils; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import java.util.Date; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.UnsupportedEncodingException; + +/** + * @Description: 订单金融信息 + * @Author: jeecg-boot + * @Date: 2025-02-20 + * @Version: V1.0 + */ +@ApiModel(value="app_order_finance对象", description="订单金融信息") +@Data +@TableName("app_order_finance") +public class AppOrderFinance 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; + /**创建日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "创建日期") + private java.util.Date createTime; + /**更新人*/ + @ApiModelProperty(value = "更新人") + private java.lang.String updateBy; + /**更新日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "更新日期") + private java.util.Date updateTime; + /**所属部门*/ + @ApiModelProperty(value = "所属部门") + private java.lang.String sysOrgCode; + /**贷款机构*/ + @Excel(name = "贷款机构", width = 15) + @ApiModelProperty(value = "贷款机构") + private java.lang.String lender; + /**贷款金额*/ + @Excel(name = "贷款金额", width = 15) + @ApiModelProperty(value = "贷款金额") + private java.math.BigDecimal lenderMoney; + /**贷款年限*/ + @Excel(name = "贷款年限", width = 15) + @ApiModelProperty(value = "贷款年限") + private java.lang.String lenderYear; + /**订单外键*/ + @ApiModelProperty(value = "订单外键") + private java.lang.String orderFkId; +} diff --git a/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/entity/AppOrderVoucher.java b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/entity/AppOrderVoucher.java new file mode 100644 index 0000000..44de715 --- /dev/null +++ b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/entity/AppOrderVoucher.java @@ -0,0 +1,117 @@ +package org.jeecg.modules.sysMiniapp.order.entity; + +import java.io.Serializable; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableLogic; +import org.jeecg.common.constant.ProvinceCityArea; +import org.jeecg.common.util.SpringContextUtils; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import java.util.Date; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.UnsupportedEncodingException; + +/** + * @Description: 订单凭证信息 + * @Author: jeecg-boot + * @Date: 2025-02-20 + * @Version: V1.0 + */ +@ApiModel(value="app_order_voucher对象", description="订单凭证信息") +@Data +@TableName("app_order_voucher") +public class AppOrderVoucher 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; + /**创建日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "创建日期") + private java.util.Date createTime; + /**更新人*/ + @ApiModelProperty(value = "更新人") + private java.lang.String updateBy; + /**更新日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "更新日期") + private java.util.Date updateTime; + /**所属部门*/ + @ApiModelProperty(value = "所属部门") + private java.lang.String sysOrgCode; + /**第一受益人*/ + @Excel(name = "第一受益人", width = 15) + @ApiModelProperty(value = "第一受益人") + private java.lang.String firstBeneficiary; + /**服务费*/ + @Excel(name = "服务费", width = 15) + @ApiModelProperty(value = "服务费") + private java.math.BigDecimal serviceMoney; + /**生效时间*/ + @Excel(name = "生效时间", width = 20, format = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "生效时间") + private java.util.Date effectiveTime; + /**服务年限*/ + @Excel(name = "服务年限", width = 15) + @ApiModelProperty(value = "服务年限") + private java.lang.String serviceYear; + /**权益套餐*/ + @Excel(name = "权益套餐", width = 15) + @ApiModelProperty(value = "权益套餐") + private java.lang.String equityPackage; + /**套餐价*/ + @Excel(name = "套餐价", width = 15) + @ApiModelProperty(value = "套餐价") + private java.math.BigDecimal packageMoney; + /**商业险编号*/ + @Excel(name = "商业险编号", width = 15) + @ApiModelProperty(value = "商业险编号") + private java.lang.String carInsuranceNo; + /**上牌城市*/ + @Excel(name = "上牌城市", width = 15) + @ApiModelProperty(value = "上牌城市") + private java.lang.String registeredCity; + /**保险公司*/ + @Excel(name = "保险公司", width = 15) + @ApiModelProperty(value = "保险公司") + private java.lang.String insuranceName; + /**受让人名称*/ + @Excel(name = "受让人名称", width = 15) + @ApiModelProperty(value = "受让人名称") + private java.lang.String assigneeName; + /**受让人电话*/ + @Excel(name = "受让人电话", width = 15) + @ApiModelProperty(value = "受让人电话") + private java.lang.String assigneePhone; + /**受让人身份证*/ + @Excel(name = "受让人身份证", width = 15) + @ApiModelProperty(value = "受让人身份证") + private java.lang.String assigneeCardNo; + /**支付时间*/ + @Excel(name = "支付时间", width = 15, format = "yyyy-MM-dd") + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern="yyyy-MM-dd") + @ApiModelProperty(value = "支付时间") + private java.util.Date payTime; + /**经销商地址*/ + @Excel(name = "经销商地址", width = 15) + @ApiModelProperty(value = "经销商地址") + private java.lang.String dealerAddress; + /**订单外键*/ + @ApiModelProperty(value = "订单外键") + private java.lang.String orderFkId; +} diff --git a/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/mapper/AppOrderCarMapper.java b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/mapper/AppOrderCarMapper.java new file mode 100644 index 0000000..098a251 --- /dev/null +++ b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/mapper/AppOrderCarMapper.java @@ -0,0 +1,31 @@ +package org.jeecg.modules.sysMiniapp.order.mapper; + +import java.util.List; +import org.jeecg.modules.sysMiniapp.order.entity.AppOrderCar; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Param; + +/** + * @Description: 订单车辆信息 + * @Author: jeecg-boot + * @Date: 2025-02-20 + * @Version: V1.0 + */ +public interface AppOrderCarMapper extends BaseMapper { + + /** + * 通过主表id删除子表数据 + * + * @param mainId 主表id + * @return boolean + */ + public boolean deleteByMainId(@Param("mainId") String mainId); + + /** + * 通过主表id查询子表数据 + * + * @param mainId 主表id + * @return List + */ + public List selectByMainId(@Param("mainId") String mainId); +} diff --git a/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/mapper/AppOrderFinanceMapper.java b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/mapper/AppOrderFinanceMapper.java new file mode 100644 index 0000000..ea83d78 --- /dev/null +++ b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/mapper/AppOrderFinanceMapper.java @@ -0,0 +1,31 @@ +package org.jeecg.modules.sysMiniapp.order.mapper; + +import java.util.List; +import org.jeecg.modules.sysMiniapp.order.entity.AppOrderFinance; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Param; + +/** + * @Description: 订单金融信息 + * @Author: jeecg-boot + * @Date: 2025-02-20 + * @Version: V1.0 + */ +public interface AppOrderFinanceMapper extends BaseMapper { + + /** + * 通过主表id删除子表数据 + * + * @param mainId 主表id + * @return boolean + */ + public boolean deleteByMainId(@Param("mainId") String mainId); + + /** + * 通过主表id查询子表数据 + * + * @param mainId 主表id + * @return List + */ + public List selectByMainId(@Param("mainId") String mainId); +} diff --git a/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/mapper/AppOrderMapper.java b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/mapper/AppOrderMapper.java new file mode 100644 index 0000000..df1ebf7 --- /dev/null +++ b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/mapper/AppOrderMapper.java @@ -0,0 +1,14 @@ +package org.jeecg.modules.sysMiniapp.order.mapper; + +import org.jeecg.modules.sysMiniapp.order.entity.AppOrder; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 合同订单表 + * @Author: jeecg-boot + * @Date: 2025-02-20 + * @Version: V1.0 + */ +public interface AppOrderMapper extends BaseMapper { + +} diff --git a/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/mapper/AppOrderVoucherMapper.java b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/mapper/AppOrderVoucherMapper.java new file mode 100644 index 0000000..2468d7a --- /dev/null +++ b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/mapper/AppOrderVoucherMapper.java @@ -0,0 +1,31 @@ +package org.jeecg.modules.sysMiniapp.order.mapper; + +import java.util.List; +import org.jeecg.modules.sysMiniapp.order.entity.AppOrderVoucher; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Param; + +/** + * @Description: 订单凭证信息 + * @Author: jeecg-boot + * @Date: 2025-02-20 + * @Version: V1.0 + */ +public interface AppOrderVoucherMapper extends BaseMapper { + + /** + * 通过主表id删除子表数据 + * + * @param mainId 主表id + * @return boolean + */ + public boolean deleteByMainId(@Param("mainId") String mainId); + + /** + * 通过主表id查询子表数据 + * + * @param mainId 主表id + * @return List + */ + public List selectByMainId(@Param("mainId") String mainId); +} diff --git a/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/mapper/xml/AppOrderCarMapper.xml b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/mapper/xml/AppOrderCarMapper.xml new file mode 100644 index 0000000..961a3a0 --- /dev/null +++ b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/mapper/xml/AppOrderCarMapper.xml @@ -0,0 +1,16 @@ + + + + + + DELETE + FROM app_order_car + WHERE + order_fk_id = #{mainId} + + + diff --git a/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/mapper/xml/AppOrderFinanceMapper.xml b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/mapper/xml/AppOrderFinanceMapper.xml new file mode 100644 index 0000000..169b218 --- /dev/null +++ b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/mapper/xml/AppOrderFinanceMapper.xml @@ -0,0 +1,16 @@ + + + + + + DELETE + FROM app_order_finance + WHERE + order_fk_id = #{mainId} + + + diff --git a/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/mapper/xml/AppOrderMapper.xml b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/mapper/xml/AppOrderMapper.xml new file mode 100644 index 0000000..a4f7cad --- /dev/null +++ b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/mapper/xml/AppOrderMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/mapper/xml/AppOrderVoucherMapper.xml b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/mapper/xml/AppOrderVoucherMapper.xml new file mode 100644 index 0000000..ad7cac8 --- /dev/null +++ b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/mapper/xml/AppOrderVoucherMapper.xml @@ -0,0 +1,16 @@ + + + + + + DELETE + FROM app_order_voucher + WHERE + order_fk_id = #{mainId} + + + diff --git a/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/service/IAppOrderCarService.java b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/service/IAppOrderCarService.java new file mode 100644 index 0000000..21222d5 --- /dev/null +++ b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/service/IAppOrderCarService.java @@ -0,0 +1,23 @@ +package org.jeecg.modules.sysMiniapp.order.service; + +import org.jeecg.modules.sysMiniapp.order.entity.AppOrderCar; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; + +/** + * @Description: 订单车辆信息 + * @Author: jeecg-boot + * @Date: 2025-02-20 + * @Version: V1.0 + */ +public interface IAppOrderCarService extends IService { + + /** + * 通过主表id查询子表数据 + * + * @param mainId 主表id + * @return List + */ + public List selectByMainId(String mainId); +} diff --git a/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/service/IAppOrderFinanceService.java b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/service/IAppOrderFinanceService.java new file mode 100644 index 0000000..6d52ffa --- /dev/null +++ b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/service/IAppOrderFinanceService.java @@ -0,0 +1,23 @@ +package org.jeecg.modules.sysMiniapp.order.service; + +import org.jeecg.modules.sysMiniapp.order.entity.AppOrderFinance; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; + +/** + * @Description: 订单金融信息 + * @Author: jeecg-boot + * @Date: 2025-02-20 + * @Version: V1.0 + */ +public interface IAppOrderFinanceService extends IService { + + /** + * 通过主表id查询子表数据 + * + * @param mainId 主表id + * @return List + */ + public List selectByMainId(String mainId); +} diff --git a/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/service/IAppOrderService.java b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/service/IAppOrderService.java new file mode 100644 index 0000000..5780bc3 --- /dev/null +++ b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/service/IAppOrderService.java @@ -0,0 +1,55 @@ +package org.jeecg.modules.sysMiniapp.order.service; + +import org.jeecg.modules.sysMiniapp.order.entity.AppOrderCar; +import org.jeecg.modules.sysMiniapp.order.entity.AppOrderVoucher; +import org.jeecg.modules.sysMiniapp.order.entity.AppOrderFinance; +import org.jeecg.modules.sysMiniapp.order.entity.AppOrder; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.io.Serializable; +import java.util.Collection; +import java.util.List; + +/** + * @Description: 合同订单表 + * @Author: jeecg-boot + * @Date: 2025-02-20 + * @Version: V1.0 + */ +public interface IAppOrderService extends IService { + + /** + * 添加一对多 + * + * @param appOrder + * @param appOrderCarList + * @param appOrderVoucherList + * @param appOrderFinanceList + */ + public void saveMain(AppOrder appOrder, List appOrderCarList, List appOrderVoucherList, List appOrderFinanceList) ; + + /** + * 修改一对多 + * + * @param appOrder + * @param appOrderCarList + * @param appOrderVoucherList + * @param appOrderFinanceList + */ + public void updateMain(AppOrder appOrder,List appOrderCarList,List appOrderVoucherList,List appOrderFinanceList); + + /** + * 删除一对多 + * + * @param id + */ + public void delMain (String id); + + /** + * 批量删除一对多 + * + * @param idList + */ + public void delBatchMain (Collection idList); + +} diff --git a/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/service/IAppOrderVoucherService.java b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/service/IAppOrderVoucherService.java new file mode 100644 index 0000000..09a6fb6 --- /dev/null +++ b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/service/IAppOrderVoucherService.java @@ -0,0 +1,23 @@ +package org.jeecg.modules.sysMiniapp.order.service; + +import org.jeecg.modules.sysMiniapp.order.entity.AppOrderVoucher; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; + +/** + * @Description: 订单凭证信息 + * @Author: jeecg-boot + * @Date: 2025-02-20 + * @Version: V1.0 + */ +public interface IAppOrderVoucherService extends IService { + + /** + * 通过主表id查询子表数据 + * + * @param mainId 主表id + * @return List + */ + public List selectByMainId(String mainId); +} diff --git a/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/service/impl/AppOrderCarServiceImpl.java b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/service/impl/AppOrderCarServiceImpl.java new file mode 100644 index 0000000..151ff59 --- /dev/null +++ b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/service/impl/AppOrderCarServiceImpl.java @@ -0,0 +1,27 @@ +package org.jeecg.modules.sysMiniapp.order.service.impl; + +import org.jeecg.modules.sysMiniapp.order.entity.AppOrderCar; +import org.jeecg.modules.sysMiniapp.order.mapper.AppOrderCarMapper; +import org.jeecg.modules.sysMiniapp.order.service.IAppOrderCarService; +import org.springframework.stereotype.Service; +import java.util.List; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; + +/** + * @Description: 订单车辆信息 + * @Author: jeecg-boot + * @Date: 2025-02-20 + * @Version: V1.0 + */ +@Service +public class AppOrderCarServiceImpl extends ServiceImpl implements IAppOrderCarService { + + @Autowired + private AppOrderCarMapper appOrderCarMapper; + + @Override + public List selectByMainId(String mainId) { + return appOrderCarMapper.selectByMainId(mainId); + } +} diff --git a/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/service/impl/AppOrderFinanceServiceImpl.java b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/service/impl/AppOrderFinanceServiceImpl.java new file mode 100644 index 0000000..0ad39b8 --- /dev/null +++ b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/service/impl/AppOrderFinanceServiceImpl.java @@ -0,0 +1,27 @@ +package org.jeecg.modules.sysMiniapp.order.service.impl; + +import org.jeecg.modules.sysMiniapp.order.entity.AppOrderFinance; +import org.jeecg.modules.sysMiniapp.order.mapper.AppOrderFinanceMapper; +import org.jeecg.modules.sysMiniapp.order.service.IAppOrderFinanceService; +import org.springframework.stereotype.Service; +import java.util.List; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; + +/** + * @Description: 订单金融信息 + * @Author: jeecg-boot + * @Date: 2025-02-20 + * @Version: V1.0 + */ +@Service +public class AppOrderFinanceServiceImpl extends ServiceImpl implements IAppOrderFinanceService { + + @Autowired + private AppOrderFinanceMapper appOrderFinanceMapper; + + @Override + public List selectByMainId(String mainId) { + return appOrderFinanceMapper.selectByMainId(mainId); + } +} diff --git a/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/service/impl/AppOrderServiceImpl.java b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/service/impl/AppOrderServiceImpl.java new file mode 100644 index 0000000..0c86f6f --- /dev/null +++ b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/service/impl/AppOrderServiceImpl.java @@ -0,0 +1,119 @@ +package org.jeecg.modules.sysMiniapp.order.service.impl; + +import org.jeecg.modules.sysMiniapp.order.entity.AppOrder; +import org.jeecg.modules.sysMiniapp.order.entity.AppOrderCar; +import org.jeecg.modules.sysMiniapp.order.entity.AppOrderVoucher; +import org.jeecg.modules.sysMiniapp.order.entity.AppOrderFinance; +import org.jeecg.modules.sysMiniapp.order.mapper.AppOrderCarMapper; +import org.jeecg.modules.sysMiniapp.order.mapper.AppOrderVoucherMapper; +import org.jeecg.modules.sysMiniapp.order.mapper.AppOrderFinanceMapper; +import org.jeecg.modules.sysMiniapp.order.mapper.AppOrderMapper; +import org.jeecg.modules.sysMiniapp.order.service.IAppOrderService; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; +import java.io.Serializable; +import java.util.List; +import java.util.Collection; + +/** + * @Description: 合同订单表 + * @Author: jeecg-boot + * @Date: 2025-02-20 + * @Version: V1.0 + */ +@Service +public class AppOrderServiceImpl extends ServiceImpl implements IAppOrderService { + + @Autowired + private AppOrderMapper appOrderMapper; + @Autowired + private AppOrderCarMapper appOrderCarMapper; + @Autowired + private AppOrderVoucherMapper appOrderVoucherMapper; + @Autowired + private AppOrderFinanceMapper appOrderFinanceMapper; + + @Override + @Transactional(rollbackFor = Exception.class) + public void saveMain(AppOrder appOrder, List appOrderCarList, List appOrderVoucherList, List appOrderFinanceList) { + appOrderMapper.insert(appOrder); + if(appOrderCarList!=null && appOrderCarList.size()>0) { + for(AppOrderCar entity:appOrderCarList) { + //外键设置 + entity.setOrderFkId(appOrder.getId()); + appOrderCarMapper.insert(entity); + } + } + if(appOrderVoucherList!=null && appOrderVoucherList.size()>0) { + for(AppOrderVoucher entity:appOrderVoucherList) { + //外键设置 + entity.setOrderFkId(appOrder.getId()); + appOrderVoucherMapper.insert(entity); + } + } + if(appOrderFinanceList!=null && appOrderFinanceList.size()>0) { + for(AppOrderFinance entity:appOrderFinanceList) { + //外键设置 + entity.setOrderFkId(appOrder.getId()); + appOrderFinanceMapper.insert(entity); + } + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void updateMain(AppOrder appOrder,List appOrderCarList,List appOrderVoucherList,List appOrderFinanceList) { + appOrderMapper.updateById(appOrder); + + //1.先删除子表数据 + appOrderCarMapper.deleteByMainId(appOrder.getId()); + appOrderVoucherMapper.deleteByMainId(appOrder.getId()); + appOrderFinanceMapper.deleteByMainId(appOrder.getId()); + + //2.子表数据重新插入 + if(appOrderCarList!=null && appOrderCarList.size()>0) { + for(AppOrderCar entity:appOrderCarList) { + //外键设置 + entity.setOrderFkId(appOrder.getId()); + appOrderCarMapper.insert(entity); + } + } + if(appOrderVoucherList!=null && appOrderVoucherList.size()>0) { + for(AppOrderVoucher entity:appOrderVoucherList) { + //外键设置 + entity.setOrderFkId(appOrder.getId()); + appOrderVoucherMapper.insert(entity); + } + } + if(appOrderFinanceList!=null && appOrderFinanceList.size()>0) { + for(AppOrderFinance entity:appOrderFinanceList) { + //外键设置 + entity.setOrderFkId(appOrder.getId()); + appOrderFinanceMapper.insert(entity); + } + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delMain(String id) { + appOrderCarMapper.deleteByMainId(id); + appOrderVoucherMapper.deleteByMainId(id); + appOrderFinanceMapper.deleteByMainId(id); + appOrderMapper.deleteById(id); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delBatchMain(Collection idList) { + for(Serializable id:idList) { + appOrderCarMapper.deleteByMainId(id.toString()); + appOrderVoucherMapper.deleteByMainId(id.toString()); + appOrderFinanceMapper.deleteByMainId(id.toString()); + appOrderMapper.deleteById(id); + } + } + +} diff --git a/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/service/impl/AppOrderVoucherServiceImpl.java b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/service/impl/AppOrderVoucherServiceImpl.java new file mode 100644 index 0000000..430e96b --- /dev/null +++ b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/service/impl/AppOrderVoucherServiceImpl.java @@ -0,0 +1,27 @@ +package org.jeecg.modules.sysMiniapp.order.service.impl; + +import org.jeecg.modules.sysMiniapp.order.entity.AppOrderVoucher; +import org.jeecg.modules.sysMiniapp.order.mapper.AppOrderVoucherMapper; +import org.jeecg.modules.sysMiniapp.order.service.IAppOrderVoucherService; +import org.springframework.stereotype.Service; +import java.util.List; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; + +/** + * @Description: 订单凭证信息 + * @Author: jeecg-boot + * @Date: 2025-02-20 + * @Version: V1.0 + */ +@Service +public class AppOrderVoucherServiceImpl extends ServiceImpl implements IAppOrderVoucherService { + + @Autowired + private AppOrderVoucherMapper appOrderVoucherMapper; + + @Override + public List selectByMainId(String mainId) { + return appOrderVoucherMapper.selectByMainId(mainId); + } +} diff --git a/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/vo/AppOrderPage.java b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/vo/AppOrderPage.java new file mode 100644 index 0000000..5740835 --- /dev/null +++ b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/vo/AppOrderPage.java @@ -0,0 +1,152 @@ +package org.jeecg.modules.sysMiniapp.order.vo; + +import java.util.List; + +import org.jeecg.modules.sysMiniapp.order.entity.AppOrderCar; +import org.jeecg.modules.sysMiniapp.order.entity.AppOrderVoucher; +import org.jeecg.modules.sysMiniapp.order.entity.AppOrderFinance; +import lombok.Data; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.jeecgframework.poi.excel.annotation.ExcelCollection; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecg.common.aspect.annotation.Dict; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * @Description: 合同订单表 + * @Author: jeecg-boot + * @Date: 2025-02-20 + * @Version: V1.0 + */ +@Data +@ApiModel(value="app_orderPage对象", description="合同订单表") +public class AppOrderPage { + + /**主键*/ + @ApiModelProperty(value = "主键") + private java.lang.String id; + /**产品服务名称*/ + @Excel(name = "产品服务名称", width = 15) + @ApiModelProperty(value = "产品服务名称") + private java.lang.String productName; + /**服务年限*/ + @Excel(name = "服务年限", width = 15) + @ApiModelProperty(value = "服务年限") + private java.lang.String productServiceYear; + /**销售金额*/ + @Excel(name = "销售金额", width = 15) + @ApiModelProperty(value = "销售金额") + private java.math.BigDecimal productMoney; + /**经销商*/ + @Excel(name = "经销商", width = 15) + @ApiModelProperty(value = "经销商") + private java.lang.String storeName; + /**客户姓名*/ + @Excel(name = "客户姓名", width = 15) + @ApiModelProperty(value = "客户姓名") + private java.lang.String custName; + /**客户地址*/ + @Excel(name = "客户地址", width = 15) + @ApiModelProperty(value = "客户地址") + private java.lang.String custAddress; + /**客户证件号*/ + @Excel(name = "客户证件号", width = 15) + @ApiModelProperty(value = "客户证件号") + private java.lang.String custCardNo; + /**客户联系电话*/ + @Excel(name = "客户联系电话", width = 15) + @ApiModelProperty(value = "客户联系电话") + private java.lang.String custPhone; + /**销售端口*/ + @Excel(name = "销售端口", width = 15, dicCode = "order_sale_port") + @Dict(dicCode = "order_sale_port") + @ApiModelProperty(value = "销售端口") + private java.lang.String salePort; + /**创建人*/ + @ApiModelProperty(value = "创建人") + private java.lang.String createBy; + /**销售顾问*/ + @Excel(name = "销售顾问", width = 15) + @ApiModelProperty(value = "销售顾问") + private java.lang.String saleName; + /**付款方式*/ + @Excel(name = "付款方式", width = 15) + @ApiModelProperty(value = "付款方式") + private java.lang.String payType; + /**客户类型*/ + @Excel(name = "客户类型", width = 15, dicCode = "customer_type") + @Dict(dicCode = "customer_type") + @ApiModelProperty(value = "客户类型") + private java.lang.Integer custType; + /**身份证正面照*/ + @Excel(name = "身份证正面照", width = 15) + @ApiModelProperty(value = "身份证正面照") + private java.lang.String certFront; + /**身份证反面照*/ + @Excel(name = "身份证反面照", width = 15) + @ApiModelProperty(value = "身份证反面照") + private java.lang.String certBack; + /**车辆合格证*/ + @Excel(name = "车辆合格证", width = 15) + @ApiModelProperty(value = "车辆合格证") + private java.lang.String carPic; + /**营业执照*/ + @Excel(name = "营业执照", width = 15) + @ApiModelProperty(value = "营业执照") + private java.lang.String busLicense; + /**创建日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "创建日期") + private java.util.Date createTime; + /**更新人*/ + @ApiModelProperty(value = "更新人") + private java.lang.String updateBy; + /**更新日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "更新日期") + private java.util.Date updateTime; + /**所属部门*/ + @ApiModelProperty(value = "所属部门") + private java.lang.String sysOrgCode; + /**订单状态*/ + @Excel(name = "订单状态", width = 15) + @ApiModelProperty(value = "订单状态") + private java.lang.Integer status; + /**订单合同*/ + @Excel(name = "订单合同", width = 15) + @ApiModelProperty(value = "订单合同") + private java.lang.String contractUrl; + /**收款方*/ + @Excel(name = "收款方", width = 15) + @ApiModelProperty(value = "收款方") + private java.lang.String payee; + /**收款时间*/ + @Excel(name = "收款时间", width = 20, format = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "收款时间") + private java.util.Date payeeTime; + /**支付凭证*/ + @Excel(name = "支付凭证", width = 15) + @ApiModelProperty(value = "支付凭证") + private java.lang.String payVoucherUrl; + /**订单编号*/ + @Excel(name = "订单编号", width = 15) + @ApiModelProperty(value = "订单编号") + private java.lang.String orderNum; + + @ExcelCollection(name="订单车辆信息") + @ApiModelProperty(value = "订单车辆信息") + private List appOrderCarList; + @ExcelCollection(name="订单凭证信息") + @ApiModelProperty(value = "订单凭证信息") + private List appOrderVoucherList; + @ExcelCollection(name="订单金融信息") + @ApiModelProperty(value = "订单金融信息") + private List appOrderFinanceList; + +} diff --git a/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/vue3/AppOrder.api.ts b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/vue3/AppOrder.api.ts new file mode 100644 index 0000000..42b7e2c --- /dev/null +++ b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/vue3/AppOrder.api.ts @@ -0,0 +1,83 @@ +import {defHttp} from '/@/utils/http/axios'; +import { useMessage } from "/@/hooks/web/useMessage"; + +const { createConfirm } = useMessage(); + +enum Api { + list = '/order/appOrder/list', + save='/order/appOrder/add', + edit='/order/appOrder/edit', + deleteOne = '/order/appOrder/delete', + deleteBatch = '/order/appOrder/deleteBatch', + importExcel = '/order/appOrder/importExcel', + exportXls = '/order/appOrder/exportXls', + appOrderCarList = '/order/appOrder/queryAppOrderCarByMainId', + appOrderVoucherList = '/order/appOrder/queryAppOrderVoucherByMainId', + appOrderFinanceList = '/order/appOrder/queryAppOrderFinanceByMainId', +} +/** + * 导出api + * @param params + */ +export const getExportUrl = Api.exportXls; + +/** + * 导入api + */ +export const getImportUrl = Api.importExcel; +/** + * 查询子表数据 + * @param params + */ +export const appOrderCarList = Api.appOrderCarList; +/** + * 查询子表数据 + * @param params + */ +export const appOrderVoucherList = Api.appOrderVoucherList; +/** + * 查询子表数据 + * @param params + */ +export const appOrderFinanceList = Api.appOrderFinanceList; +/** + * 列表接口 + * @param params + */ +export const list = (params) => + defHttp.get({url: Api.list, params}); + +/** + * 删除单个 + */ +export const deleteOne = (params,handleSuccess) => { + return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); +} +/** + * 批量删除 + * @param params + */ +export const batchDelete = (params, handleSuccess) => { + createConfirm({ + iconType: 'warning', + title: '确认删除', + content: '是否删除选中数据', + okText: '确认', + cancelText: '取消', + onOk: () => { + return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); + } + }); +} +/** + * 保存或者更新 + * @param params + */ +export const saveOrUpdate = (params, isUpdate) => { + let url = isUpdate ? Api.edit : Api.save; + return defHttp.post({url: url, params}); +} diff --git a/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/vue3/AppOrder.data.ts b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/vue3/AppOrder.data.ts new file mode 100644 index 0000000..1c935b9 --- /dev/null +++ b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/vue3/AppOrder.data.ts @@ -0,0 +1,795 @@ +import {BasicColumn} from '/@/components/Table'; +import {FormSchema} from '/@/components/Table'; +import { rules} from '/@/utils/helper/validator'; +import { render } from '/@/utils/common/renderUtils'; +import {JVxeTypes,JVxeColumn} from '/@/components/jeecg/JVxeTable/types' +import { getWeekMonthQuarterYear } from '/@/utils'; +//列表数据 +export const columns: BasicColumn[] = [ + { + title: '产品服务名称', + align:"center", + dataIndex: 'productName' + }, + { + title: '服务年限', + align:"center", + dataIndex: 'productServiceYear' + }, + { + title: '销售金额', + align:"center", + dataIndex: 'productMoney' + }, + { + title: '经销商', + align:"center", + dataIndex: 'storeName' + }, + { + title: '客户姓名', + align:"center", + dataIndex: 'custName' + }, + { + title: '客户地址', + align:"center", + dataIndex: 'custAddress' + }, + { + title: '客户证件号', + align:"center", + dataIndex: 'custCardNo' + }, + { + title: '客户联系电话', + align:"center", + dataIndex: 'custPhone' + }, + { + title: '销售端口', + align:"center", + dataIndex: 'salePort_dictText' + }, + { + title: '销售顾问', + align:"center", + dataIndex: 'saleName' + }, + { + title: '付款方式', + align:"center", + dataIndex: 'payType' + }, + { + title: '客户类型', + align:"center", + dataIndex: 'custType_dictText' + }, + { + title: '身份证正面照', + align:"center", + dataIndex: 'certFront', + customRender:render.renderImage, + }, + { + title: '身份证反面照', + align:"center", + dataIndex: 'certBack', + customRender:render.renderImage, + }, + { + title: '车辆合格证', + align:"center", + dataIndex: 'carPic', + customRender:render.renderImage, + }, + { + title: '营业执照', + align:"center", + dataIndex: 'busLicense', + customRender:render.renderImage, + }, + { + title: '创建日期', + align:"center", + dataIndex: 'createTime' + }, + { + title: '订单状态', + align:"center", + dataIndex: 'status_dictText' + }, + { + title: '订单合同', + align:"center", + dataIndex: 'contractUrl', + }, + { + title: '收款方', + align:"center", + dataIndex: 'payee' + }, + { + title: '收款时间', + align:"center", + dataIndex: 'payeeTime' + }, + { + title: '支付凭证', + align:"center", + dataIndex: 'payVoucherUrl', + customRender:render.renderImage, + }, + { + title: '订单编号', + align:"center", + dataIndex: 'orderNum' + }, +]; +//查询数据 +export const searchFormSchema: FormSchema[] = [ + { + label: "产品服务名称", + field: "productName", + component: 'JInput', + }, + { + label: "经销商", + field: "storeName", + component: 'JInput', + }, + { + label: "客户姓名", + field: "custName", + component: 'JInput', + }, + { + label: "客户证件号", + field: "custCardNo", + component: 'Input', + //colProps: {span: 6}, + }, + { + label: "客户联系电话", + field: "custPhone", + component: 'Input', + //colProps: {span: 6}, + }, + { + label: "销售端口", + field: "salePort", + component: 'JSelectMultiple', + componentProps:{ + dictCode:"order_sale_port" + }, + //colProps: {span: 6}, + }, + { + label: "付款方式", + field: "payType", + component: 'Input', + //colProps: {span: 6}, + }, + { + label: "客户类型", + field: "custType", + component: 'JSelectMultiple', + componentProps:{ + dictCode:"customer_type" + }, + //colProps: {span: 6}, + }, + { + label: "创建日期", + field: "createTime", + component: 'RangePicker', + componentProps: { + valueType: 'Date', + showTime:true + }, + //colProps: {span: 6}, + }, + { + label: "订单状态", + field: "status", + component: 'JSelectMultiple', + componentProps:{ + }, + //colProps: {span: 6}, + }, + { + label: "订单编号", + field: "orderNum", + component: 'Input', + //colProps: {span: 6}, + }, +]; +//表单数据 +export const formSchema: FormSchema[] = [ + { + label: '产品服务名称', + field: 'productName', + component: 'Input', + dynamicRules: ({model,schema}) => { + return [ + { required: true, message: '请输入产品服务名称!'}, + ]; + }, + }, + { + label: '服务年限', + field: 'productServiceYear', + component: 'Input', + dynamicRules: ({model,schema}) => { + return [ + { required: true, message: '请输入服务年限!'}, + ]; + }, + }, + { + label: '销售金额', + field: 'productMoney', + component: 'InputNumber', + dynamicRules: ({model,schema}) => { + return [ + { required: true, message: '请输入销售金额!'}, + ]; + }, + }, + { + label: '经销商', + field: 'storeName', + component: 'Input', + dynamicRules: ({model,schema}) => { + return [ + { required: true, message: '请输入经销商!'}, + ]; + }, + }, + { + label: '客户姓名', + field: 'custName', + component: 'Input', + dynamicRules: ({model,schema}) => { + return [ + { required: true, message: '请输入客户姓名!'}, + ]; + }, + }, + { + label: '客户地址', + field: 'custAddress', + component: 'Input', + dynamicRules: ({model,schema}) => { + return [ + { required: true, message: '请输入客户地址!'}, + ]; + }, + }, + { + label: '客户证件号', + field: 'custCardNo', + component: 'Input', + dynamicRules: ({model,schema}) => { + return [ + { required: true, message: '请输入客户证件号!'}, + ]; + }, + }, + { + label: '客户联系电话', + field: 'custPhone', + component: 'Input', + dynamicRules: ({model,schema}) => { + return [ + { required: true, message: '请输入客户联系电话!'}, + ]; + }, + }, + { + label: '销售端口', + field: 'salePort', + component: 'JDictSelectTag', + componentProps:{ + dictCode:"order_sale_port" + }, + dynamicRules: ({model,schema}) => { + return [ + { required: true, message: '请输入销售端口!'}, + ]; + }, + }, + { + label: '销售顾问', + field: 'saleName', + component: 'Input', + dynamicRules: ({model,schema}) => { + return [ + { required: true, message: '请输入销售顾问!'}, + ]; + }, + }, + { + label: '付款方式', + field: 'payType', + component: 'Input', + dynamicRules: ({model,schema}) => { + return [ + { required: true, message: '请输入付款方式!'}, + ]; + }, + }, + { + label: '客户类型', + field: 'custType', + component: 'JDictSelectTag', + componentProps:{ + dictCode:"customer_type" + }, + dynamicRules: ({model,schema}) => { + return [ + { required: true, message: '请输入客户类型!'}, + ]; + }, + }, + { + label: '身份证正面照', + field: 'certFront', + component: 'JImageUpload', + componentProps:{ + fileMax: 0 + }, + }, + { + label: '身份证反面照', + field: 'certBack', + component: 'JImageUpload', + componentProps:{ + fileMax: 0 + }, + }, + { + label: '车辆合格证', + field: 'carPic', + component: 'JImageUpload', + componentProps:{ + fileMax: 0 + }, + }, + { + label: '营业执照', + field: 'busLicense', + component: 'JImageUpload', + componentProps:{ + fileMax: 0 + }, + }, + { + label: '订单状态', + field: 'status', + component: 'JDictSelectTag', + componentProps:{ + dictCode:"" + }, + dynamicRules: ({model,schema}) => { + return [ + { required: true, message: '请输入订单状态!'}, + ]; + }, + }, + { + label: '订单合同', + field: 'contractUrl', + component: 'JUpload', + componentProps:{ + }, + dynamicRules: ({model,schema}) => { + return [ + { required: true, message: '请输入订单合同!'}, + ]; + }, + }, + { + label: '收款方', + field: 'payee', + component: 'Input', + dynamicRules: ({model,schema}) => { + return [ + { required: true, message: '请输入收款方!'}, + ]; + }, + }, + { + label: '收款时间', + field: 'payeeTime', + component: 'DatePicker', + componentProps: { + showTime:true, + valueFormat: 'YYYY-MM-DD HH:mm:ss' + }, + dynamicRules: ({model,schema}) => { + return [ + { required: true, message: '请输入收款时间!'}, + ]; + }, + }, + { + label: '支付凭证', + field: 'payVoucherUrl', + component: 'JImageUpload', + componentProps:{ + fileMax: 0 + }, + dynamicRules: ({model,schema}) => { + return [ + { required: true, message: '请输入支付凭证!'}, + ]; + }, + }, + // TODO 主键隐藏字段,目前写死为ID + { + label: '', + field: 'id', + component: 'Input', + show: false + }, +]; +//子表单数据 +export const appOrderCarFormSchema: FormSchema[] = [ + { + label: '车牌车系', + field: 'carSeries', + component: 'Input', + dynamicRules: ({model,schema}) => { + return [ + { required: true, message: '请输入车牌车系!'}, + ]; + }, + }, + { + label: '车架号', + field: 'vin', + component: 'Input', + dynamicRules: ({model,schema}) => { + return [ + { required: true, message: '请输入车架号!'}, + ]; + }, + }, + { + label: '车辆类型', + field: 'carType', + component: 'Input', + dynamicRules: ({model,schema}) => { + return [ + { required: true, message: '请输入车辆类型!'}, + ]; + }, + }, + { + label: '使用性质', + field: 'useType', + component: 'Input', + dynamicRules: ({model,schema}) => { + return [ + { required: true, message: '请输入使用性质!'}, + ]; + }, + }, + { + label: '是否新车', + field: 'newCar', + component: 'InputNumber', + dynamicRules: ({model,schema}) => { + return [ + { required: true, message: '请输入是否新车!'}, + ]; + }, + }, + { + label: '车辆型号', + field: 'carModel', + component: 'Input', + dynamicRules: ({model,schema}) => { + return [ + { required: true, message: '请输入车辆型号!'}, + ]; + }, + }, + { + label: '车牌号', + field: 'carNo', + component: 'Input', + dynamicRules: ({model,schema}) => { + return [ + { required: true, message: '请输入车牌号!'}, + ]; + }, + }, + { + label: '发动机号', + field: 'engineNo', + component: 'Input', + dynamicRules: ({model,schema}) => { + return [ + { required: true, message: '请输入发动机号!'}, + ]; + }, + }, + { + label: '里程', + field: 'mileage', + component: 'Input', + dynamicRules: ({model,schema}) => { + return [ + { required: true, message: '请输入里程!'}, + ]; + }, + }, + { + label: '购车时间', + field: 'buyTime', + component: 'DatePicker', + componentProps: { + showTime:true, + valueFormat: 'YYYY-MM-DD HH:mm:ss' + }, + dynamicRules: ({model,schema}) => { + return [ + { required: true, message: '请输入购车时间!'}, + ]; + }, + }, + { + label: '车辆购置价', + field: 'buyMoney', + component: 'InputNumber', + dynamicRules: ({model,schema}) => { + return [ + { required: true, message: '请输入车辆购置价!'}, + ]; + }, + }, + { + label: '车辆购置税', + field: 'buyTax', + component: 'InputNumber', + dynamicRules: ({model,schema}) => { + return [ + { required: true, message: '请输入车辆购置税!'}, + ]; + }, + }, + { + label: '', + field: 'id', + component: 'Input', + show: false + }, +]; +export const appOrderVoucherFormSchema: FormSchema[] = [ + { + label: '第一受益人', + field: 'firstBeneficiary', + component: 'Input', + dynamicRules: ({model,schema}) => { + return [ + { required: true, message: '请输入第一受益人!'}, + ]; + }, + }, + { + label: '服务费', + field: 'serviceMoney', + component: 'InputNumber', + dynamicRules: ({model,schema}) => { + return [ + { required: true, message: '请输入服务费!'}, + ]; + }, + }, + { + label: '生效时间', + field: 'effectiveTime', + component: 'DatePicker', + componentProps: { + showTime:true, + valueFormat: 'YYYY-MM-DD HH:mm:ss' + }, + dynamicRules: ({model,schema}) => { + return [ + { required: true, message: '请输入生效时间!'}, + ]; + }, + }, + { + label: '服务年限', + field: 'serviceYear', + component: 'Input', + dynamicRules: ({model,schema}) => { + return [ + { required: true, message: '请输入服务年限!'}, + ]; + }, + }, + { + label: '权益套餐', + field: 'equityPackage', + component: 'Input', + dynamicRules: ({model,schema}) => { + return [ + { required: true, message: '请输入权益套餐!'}, + ]; + }, + }, + { + label: '套餐价', + field: 'packageMoney', + component: 'InputNumber', + dynamicRules: ({model,schema}) => { + return [ + { required: true, message: '请输入套餐价!'}, + ]; + }, + }, + { + label: '商业险编号', + field: 'carInsuranceNo', + component: 'Input', + }, + { + label: '上牌城市', + field: 'registeredCity', + component: 'Input', + }, + { + label: '保险公司', + field: 'insuranceName', + component: 'Input', + }, + { + label: '受让人名称', + field: 'assigneeName', + component: 'Input', + }, + { + label: '受让人电话', + field: 'assigneePhone', + component: 'Input', + }, + { + label: '受让人身份证', + field: 'assigneeCardNo', + component: 'Input', + }, + { + label: '支付时间', + field: 'payTime', + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD' + }, + }, + { + label: '经销商地址', + field: 'dealerAddress', + component: 'Input', + }, + { + label: '', + field: 'id', + component: 'Input', + show: false + }, +]; +export const appOrderFinanceFormSchema: FormSchema[] = [ + { + label: '贷款机构', + field: 'lender', + component: 'Input', + }, + { + label: '贷款金额', + field: 'lenderMoney', + component: 'InputNumber', + }, + { + label: '贷款年限', + field: 'lenderYear', + component: 'Input', + }, + { + label: '', + field: 'id', + component: 'Input', + show: false + }, +]; +//子表表格配置 + + +// 高级查询数据 +export const superQuerySchema = { + productName: {title: '产品服务名称',order: 0,view: 'text', type: 'string',}, + productServiceYear: {title: '服务年限',order: 1,view: 'text', type: 'string',}, + productMoney: {title: '销售金额',order: 2,view: 'number', type: 'number',}, + storeName: {title: '经销商',order: 3,view: 'text', type: 'string',}, + custName: {title: '客户姓名',order: 4,view: 'text', type: 'string',}, + custAddress: {title: '客户地址',order: 5,view: 'text', type: 'string',}, + custCardNo: {title: '客户证件号',order: 6,view: 'text', type: 'string',}, + custPhone: {title: '客户联系电话',order: 7,view: 'text', type: 'string',}, + salePort: {title: '销售端口',order: 8,view: 'list', type: 'string',dictCode: 'order_sale_port',}, + saleName: {title: '销售顾问',order: 9,view: 'text', type: 'string',}, + payType: {title: '付款方式',order: 10,view: 'text', type: 'string',}, + custType: {title: '客户类型',order: 11,view: 'number', type: 'number',dictCode: 'customer_type',}, + certFront: {title: '身份证正面照',order: 12,view: 'image', type: 'string',}, + certBack: {title: '身份证反面照',order: 13,view: 'image', type: 'string',}, + carPic: {title: '车辆合格证',order: 14,view: 'image', type: 'string',}, + busLicense: {title: '营业执照',order: 15,view: 'image', type: 'string',}, + createTime: {title: '创建日期',order: 16,view: 'datetime', type: 'string',}, + status: {title: '订单状态',order: 17,view: 'number', type: 'number',dictCode: '',}, + contractUrl: {title: '订单合同',order: 18,view: 'file', type: 'string',}, + payee: {title: '收款方',order: 19,view: 'text', type: 'string',}, + payeeTime: {title: '收款时间',order: 20,view: 'datetime', type: 'string',}, + payVoucherUrl: {title: '支付凭证',order: 21,view: 'image', type: 'string',}, + orderNum: {title: '订单编号',order: 22,view: 'text', type: 'string',}, + //子表高级查询 + appOrderCar: { + title: '订单车辆信息', + view: 'table', + fields: { + carSeries: {title: '车牌车系',order: 0,view: 'text', type: 'string',}, + vin: {title: '车架号',order: 1,view: 'text', type: 'string',}, + carType: {title: '车辆类型',order: 2,view: 'text', type: 'string',}, + useType: {title: '使用性质',order: 3,view: 'text', type: 'string',}, + newCar: {title: '是否新车',order: 4,view: 'number', type: 'number',}, + carModel: {title: '车辆型号',order: 5,view: 'text', type: 'string',}, + carNo: {title: '车牌号',order: 6,view: 'text', type: 'string',}, + engineNo: {title: '发动机号',order: 7,view: 'text', type: 'string',}, + mileage: {title: '里程',order: 8,view: 'text', type: 'string',}, + buyTime: {title: '购车时间',order: 9,view: 'datetime', type: 'string',}, + buyMoney: {title: '车辆购置价',order: 10,view: 'number', type: 'number',}, + buyTax: {title: '车辆购置税',order: 11,view: 'number', type: 'number',}, + createTime: {title: '创建日期',order: 12,view: 'datetime', type: 'string',}, + } + }, + appOrderVoucher: { + title: '订单凭证信息', + view: 'table', + fields: { + firstBeneficiary: {title: '第一受益人',order: 0,view: 'text', type: 'string',}, + serviceMoney: {title: '服务费',order: 1,view: 'number', type: 'number',}, + effectiveTime: {title: '生效时间',order: 2,view: 'datetime', type: 'string',}, + serviceYear: {title: '服务年限',order: 3,view: 'text', type: 'string',}, + equityPackage: {title: '权益套餐',order: 4,view: 'text', type: 'string',}, + packageMoney: {title: '套餐价',order: 5,view: 'number', type: 'number',}, + carInsuranceNo: {title: '商业险编号',order: 6,view: 'text', type: 'string',}, + registeredCity: {title: '上牌城市',order: 7,view: 'text', type: 'string',}, + insuranceName: {title: '保险公司',order: 8,view: 'text', type: 'string',}, + assigneeName: {title: '受让人名称',order: 9,view: 'text', type: 'string',}, + assigneePhone: {title: '受让人电话',order: 10,view: 'text', type: 'string',}, + assigneeCardNo: {title: '受让人身份证',order: 11,view: 'text', type: 'string',}, + payTime: {title: '支付时间',order: 12,view: 'date', type: 'string',}, + dealerAddress: {title: '经销商地址',order: 13,view: 'text', type: 'string',}, + } + }, + appOrderFinance: { + title: '订单金融信息', + view: 'table', + fields: { + lender: {title: '贷款机构',order: 0,view: 'text', type: 'string',}, + lenderMoney: {title: '贷款金额',order: 1,view: 'number', type: 'number',}, + lenderYear: {title: '贷款年限',order: 2,view: 'text', type: 'string',}, + } + }, +}; + +/** +* 流程表单调用这个方法获取formSchema +* @param param +*/ +export function getBpmFormSchema(_formData): FormSchema[]{ +// 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema + return formSchema; +} \ No newline at end of file diff --git a/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/vue3/AppOrderList.vue b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/vue3/AppOrderList.vue new file mode 100644 index 0000000..727e548 --- /dev/null +++ b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/vue3/AppOrderList.vue @@ -0,0 +1,198 @@ + + + + + \ No newline at end of file diff --git a/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/vue3/V20250220_1__menu_insert_AppOrder.sql b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/vue3/V20250220_1__menu_insert_AppOrder.sql new file mode 100644 index 0000000..bb7a4a2 --- /dev/null +++ b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/vue3/V20250220_1__menu_insert_AppOrder.sql @@ -0,0 +1,26 @@ +-- 注意:该页面对应的前台目录为views/order文件夹下 +-- 如果你想更改到其他目录,请修改sql中component字段对应的值 + + +INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external) +VALUES ('202502200943650390', NULL, '合同订单表', '/order/appOrderList', 'miniapp/order/AppOrderList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2025-02-20 21:43:39', NULL, NULL, 0); + +-- 权限控制sql +-- 新增 +INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) +VALUES ('202502200943650391', '202502200943650390', '添加合同订单表', NULL, NULL, 0, NULL, NULL, 2, 'order:app_order:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-02-20 21:43:39', NULL, NULL, 0, 0, '1', 0); +-- 编辑 +INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) +VALUES ('202502200943650392', '202502200943650390', '编辑合同订单表', NULL, NULL, 0, NULL, NULL, 2, 'order:app_order:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-02-20 21:43:39', NULL, NULL, 0, 0, '1', 0); +-- 删除 +INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) +VALUES ('202502200943650393', '202502200943650390', '删除合同订单表', NULL, NULL, 0, NULL, NULL, 2, 'order:app_order:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-02-20 21:43:39', NULL, NULL, 0, 0, '1', 0); +-- 批量删除 +INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) +VALUES ('202502200943650394', '202502200943650390', '批量删除合同订单表', NULL, NULL, 0, NULL, NULL, 2, 'order:app_order:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-02-20 21:43:39', NULL, NULL, 0, 0, '1', 0); +-- 导出excel +INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) +VALUES ('202502200943650395', '202502200943650390', '导出excel_合同订单表', NULL, NULL, 0, NULL, NULL, 2, 'order:app_order:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-02-20 21:43:39', NULL, NULL, 0, 0, '1', 0); +-- 导入excel +INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) +VALUES ('202502200943650396', '202502200943650390', '导入excel_合同订单表', NULL, NULL, 0, NULL, NULL, 2, 'order:app_order:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-02-20 21:43:39', NULL, NULL, 0, 0, '1', 0); diff --git a/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/vue3/components/AppOrderCarForm.vue b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/vue3/components/AppOrderCarForm.vue new file mode 100644 index 0000000..cda026d --- /dev/null +++ b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/vue3/components/AppOrderCarForm.vue @@ -0,0 +1,78 @@ + + + diff --git a/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/vue3/components/AppOrderFinanceForm.vue b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/vue3/components/AppOrderFinanceForm.vue new file mode 100644 index 0000000..dade501 --- /dev/null +++ b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/vue3/components/AppOrderFinanceForm.vue @@ -0,0 +1,78 @@ + + + diff --git a/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/vue3/components/AppOrderForm.vue b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/vue3/components/AppOrderForm.vue new file mode 100644 index 0000000..67f7f89 --- /dev/null +++ b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/vue3/components/AppOrderForm.vue @@ -0,0 +1,135 @@ + + + \ No newline at end of file diff --git a/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/vue3/components/AppOrderModal.vue b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/vue3/components/AppOrderModal.vue new file mode 100644 index 0000000..4221953 --- /dev/null +++ b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/vue3/components/AppOrderModal.vue @@ -0,0 +1,141 @@ + + + + + \ No newline at end of file diff --git a/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/vue3/components/AppOrderVoucherForm.vue b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/vue3/components/AppOrderVoucherForm.vue new file mode 100644 index 0000000..a664f52 --- /dev/null +++ b/jeecg-module-demo/src/main/java/org/jeecg/modules/sysMiniapp/order/vue3/components/AppOrderVoucherForm.vue @@ -0,0 +1,78 @@ + + + diff --git a/jeecg-module-miniapp/pom.xml b/jeecg-module-miniapp/pom.xml index 5dd69eb..26bb0cb 100644 --- a/jeecg-module-miniapp/pom.xml +++ b/jeecg-module-miniapp/pom.xml @@ -51,3 +51,4 @@ + diff --git a/jeecg-module-miniapp/src/main/java/org/jeecg/modules/miniapp/cartree/controller/CarTreeController.java b/jeecg-module-miniapp/src/main/java/org/jeecg/modules/miniapp/cartree/controller/CarTreeController.java new file mode 100644 index 0000000..bab3cf8 --- /dev/null +++ b/jeecg-module-miniapp/src/main/java/org/jeecg/modules/miniapp/cartree/controller/CarTreeController.java @@ -0,0 +1,183 @@ +package org.jeecg.modules.miniapp.cartree.controller; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.aspect.annotation.AutoLog; +import org.jeecg.common.system.base.controller.JeecgController; +import org.jeecg.common.system.query.QueryGenerator; +import org.jeecg.common.system.vo.SelectTreeModel; +import org.jeecg.common.util.oConvertUtils; +import org.jeecg.modules.sysMiniapp.car.entity.AppCarTree; +import org.jeecg.modules.sysMiniapp.car.service.IAppCarTreeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.servlet.ModelAndView; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Arrays; +import java.util.List; + +/** +* @Description: 汽车品牌 +* @Author: jeecg-boot +* @Date: 2025-02-19 +* @Version: V1.0 +*/ +@Api(tags="汽车品牌") +@RestController +@RequestMapping("/miniapp/car") +@Slf4j +public class CarTreeController extends JeecgController{ + @Autowired + private IAppCarTreeService appCarTreeService; + + /** + * 分页列表查询 + * + * @param appCarTree + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "汽车品牌-分页列表查询") + @ApiOperation(value="汽车品牌-分页列表查询", notes="汽车品牌-分页列表查询") + @GetMapping(value = "/rootList") + public Result> queryPageList(AppCarTree appCarTree, + @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 queryWrapper = QueryGenerator.initQueryWrapper(appCarTree, req.getParameterMap()); + List list = appCarTreeService.queryTreeListNoPage(queryWrapper); + IPage pageList = new Page<>(1, 10, list.size()); + pageList.setRecords(list); + return Result.OK(pageList); + }else{ + String parentId = appCarTree.getPid(); + if (oConvertUtils.isEmpty(parentId)) { + parentId = "0"; + } + appCarTree.setPid(null); + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(appCarTree, req.getParameterMap()); + // 使用 eq 防止模糊查询 + queryWrapper.eq("pid", parentId); + Page page = new Page(pageNo, pageSize); + IPage pageList = appCarTreeService.page(page, queryWrapper); + return Result.OK(pageList); + } + } + + /** + * 【vue3专用】加载节点的子数据 + * + * @param pid + * @return + */ + @RequestMapping(value = "/loadTreeChildren", method = RequestMethod.GET) + public Result> loadTreeChildren(@RequestParam(name = "pid") String pid) { + Result> result = new Result<>(); + try { + List ls = appCarTreeService.queryListByPid(pid); + result.setResult(ls); + result.setSuccess(true); + } catch (Exception e) { + e.printStackTrace(); + result.setMessage(e.getMessage()); + result.setSuccess(false); + } + return result; + } + + /** + * 【vue3专用】加载一级节点/如果是同步 则所有数据 + * + * @param async + * @param pcode + * @return + */ + @RequestMapping(value = "/loadTreeRoot", method = RequestMethod.GET) + public Result> loadTreeRoot(@RequestParam(name = "async") Boolean async, @RequestParam(name = "pcode") String pcode) { + Result> result = new Result<>(); + try { + List ls = appCarTreeService.queryListByCode(pcode); + if (!async) { + loadAllChildren(ls); + } + result.setResult(ls); + result.setSuccess(true); + } catch (Exception e) { + e.printStackTrace(); + result.setMessage(e.getMessage()); + result.setSuccess(false); + } + return result; + } + + /** + * 【vue3专用】递归求子节点 同步加载用到 + * + * @param ls + */ + private void loadAllChildren(List ls) { + for (SelectTreeModel tsm : ls) { + List temp = appCarTreeService.queryListByPid(tsm.getKey()); + if (temp != null && temp.size() > 0) { + tsm.setChildren(temp); + loadAllChildren(temp); + } + } + } + + /** + * 获取子数据 + * @param appCarTree + * @param req + * @return + */ + //@AutoLog(value = "汽车品牌-获取子数据") + @ApiOperation(value="汽车品牌-获取子数据", notes="汽车品牌-获取子数据") + @GetMapping(value = "/childList") + public Result> queryPageList(AppCarTree appCarTree,HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(appCarTree, req.getParameterMap()); + List list = appCarTreeService.list(queryWrapper); + IPage 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 queryWrapper = new QueryWrapper<>(); + List parentIdList = Arrays.asList(parentIds.split(",")); + queryWrapper.in("pid", parentIdList); + List list = appCarTreeService.list(queryWrapper); + IPage 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()); + } + } + + +} diff --git a/jeecg-module-miniapp/src/main/java/org/jeecg/modules/miniapp/file/controller/FileController.java b/jeecg-module-miniapp/src/main/java/org/jeecg/modules/miniapp/file/controller/FileController.java new file mode 100644 index 0000000..0178b96 --- /dev/null +++ b/jeecg-module-miniapp/src/main/java/org/jeecg/modules/miniapp/file/controller/FileController.java @@ -0,0 +1,183 @@ +package org.jeecg.modules.miniapp.file.controller; + +/** + * @author tanzs + * @date 2025/2/20 22:19 + * 文件处理 + */ + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.constant.CommonConstant; +import org.jeecg.common.constant.SymbolConstant; +import org.jeecg.common.exception.JeecgBootException; +import org.jeecg.common.util.CommonUtils; +import org.jeecg.common.util.filter.SsrfFileTypeFilter; +import org.jeecg.common.util.oConvertUtils; +import org.jeecg.modules.miniapp.file.service.impl.FileServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.util.AntPathMatcher; +import org.springframework.util.FileCopyUtils; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.MultipartHttpServletRequest; +import org.springframework.web.servlet.HandlerMapping; +import org.springframework.web.servlet.ModelAndView; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.*; + +@Api(tags="文件处理") +@RestController +@RequestMapping("/miniapp/file") +@Slf4j +public class FileController { + + @Value(value = "${jeecg.path.upload}") + private String uploadpath; + + /** + * 本地:local minio:minio 阿里:alioss + */ + @Value(value="${jeecg.uploadType}") + private String uploadType; + + @Autowired + private FileServiceImpl fileService; + + + + @ApiOperation(value="身份证识别", notes="身份证识别") + @PostMapping(value = "/ocr/idcard") + public Result ocrIdCard(@RequestParam(name="url") String url, @RequestParam(name="side") String side){ + return fileService.ocrIdCard(url,side); + } + + /** + * 文件上传统一方法 + * @param request + * @param response + * @return + */ + @ApiOperation(value="通用文件上传", notes="通用文件上传") + @PostMapping(value = "/upload") + public Result upload(HttpServletRequest request, HttpServletResponse response) throws Exception { + Result result = new Result<>(); + String savePath = ""; + String bizPath = request.getParameter("biz"); + + //LOWCOD-2580 sys/common/upload接口存在任意文件上传漏洞 + if (oConvertUtils.isNotEmpty(bizPath)) { + if(bizPath.contains(SymbolConstant.SPOT_SINGLE_SLASH) || bizPath.contains(SymbolConstant.SPOT_DOUBLE_BACKSLASH)){ + throw new JeecgBootException("上传目录bizPath,格式非法!"); + } + } + + MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; + // 获取上传文件对象 + MultipartFile file = multipartRequest.getFile("file"); + if(oConvertUtils.isEmpty(bizPath)){ + if(CommonConstant.UPLOAD_TYPE_OSS.equals(uploadType)){ + //未指定目录,则用阿里云默认目录 upload + bizPath = "upload"; + //result.setMessage("使用阿里云文件上传时,必须添加目录!"); + //result.setSuccess(false); + //return result; + }else{ + bizPath = ""; + } + } + if(CommonConstant.UPLOAD_TYPE_LOCAL.equals(uploadType)){ + //update-begin-author:liusq date:20221102 for: 过滤上传文件类型 + SsrfFileTypeFilter.checkUploadFileType(file); + //update-end-author:liusq date:20221102 for: 过滤上传文件类型 + //update-begin-author:lvdandan date:20200928 for:修改JEditor编辑器本地上传 + savePath = this.uploadLocal(file,bizPath); + //update-begin-author:lvdandan date:20200928 for:修改JEditor编辑器本地上传 + /** 富文本编辑器及markdown本地上传时,采用返回链接方式 + //针对jeditor编辑器如何使 lcaol模式,采用 base64格式存储 + String jeditor = request.getParameter("jeditor"); + if(oConvertUtils.isNotEmpty(jeditor)){ + result.setMessage(CommonConstant.UPLOAD_TYPE_LOCAL); + result.setSuccess(true); + return result; + }else{ + savePath = this.uploadLocal(file,bizPath); + } + */ + }else{ + //update-begin-author:taoyan date:20200814 for:文件上传改造 + savePath = CommonUtils.upload(file, bizPath, uploadType); + //update-end-author:taoyan date:20200814 for:文件上传改造 + } + if(oConvertUtils.isNotEmpty(savePath)){ + result.setMessage(savePath); + result.setSuccess(true); + }else { + result.setMessage("上传失败!"); + result.setSuccess(false); + } + return result; + } + + + /** + * 本地文件上传 + * @param mf 文件 + * @param bizPath 自定义路径 + * @return + */ + private String uploadLocal(MultipartFile mf,String bizPath){ + try { + String ctxPath = uploadpath; + String fileName = null; + File file = new File(ctxPath + File.separator + bizPath + File.separator ); + if (!file.exists()) { + // 创建文件根目录 + file.mkdirs(); + } + // 获取文件名 + String orgName = mf.getOriginalFilename(); + orgName = CommonUtils.getFileName(orgName); + if(orgName.indexOf(SymbolConstant.SPOT)!=-1){ + fileName = orgName.substring(0, orgName.lastIndexOf(".")) + "_" + System.currentTimeMillis() + orgName.substring(orgName.lastIndexOf(".")); + }else{ + fileName = orgName+ "_" + System.currentTimeMillis(); + } + String savePath = file.getPath() + File.separator + fileName; + File savefile = new File(savePath); + FileCopyUtils.copy(mf.getBytes(), savefile); + String dbpath = null; + if(oConvertUtils.isNotEmpty(bizPath)){ + dbpath = bizPath + File.separator + fileName; + }else{ + dbpath = fileName; + } + if (dbpath.contains(SymbolConstant.DOUBLE_BACKSLASH)) { + dbpath = dbpath.replace(SymbolConstant.DOUBLE_BACKSLASH, SymbolConstant.SINGLE_SLASH); + } + return dbpath; + } catch (IOException e) { + log.error(e.getMessage(), e); + } + return ""; + } + + + /** + * 把指定URL后的字符串全部截断当成参数 + * 这么做是为了防止URL中包含中文或者特殊字符(/等)时,匹配不了的问题 + * @param request + * @return + */ + private static String extractPathFromPattern(final HttpServletRequest request) { + String path = (String) request.getAttribute(HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE); + String bestMatchPattern = (String) request.getAttribute(HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE); + return new AntPathMatcher().extractPathWithinPattern(bestMatchPattern, path); + } + +} diff --git a/jeecg-module-miniapp/src/main/java/org/jeecg/modules/miniapp/file/entity/IdCardInfo.java b/jeecg-module-miniapp/src/main/java/org/jeecg/modules/miniapp/file/entity/IdCardInfo.java new file mode 100644 index 0000000..dab92f2 --- /dev/null +++ b/jeecg-module-miniapp/src/main/java/org/jeecg/modules/miniapp/file/entity/IdCardInfo.java @@ -0,0 +1,25 @@ +package org.jeecg.modules.miniapp.file.entity; + +import lombok.Data; + +/** + * @author tanzs + * @date 2025/2/20 22:56 + */ + +@Data +public class IdCardInfo { + + private String name; + + private String address; + + private String idCard; + + private String start; + + private String end; + + private String organ; + +} diff --git a/jeecg-module-miniapp/src/main/java/org/jeecg/modules/miniapp/file/service/FileService.java b/jeecg-module-miniapp/src/main/java/org/jeecg/modules/miniapp/file/service/FileService.java new file mode 100644 index 0000000..78f43d6 --- /dev/null +++ b/jeecg-module-miniapp/src/main/java/org/jeecg/modules/miniapp/file/service/FileService.java @@ -0,0 +1,14 @@ +package org.jeecg.modules.miniapp.file.service; + +import com.alibaba.fastjson.JSONObject; +import org.jeecg.common.api.vo.Result; + + +/** + * @author tanzs + * @date 2025/2/20 22:38 + */ +public interface FileService { + + Result ocrIdCard(String url, String side); +} diff --git a/jeecg-module-miniapp/src/main/java/org/jeecg/modules/miniapp/pdftest/service/PdfService.java b/jeecg-module-miniapp/src/main/java/org/jeecg/modules/miniapp/file/service/PdfService.java similarity index 74% rename from jeecg-module-miniapp/src/main/java/org/jeecg/modules/miniapp/pdftest/service/PdfService.java rename to jeecg-module-miniapp/src/main/java/org/jeecg/modules/miniapp/file/service/PdfService.java index 2b686e9..7e65e88 100644 --- a/jeecg-module-miniapp/src/main/java/org/jeecg/modules/miniapp/pdftest/service/PdfService.java +++ b/jeecg-module-miniapp/src/main/java/org/jeecg/modules/miniapp/file/service/PdfService.java @@ -1,4 +1,4 @@ -package org.jeecg.modules.miniapp.pdftest.service; +package org.jeecg.modules.miniapp.file.service; /** * @author Tanzs diff --git a/jeecg-module-miniapp/src/main/java/org/jeecg/modules/miniapp/file/service/impl/FileServiceImpl.java b/jeecg-module-miniapp/src/main/java/org/jeecg/modules/miniapp/file/service/impl/FileServiceImpl.java new file mode 100644 index 0000000..e1d7fcb --- /dev/null +++ b/jeecg-module-miniapp/src/main/java/org/jeecg/modules/miniapp/file/service/impl/FileServiceImpl.java @@ -0,0 +1,47 @@ +package org.jeecg.modules.miniapp.file.service.impl; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import lombok.extern.slf4j.Slf4j; +import org.jeecg.common.api.vo.Result; +import org.jeecg.modules.miniapp.file.entity.IdCardInfo; +import org.jeecg.modules.miniapp.file.service.FileService; +import org.jeecg.modules.miniapp.utils.BaiduOCRUtil; +import org.springframework.stereotype.Service; + +/** + * @author tanzs + * @date 2025/2/20 22:39 + */ +@Service +@Slf4j +public class FileServiceImpl implements FileService { + @Override + public Result ocrIdCard(String url, String side) { + Result result = new Result<>(); + try { + String info = BaiduOCRUtil.recognizeIdCardWithImage(url, side, false); + JSONObject json = JSON.parseObject(info); + IdCardInfo infoCardInfo = new IdCardInfo(); + if (json.containsKey("words_result") && "front".equals(side)){ + infoCardInfo.setName(json.getJSONObject("words_result").getJSONObject("姓名").getString("words")); + infoCardInfo.setAddress(json.getJSONObject("words_result").getJSONObject("住址").getString("words")); + infoCardInfo.setIdCard(json.getJSONObject("words_result").getJSONObject("公民身份号码").getString("words")); + result.setResult(infoCardInfo); + } else if (json.containsKey("words_result") && "back".equals(side)) { + infoCardInfo.setEnd(json.getJSONObject("words_result").getJSONObject("失效日期").getString("words")); + infoCardInfo.setOrgan(json.getJSONObject("words_result").getJSONObject("签发机关").getString("words")); + infoCardInfo.setStart(json.getJSONObject("words_result").getJSONObject("签发日期").getString("words")); + result.setResult(infoCardInfo); + } else { + result.setSuccess(false); + result.setMessage("识别失败"); + } + + } catch (Exception e) { + result.setSuccess(false); + result.setMessage("识别失败"); + } + return result; + } +} diff --git a/jeecg-module-miniapp/src/main/java/org/jeecg/modules/miniapp/pdftest/service/impl/PdfServiceImpl.java b/jeecg-module-miniapp/src/main/java/org/jeecg/modules/miniapp/file/service/impl/PdfServiceImpl.java similarity index 92% rename from jeecg-module-miniapp/src/main/java/org/jeecg/modules/miniapp/pdftest/service/impl/PdfServiceImpl.java rename to jeecg-module-miniapp/src/main/java/org/jeecg/modules/miniapp/file/service/impl/PdfServiceImpl.java index e9625bf..2012c94 100644 --- a/jeecg-module-miniapp/src/main/java/org/jeecg/modules/miniapp/pdftest/service/impl/PdfServiceImpl.java +++ b/jeecg-module-miniapp/src/main/java/org/jeecg/modules/miniapp/file/service/impl/PdfServiceImpl.java @@ -1,7 +1,7 @@ -package org.jeecg.modules.miniapp.pdftest.service.impl; +package org.jeecg.modules.miniapp.file.service.impl; import org.jeecg.common.util.oss.OssBootUtil; -import org.jeecg.modules.miniapp.pdftest.service.PdfService; +import org.jeecg.modules.miniapp.file.service.PdfService; import org.springframework.stereotype.Service; import java.io.File; diff --git a/jeecg-module-miniapp/src/main/java/org/jeecg/modules/miniapp/order/controller/OrderController.java b/jeecg-module-miniapp/src/main/java/org/jeecg/modules/miniapp/order/controller/OrderController.java new file mode 100644 index 0000000..cfcc4a7 --- /dev/null +++ b/jeecg-module-miniapp/src/main/java/org/jeecg/modules/miniapp/order/controller/OrderController.java @@ -0,0 +1,187 @@ +package org.jeecg.modules.miniapp.order.controller; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.apache.shiro.SecurityUtils; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.aspect.annotation.AutoLog; +import org.jeecg.common.system.query.QueryGenerator; +import org.jeecg.common.system.query.QueryRuleEnum; +import org.jeecg.common.system.vo.LoginUser; +import org.jeecg.common.util.oConvertUtils; +import org.jeecg.modules.sysMiniapp.order.entity.AppOrder; +import org.jeecg.modules.sysMiniapp.order.entity.AppOrderCar; +import org.jeecg.modules.sysMiniapp.order.entity.AppOrderFinance; +import org.jeecg.modules.sysMiniapp.order.entity.AppOrderVoucher; +import org.jeecg.modules.sysMiniapp.order.service.IAppOrderCarService; +import org.jeecg.modules.sysMiniapp.order.service.IAppOrderFinanceService; +import org.jeecg.modules.sysMiniapp.order.service.IAppOrderService; +import org.jeecg.modules.sysMiniapp.order.service.IAppOrderVoucherService; +import org.jeecg.modules.sysMiniapp.order.vo.AppOrderPage; +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.springframework.beans.BeanUtils; +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 javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.*; + + +/** +* @Description: 合同订单表 +* @Author: jeecg-boot +* @Date: 2025-02-20 +* @Version: V1.0 +*/ +@Api(tags="合同订单表") +@RestController +@RequestMapping("/miniapp/order") +@Slf4j +public class OrderController { + @Autowired + private IAppOrderService appOrderService; + @Autowired + private IAppOrderCarService appOrderCarService; + @Autowired + private IAppOrderVoucherService appOrderVoucherService; + @Autowired + private IAppOrderFinanceService appOrderFinanceService; + + /** + * 分页列表查询 + * + * @param appOrder + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "合同订单表-分页列表查询") + @ApiOperation(value="合同订单表-分页列表查询", notes="合同订单表-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(AppOrder appOrder, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + // 自定义查询规则 + Map customeRuleMap = new HashMap<>(); + // 自定义多选的查询规则为:LIKE_WITH_OR + customeRuleMap.put("salePort", QueryRuleEnum.LIKE_WITH_OR); + customeRuleMap.put("custType", QueryRuleEnum.LIKE_WITH_OR); + customeRuleMap.put("status", QueryRuleEnum.LIKE_WITH_OR); + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(appOrder, req.getParameterMap(),customeRuleMap); + Page page = new Page(pageNo, pageSize); + IPage pageList = appOrderService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param appOrderPage + * @return + */ + @AutoLog(value = "合同订单表-添加") + @ApiOperation(value="合同订单表-添加", notes="合同订单表-添加") + @PostMapping(value = "/add") + public Result add(@RequestBody AppOrderPage appOrderPage) { + AppOrder appOrder = new AppOrder(); + BeanUtils.copyProperties(appOrderPage, appOrder); + appOrderService.saveMain(appOrder, appOrderPage.getAppOrderCarList(),appOrderPage.getAppOrderVoucherList(),appOrderPage.getAppOrderFinanceList()); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param appOrderPage + * @return + */ + @AutoLog(value = "合同订单表-编辑") + @ApiOperation(value="合同订单表-编辑", notes="合同订单表-编辑") + @RequiresPermissions("order:app_order:edit") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) + public Result edit(@RequestBody AppOrderPage appOrderPage) { + AppOrder appOrder = new AppOrder(); + BeanUtils.copyProperties(appOrderPage, appOrder); + AppOrder appOrderEntity = appOrderService.getById(appOrder.getId()); + if(appOrderEntity==null) { + return Result.error("未找到对应数据"); + } + appOrderService.updateMain(appOrder, appOrderPage.getAppOrderCarList(),appOrderPage.getAppOrderVoucherList(),appOrderPage.getAppOrderFinanceList()); + return Result.OK("编辑成功!"); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + //@AutoLog(value = "合同订单表-通过id查询") + @ApiOperation(value="合同订单表-通过id查询", notes="合同订单表-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name="id",required=true) String id) { + AppOrder appOrder = appOrderService.getById(id); + if(appOrder==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(appOrder); + + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + //@AutoLog(value = "订单车辆信息通过主表ID查询") + @ApiOperation(value="订单车辆信息主表ID查询", notes="订单车辆信息-通主表ID查询") + @GetMapping(value = "/queryAppOrderCarByMainId") + public Result> queryAppOrderCarListByMainId(@RequestParam(name="id",required=true) String id) { + List appOrderCarList = appOrderCarService.selectByMainId(id); + return Result.OK(appOrderCarList); + } + /** + * 通过id查询 + * + * @param id + * @return + */ + //@AutoLog(value = "订单凭证信息通过主表ID查询") + @ApiOperation(value="订单凭证信息主表ID查询", notes="订单凭证信息-通主表ID查询") + @GetMapping(value = "/queryAppOrderVoucherByMainId") + public Result> queryAppOrderVoucherListByMainId(@RequestParam(name="id",required=true) String id) { + List appOrderVoucherList = appOrderVoucherService.selectByMainId(id); + return Result.OK(appOrderVoucherList); + } + /** + * 通过id查询 + * + * @param id + * @return + */ + //@AutoLog(value = "订单金融信息通过主表ID查询") + @ApiOperation(value="订单金融信息主表ID查询", notes="订单金融信息-通主表ID查询") + @GetMapping(value = "/queryAppOrderFinanceByMainId") + public Result> queryAppOrderFinanceListByMainId(@RequestParam(name="id",required=true) String id) { + List appOrderFinanceList = appOrderFinanceService.selectByMainId(id);return Result.OK(appOrderFinanceList); + } + + +} diff --git a/jeecg-module-miniapp/src/main/java/org/jeecg/modules/miniapp/utils/BaiduOCRUtil.java b/jeecg-module-miniapp/src/main/java/org/jeecg/modules/miniapp/utils/BaiduOCRUtil.java index dd3bcf3..2274dd4 100644 --- a/jeecg-module-miniapp/src/main/java/org/jeecg/modules/miniapp/utils/BaiduOCRUtil.java +++ b/jeecg-module-miniapp/src/main/java/org/jeecg/modules/miniapp/utils/BaiduOCRUtil.java @@ -155,7 +155,8 @@ public class BaiduOCRUtil { public static void main(String[] args) throws IOException { // 示例:调用身份证识别API(图片URL) // String idCardResultUrl = recognizeIdCardWithImage("/Users/tanzs/Pictures/cert/font.jpg","front",true); - String idCardResultUrl = recognizeIdCardWithImage("https://jf.sh.189.cn/minio/gov-miniapp/order_pdf/font.jpg","front",false); +// String idCardResultUrl = recognizeIdCardWithImage("https://img.augcl.com/temp/font_1740062829439.jpg","front",false); + String idCardResultUrl = recognizeIdCardWithImage("https://img.augcl.com/temp/back_1740063490107.jpg","back",false); System.out.println("身份证识别结果: " + idCardResultUrl); // 示例:调用营业执照识别API(图片URL) diff --git a/jeecg-module-system/jeecg-system-start/src/test/java/org/jeecg/modules/miniapp/pdf/PdfUtilTest.java b/jeecg-module-system/jeecg-system-start/src/test/java/org/jeecg/modules/miniapp/pdf/PdfUtilTest.java index b778d42..c16a510 100644 --- a/jeecg-module-system/jeecg-system-start/src/test/java/org/jeecg/modules/miniapp/pdf/PdfUtilTest.java +++ b/jeecg-module-system/jeecg-system-start/src/test/java/org/jeecg/modules/miniapp/pdf/PdfUtilTest.java @@ -1,7 +1,7 @@ package org.jeecg.modules.miniapp.pdf; import org.jeecg.JeecgSystemApplication; -import org.jeecg.modules.miniapp.pdftest.service.PdfService; +import org.jeecg.modules.miniapp.file.service.PdfService; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired;