| @ -1,4 +1,4 @@ | |||
| package org.jeecg.modules.demo.car.entity; | |||
| package org.jeecg.modules.sysMiniapp.car.entity; | |||
| import java.io.Serializable; | |||
| import java.util.Date; | |||
| @ -1,9 +1,9 @@ | |||
| package org.jeecg.modules.demo.car.mapper; | |||
| package org.jeecg.modules.sysMiniapp.car.mapper; | |||
| import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import org.jeecg.common.system.vo.SelectTreeModel; | |||
| import org.jeecg.modules.demo.car.entity.AppCarTree; | |||
| import org.jeecg.modules.sysMiniapp.car.entity.AppCarTree; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| @ -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<IPage<AppOrder>> queryPageList(AppOrder appOrder, | |||
| @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, | |||
| @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, | |||
| HttpServletRequest req) { | |||
| // 自定义查询规则 | |||
| Map<String, QueryRuleEnum> 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<AppOrder> queryWrapper = QueryGenerator.initQueryWrapper(appOrder, req.getParameterMap(),customeRuleMap); | |||
| Page<AppOrder> page = new Page<AppOrder>(pageNo, pageSize); | |||
| IPage<AppOrder> 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<String> 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<String> 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<String> 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<String> 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<AppOrder> 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<List<AppOrderCar>> queryAppOrderCarListByMainId(@RequestParam(name="id",required=true) String id) { | |||
| List<AppOrderCar> 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<List<AppOrderVoucher>> queryAppOrderVoucherListByMainId(@RequestParam(name="id",required=true) String id) { | |||
| List<AppOrderVoucher> 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<List<AppOrderFinance>> queryAppOrderFinanceListByMainId(@RequestParam(name="id",required=true) String id) { | |||
| List<AppOrderFinance> 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<AppOrder> queryWrapper = QueryGenerator.initQueryWrapper(appOrder, request.getParameterMap()); | |||
| LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); | |||
| //配置选中数据查询条件 | |||
| String selections = request.getParameter("selections"); | |||
| if(oConvertUtils.isNotEmpty(selections)) { | |||
| List<String> selectionList = Arrays.asList(selections.split(",")); | |||
| queryWrapper.in("id",selectionList); | |||
| } | |||
| //Step.2 获取导出数据 | |||
| List<AppOrder> appOrderList = appOrderService.list(queryWrapper); | |||
| // Step.3 组装pageList | |||
| List<AppOrderPage> pageList = new ArrayList<AppOrderPage>(); | |||
| for (AppOrder main : appOrderList) { | |||
| AppOrderPage vo = new AppOrderPage(); | |||
| BeanUtils.copyProperties(main, vo); | |||
| List<AppOrderCar> appOrderCarList = appOrderCarService.selectByMainId(main.getId()); | |||
| vo.setAppOrderCarList(appOrderCarList); | |||
| List<AppOrderVoucher> appOrderVoucherList = appOrderVoucherService.selectByMainId(main.getId()); | |||
| vo.setAppOrderVoucherList(appOrderVoucherList); | |||
| List<AppOrderFinance> 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<String, MultipartFile> fileMap = multipartRequest.getFileMap(); | |||
| for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) { | |||
| // 获取上传文件对象 | |||
| MultipartFile file = entity.getValue(); | |||
| ImportParams params = new ImportParams(); | |||
| params.setTitleRows(2); | |||
| params.setHeadRows(1); | |||
| params.setNeedSave(true); | |||
| try { | |||
| List<AppOrderPage> 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("文件导入失败!"); | |||
| } | |||
| } | |||
| @ -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; | |||
| } | |||
| @ -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; | |||
| } | |||
| @ -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; | |||
| } | |||
| @ -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; | |||
| } | |||
| @ -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<AppOrderCar> { | |||
| /** | |||
| * 通过主表id删除子表数据 | |||
| * | |||
| * @param mainId 主表id | |||
| * @return boolean | |||
| */ | |||
| public boolean deleteByMainId(@Param("mainId") String mainId); | |||
| /** | |||
| * 通过主表id查询子表数据 | |||
| * | |||
| * @param mainId 主表id | |||
| * @return List<AppOrderCar> | |||
| */ | |||
| public List<AppOrderCar> selectByMainId(@Param("mainId") String mainId); | |||
| } | |||
| @ -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<AppOrderFinance> { | |||
| /** | |||
| * 通过主表id删除子表数据 | |||
| * | |||
| * @param mainId 主表id | |||
| * @return boolean | |||
| */ | |||
| public boolean deleteByMainId(@Param("mainId") String mainId); | |||
| /** | |||
| * 通过主表id查询子表数据 | |||
| * | |||
| * @param mainId 主表id | |||
| * @return List<AppOrderFinance> | |||
| */ | |||
| public List<AppOrderFinance> selectByMainId(@Param("mainId") String mainId); | |||
| } | |||
| @ -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<AppOrder> { | |||
| } | |||
| @ -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<AppOrderVoucher> { | |||
| /** | |||
| * 通过主表id删除子表数据 | |||
| * | |||
| * @param mainId 主表id | |||
| * @return boolean | |||
| */ | |||
| public boolean deleteByMainId(@Param("mainId") String mainId); | |||
| /** | |||
| * 通过主表id查询子表数据 | |||
| * | |||
| * @param mainId 主表id | |||
| * @return List<AppOrderVoucher> | |||
| */ | |||
| public List<AppOrderVoucher> selectByMainId(@Param("mainId") String mainId); | |||
| } | |||
| @ -0,0 +1,16 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
| <mapper namespace="org.jeecg.modules.sysMiniapp.order.mapper.AppOrderCarMapper"> | |||
| <delete id="deleteByMainId" parameterType="java.lang.String"> | |||
| DELETE | |||
| FROM app_order_car | |||
| WHERE | |||
| order_fk_id = #{mainId} </delete> | |||
| <select id="selectByMainId" parameterType="java.lang.String" resultType="org.jeecg.modules.sysMiniapp.order.entity.AppOrderCar"> | |||
| SELECT * | |||
| FROM app_order_car | |||
| WHERE | |||
| order_fk_id = #{mainId} </select> | |||
| </mapper> | |||
| @ -0,0 +1,16 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
| <mapper namespace="org.jeecg.modules.sysMiniapp.order.mapper.AppOrderFinanceMapper"> | |||
| <delete id="deleteByMainId" parameterType="java.lang.String"> | |||
| DELETE | |||
| FROM app_order_finance | |||
| WHERE | |||
| order_fk_id = #{mainId} </delete> | |||
| <select id="selectByMainId" parameterType="java.lang.String" resultType="org.jeecg.modules.sysMiniapp.order.entity.AppOrderFinance"> | |||
| SELECT * | |||
| FROM app_order_finance | |||
| WHERE | |||
| order_fk_id = #{mainId} </select> | |||
| </mapper> | |||
| @ -0,0 +1,5 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
| <mapper namespace="org.jeecg.modules.sysMiniapp.order.mapper.AppOrderMapper"> | |||
| </mapper> | |||
| @ -0,0 +1,16 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
| <mapper namespace="org.jeecg.modules.sysMiniapp.order.mapper.AppOrderVoucherMapper"> | |||
| <delete id="deleteByMainId" parameterType="java.lang.String"> | |||
| DELETE | |||
| FROM app_order_voucher | |||
| WHERE | |||
| order_fk_id = #{mainId} </delete> | |||
| <select id="selectByMainId" parameterType="java.lang.String" resultType="org.jeecg.modules.sysMiniapp.order.entity.AppOrderVoucher"> | |||
| SELECT * | |||
| FROM app_order_voucher | |||
| WHERE | |||
| order_fk_id = #{mainId} </select> | |||
| </mapper> | |||
| @ -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<AppOrderCar> { | |||
| /** | |||
| * 通过主表id查询子表数据 | |||
| * | |||
| * @param mainId 主表id | |||
| * @return List<AppOrderCar> | |||
| */ | |||
| public List<AppOrderCar> selectByMainId(String mainId); | |||
| } | |||
| @ -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<AppOrderFinance> { | |||
| /** | |||
| * 通过主表id查询子表数据 | |||
| * | |||
| * @param mainId 主表id | |||
| * @return List<AppOrderFinance> | |||
| */ | |||
| public List<AppOrderFinance> selectByMainId(String mainId); | |||
| } | |||
| @ -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<AppOrder> { | |||
| /** | |||
| * 添加一对多 | |||
| * | |||
| * @param appOrder | |||
| * @param appOrderCarList | |||
| * @param appOrderVoucherList | |||
| * @param appOrderFinanceList | |||
| */ | |||
| public void saveMain(AppOrder appOrder, List<AppOrderCar> appOrderCarList, List<AppOrderVoucher> appOrderVoucherList, List<AppOrderFinance> appOrderFinanceList) ; | |||
| /** | |||
| * 修改一对多 | |||
| * | |||
| * @param appOrder | |||
| * @param appOrderCarList | |||
| * @param appOrderVoucherList | |||
| * @param appOrderFinanceList | |||
| */ | |||
| public void updateMain(AppOrder appOrder,List<AppOrderCar> appOrderCarList,List<AppOrderVoucher> appOrderVoucherList,List<AppOrderFinance> appOrderFinanceList); | |||
| /** | |||
| * 删除一对多 | |||
| * | |||
| * @param id | |||
| */ | |||
| public void delMain (String id); | |||
| /** | |||
| * 批量删除一对多 | |||
| * | |||
| * @param idList | |||
| */ | |||
| public void delBatchMain (Collection<? extends Serializable> idList); | |||
| } | |||
| @ -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<AppOrderVoucher> { | |||
| /** | |||
| * 通过主表id查询子表数据 | |||
| * | |||
| * @param mainId 主表id | |||
| * @return List<AppOrderVoucher> | |||
| */ | |||
| public List<AppOrderVoucher> selectByMainId(String mainId); | |||
| } | |||
| @ -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<AppOrderCarMapper, AppOrderCar> implements IAppOrderCarService { | |||
| @Autowired | |||
| private AppOrderCarMapper appOrderCarMapper; | |||
| @Override | |||
| public List<AppOrderCar> selectByMainId(String mainId) { | |||
| return appOrderCarMapper.selectByMainId(mainId); | |||
| } | |||
| } | |||
| @ -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<AppOrderFinanceMapper, AppOrderFinance> implements IAppOrderFinanceService { | |||
| @Autowired | |||
| private AppOrderFinanceMapper appOrderFinanceMapper; | |||
| @Override | |||
| public List<AppOrderFinance> selectByMainId(String mainId) { | |||
| return appOrderFinanceMapper.selectByMainId(mainId); | |||
| } | |||
| } | |||
| @ -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<AppOrderMapper, AppOrder> 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<AppOrderCar> appOrderCarList, List<AppOrderVoucher> appOrderVoucherList, List<AppOrderFinance> 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<AppOrderCar> appOrderCarList,List<AppOrderVoucher> appOrderVoucherList,List<AppOrderFinance> 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<? extends Serializable> idList) { | |||
| for(Serializable id:idList) { | |||
| appOrderCarMapper.deleteByMainId(id.toString()); | |||
| appOrderVoucherMapper.deleteByMainId(id.toString()); | |||
| appOrderFinanceMapper.deleteByMainId(id.toString()); | |||
| appOrderMapper.deleteById(id); | |||
| } | |||
| } | |||
| } | |||
| @ -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<AppOrderVoucherMapper, AppOrderVoucher> implements IAppOrderVoucherService { | |||
| @Autowired | |||
| private AppOrderVoucherMapper appOrderVoucherMapper; | |||
| @Override | |||
| public List<AppOrderVoucher> selectByMainId(String mainId) { | |||
| return appOrderVoucherMapper.selectByMainId(mainId); | |||
| } | |||
| } | |||
| @ -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<AppOrderCar> appOrderCarList; | |||
| @ExcelCollection(name="订单凭证信息") | |||
| @ApiModelProperty(value = "订单凭证信息") | |||
| private List<AppOrderVoucher> appOrderVoucherList; | |||
| @ExcelCollection(name="订单金融信息") | |||
| @ApiModelProperty(value = "订单金融信息") | |||
| private List<AppOrderFinance> appOrderFinanceList; | |||
| } | |||
| @ -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}); | |||
| } | |||
| @ -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; | |||
| } | |||
| @ -0,0 +1,198 @@ | |||
| <template> | |||
| <div> | |||
| <!--引用表格--> | |||
| <BasicTable @register="registerTable" :rowSelection="rowSelection"> | |||
| <!--插槽:table标题--> | |||
| <template #tableTitle> | |||
| <a-button type="primary" v-auth="'order:app_order:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button> | |||
| <a-button type="primary" v-auth="'order:app_order:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button> | |||
| <j-upload-button type="primary" v-auth="'order:app_order:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button> | |||
| <a-dropdown v-if="selectedRowKeys.length > 0"> | |||
| <template #overlay> | |||
| <a-menu> | |||
| <a-menu-item key="1" @click="batchHandleDelete"> | |||
| <Icon icon="ant-design:delete-outlined"></Icon> | |||
| 删除 | |||
| </a-menu-item> | |||
| </a-menu> | |||
| </template> | |||
| <a-button v-auth="'order:app_order:deleteBatch'">批量操作 | |||
| <Icon icon="mdi:chevron-down"></Icon> | |||
| </a-button> | |||
| </a-dropdown> | |||
| <!-- 高级查询 --> | |||
| <super-query :config="superQueryConfig" @search="handleSuperQuery" /> | |||
| </template> | |||
| <!--操作栏--> | |||
| <template #action="{ record }"> | |||
| <TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/> | |||
| </template> | |||
| <!--字段回显插槽--> | |||
| <template v-slot:bodyCell="{ column, record, index, text }"> | |||
| <template v-if="column.dataIndex==='contractUrl'"> | |||
| <!--文件字段回显插槽--> | |||
| <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> | |||
| <a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button> | |||
| </template> | |||
| </template> | |||
| </BasicTable> | |||
| <!-- 表单区域 --> | |||
| <AppOrderModal @register="registerModal" @success="handleSuccess"></AppOrderModal> | |||
| </div> | |||
| </template> | |||
| <script lang="ts" name="order-appOrder" setup> | |||
| import {ref, reactive, computed, unref} from 'vue'; | |||
| import {BasicTable, useTable, TableAction} from '/@/components/Table'; | |||
| import { useListPage } from '/@/hooks/system/useListPage' | |||
| import {useModal} from '/@/components/Modal'; | |||
| import AppOrderModal from './components/AppOrderModal.vue' | |||
| import {columns, searchFormSchema, superQuerySchema} from './AppOrder.data'; | |||
| import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './AppOrder.api'; | |||
| import {downloadFile} from '/@/utils/common/renderUtils'; | |||
| import { useUserStore } from '/@/store/modules/user'; | |||
| const queryParam = reactive<any>({}); | |||
| const checkedKeys = ref<Array<string | number>>([]); | |||
| const userStore = useUserStore(); | |||
| //注册model | |||
| const [registerModal, {openModal}] = useModal(); | |||
| //注册table数据 | |||
| const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({ | |||
| tableProps:{ | |||
| title: '合同订单表', | |||
| api: list, | |||
| columns, | |||
| canResize:false, | |||
| formConfig: { | |||
| //labelWidth: 120, | |||
| schemas: searchFormSchema, | |||
| autoSubmitOnEnter:true, | |||
| showAdvancedButton:true, | |||
| fieldMapToNumber: [ | |||
| ], | |||
| fieldMapToTime: [ | |||
| ['createTime', ['createTime_begin', 'createTime_end'], 'YYYY-MM-DD HH:mm:ss'], | |||
| ], | |||
| }, | |||
| actionColumn: { | |||
| width: 120, | |||
| fixed:'right' | |||
| }, | |||
| beforeFetch: (params) => { | |||
| return Object.assign(params, queryParam); | |||
| }, | |||
| }, | |||
| exportConfig: { | |||
| name:"合同订单表", | |||
| url: getExportUrl, | |||
| params: queryParam, | |||
| }, | |||
| importConfig: { | |||
| url: getImportUrl, | |||
| success: handleSuccess | |||
| }, | |||
| }) | |||
| const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext | |||
| // 高级查询配置 | |||
| const superQueryConfig = reactive(superQuerySchema); | |||
| /** | |||
| * 高级查询事件 | |||
| */ | |||
| function handleSuperQuery(params) { | |||
| Object.keys(params).map((k) => { | |||
| queryParam[k] = params[k]; | |||
| }); | |||
| reload(); | |||
| } | |||
| /** | |||
| * 新增事件 | |||
| */ | |||
| function handleAdd() { | |||
| openModal(true, { | |||
| isUpdate: false, | |||
| showFooter: true, | |||
| }); | |||
| } | |||
| /** | |||
| * 编辑事件 | |||
| */ | |||
| function handleEdit(record: Recordable) { | |||
| openModal(true, { | |||
| record, | |||
| isUpdate: true, | |||
| showFooter: true, | |||
| }); | |||
| } | |||
| /** | |||
| * 详情 | |||
| */ | |||
| function handleDetail(record: Recordable) { | |||
| openModal(true, { | |||
| record, | |||
| isUpdate: true, | |||
| showFooter: false, | |||
| }); | |||
| } | |||
| /** | |||
| * 删除事件 | |||
| */ | |||
| async function handleDelete(record) { | |||
| await deleteOne({id: record.id}, handleSuccess); | |||
| } | |||
| /** | |||
| * 批量删除事件 | |||
| */ | |||
| async function batchHandleDelete() { | |||
| await batchDelete({ids: selectedRowKeys.value},handleSuccess); | |||
| } | |||
| /** | |||
| * 成功回调 | |||
| */ | |||
| function handleSuccess() { | |||
| (selectedRowKeys.value = []) && reload(); | |||
| } | |||
| /** | |||
| * 操作栏 | |||
| */ | |||
| function getTableAction(record){ | |||
| return [ | |||
| { | |||
| label: '编辑', | |||
| onClick: handleEdit.bind(null, record), | |||
| auth: 'order:app_order:edit' | |||
| } | |||
| ] | |||
| } | |||
| /** | |||
| * 下拉操作栏 | |||
| */ | |||
| function getDropDownAction(record){ | |||
| return [ | |||
| { | |||
| label: '详情', | |||
| onClick: handleDetail.bind(null, record), | |||
| }, { | |||
| label: '删除', | |||
| popConfirm: { | |||
| title: '是否确认删除', | |||
| confirm: handleDelete.bind(null, record), | |||
| placement: 'topLeft' | |||
| }, | |||
| auth: 'order:app_order:delete' | |||
| } | |||
| ] | |||
| } | |||
| </script> | |||
| <style lang="less" scoped> | |||
| :deep(.ant-picker),:deep(.ant-input-number){ | |||
| width: 100%; | |||
| } | |||
| </style> | |||
| @ -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); | |||
| @ -0,0 +1,78 @@ | |||
| <template> | |||
| <BasicForm @register="registerForm" name="AppOrderCarForm" class="basic-modal-form"/> | |||
| </template> | |||
| <script lang="ts"> | |||
| import {defineComponent} from 'vue'; | |||
| import {BasicForm, useForm} from '/@/components/Form/index'; | |||
| import {appOrderCarFormSchema} from '../AppOrder.data'; | |||
| import {defHttp} from '/@/utils/http/axios'; | |||
| import { VALIDATE_FAILED } from '/@/utils/common/vxeUtils' | |||
| export default defineComponent({ | |||
| name:"AppOrderCarForm", | |||
| components: {BasicForm}, | |||
| emits:['register'], | |||
| props:{ | |||
| disabled: { | |||
| type: Boolean, | |||
| default: false | |||
| } | |||
| }, | |||
| setup(props,{emit}) { | |||
| const [registerForm, { setProps, resetFields, setFieldsValue, getFieldsValue, validate, scrollToField }] = useForm({ | |||
| schemas: appOrderCarFormSchema, | |||
| showActionButtonGroup: false, | |||
| baseColProps: {span: 12} | |||
| }); | |||
| /** | |||
| *初始化加载数据 | |||
| */ | |||
| function initFormData(url,id){ | |||
| if(id){ | |||
| defHttp.get({url,params:{id}},{isTransformResponse:false}).then(res=>{ | |||
| res.success && setFieldsValue({...res.result[0]}); | |||
| }) | |||
| } | |||
| setProps({disabled: props.disabled}) | |||
| } | |||
| /** | |||
| *获取表单数据 | |||
| */ | |||
| function getFormData(){ | |||
| let formData = getFieldsValue(); | |||
| Object.keys(formData).map(k=>{ | |||
| if(formData[k] instanceof Array){ | |||
| formData[k] = formData[k].join(',') | |||
| } | |||
| }); | |||
| return [formData]; | |||
| } | |||
| /** | |||
| *表单校验 | |||
| */ | |||
| function validateForm(index){ | |||
| return new Promise((resolve, reject) => { | |||
| // 验证子表表单 | |||
| validate().then(()=>{ | |||
| return resolve() | |||
| }).catch(({ errorFields }) => { | |||
| return reject({ error: VALIDATE_FAILED, index, errorFields: errorFields, scrollToField: scrollToField }); | |||
| }); | |||
| }) | |||
| } | |||
| return { | |||
| registerForm, | |||
| resetFields, | |||
| initFormData, | |||
| getFormData, | |||
| validateForm | |||
| } | |||
| } | |||
| }) | |||
| </script> | |||
| <style lang="less" scoped> | |||
| .basic-modal-form { | |||
| overflow: auto; | |||
| height: 340px; | |||
| } | |||
| </style> | |||
| @ -0,0 +1,78 @@ | |||
| <template> | |||
| <BasicForm @register="registerForm" name="AppOrderFinanceForm" class="basic-modal-form"/> | |||
| </template> | |||
| <script lang="ts"> | |||
| import {defineComponent} from 'vue'; | |||
| import {BasicForm, useForm} from '/@/components/Form/index'; | |||
| import {appOrderFinanceFormSchema} from '../AppOrder.data'; | |||
| import {defHttp} from '/@/utils/http/axios'; | |||
| import { VALIDATE_FAILED } from '/@/utils/common/vxeUtils' | |||
| export default defineComponent({ | |||
| name:"AppOrderFinanceForm", | |||
| components: {BasicForm}, | |||
| emits:['register'], | |||
| props:{ | |||
| disabled: { | |||
| type: Boolean, | |||
| default: false | |||
| } | |||
| }, | |||
| setup(props,{emit}) { | |||
| const [registerForm, { setProps, resetFields, setFieldsValue, getFieldsValue, validate, scrollToField }] = useForm({ | |||
| schemas: appOrderFinanceFormSchema, | |||
| showActionButtonGroup: false, | |||
| baseColProps: {span: 12} | |||
| }); | |||
| /** | |||
| *初始化加载数据 | |||
| */ | |||
| function initFormData(url,id){ | |||
| if(id){ | |||
| defHttp.get({url,params:{id}},{isTransformResponse:false}).then(res=>{ | |||
| res.success && setFieldsValue({...res.result[0]}); | |||
| }) | |||
| } | |||
| setProps({disabled: props.disabled}) | |||
| } | |||
| /** | |||
| *获取表单数据 | |||
| */ | |||
| function getFormData(){ | |||
| let formData = getFieldsValue(); | |||
| Object.keys(formData).map(k=>{ | |||
| if(formData[k] instanceof Array){ | |||
| formData[k] = formData[k].join(',') | |||
| } | |||
| }); | |||
| return [formData]; | |||
| } | |||
| /** | |||
| *表单校验 | |||
| */ | |||
| function validateForm(index){ | |||
| return new Promise((resolve, reject) => { | |||
| // 验证子表表单 | |||
| validate().then(()=>{ | |||
| return resolve() | |||
| }).catch(({ errorFields }) => { | |||
| return reject({ error: VALIDATE_FAILED, index, errorFields: errorFields, scrollToField: scrollToField }); | |||
| }); | |||
| }) | |||
| } | |||
| return { | |||
| registerForm, | |||
| resetFields, | |||
| initFormData, | |||
| getFormData, | |||
| validateForm | |||
| } | |||
| } | |||
| }) | |||
| </script> | |||
| <style lang="less" scoped> | |||
| .basic-modal-form { | |||
| overflow: auto; | |||
| height: 340px; | |||
| } | |||
| </style> | |||
| @ -0,0 +1,135 @@ | |||
| <template> | |||
| <div> | |||
| <BasicForm @register="registerForm" ref="formRef"/> | |||
| <!-- 子表单区域 --> | |||
| <a-tabs v-model:activeKey="activeKey" animated @change="handleChangeTabs"> | |||
| <a-tab-pane tab="订单车辆信息" key="appOrderCar" :forceRender="true"> | |||
| <AppOrderCarForm ref="appOrderCarForm" :disabled="formDisabled"></AppOrderCarForm> | |||
| </a-tab-pane> | |||
| <a-tab-pane tab="订单凭证信息" key="appOrderVoucher" :forceRender="true"> | |||
| <AppOrderVoucherForm ref="appOrderVoucherForm" :disabled="formDisabled"></AppOrderVoucherForm> | |||
| </a-tab-pane> | |||
| <a-tab-pane tab="订单金融信息" key="appOrderFinance" :forceRender="true"> | |||
| <AppOrderFinanceForm ref="appOrderFinanceForm" :disabled="formDisabled"></AppOrderFinanceForm> | |||
| </a-tab-pane> | |||
| </a-tabs> | |||
| <div style="width: 100%;text-align: center" v-if="!formDisabled"> | |||
| <a-button @click="handleSubmit" pre-icon="ant-design:check" type="primary">提 交</a-button> | |||
| </div> | |||
| </div> | |||
| </template> | |||
| <script lang="ts"> | |||
| import {BasicForm, useForm} from '/@/components/Form/index'; | |||
| import { computed, defineComponent, reactive, ref, unref } from 'vue'; | |||
| import {defHttp} from '/@/utils/http/axios'; | |||
| import { propTypes } from '/@/utils/propTypes'; | |||
| import { useJvxeMethod } from '/@/hooks/system/useJvxeMethods'; | |||
| import { VALIDATE_FAILED } from '/@/utils/common/vxeUtils'; | |||
| import AppOrderCarForm from './AppOrderCarForm.vue' | |||
| import AppOrderVoucherForm from './AppOrderVoucherForm.vue' | |||
| import AppOrderFinanceForm from './AppOrderFinanceForm.vue' | |||
| import {getBpmFormSchema} from '../AppOrder.data'; | |||
| import {saveOrUpdate,appOrderCarList,appOrderVoucherList,appOrderFinanceList} from '../AppOrder.api'; | |||
| export default defineComponent({ | |||
| name: "AppOrderForm", | |||
| components:{ | |||
| BasicForm, | |||
| AppOrderCarForm, | |||
| AppOrderVoucherForm, | |||
| AppOrderFinanceForm, | |||
| }, | |||
| props:{ | |||
| formData: propTypes.object.def({}), | |||
| formBpm: propTypes.bool.def(true), | |||
| }, | |||
| setup(props){ | |||
| const [registerForm, { setFieldsValue, setProps }] = useForm({ | |||
| labelWidth: 150, | |||
| schemas: getBpmFormSchema(props.formData), | |||
| showActionButtonGroup: false, | |||
| baseColProps: {span: 12} | |||
| }); | |||
| const formDisabled = computed(()=>{ | |||
| if(props.formData.disabled === false){ | |||
| return false; | |||
| } | |||
| return true; | |||
| }); | |||
| const refKeys = ref(['appOrderCar', 'appOrderVoucher', 'appOrderFinance', ]); | |||
| const activeKey = ref('appOrderCar'); | |||
| const appOrderCarForm = ref(); | |||
| const appOrderVoucherForm = ref(); | |||
| const appOrderFinanceForm = ref(); | |||
| const tableRefs = {}; | |||
| const [handleChangeTabs,handleSubmit,requestSubTableData,formRef] = useJvxeMethod(requestAddOrEdit,classifyIntoFormData,tableRefs,activeKey,refKeys,validateSubForm); | |||
| function classifyIntoFormData(allValues) { | |||
| let main = Object.assign({}, allValues.formValue) | |||
| return { | |||
| ...main, // 展开 | |||
| appOrderCarList: appOrderCarForm.value.getFormData(), | |||
| appOrderVoucherList: appOrderVoucherForm.value.getFormData(), | |||
| appOrderFinanceList: appOrderFinanceForm.value.getFormData(), | |||
| } | |||
| } | |||
| //校验所有一对一子表表单 | |||
| function validateSubForm(allValues){ | |||
| return new Promise((resolve, _reject)=>{ | |||
| Promise.all([ | |||
| appOrderCarForm.value.validateForm(0), | |||
| appOrderVoucherForm.value.validateForm(1), | |||
| appOrderFinanceForm.value.validateForm(2), | |||
| ]).then(() => { | |||
| resolve(allValues) | |||
| }).catch(e => { | |||
| if (e.error === VALIDATE_FAILED) { | |||
| // 如果有未通过表单验证的子表,就自动跳转到它所在的tab | |||
| activeKey.value = e.index == null ? unref(activeKey) : refKeys.value[e.index] | |||
| } else { | |||
| console.error(e) | |||
| } | |||
| }) | |||
| }) | |||
| } | |||
| //表单提交事件 | |||
| async function requestAddOrEdit(values) { | |||
| await saveOrUpdate(values, true); | |||
| } | |||
| const queryByIdUrl = '/order/appOrder/queryById'; | |||
| async function initFormData(){ | |||
| let params = {id: props.formData.dataId}; | |||
| const data = await defHttp.get({url: queryByIdUrl, params}); | |||
| //设置表单的值 | |||
| await setFieldsValue({...data}); | |||
| appOrderCarForm.value.initFormData(appOrderCarList, data.id); | |||
| appOrderVoucherForm.value.initFormData(appOrderVoucherList, data.id); | |||
| appOrderFinanceForm.value.initFormData(appOrderFinanceList, data.id); | |||
| //默认是禁用 | |||
| await setProps({disabled: formDisabled.value}) | |||
| } | |||
| initFormData(); | |||
| return { | |||
| registerForm, | |||
| formDisabled, | |||
| formRef, | |||
| handleSubmit, | |||
| activeKey, | |||
| handleChangeTabs, | |||
| appOrderCarForm, | |||
| appOrderVoucherForm, | |||
| appOrderFinanceForm, | |||
| } | |||
| } | |||
| }); | |||
| </script> | |||
| @ -0,0 +1,141 @@ | |||
| <template> | |||
| <BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="896" @ok="handleSubmit"> | |||
| <BasicForm @register="registerForm" ref="formRef" name="AppOrderForm"/> | |||
| <!-- 子表单区域 --> | |||
| <a-tabs v-model:activeKey="activeKey" animated @change="handleChangeTabs"> | |||
| <a-tab-pane tab="订单车辆信息" key="appOrderCar" :forceRender="true"> | |||
| <AppOrderCarForm ref="appOrderCarForm" :disabled="formDisabled"></AppOrderCarForm> | |||
| </a-tab-pane> | |||
| <a-tab-pane tab="订单凭证信息" key="appOrderVoucher" :forceRender="true"> | |||
| <AppOrderVoucherForm ref="appOrderVoucherForm" :disabled="formDisabled"></AppOrderVoucherForm> | |||
| </a-tab-pane> | |||
| <a-tab-pane tab="订单金融信息" key="appOrderFinance" :forceRender="true"> | |||
| <AppOrderFinanceForm ref="appOrderFinanceForm" :disabled="formDisabled"></AppOrderFinanceForm> | |||
| </a-tab-pane> | |||
| </a-tabs> | |||
| </BasicModal> | |||
| </template> | |||
| <script lang="ts" setup> | |||
| import {ref, computed, unref,reactive} from 'vue'; | |||
| import {BasicModal, useModalInner} from '/@/components/Modal'; | |||
| import {BasicForm, useForm} from '/@/components/Form/index'; | |||
| import { JVxeTable } from '/@/components/jeecg/JVxeTable' | |||
| import { useJvxeMethod } from '/@/hooks/system/useJvxeMethods.ts' | |||
| import AppOrderCarForm from './AppOrderCarForm.vue' | |||
| import AppOrderVoucherForm from './AppOrderVoucherForm.vue' | |||
| import AppOrderFinanceForm from './AppOrderFinanceForm.vue' | |||
| import {formSchema} from '../AppOrder.data'; | |||
| import {saveOrUpdate,appOrderCarList,appOrderVoucherList,appOrderFinanceList} from '../AppOrder.api'; | |||
| import { VALIDATE_FAILED } from '/@/utils/common/vxeUtils' | |||
| // Emits声明 | |||
| const emit = defineEmits(['register','success']); | |||
| const isUpdate = ref(true); | |||
| const formDisabled = ref(false); | |||
| const refKeys = ref(['appOrderCar', 'appOrderVoucher', 'appOrderFinance', ]); | |||
| const activeKey = ref('appOrderCar'); | |||
| const appOrderCarForm = ref(); | |||
| const appOrderVoucherForm = ref(); | |||
| const appOrderFinanceForm = ref(); | |||
| const tableRefs = {}; | |||
| //表单配置 | |||
| const [registerForm, {setProps,resetFields, setFieldsValue, validate}] = useForm({ | |||
| schemas: formSchema, | |||
| showActionButtonGroup: false, | |||
| baseColProps: {span: 12} | |||
| }); | |||
| //表单赋值 | |||
| const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => { | |||
| //重置表单 | |||
| await reset(); | |||
| setModalProps({confirmLoading: false,showCancelBtn:data?.showFooter,showOkBtn:data?.showFooter}); | |||
| isUpdate.value = !!data?.isUpdate; | |||
| formDisabled.value = !data?.showFooter; | |||
| if (unref(isUpdate)) { | |||
| //表单赋值 | |||
| await setFieldsValue({ | |||
| ...data.record, | |||
| }); | |||
| appOrderCarForm.value.initFormData(appOrderCarList,data?.record?.id) | |||
| appOrderVoucherForm.value.initFormData(appOrderVoucherList,data?.record?.id) | |||
| appOrderFinanceForm.value.initFormData(appOrderFinanceList,data?.record?.id) | |||
| } | |||
| // 隐藏底部时禁用整个表单 | |||
| setProps({ disabled: !data?.showFooter }) | |||
| }); | |||
| //方法配置 | |||
| const [handleChangeTabs,handleSubmit,requestSubTableData,formRef] = useJvxeMethod(requestAddOrEdit,classifyIntoFormData,tableRefs,activeKey,refKeys,validateSubForm); | |||
| //设置标题 | |||
| const title = computed(() => (!unref(isUpdate) ? '新增' : !unref(formDisabled) ? '编辑' : '详情')); | |||
| async function reset(){ | |||
| await resetFields(); | |||
| activeKey.value = 'appOrderCar'; | |||
| appOrderCarForm.value.resetFields(); | |||
| appOrderVoucherForm.value.resetFields(); | |||
| appOrderFinanceForm.value.resetFields(); | |||
| } | |||
| function classifyIntoFormData(allValues) { | |||
| let main = Object.assign({}, allValues.formValue) | |||
| return { | |||
| ...main, // 展开 | |||
| appOrderCarList: appOrderCarForm.value.getFormData(), | |||
| appOrderVoucherList: appOrderVoucherForm.value.getFormData(), | |||
| appOrderFinanceList: appOrderFinanceForm.value.getFormData(), | |||
| } | |||
| } | |||
| //校验所有一对一子表表单 | |||
| function validateSubForm(allValues){ | |||
| return new Promise((resolve,reject)=>{ | |||
| Promise.all([ | |||
| appOrderCarForm.value.validateForm(0), | |||
| appOrderVoucherForm.value.validateForm(1), | |||
| appOrderFinanceForm.value.validateForm(2), | |||
| ]).then(() => { | |||
| resolve(allValues) | |||
| }).catch(e => { | |||
| if (e.error === VALIDATE_FAILED) { | |||
| // 如果有未通过表单验证的子表,就自动跳转到它所在的tab | |||
| activeKey.value = e.index == null ? unref(activeKey) : refKeys.value[e.index] | |||
| if (e.errorFields) { | |||
| const firstField = e.errorFields[0]; | |||
| if (firstField) { | |||
| e.scrollToField(firstField.name, { behavior: 'smooth', block: 'center' }); | |||
| } | |||
| } | |||
| } else { | |||
| console.error(e) | |||
| } | |||
| }) | |||
| }) | |||
| } | |||
| //表单提交事件 | |||
| async function requestAddOrEdit(values) { | |||
| try { | |||
| setModalProps({confirmLoading: true}); | |||
| //提交表单 | |||
| await saveOrUpdate(values, isUpdate.value); | |||
| //关闭弹窗 | |||
| closeModal(); | |||
| //刷新列表 | |||
| emit('success'); | |||
| } finally { | |||
| setModalProps({confirmLoading: false}); | |||
| } | |||
| } | |||
| </script> | |||
| <style lang="less" scoped> | |||
| /** 时间和数字输入框样式 */ | |||
| :deep(.ant-input-number) { | |||
| width: 100%; | |||
| } | |||
| :deep(.ant-calendar-picker) { | |||
| width: 100%; | |||
| } | |||
| </style> | |||
| @ -0,0 +1,78 @@ | |||
| <template> | |||
| <BasicForm @register="registerForm" name="AppOrderVoucherForm" class="basic-modal-form"/> | |||
| </template> | |||
| <script lang="ts"> | |||
| import {defineComponent} from 'vue'; | |||
| import {BasicForm, useForm} from '/@/components/Form/index'; | |||
| import {appOrderVoucherFormSchema} from '../AppOrder.data'; | |||
| import {defHttp} from '/@/utils/http/axios'; | |||
| import { VALIDATE_FAILED } from '/@/utils/common/vxeUtils' | |||
| export default defineComponent({ | |||
| name:"AppOrderVoucherForm", | |||
| components: {BasicForm}, | |||
| emits:['register'], | |||
| props:{ | |||
| disabled: { | |||
| type: Boolean, | |||
| default: false | |||
| } | |||
| }, | |||
| setup(props,{emit}) { | |||
| const [registerForm, { setProps, resetFields, setFieldsValue, getFieldsValue, validate, scrollToField }] = useForm({ | |||
| schemas: appOrderVoucherFormSchema, | |||
| showActionButtonGroup: false, | |||
| baseColProps: {span: 12} | |||
| }); | |||
| /** | |||
| *初始化加载数据 | |||
| */ | |||
| function initFormData(url,id){ | |||
| if(id){ | |||
| defHttp.get({url,params:{id}},{isTransformResponse:false}).then(res=>{ | |||
| res.success && setFieldsValue({...res.result[0]}); | |||
| }) | |||
| } | |||
| setProps({disabled: props.disabled}) | |||
| } | |||
| /** | |||
| *获取表单数据 | |||
| */ | |||
| function getFormData(){ | |||
| let formData = getFieldsValue(); | |||
| Object.keys(formData).map(k=>{ | |||
| if(formData[k] instanceof Array){ | |||
| formData[k] = formData[k].join(',') | |||
| } | |||
| }); | |||
| return [formData]; | |||
| } | |||
| /** | |||
| *表单校验 | |||
| */ | |||
| function validateForm(index){ | |||
| return new Promise((resolve, reject) => { | |||
| // 验证子表表单 | |||
| validate().then(()=>{ | |||
| return resolve() | |||
| }).catch(({ errorFields }) => { | |||
| return reject({ error: VALIDATE_FAILED, index, errorFields: errorFields, scrollToField: scrollToField }); | |||
| }); | |||
| }) | |||
| } | |||
| return { | |||
| registerForm, | |||
| resetFields, | |||
| initFormData, | |||
| getFormData, | |||
| validateForm | |||
| } | |||
| } | |||
| }) | |||
| </script> | |||
| <style lang="less" scoped> | |||
| .basic-modal-form { | |||
| overflow: auto; | |||
| height: 340px; | |||
| } | |||
| </style> | |||
| @ -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<AppCarTree, IAppCarTreeService>{ | |||
| @Autowired | |||
| private IAppCarTreeService appCarTreeService; | |||
| /** | |||
| * 分页列表查询 | |||
| * | |||
| * @param appCarTree | |||
| * @param pageNo | |||
| * @param pageSize | |||
| * @param req | |||
| * @return | |||
| */ | |||
| //@AutoLog(value = "汽车品牌-分页列表查询") | |||
| @ApiOperation(value="汽车品牌-分页列表查询", notes="汽车品牌-分页列表查询") | |||
| @GetMapping(value = "/rootList") | |||
| public Result<IPage<AppCarTree>> 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<AppCarTree> queryWrapper = QueryGenerator.initQueryWrapper(appCarTree, req.getParameterMap()); | |||
| List<AppCarTree> list = appCarTreeService.queryTreeListNoPage(queryWrapper); | |||
| IPage<AppCarTree> 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<AppCarTree> queryWrapper = QueryGenerator.initQueryWrapper(appCarTree, req.getParameterMap()); | |||
| // 使用 eq 防止模糊查询 | |||
| queryWrapper.eq("pid", parentId); | |||
| Page<AppCarTree> page = new Page<AppCarTree>(pageNo, pageSize); | |||
| IPage<AppCarTree> pageList = appCarTreeService.page(page, queryWrapper); | |||
| return Result.OK(pageList); | |||
| } | |||
| } | |||
| /** | |||
| * 【vue3专用】加载节点的子数据 | |||
| * | |||
| * @param pid | |||
| * @return | |||
| */ | |||
| @RequestMapping(value = "/loadTreeChildren", method = RequestMethod.GET) | |||
| public Result<List<SelectTreeModel>> loadTreeChildren(@RequestParam(name = "pid") String pid) { | |||
| Result<List<SelectTreeModel>> result = new Result<>(); | |||
| try { | |||
| List<SelectTreeModel> 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<List<SelectTreeModel>> loadTreeRoot(@RequestParam(name = "async") Boolean async, @RequestParam(name = "pcode") String pcode) { | |||
| Result<List<SelectTreeModel>> result = new Result<>(); | |||
| try { | |||
| List<SelectTreeModel> 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<SelectTreeModel> ls) { | |||
| for (SelectTreeModel tsm : ls) { | |||
| List<SelectTreeModel> 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<IPage<AppCarTree>> queryPageList(AppCarTree appCarTree,HttpServletRequest req) { | |||
| QueryWrapper<AppCarTree> queryWrapper = QueryGenerator.initQueryWrapper(appCarTree, req.getParameterMap()); | |||
| List<AppCarTree> list = appCarTreeService.list(queryWrapper); | |||
| IPage<AppCarTree> 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<AppCarTree> queryWrapper = new QueryWrapper<>(); | |||
| List<String> parentIdList = Arrays.asList(parentIds.split(",")); | |||
| queryWrapper.in("pid", parentIdList); | |||
| List<AppCarTree> list = appCarTreeService.list(queryWrapper); | |||
| IPage<AppCarTree> 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()); | |||
| } | |||
| } | |||
| } | |||
| @ -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); | |||
| } | |||
| } | |||
| @ -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; | |||
| } | |||
| @ -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); | |||
| } | |||
| @ -1,4 +1,4 @@ | |||
| package org.jeecg.modules.miniapp.pdftest.service; | |||
| package org.jeecg.modules.miniapp.file.service; | |||
| /** | |||
| * @author Tanzs | |||
| @ -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<IdCardInfo> 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; | |||
| } | |||
| } | |||
| @ -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; | |||
| @ -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<IPage<AppOrder>> queryPageList(AppOrder appOrder, | |||
| @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, | |||
| @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, | |||
| HttpServletRequest req) { | |||
| // 自定义查询规则 | |||
| Map<String, QueryRuleEnum> 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<AppOrder> queryWrapper = QueryGenerator.initQueryWrapper(appOrder, req.getParameterMap(),customeRuleMap); | |||
| Page<AppOrder> page = new Page<AppOrder>(pageNo, pageSize); | |||
| IPage<AppOrder> pageList = appOrderService.page(page, queryWrapper); | |||
| return Result.OK(pageList); | |||
| } | |||
| /** | |||
| * 添加 | |||
| * | |||
| * @param appOrderPage | |||
| * @return | |||
| */ | |||
| @AutoLog(value = "合同订单表-添加") | |||
| @ApiOperation(value="合同订单表-添加", notes="合同订单表-添加") | |||
| @PostMapping(value = "/add") | |||
| public Result<String> 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<String> 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<AppOrder> 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<List<AppOrderCar>> queryAppOrderCarListByMainId(@RequestParam(name="id",required=true) String id) { | |||
| List<AppOrderCar> 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<List<AppOrderVoucher>> queryAppOrderVoucherListByMainId(@RequestParam(name="id",required=true) String id) { | |||
| List<AppOrderVoucher> 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<List<AppOrderFinance>> queryAppOrderFinanceListByMainId(@RequestParam(name="id",required=true) String id) { | |||
| List<AppOrderFinance> appOrderFinanceList = appOrderFinanceService.selectByMainId(id);return Result.OK(appOrderFinanceList); | |||
| } | |||
| } | |||