| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | import cn.hutool.http.HttpUtil; |
| | | import cn.hutool.json.JSONObject; |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | |
| | | if(user!=null && user.getStatus()==2){ |
| | | return AjaxResult.error("登录失败,当前账号已被冻结"); |
| | | } |
| | | String openid = getOpenid(loginBody.getJscode()); |
| | | TbUser user1 = tbUserService.getOne(new LambdaQueryWrapper<TbUser>().eq(TbUser::getOpenId, openid).ne(TbUser::getStatus,3).eq(TbUser::getIsDelete, 0)); |
| | | if(user1!=null && !loginBody.getPhone().equals(user1.getPhone())){ |
| | | return AjaxResult.error("该微信已绑定其他手机号"); |
| | | } |
| | | if(user==null){ |
| | | TbUser tbUser = new TbUser(); |
| | | tbUser.setPhone(loginBody.getPhone()); |
| | | tbUser.setStatus(1); |
| | | tbUser.setUserName(loginBody.getPhone()); |
| | | tbUser.setInviteId(loginBody.getInviteUserId()); |
| | | tbUser.setOpenId(openid); |
| | | tbUserService.save(tbUser); |
| | | user = tbUser; |
| | | ajax.put("firstRegister",1); |
| | |
| | | if(StringUtils.isEmpty(user.getInviteId()) && !StringUtils.isEmpty(loginBody.getInviteUserId())){ |
| | | user.setInviteId(loginBody.getInviteUserId()); |
| | | } |
| | | if(StringUtils.isEmpty(user.getOpenId())){ |
| | | user.setOpenId(openid); |
| | | } |
| | | tbUserService.updateById(user); |
| | | } |
| | | LoginUser loginUser = new LoginUser(); |
| | | loginUser.setUserId(Long.valueOf(user.getId())); |
| | |
| | | } |
| | | |
| | | |
| | | public String getOpenid(String jscode) { |
| | | String url = "https://api.weixin.qq.com/sns/jscode2session?appid=" + wxConfig.getMemberAppId() + |
| | | "&secret=" + wxConfig.getMemberAppSecret() + |
| | | "&js_code=" + jscode + |
| | | "&grant_type=authorization_code"; |
| | | |
| | | String result = HttpUtil.get(url); |
| | | JSONObject jsonObject = JSONUtil.parseObj(result); |
| | | |
| | | String openid = jsonObject.getStr("openid"); |
| | | |
| | | return openid; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | |
| | | import cn.hutool.core.map.MapUtil; |
| | | import cn.hutool.http.HttpRequest; |
| | | import cn.hutool.http.HttpResponse; |
| | | import cn.hutool.http.HttpUtil; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.fasterxml.jackson.databind.JsonNode; |
| | | import com.ruoyi.common.core.domain.BasePage; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.domain.model.LoginUser; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.redis.service.RedisService; |
| | | import com.ruoyi.common.utils.QiChaChaUtil; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.http.HttpUtils; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.dto.*; |
| | | import com.ruoyi.system.dto.AddScheduleDto; |
| | | import com.ruoyi.system.dto.CompanyUpdateStatusDto; |
| | | import com.ruoyi.system.dto.EditCompanyDto; |
| | | import com.ruoyi.system.dto.PushCompanyDto; |
| | | import com.ruoyi.system.model.*; |
| | | import com.ruoyi.system.query.CompanyListQuery; |
| | | import com.ruoyi.system.query.MyPushCompanyListQuery; |
| | | import com.ruoyi.system.service.*; |
| | | import com.ruoyi.system.vo.CompanyDetailVo; |
| | | import com.ruoyi.system.vo.IndexCompanyListVo; |
| | | import com.ruoyi.system.vo.MyPushCompanyListVo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.poi.ss.formula.functions.T; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | |
| | | @Autowired |
| | | private TbCompanyTypeService companyTypeService; |
| | | |
| | | |
| | | @Autowired |
| | | private QiChaChaUtil qiChaChaUtil; |
| | | |
| | | private RedisCache redisCache; |
| | | |
| | | |
| | | |
| | | |
| | | @ApiOperation(value = "获取我发布的公司",tags = {"发布模块"}) |
| | | @GetMapping("/getMyPushCompanyList") |
| | | public R<Page<MyPushCompanyListVo>> getMyPushCompanyList(MyPushCompanyListQuery query) { |
| | | public R< HashMap<String, Object>> getMyPushCompanyList(MyPushCompanyListQuery query) { |
| | | LoginUser loginUser = tokenService.getLoginUser(); |
| | | Long userId = loginUser.getUserId(); |
| | | Page<MyPushCompanyListVo> page = tbCompanyService.getMyPushCompanyList(query,userId); |
| | | return R.ok(page); |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("data",page); |
| | | map = tbCompanyService.getMyPushCompanyListNum(userId,map); |
| | | return R.ok(map); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取行业信息",tags = {"发布模块"}) |
| | | @GetMapping("/getIndustryList") |
| | | public R<Page<TbIndustry>> getIndustryList(BasePage page) { |
| | | Page<TbIndustry> page1 = industryService.page(new Page<>(page.getPageNum(),page.getPageSize()),new LambdaQueryWrapper<TbIndustry>().orderByDesc(TbIndustry::getOrderNum)); |
| | | public R<List<TbIndustry>> getIndustryList() { |
| | | List<TbIndustry> page1 = industryService.list(new LambdaQueryWrapper<TbIndustry>().orderByDesc(TbIndustry::getOrderNum)); |
| | | return R.ok(page1); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取公司类型信息",tags = {"发布模块"}) |
| | | @GetMapping("/getCompanyTypeList") |
| | | public R<Page<TbCompanyType>> getCompanyTypeList(BasePage page) { |
| | | Page<TbCompanyType> page1 = companyTypeService.page(new Page<>(page.getPageNum(),page.getPageSize()),new LambdaQueryWrapper<TbCompanyType>().eq(TbCompanyType::getDelFlag,0).orderByDesc(TbCompanyType::getOrderNum)); |
| | | public R<List<TbCompanyType>> getCompanyTypeList() { |
| | | List<TbCompanyType> page1 = companyTypeService.list(new LambdaQueryWrapper<TbCompanyType>().eq(TbCompanyType::getDelFlag,0).orderByDesc(TbCompanyType::getOrderNum)); |
| | | return R.ok(page1); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取许可证信息",tags = {"发布模块"}) |
| | | @GetMapping("/getLicenceList") |
| | | public R<Page<TbLicence>> getLicenceList(BasePage page) { |
| | | Page<TbLicence> page1 = licenceService.page(new Page<>(page.getPageNum(),page.getPageSize()),new LambdaQueryWrapper<TbLicence>().eq(TbLicence::getDelFlag,0).orderByDesc(TbLicence::getOrderNum)); |
| | | public R<List<TbLicence>> getLicenceList() { |
| | | List<TbLicence> page1 = licenceService.list(new LambdaQueryWrapper<TbLicence>().eq(TbLicence::getDelFlag,0).orderByDesc(TbLicence::getOrderNum)); |
| | | return R.ok(page1); |
| | | } |
| | | |
| | |
| | | if (count > 0) { |
| | | return R.fail("该公司已发布"); |
| | | } |
| | | tbCompanyService.pushCompany(dto,userId); |
| | | return R.ok(); |
| | | String companyId = tbCompanyService.pushCompany(dto, userId); |
| | | return R.ok(companyId); |
| | | } |
| | | |
| | | @ApiOperation(value = "发布前获取公司信息--企查查",tags = {"发布模块"}) |
| | |
| | | if (count > 0) { |
| | | return R.fail("该公司已发布"); |
| | | } |
| | | Object cacheObject = redisCache.getCacheObject("push_" + companyName); |
| | | if(cacheObject!=null){ |
| | | return R.ok(cacheObject); |
| | | } |
| | | Object qiChaChaToken = QiChaChaUtil.getQiChaChaCompanyInfo(companyName); |
| | | if(qiChaChaToken==null){ |
| | | return R.fail("查询公司信息失败请联系客服"); |
| | | } |
| | | redisCache.setCacheObject("push_" + companyName, qiChaChaToken, 24, TimeUnit.HOURS); |
| | | return R.ok(qiChaChaToken); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | tbCompanyService.editCompany(dto,company,userId); |
| | | return R.ok(); |
| | | return R.ok(dto.getId()); |
| | | } |
| | | |
| | | |
| | |
| | | tbCompanyService.updateById(company); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "删除公司",tags = {"发布模块"}) |
| | | @DeleteMapping("/delete/{id}") |
| | | public R<?> delete(@PathVariable("id")String id) { |
| | | LoginUser loginUser = tokenService.getLoginUser(); |
| | | Long userId = loginUser.getUserId(); |
| | | TbCompany company = tbCompanyService.getById(id); |
| | | if (company == null || !company.getUserId().equals(userId.toString())) { |
| | | return R.fail("非法操作"); |
| | | } |
| | | long count = orderService.count(new LambdaQueryWrapper<TbOrder>().eq(TbOrder::getCompanyId,id).in(TbOrder::getStatus, 3, 4, 5)); |
| | | if (company.getStatus()!=1) { |
| | | return R.fail("订单状态不能修改"); |
| | | } |
| | | company.setIsDelete(1); |
| | | tbCompanyService.updateById(company); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation(value = "确认订单",tags = {"发布模块"}) |
| | | @PostMapping("/confirmOrder") |
| | |
| | | } |
| | | scheduleService.addSchedule(dto,userId); |
| | | |
| | | messageService.addMessage("您有订单卖家已完成,等待确认", order.getUserId(),order.getId()); |
| | | messageService.addMessage("您的订单有新的进度提醒", order.getUserId(),order.getId()); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | CompanyDetailVo companyDetailVo = tbCompanyService.companyDetail(companyId,userId); |
| | | Object qiChaChaCompanyExceptionCheck = QiChaChaUtil.getQiChaChaCompanyExceptionCheck(companyDetailVo.getCompanyName()); |
| | | companyDetailVo.setCompanyExceptionInfo(qiChaChaCompanyExceptionCheck); |
| | | |
| | | companyDetailVo.setEstablishTime(companyDetailVo.getEstablishTime().substring(0,10)); |
| | | return R.ok(companyDetailVo); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "公司详情--异常信息",tags = {"发布模块"}) |
| | | @GetMapping("/qiChaChaCompanyExceptionCheck") |
| | | public R<Object> qiChaChaCompanyExceptionCheck(@RequestParam String companyName) { |
| | | Object qiChaChaCompanyExceptionCheck = QiChaChaUtil.getQiChaChaCompanyExceptionCheck(companyName); |
| | | return R.ok(qiChaChaCompanyExceptionCheck); |
| | | } |
| | | |
| | | @ApiOperation(value = "公司详情--财务征信信息",tags = {"发布模块"}) |
| | | @GetMapping("/companyDetailDataInfo") |
| | | public R<Object> companyDetailDataInfo(@RequestParam String companyId) { |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.List; |
| | |
| | | |
| | | |
| | | @ApiOperation(value = "获取商城首页",tags = {"商城模块"}) |
| | | @GetMapping("/getCompanyList") |
| | | public R<Page<IndexCompanyListVo>> getCompanyList(@Valid CompanyListQuery query) { |
| | | @PostMapping("/getCompanyList") |
| | | public R<Page<IndexCompanyListVo>> getCompanyList(@Valid @RequestBody CompanyListQuery query) { |
| | | LoginUser loginUser = tokenService.getLoginUser(); |
| | | Long userId = loginUser.getUserId(); |
| | | Page<IndexCompanyListVo> page = tbCompanyService.getCompanyList(query,userId); |
| | |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | |
| | | @Autowired |
| | | private TbUserService userService; |
| | | |
| | | @Autowired |
| | | private TbAgreementService agreementService; |
| | | |
| | | @ApiOperation(value = "获取我的订单", tags = {"订单模块"}) |
| | | |
| | | @ApiOperation(value = "获取我的订单", tags = {"订单模块"},response =MyPushCompanyListVo.class ) |
| | | @GetMapping("/getMyOrderList") |
| | | public R<Page<MyPushCompanyListVo>> getMyOrderList(MyOrderListQuery query) { |
| | | public R<HashMap<String, Object>> getMyOrderList(MyOrderListQuery query) { |
| | | LoginUser loginUser = tokenService.getLoginUser(); |
| | | Long userId = loginUser.getUserId(); |
| | | Page<MyPushCompanyListVo> page = orderService.getMyOrderList(query, userId); |
| | | return R.ok(page); |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("data",page); |
| | | map = orderService.getMyOrderListNum(userId,map); |
| | | return R.ok(map); |
| | | } |
| | | |
| | | |
| | |
| | | */ |
| | | @ApiOperation(value = "立即支付前填写信息", tags = {"订单模块"}) |
| | | @PostMapping("/lastPayOrderData") |
| | | public R<?> lastPayOrderData(@RequestBody @Valid AddBuyerCompanyInfoDto dto) { |
| | | public synchronized R<WxPayMpOrderResult> lastPayOrderData(@RequestBody @Valid AddBuyerCompanyInfoDto dto) { |
| | | LoginUser loginUser = tokenService.getLoginUser(); |
| | | Long userId = loginUser.getUserId(); |
| | | TbOrder tbOrder = orderService.getById(dto.getOrderId()); |
| | |
| | | if (company == null || company.getStatus() == 2 || company.getIsDelete() == 1) { |
| | | return R.fail("该公司已下架或者删除"); |
| | | } |
| | | long count = buyerCompanyInfoService.count(new LambdaQueryWrapper<TbBuyerCompanyInfo>().eq(TbBuyerCompanyInfo::getOrderId, dto.getOrderId())); |
| | | if (count > 0) { |
| | | return R.fail("请勿重复填写"); |
| | | } |
| | | orderService.lastPayOrderData(tbOrder, dto, userId, company); |
| | | return R.ok(); |
| | | TbBuyerCompanyInfo one = buyerCompanyInfoService.getOne(new LambdaQueryWrapper<TbBuyerCompanyInfo>().eq(TbBuyerCompanyInfo::getOrderId, dto.getOrderId())); |
| | | orderService.lastPayOrderData(tbOrder, dto, userId, company,one); |
| | | R<WxPayMpOrderResult> wxPayMpOrderResultR = payOrder(dto.getOrderId()); |
| | | return wxPayMpOrderResultR; |
| | | } |
| | | |
| | | |
| | |
| | | @PostMapping("/placeOrder") |
| | | public synchronized R<?> placeOrder(String companyId) { |
| | | if (StringUtils.isEmpty(companyId)) { |
| | | R.fail("id不能为空"); |
| | | return R.fail("id不能为空"); |
| | | } |
| | | LoginUser loginUser = tokenService.getLoginUser(); |
| | | Long userId = loginUser.getUserId(); |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "下单预定-获取信息", tags = {"订单模块"}) |
| | | @GetMapping("/placeOrderInfo") |
| | | public R<?> placeOrderInfo(String companyId) { |
| | | if (StringUtils.isEmpty(companyId)) { |
| | | R.fail("id不能为空"); |
| | | } |
| | | TbCompany company = companyService.getById(companyId); |
| | | String information = company.getInformation(); |
| | | HashMap<String, String> map = new HashMap<>(); |
| | | map.put("information", information); |
| | | TbAgreement one = agreementService.getOne(new LambdaQueryWrapper<TbAgreement>().eq(TbAgreement::getType, 3)); |
| | | map.put("agreement", one.getContent()); |
| | | return R.ok(map); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "买家完成订单", tags = {"订单模块"}) |
| | | @PostMapping("/buyerSuccessOrder") |
| | |
| | | @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) |
| | | public R<?> withdrawal(@RequestBody @Valid UserWithdrawalDto dto) { |
| | | if(dto.getAmount()<=0){ |
| | | return R.fail("提现金额不能小于0"); |
| | | return R.fail("提现金额不能小于等于0"); |
| | | } |
| | | LoginUser loginUser = tokenService.getLoginUser(); |
| | | TbUser user = userService.getById(loginUser.getUserId()); |
| | |
| | | import com.ruoyi.system.model.TbUser; |
| | | import com.ruoyi.system.query.UserMessageQuery; |
| | | import com.ruoyi.system.service.TbMessageService; |
| | | import com.ruoyi.system.service.TbOrderService; |
| | | import com.ruoyi.system.service.TbUserService; |
| | | import com.ruoyi.system.vo.InviteUserListVo; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | |
| | | @Autowired |
| | | private TokenService tokenService; |
| | | |
| | | @Autowired |
| | | private TbOrderService orderService; |
| | | |
| | | |
| | | @ApiOperation(value = "获取用户消息",tags = {"消息模块"}) |
| | | @GetMapping("/getUserMessage") |
| | | public R<Page<TbMessage>> getUserMessage(UserMessageQuery query) { |
| | | LoginUser loginUser = tokenService.getLoginUser(); |
| | | Long userId = loginUser.getUserId(); |
| | | Page<TbMessage> page = messageService.page(new Page<>(query.getPageNum(), query.getPageSize()), new LambdaQueryWrapper<TbMessage>().eq(TbMessage::getUserId, userId)); |
| | | Page<TbMessage> page = messageService.page(new Page<>(query.getPageNum(), query.getPageSize()), new LambdaQueryWrapper<TbMessage>().eq(query.getIsRead()!=null, TbMessage::getIsRead, query.getIsRead()).eq(TbMessage::getUserId, userId).orderByDesc(TbMessage::getCreateTime)); |
| | | page.getRecords().forEach(item -> { |
| | | String companyId = orderService.getById(item.getOrderId()).getCompanyId(); |
| | | item.setCompanyId(companyId); |
| | | }); |
| | | long count = messageService.count(new LambdaQueryWrapper<TbMessage>().eq(TbMessage::getIsRead, 0).eq(TbMessage::getUserId, userId)); |
| | | page.setCurrent(count); |
| | | return R.ok(page); |
| | | } |
| | | |
| | |
| | | mchKey: 5Kb8zX9qR3r4D7Yw3vHnJgLp6sA4cE1M #微信支付商户密钥 |
| | | keyPath: C:\Users\Admin\Desktop\zsxcert\apiclient_cert.p12 # p12证书的位置 |
| | | callbackPath: https://api.dshl.vip/WalletApi/WX/callback |
| | | notifyUrl: http://127.0.0.1:9081/order/WX/zxsCallback |
| | | notifyUrl: http://9ndirhvulyyt.ngrok.xiaomiqiu123.top/order/WX/zxsCallback |
| | | |
| | | |
| | |
| | | private String inviteUserId; |
| | | |
| | | @ApiModelProperty(value = "微信授权code") |
| | | @NotBlank(message = "微信授权code不能为空") |
| | | private String jscode; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty("开户行信息") |
| | | @NotNull(message = "请选择开户行信息") |
| | | private List<TbOpeningBank> openingBanks; |
| | | |
| | | @ApiModelProperty("登记机关") |
| | | private String belongOrg; |
| | | |
| | | @ApiModelProperty("登记状态") |
| | | private String registrationStatus; |
| | | } |
| | |
| | | @NotBlank(message = "成立时间不能为空") |
| | | private String establishTime; |
| | | /** |
| | | * 1个体工商户 2有限公司 3独资 |
| | | * 1个体工商户 2 有限公司 3独资 |
| | | */ |
| | | @TableField("company_category") |
| | | @NotNull(message = "请选择公司类型") |
| | |
| | | @ApiModelProperty("行业id不能为空") |
| | | private Integer companyIndustryId; |
| | | /** |
| | | * 1一般纳税人 2小规模纳税人 3税务未登记 |
| | | * 1一般纳税人 2小规模纳税人 3 税务未登记 |
| | | */ |
| | | @NotNull(message = "请选择纳税人类型") |
| | | @ApiModelProperty("纳税人类型 1一般纳税人 2小规模纳税人 3税务未登记") |
| | |
| | | @ApiModelProperty("开户行信息") |
| | | @NotNull(message = "请选择开户行信息") |
| | | private List<TbOpeningBank> openingBanks; |
| | | |
| | | |
| | | @ApiModelProperty("登记机关") |
| | | private String belongOrg; |
| | | |
| | | @ApiModelProperty("登记状态") |
| | | private String registrationStatus; |
| | | } |
| | |
| | | import com.ruoyi.system.vo.MyPushCompanyListVo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 公司消息表 Mapper 接口 |
| | |
| | | |
| | | Page<MyPushCompanyListVo> getMyPushCompanyList(@Param("page") Page<MyPushCompanyListVo> page, @Param("query") MyPushCompanyListQuery query, @Param("userId") Long userId); |
| | | |
| | | List<MyPushCompanyListVo> getMyPushCompanyListNum(@Param("userId") Long userId); |
| | | |
| | | |
| | | } |
| | |
| | | import com.ruoyi.system.vo.MyPushCompanyListVo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 订单表 Mapper 接口 |
| | |
| | | |
| | | Page<MyPushCompanyListVo> getMyOrderList(@Param("page") Page<MyPushCompanyListVo> page, @Param("query") MyOrderListQuery query, @Param("userId") Long userId); |
| | | |
| | | List<MyPushCompanyListVo> getMyOrderListNum(@Param("userId") Long userId); |
| | | |
| | | } |
| | |
| | | private String orderId; |
| | | |
| | | |
| | | @TableField(exist = false) |
| | | private String companyId; |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | |
| | | @TableField("expire_time") |
| | | private String expireTime; |
| | | @TableField("create_time") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createTime; |
| | | |
| | | |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | |
| | | private String img; |
| | | @TableField("create_time") |
| | | @ApiModelProperty("创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createTime; |
| | | /** |
| | | * 卖家回复才会有 |
| | |
| | | import javax.validation.constraints.NotBlank; |
| | | import java.util.List; |
| | | |
| | | |
| | | @Data |
| | | @ApiModel("商城首页查询Query") |
| | | public class CompanyListQuery extends BasePage { |
| | |
| | | @NotBlank(message = "城市code不能为空") |
| | | private String cityCode; |
| | | @ApiModelProperty("区code") |
| | | @NotBlank(message = "区code不能为空") |
| | | private String areaCode; |
| | | @ApiModelProperty("公司名称") |
| | | private String companyName; |
| | |
| | | import com.ruoyi.common.core.domain.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @ApiModel("发布查询query") |
| | | @Data |
| | | public class MyOrderListQuery extends BasePage { |
| | | @ApiModelProperty("0待支付 2待确认 4办理中 5已完成") |
| | | private Integer status; |
| | |
| | | import com.ruoyi.common.core.domain.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @ApiModel("发布查询query") |
| | | @Data |
| | | public class MyPushCompanyListQuery extends BasePage { |
| | | @ApiModelProperty("1待交易 2待确认 3已确认 4办理中 5已完成") |
| | | private Integer status; |
| | |
| | | import com.ruoyi.system.vo.MyPushCompanyListVo; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.HashMap; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | Page<IndexCompanyListVo> getCompanyList(CompanyListQuery query, Long userId); |
| | | |
| | | |
| | | void pushCompany(PushCompanyDto dto, Long userId); |
| | | String pushCompany(PushCompanyDto dto, Long userId); |
| | | |
| | | |
| | | void editCompany(EditCompanyDto dto, TbCompany company , Long userId); |
| | |
| | | CompanyDetailVo companyDetail(String companyId, Long userId); |
| | | |
| | | |
| | | HashMap<String, Object> getMyPushCompanyListNum(Long userId, HashMap<String, Object> map); |
| | | |
| | | } |
| | |
| | | import com.github.binarywang.wxpay.bean.order.WxPayMpOrderResult; |
| | | import com.github.binarywang.wxpay.exception.WxPayException; |
| | | import com.ruoyi.system.dto.AddBuyerCompanyInfoDto; |
| | | import com.ruoyi.system.model.TbBuyerCompanyInfo; |
| | | import com.ruoyi.system.model.TbCompany; |
| | | import com.ruoyi.system.model.TbOrder; |
| | | import com.ruoyi.system.query.MyOrderListQuery; |
| | | import com.ruoyi.system.vo.MyPushCompanyListVo; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.HashMap; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | void commission(TbOrder order,String userId); |
| | | |
| | | |
| | | void lastPayOrderData(TbOrder tbOrder, AddBuyerCompanyInfoDto dto, Long userId,TbCompany company); |
| | | void lastPayOrderData(TbOrder tbOrder, AddBuyerCompanyInfoDto dto, Long userId,TbCompany company, TbBuyerCompanyInfo one); |
| | | |
| | | HashMap<String, Object> getMyOrderListNum(Long userId, HashMap<String, Object> map); |
| | | |
| | | |
| | | } |
| | |
| | | import com.ruoyi.system.query.MyPushCompanyListQuery; |
| | | import com.ruoyi.system.service.*; |
| | | import com.ruoyi.system.vo.*; |
| | | import org.apache.poi.ss.formula.functions.T; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private TbScheduleService scheduleService; |
| | | |
| | | @Autowired |
| | | private TbShareholderService shareholderService; |
| | | |
| | | @Autowired |
| | | private TbBuyerCompanyInfoService buyerCompanyInfoService; |
| | |
| | | } |
| | | |
| | | if (query.getRegisteredCapitals() != null && query.getRegisteredCapitals().size() > 0) { |
| | | |
| | | queryWrapper.in(TbCompany::getRegisteredCapital, query.getRegisteredCapitals()); |
| | | } |
| | | |
| | |
| | | |
| | | @Override |
| | | @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) |
| | | public void pushCompany(PushCompanyDto dto, Long userId) { |
| | | public String pushCompany(PushCompanyDto dto, Long userId) { |
| | | TbCompany tbCompany = new TbCompany(); |
| | | BeanUtils.copyProperties(dto, tbCompany); |
| | | tbCompany.setUserId(userId.toString()); |
| | |
| | | openingBank.setCompanyId(tbCompany.getId()); |
| | | openingBankService.save(openingBank); |
| | | } |
| | | return tbCompany.getId(); |
| | | |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public HashMap<String, Object> getMyPushCompanyListNum(Long userId, HashMap<String, Object> map) { |
| | | List<MyPushCompanyListVo> list = this.baseMapper.getMyPushCompanyListNum(userId); |
| | | map.put("pendingTransaction", list.stream().filter(e -> e.getStatus() == 1).count()); |
| | | map.put("toBeConfirmed", list.stream().filter(e -> e.getStatus() == 2).count()); |
| | | map.put("confirmed", list.stream().filter(e -> e.getStatus() == 3).count()); |
| | | map.put("processing", list.stream().filter(e -> e.getStatus() == 4).count()); |
| | | map.put("completed", list.stream().filter(e -> e.getStatus() == 5).count()); |
| | | return map; |
| | | } |
| | | @Override |
| | | public CompanyDetailVo companyDetail(String companyId, Long userId) { |
| | | CompanyDetailVo companyDetailVo = new CompanyDetailVo(); |
| | | TbCompany tbCompany = this.baseMapper.selectById(companyId); |
| | | BeanUtils.copyProperties(tbCompany, companyDetailVo); |
| | | companyDetailVo.setState(tbCompany.getStatus()); |
| | | |
| | | TbIndustry industry = industryService.getById(tbCompany.getCompanyIndustryId()); |
| | | companyDetailVo.setCompanyIndustryName(industry.getName()); |
| | |
| | | } |
| | | |
| | | TbOrder order = orderService.getOne(new LambdaQueryWrapper<TbOrder>().eq(TbOrder::getCompanyId, companyId).gt(TbOrder::getStatus, 0).orderByDesc(TbOrder::getCreateTime).last("limit 1")); |
| | | companyDetailVo.setStatus(order.getStatus()); |
| | | if(order!=null){ |
| | | companyDetailVo.setStatus(order.getStatus()); |
| | | companyDetailVo.setSellerFinishTime(order.getSellerFinishTime()); |
| | | companyDetailVo.setOrderId(order.getId()); |
| | | } |
| | | |
| | | List<TbSchedule> list2 = scheduleService.list(new LambdaQueryWrapper<TbSchedule>().eq(TbSchedule::getOrderId, order.getId()).orderByDesc(TbSchedule::getCreateTime)); |
| | | List<TbSchedule> collect = list2.stream().filter(e -> StringUtils.isEmpty(e.getParentId())).collect(Collectors.toList()); |
| | |
| | | |
| | | TbBuyerCompanyInfo one = buyerCompanyInfoService.getOne(new LambdaQueryWrapper<TbBuyerCompanyInfo>().eq(TbBuyerCompanyInfo::getOrderId, order.getId())); |
| | | CustomerInfoVo customerInfoVo = new CustomerInfoVo(); |
| | | BeanUtils.copyProperties(one, customerInfoVo); |
| | | if(one!=null){ |
| | | BeanUtils.copyProperties(one, customerInfoVo); |
| | | String orderId = one.getOrderId(); |
| | | List<TbShareholder> list3 = shareholderService.list(new LambdaQueryWrapper<TbShareholder>().eq(TbShareholder::getOrderId, orderId)); |
| | | customerInfoVo.setShareHolders(list3); |
| | | } |
| | | companyDetailVo.setCustomerInfoVo(customerInfoVo); |
| | | companyDetailVo.setEstimatedRevenue(order.getPrice().subtract(order.getCommissionPrice()).subtract(order.getCommissionPlatform())); |
| | | |
| | | TbUser user = userService.getById(order.getUserId()); |
| | | companyDetailVo.setCustomerName(user.getUserName()); |
| | | |
| | | // 异常原因 |
| | | List<Object> cacheList = redisCache.getCacheList("abnormal_" + companyId); |
| | | if (cacheList.isEmpty()) { |
| | | ArrayList<AbnormalVo> abnormalVos = new ArrayList<>(); |
| | | for (Object o : cacheList) { |
| | | AbnormalVo abnormalVo = JSONObject.parseObject(o.toString(), AbnormalVo.class); |
| | | abnormalVos.add(abnormalVo); |
| | | // 判断是否要迁区 是否要改名 新增天数 |
| | | if(one!=null){ |
| | | companyDetailVo.setEstimatedDays(one.getAddDay()+companyDetailVo.getEstimatedDays()); |
| | | if(one.getNeedRename()==1){ |
| | | companyDetailVo.setSaleMoney( companyDetailVo.getSaleMoney().add(companyDetailVo.getRenameMoney())); |
| | | } |
| | | companyDetailVo.setAbnormalVos(abnormalVos); |
| | | }else { |
| | | // TODO 企查查 次数查询加数据库 并加入缓存1天过期 |
| | | } |
| | | if(one.getNewDistrict()==1){ |
| | | companyDetailVo.setSaleMoney( companyDetailVo.getSaleMoney().add(companyDetailVo.getRelocationAreaMoney())); |
| | | } |
| | | } |
| | | |
| | | return companyDetailVo; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import java.math.RoundingMode; |
| | | import java.net.InetAddress; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | @Autowired |
| | | private TbMessageService messageService; |
| | | |
| | | @Autowired |
| | | private TbShareholderService shareholderService; |
| | | |
| | | |
| | | @Override |
| | | public Page<MyPushCompanyListVo> getMyOrderList(MyOrderListQuery query, Long userId) { |
| | | Page<MyPushCompanyListVo> page = new Page<>(query.getPageNum(), query.getPageSize()); |
| | | return this.baseMapper.getMyOrderList(page,query,userId); |
| | | } |
| | | |
| | | @Override |
| | | public HashMap<String, Object> getMyOrderListNum(Long userId, HashMap<String, Object> map) { |
| | | List<MyPushCompanyListVo> list = this.baseMapper.getMyOrderListNum(userId); |
| | | map.put("toBeConfirmed", list.stream().filter(e -> e.getStatus() == 2).count()); |
| | | map.put("pendingPayment", list.stream().filter(e -> e.getStatus() == 3).count()); |
| | | map.put("processing", list.stream().filter(e -> e.getStatus() == 4).count()); |
| | | map.put("completed", list.stream().filter(e -> e.getStatus() == 6).count()); |
| | | return map; |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | @Override |
| | | @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) |
| | | public void lastPayOrderData(TbOrder tbOrder, AddBuyerCompanyInfoDto dto, Long userId,TbCompany company) { |
| | | public void lastPayOrderData(TbOrder tbOrder, AddBuyerCompanyInfoDto dto, Long userId,TbCompany company, TbBuyerCompanyInfo one) { |
| | | TbBuyerCompanyInfo tbBuyerCompanyInfo = new TbBuyerCompanyInfo(); |
| | | BeanUtils.copyProperties(dto,tbBuyerCompanyInfo); |
| | | if(one!=null){ |
| | | tbBuyerCompanyInfo.setId(one.getId()); |
| | | } |
| | | tbBuyerCompanyInfo.setOrderId(tbOrder.getId()); |
| | | List<TbShareholder> shareholders = dto.getShareholders(); |
| | | |
| | |
| | | addDay = addDay+company.getRelocationAreaDay(); |
| | | } |
| | | // 更新订单金额 |
| | | if(addMoney.compareTo(BigDecimal.ZERO)>0){ |
| | | BigDecimal add = tbOrder.getPrice().add(addMoney); |
| | | tbOrder.setPrice(add); |
| | | tbOrder.updateById(); |
| | | } |
| | | BigDecimal add = company.getSaleMoney().add(addMoney); |
| | | tbOrder.setPrice(add); |
| | | tbOrder.setOrderNo(OrderUtil.getOrderNoForPrefix("ZSX")); |
| | | tbOrder.updateById(); |
| | | |
| | | if(addDay>0){ |
| | | tbBuyerCompanyInfo.setAddDay(addDay); |
| | | } |
| | | tbBuyerCompanyInfo.insert(); |
| | | tbBuyerCompanyInfo.insertOrUpdate(); |
| | | |
| | | shareholderService.remove(new LambdaQueryWrapper<TbShareholder>().eq(TbShareholder::getOrderId, tbOrder.getId())); |
| | | for (TbShareholder shareholder : shareholders) { |
| | | shareholder.setOrderId(tbOrder.getId()); |
| | | shareholder.insert(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | InetAddress.getLoopbackAddress().getHostAddress()); |
| | | wxPayUnifiedOrderRequest.setTradeType("JSAPI"); |
| | | wxPayUnifiedOrderRequest.setNotifyUrl( |
| | | wxProperties.getNotifyUrl() +"mall-hotel-order/WX/callback"); |
| | | wxProperties.getNotifyUrl()); |
| | | WxPayMpOrderResult result = wxPayService.createOrder(wxPayUnifiedOrderRequest); |
| | | |
| | | return result; |
| | |
| | | package com.ruoyi.system.task.utils; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.system.model.TbAccountDetail; |
| | | import com.ruoyi.system.model.TbCompany; |
| | | import com.ruoyi.system.model.TbOrder; |
| | | import com.ruoyi.system.service.TbAccountDetailService; |
| | | import com.ruoyi.system.service.TbCompanyService; |
| | | import com.ruoyi.system.service.TbOrderService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @date 2023/7/11 8:39 |
| | | */ |
| | | @Component |
| | | public class TaskUtil { |
| | | |
| | | @Autowired |
| | | private TbOrderService orderService; |
| | | @Autowired |
| | | private TbCompanyService companyService; |
| | | @Autowired |
| | | private TbAccountDetailService accountDetailService; |
| | | |
| | | |
| | | |
| | | @Scheduled(fixedRate = 60000) |
| | | public void confirmOrder() { |
| | | String format = LocalDateTime.now().minusDays(5).format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | | List<TbOrder> list = orderService.list(new LambdaQueryWrapper<TbOrder>().eq(TbOrder::getStatus, 5).le(TbOrder::getSellerFinishTime, format)); |
| | | for (TbOrder tbOrder : list) { |
| | | successOrder(tbOrder.getId()); |
| | | } |
| | | } |
| | | |
| | | private void successOrder(String orderId){ |
| | | TbOrder order = orderService.getById(orderId); |
| | | TbCompany company = companyService.getById(order.getCompanyId()); |
| | | // 订单完成 商品已售卖 |
| | | order.setStatus(6); |
| | | order.updateById(); |
| | | order.setFinishTime( new Date()); |
| | | company.setStatus(3); |
| | | |
| | | // 分佣 |
| | | orderService.commission(order, company.getUserId()); |
| | | |
| | | // 卖家账户明细记录更新 |
| | | TbAccountDetail one = accountDetailService.getOne(new LambdaQueryWrapper<TbAccountDetail>().eq(TbAccountDetail::getOrderId, orderId).eq(TbAccountDetail::getCategory, 2)); |
| | | if (one != null) { |
| | | one.setStatus(2); |
| | | one.updateById(); |
| | | } |
| | | |
| | | company.updateById(); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.vo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.system.model.TbOpeningBank; |
| | | import com.ruoyi.system.model.TbPermit; |
| | | import com.ruoyi.system.model.TbSchedule; |
| | |
| | | @ApiModelProperty("市") |
| | | private String city; |
| | | |
| | | @ApiModelProperty("市编码") |
| | | private String cityCode; |
| | | |
| | | @ApiModelProperty("省") |
| | | private String province; |
| | | |
| | | @ApiModelProperty("区") |
| | | private String area; |
| | | |
| | | @ApiModelProperty("区编码") |
| | | private String areaCode; |
| | | |
| | | @ApiModelProperty("预估天数") |
| | | private Integer estimatedDays; |
| | |
| | | private CustomerInfoVo customerInfoVo; |
| | | |
| | | @ApiModelProperty("支付时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date payTime; |
| | | |
| | | @ApiModelProperty("预估收入") |
| | |
| | | private String customerName; |
| | | |
| | | @ApiModelProperty("确认时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date confirmTime; |
| | | |
| | | |
| | | @ApiModelProperty("企业经营异常信息 企查查参数说明") |
| | | private Object companyExceptionInfo; |
| | | |
| | | @ApiModelProperty("实缴资金") |
| | | private String paidInFunds; |
| | | |
| | | @ApiModelProperty("征信报告链接") |
| | | private String link; |
| | | |
| | | |
| | | @ApiModelProperty("卖家确认时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date sellerFinishTime; |
| | | |
| | | @ApiModelProperty("1上架 2 下架 3已出售 4锁定中") |
| | | private Integer state; |
| | | |
| | | @ApiModelProperty("订单id") |
| | | private String orderId; |
| | | |
| | | } |
| | |
| | | package com.ruoyi.system.vo; |
| | | |
| | | import com.ruoyi.system.model.TbShareholder; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel("客户填写信息Vo") |
| | |
| | | |
| | | @ApiModelProperty("添加天数") |
| | | private Integer addDay; |
| | | |
| | | @ApiModelProperty("股东信息") |
| | | private List<TbShareholder> shareHolders; |
| | | } |
| | | |
| | | |
| | |
| | | package com.ruoyi.system.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | private String companyName; |
| | | |
| | | @ApiModelProperty("发布时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createTime; |
| | | |
| | | @ApiModelProperty("售卖价格") |
| | |
| | | @ApiModelProperty("订单id") |
| | | private String orderId; |
| | | |
| | | @ApiModelProperty("状态 -1取消 1待交易 2待确认(预定) 3已确认(待支付) 4办理中 5已完成") |
| | | @ApiModelProperty("状态 -1取消 1待交易 2待确认(预定) 3已确认(待支付) 4办理中 5已完成 6已下架") |
| | | private Integer status; |
| | | } |
| | |
| | | <select id="getMyPushCompanyList" resultType="com.ruoyi.system.vo.MyPushCompanyListVo"> |
| | | select * from ( |
| | | select t1.id,t1.company_name,t1.create_time,t1.sale_money ,t2.id orderId, |
| | | COALESCE(t2.status, 1) AS status |
| | | case |
| | | when t1.status=2 then 6 |
| | | else |
| | | COALESCE(t2.status, 1) END AS status |
| | | from tb_company t1 |
| | | left join tb_order t2 on t1.id = t2.company_id |
| | | where t1.user_id = #{userId} and t2.status >0 |
| | | where t1.user_id = #{userId} and t1.is_delete =0 |
| | | ) as t3 where 1= 1 |
| | | <if test="query.status!=null"> |
| | | and t3.status = #{query.status} |
| | |
| | | |
| | | |
| | | </select> |
| | | <select id="getMyPushCompanyListNum" resultType="com.ruoyi.system.vo.MyPushCompanyListVo" |
| | | parameterType="java.lang.Long"> |
| | | select * from ( |
| | | select t1.id,t1.company_name,t1.create_time,t1.sale_money ,t2.id orderId, |
| | | case when t1.status=2 then 6 |
| | | else |
| | | COALESCE(t2.status, 1) END AS status |
| | | from tb_company t1 |
| | | left join tb_order t2 on t1.id = t2.company_id |
| | | where t1.user_id = #{userId} and t1.is_delete =0 |
| | | ) as t3 where 1= 1 |
| | | order by t3.create_time desc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | </resultMap> |
| | | |
| | | <select id="getMyOrderList" resultType="com.ruoyi.system.vo.MyPushCompanyListVo"> |
| | | select t1.id orderId,t2.id,t2.compamy_name companyName,t2.create_time createTime,t2.sale_money saleMoney,t2.status |
| | | select t1.id orderId,t2.id,t2.company_name companyName,t2.create_time createTime,t2.sale_money saleMoney,t1.status |
| | | from tb_order t1 left join tb_company t2 on t1.company_id = t2.id |
| | | where t2.user_id =#{userId} |
| | | where t1.user_id =#{userId} and t2.id is not null |
| | | <if test="query.status != null and query.status !=6 "> |
| | | and t1.status = #{query.status} |
| | | </if> |
| | | <if test="query.status != null and query.status ==6 "> |
| | | and t1.status in (5,6) |
| | | </if> |
| | | order by t1.create_time desc |
| | | </select> |
| | | <select id="getMyOrderListNum" resultType="com.ruoyi.system.vo.MyPushCompanyListVo" |
| | | parameterType="java.lang.Long"> |
| | | select t1.id orderId,t2.id,t2.company_name companyName,t2.create_time createTime,t2.sale_money saleMoney,t1.status |
| | | from tb_order t1 left join tb_company t2 on t1.company_id = t2.id |
| | | where t1.user_id =#{userId} and t2.id is not null |
| | | order by t1.create_time desc |
| | | </select> |
| | | |