| | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.core.annotation.excel.ExcelExporter; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.core.constants.Constants; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.business.model.Member; |
| | | import com.doumee.service.business.MemberService; |
| | | import com.github.xiaoymin.knife4j.core.util.CollectionUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * @author 江蹄蹄 |
| | |
| | | @PostMapping("/exportExcel") |
| | | @RequiresPermissions("business:member:exportExcel") |
| | | public void exportExcel (@RequestBody PageWrap<Member> pageWrap, HttpServletResponse response) { |
| | | ExcelExporter.build(Member.class).export(memberService.findPage(pageWrap).getRecords(), "会员信息表", response); |
| | | List<Member> memberList = memberService.findPage(pageWrap).getRecords(); |
| | | if(CollectionUtils.isNotEmpty(memberList)){ |
| | | for (Member m:memberList) { |
| | | m.setAmountYuan(Objects.nonNull(m.getAmount())&&m.getAmount()> Constants.ZERO? new BigDecimal(m.getAmount()+"").divide(new BigDecimal("100"),2,BigDecimal.ROUND_UP):BigDecimal.ZERO); |
| | | List<String> identityInfo = new ArrayList<>(); |
| | | if(Constants.equalsInteger(m.getWorkerIdentity(),Constants.TWO)){ |
| | | identityInfo.add("工人"); |
| | | } |
| | | if(Constants.equalsInteger(m.getDriverIdentity(),Constants.TWO)){ |
| | | identityInfo.add("司机"); |
| | | } |
| | | if(Constants.equalsInteger(m.getChefIdentity(),Constants.TWO)){ |
| | | identityInfo.add("供餐"); |
| | | } |
| | | m.setIdentityApplyInfo(StringUtils.join(identityInfo,",")); |
| | | m.setIdentityInfo("发单方" + (StringUtils.isNotBlank(m.getIdentityApplyInfo())?" | 接单方":"")); |
| | | } |
| | | } |
| | | ExcelExporter.build(Member.class).export(memberList, "会员信息表", response); |
| | | } |
| | | |
| | | @ApiOperation("根据ID查询") |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 初始化Jobs |
| | | */ |
| | | // @PostConstruct |
| | | @PostConstruct |
| | | public void initJobs () { |
| | | log.debug("Initializing jobs"); |
| | | // 修复JOB |
| | |
| | | public void refreshToken(String token,Member member) { |
| | | try { |
| | | if(Objects.nonNull(member)){ |
| | | redisTemplate.expire(Constants.REDIS_TOKEN_KEY+token,jwtProperties.getExpiration(), TimeUnit.MILLISECONDS); |
| | | // redisTemplate.expire(Constants.REDIS_TOKEN_KEY+token,jwtProperties.getExpiration(), TimeUnit.MILLISECONDS); |
| | | // redisTemplate.delete(Constants.REDIS_TOKEN_KEY+token); |
| | | // redisTemplate.opsForValue().set(Constants.REDIS_TOKEN_KEY+token,JSONObject.toJSONString(member),jwtProperties.getExpiration(), TimeUnit.MILLISECONDS); |
| | | } |
| | |
| | | .setExpiration(expirationDate) |
| | | .signWith(SignatureAlgorithm.HS512, jwtProperties.getSecret()) |
| | | .compact(); |
| | | redisTemplate.opsForValue().set(Constants.REDIS_TOKEN_KEY+token,JSONObject.toJSONString(member), |
| | | jwtProperties.getExpiration(), TimeUnit.MILLISECONDS); |
| | | redisTemplate.opsForValue().set(Constants.REDIS_TOKEN_KEY+token,JSONObject.toJSONString(member) |
| | | // , jwtProperties.getExpiration(), TimeUnit.MILLISECONDS |
| | | ); |
| | | return token; |
| | | } |
| | | |
| | |
| | | } |
| | | Integer count = dao.queryForObject("select count(1) from member where id = ?", Integer.class, member.getId()); |
| | | if (count != null && count > 0) { |
| | | jwtTokenUtil.refreshToken(token,member); |
| | | // jwtTokenUtil.refreshToken(token,member); |
| | | request.setAttribute(JwtTokenUtil.MEMBER_INFO, JSONObject.toJSONString(member)); |
| | | request.setAttribute(JwtTokenUtil.MEMBER_ID, member.getId()); |
| | | return true; |
| | |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | @ApiModelProperty(value = "主键", example = "1") |
| | | @ExcelColumn(name="主键") |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "是否已删除 0未删除 1已删除", example = "1") |
| | | @ExcelColumn(name="是否已删除 0未删除 1已删除") |
| | | private Integer deleted; |
| | | |
| | | @ApiModelProperty(value = "创建人编码", example = "1") |
| | | @ExcelColumn(name="创建人编码") |
| | | @ExcelColumn(name="申请时间",index = 10,dateFormat = "yyyy-MM-dd HH:mm:ss",width = 16) |
| | | private Integer createUser; |
| | | |
| | | @ApiModelProperty(value = "创建时间") |
| | | @ExcelColumn(name="创建时间") |
| | | private Date createTime; |
| | | |
| | | @ApiModelProperty(value = "更新人编码", example = "1") |
| | | @ExcelColumn(name="更新人编码") |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty(value = "更新时间") |
| | | @ExcelColumn(name="更新时间") |
| | | private Date updateTime; |
| | | |
| | | @ApiModelProperty(value = "备注") |
| | | @ExcelColumn(name="备注") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(value = "类型:0=用工身份;1=货运身份;2=供餐身份;", example = "1") |
| | | @ExcelColumn(name="类型:0=用工身份;1=货运身份;2=供餐身份;") |
| | | @ExcelColumn(name="类型",valueMapping = "0=用工身份;1=货运身份;2=供餐身份;",index = 4,width = 10) |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "会员主键", example = "1") |
| | | @ExcelColumn(name="会员主键") |
| | | private Integer memberId; |
| | | |
| | | @ApiModelProperty(value = "认证类型:0=个人;1=企业", example = "1") |
| | | @ExcelColumn(name="认证类型:0=个人;1=企业") |
| | | @ExcelColumn(name="认证类型",valueMapping = "0=个人;1=企业;",index = 5,width = 10) |
| | | private Integer authType; |
| | | |
| | | @ApiModelProperty(value = "联系人") |
| | | @ExcelColumn(name="联系人") |
| | | @ExcelColumn(name="联系人",index = 6,width = 10) |
| | | private String linkName; |
| | | |
| | | @ApiModelProperty(value = "联系方式") |
| | | @ExcelColumn(name="联系方式") |
| | | @ExcelColumn(name="联系方式",index = 7,width = 10) |
| | | private String telephone; |
| | | |
| | | @ApiModelProperty(value = "接单位置") |
| | | @ExcelColumn(name="接单位置") |
| | | @ExcelColumn(name="接单位置",index = 8,width = 20) |
| | | private String location; |
| | | |
| | | @ApiModelProperty(value = "单位名称") |
| | | @ExcelColumn(name="单位名称") |
| | | @ExcelColumn(name="单位名称",index = 9,width = 10) |
| | | private String companyName; |
| | | |
| | | @ApiModelProperty(value = "纬度", example = "1") |
| | | @ExcelColumn(name="纬度") |
| | | private BigDecimal lat; |
| | | |
| | | @ApiModelProperty(value = "经度", example = "1") |
| | | @ExcelColumn(name="经度") |
| | | private BigDecimal lgt; |
| | | |
| | | @ApiModelProperty(value = "身份证人像面/营业执照") |
| | | @ExcelColumn(name="身份证人像面/营业执照") |
| | | private String img1; |
| | | |
| | | @ApiModelProperty(value = "身份证国徽面/道路交通营运许可证/食品经营许可证") |
| | | @ExcelColumn(name="身份证国徽面/道路交通营运许可证/食品经营许可证") |
| | | private String img2; |
| | | |
| | | @ApiModelProperty(value = "从业人员健康证") |
| | | @ExcelColumn(name="从业人员健康证") |
| | | private String img3; |
| | | |
| | | @ApiModelProperty(value = "其他认证资料") |
| | | @ExcelColumn(name="其他认证资料") |
| | | private String img4; |
| | | |
| | | @ApiModelProperty(value = "认证审批状态:1=申请中;2=已通过;3=未通过;", example = "1") |
| | | @ExcelColumn(name="认证审批状态:1=申请中;2=已通过;3=未通过;") |
| | | @ExcelColumn(name="审核状态",valueMapping = "1=申请中;2=已通过;3=未通过;",index = 1,width = 10) |
| | | private Integer auditStatus; |
| | | |
| | | @ApiModelProperty(value = "认证审批时间") |
| | | @ExcelColumn(name="认证审批时间") |
| | | @ExcelColumn(name="认证审批时间",index = 12,dateFormat = "yyyy-MM-dd HH:mm:ss",width = 16) |
| | | private Date auditTime; |
| | | |
| | | @ApiModelProperty(value = "认证审批备注") |
| | | @ExcelColumn(name="认证审批备注") |
| | | @ExcelColumn(name="认证审批备注",index = 13,width = 16) |
| | | private String auditRemark; |
| | | |
| | | |
| | | @ApiModelProperty(value = "审核人姓名") |
| | | @TableField(exist = false) |
| | | @ExcelColumn(name="审核人姓名",index = 11,width = 10) |
| | | private String editorName; |
| | | @ApiModelProperty(value = "用户openid") |
| | | @ExcelColumn(name="openid",index = 2,width = 20) |
| | | @TableField(exist = false) |
| | | private String openid; |
| | | @ApiModelProperty(value = "用户昵称") |
| | | @ExcelColumn(name="会员昵称",index = 3,width = 10) |
| | | @TableField(exist = false) |
| | | private String memberName; |
| | | @ApiModelProperty(value = "图片集合") |
| | |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | @ApiModelProperty(value = "主键", example = "1") |
| | | @ExcelColumn(name="主键") |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "是否已删除 0未删除 1已删除", example = "1") |
| | | @ExcelColumn(name="是否已删除 0未删除 1已删除") |
| | | private Integer deleted; |
| | | |
| | | @ApiModelProperty(value = "创建人编码", example = "1") |
| | | @ExcelColumn(name="创建人编码") |
| | | private Integer createUser; |
| | | |
| | | @ApiModelProperty(value = "创建时间") |
| | | @ExcelColumn(name="创建时间") |
| | | @ExcelColumn(name="注册时间",index = 8,width = 16, dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | @ApiModelProperty(value = "更新人编码", example = "1") |
| | | @ExcelColumn(name="更新人编码") |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty(value = "更新时间") |
| | | @ExcelColumn(name="更新时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date updateTime; |
| | | |
| | | @ApiModelProperty(value = "备注") |
| | | @ExcelColumn(name="备注") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(value = "头像") |
| | | @ExcelColumn(name="头像") |
| | | private String coverImage; |
| | | |
| | | @ApiModelProperty(value = "openid") |
| | | @ExcelColumn(name="openid") |
| | | @ExcelColumn(name="openid",index = 1,width = 20) |
| | | private String openid; |
| | | |
| | | @ApiModelProperty(value = "昵称") |
| | | @ExcelColumn(name="昵称") |
| | | @ExcelColumn(name="昵称",index = 3,width = 10) |
| | | private String nickName; |
| | | |
| | | @ApiModelProperty(value = "联系电话") |
| | | @ExcelColumn(name="联系电话") |
| | | @ExcelColumn(name="手机号",index = 2,width = 10) |
| | | private String telephone; |
| | | |
| | | @ApiModelProperty(value = "姓名") |
| | | @ExcelColumn(name="姓名") |
| | | @ExcelColumn(name="真实姓名",index = 4,width = 10) |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "用工身份:0=未申请;1=申请中;2=已通过;3=未通过;", example = "1") |
| | | @ExcelColumn(name="用工身份:0=未申请;1=申请中;2=已通过;3=未通过;") |
| | | private Integer workerIdentity; |
| | | |
| | | @ApiModelProperty(value = "货运身份:0=未申请;1=申请中;2=已通过;3=未通过;", example = "1") |
| | | @ExcelColumn(name="货运身份:0=未申请;1=申请中;2=已通过;3=未通过;") |
| | | private Integer driverIdentity; |
| | | |
| | | @ApiModelProperty(value = "供餐很粉:0=未申请;1=申请中;2=已通过;3=未通过;", example = "1") |
| | | @ExcelColumn(name="供餐很粉:0=未申请;1=申请中;2=已通过;3=未通过;") |
| | | @ApiModelProperty(value = "供餐身份:0=未申请;1=申请中;2=已通过;3=未通过;", example = "1") |
| | | private Integer chefIdentity; |
| | | |
| | | @ApiModelProperty(value = "当前余额(单位:分)", example = "1") |
| | | @ExcelColumn(name="当前余额(单位:分)") |
| | | private Long amount; |
| | | |
| | | @ApiModelProperty(value = "历史总金额(单位:分)", example = "1") |
| | | @ExcelColumn(name="历史总金额(单位:分)") |
| | | private Long totalAmount; |
| | | |
| | | @ApiModelProperty(value = "状态", example = "1") |
| | | @ExcelColumn(name="状态") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "最后登录时间") |
| | | @ExcelColumn(name="最后登录时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date loginTime; |
| | | |
| | | @ApiModelProperty(value = "总登录次数", example = "1") |
| | | @ExcelColumn(name="总登录次数") |
| | | private Long loginTimes; |
| | | |
| | | @ApiModelProperty(value = "总接单量", example = "1") |
| | | @ExcelColumn(name="总接单量") |
| | | private Long receiveNum; |
| | | |
| | | @ApiModelProperty(value = "总发单量", example = "1") |
| | | @ExcelColumn(name="总发单量") |
| | | private Long publishNum; |
| | | |
| | | @ApiModelProperty(value = "评分", example = "1") |
| | | @ExcelColumn(name="评分") |
| | | private BigDecimal score; |
| | | |
| | | |
| | | @ApiModelProperty(value = "评分总数", example = "1") |
| | | @ExcelColumn(name="评分总数") |
| | | private BigDecimal totalScore; |
| | | |
| | | @ApiModelProperty(value = "被评价总订单数", example = "1") |
| | | @ExcelColumn(name="被评价总订单数") |
| | | private Integer scoreOrderNum; |
| | | |
| | | |
| | | @ApiModelProperty(value = "定位地址") |
| | | @ExcelColumn(name="定位地址") |
| | | private String location; |
| | | |
| | | @ApiModelProperty(value = "纬度", example = "1") |
| | | @ExcelColumn(name="纬度") |
| | | private BigDecimal lat; |
| | | |
| | | @ApiModelProperty(value = "经度", example = "1") |
| | | @ExcelColumn(name="经度") |
| | | private BigDecimal lgt; |
| | | |
| | | @ApiModelProperty(value = "省份") |
| | | @ExcelColumn(name="省份") |
| | | private String province; |
| | | |
| | | @ApiModelProperty(value = "城市") |
| | | @ExcelColumn(name="城市") |
| | | private String city; |
| | | |
| | | @ApiModelProperty(value = "区县") |
| | | @ExcelColumn(name="区县") |
| | | private String area; |
| | | |
| | | @ApiModelProperty(value = "是否接受自动派单:0=否;1=是;", example = "1") |
| | | @ExcelColumn(name="是否接受自动派单:0=否;1=是;") |
| | | @ExcelColumn(name="接受自动派单",index = 9,width = 10,valueMapping = "0=否;1=是;") |
| | | private Integer autoReceiveStatus; |
| | | |
| | | @ApiModelProperty(value = "当前使用身份:0=用工发布方;1=用工接单方;", example = "1") |
| | | @ExcelColumn(name="当前使用身份:0=用工发布方;1=用工接单方;") |
| | | private Integer useIdentity; |
| | | |
| | | @ApiModelProperty(value = "我的 - 数据信息", example = "1") |
| | |
| | | @ApiModelProperty(value = "距离", example = "1") |
| | | @TableField(exist = false) |
| | | private BigDecimal distance; |
| | | |
| | | @ApiModelProperty(value = "身份信息", example = "1") |
| | | @TableField(exist = false) |
| | | @ExcelColumn(name="身份",index = 5,width = 10) |
| | | private String identityInfo; |
| | | |
| | | @ApiModelProperty(value = "接单认证身份", example = "1") |
| | | @TableField(exist = false) |
| | | @ExcelColumn(name="接单认证身份",index = 6,width = 10) |
| | | private String identityApplyInfo; |
| | | |
| | | @ApiModelProperty(value = "当前余额(元)", example = "1") |
| | | @TableField(exist = false) |
| | | @ExcelColumn(name="当前余额(元)",index = 7,width = 10) |
| | | private BigDecimal amountYuan; |
| | | |
| | | } |
| | |
| | | @ApiModel("餐饮标准信息") |
| | | public class CateringDTO { |
| | | |
| | | @ApiModelProperty(value = "分类主键") |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "类型:早餐、中餐、晚餐") |
| | | private String name; |
| | | |
| | |
| | | import com.wechat.pay.java.service.refund.model.RefundNotification; |
| | | import jodd.util.StringUtil; |
| | | import lombok.With; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import nonapi.io.github.classgraph.json.Id; |
| | | import org.apache.poi.sl.image.ImageHeaderEMF; |
| | | import org.checkerframework.checker.units.qual.A; |
| | |
| | | * @author 江蹄蹄 |
| | | * @date 2025/07/09 12:00 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class OrdersServiceImpl implements OrdersService { |
| | | |
| | |
| | | } |
| | | orders.setWayInfo(JSONObject.toJSONString(orders.getWayInfoDTOList())); |
| | | }else{ |
| | | List<Category> categoryList = categoryMapper.selectList(new QueryWrapper<Category>().lambda().eq(Category::getDeleted,Constants.ZERO) |
| | | .eq(Category::getType,Constants.TWO) |
| | | ); |
| | | if(CollectionUtils.isEmpty(categoryList)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"餐标信息错误"); |
| | | } |
| | | //用餐订单 |
| | | if(CollectionUtils.isEmpty(orders.getCateringDTOList())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | |
| | | || Objects.isNull(cateringDTO.getNum()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"用餐标准数据错误"); |
| | | } |
| | | //餐标信息 |
| | | List<Category> categories = categoryList.stream().filter(i->Constants.equalsInteger(i.getId(),cateringDTO.getId())).collect(Collectors.toList()); |
| | | if(CollectionUtils.isEmpty(categories)){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"用餐标准数据错误,请刷新重试"); |
| | | } |
| | | Category category = categories.get(Constants.ZERO); |
| | | List<String> priceList = JSONArray.parseArray(category.getDetail(),String.class ); |
| | | if(CollectionUtils.isEmpty(priceList)){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"用餐标准数据错误,请刷新重试"); |
| | | } |
| | | if(priceList.stream().filter(i->((Long.valueOf(i)*100)+"").equals((cateringDTO.getPrice()+""))).collect(Collectors.toList()).size()==Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"用餐标准数据错误,请刷新重试"); |
| | | } |
| | | sumPrice = sumPrice + (cateringDTO.getPrice() * cateringDTO.getNum()) ; |
| | | } |
| | |
| | | ); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(orderLogList)){ |
| | | for (OrderLog orderLog:orderLogList) { |
| | | if(Constants.equalsInteger(orderLog.getOptUserType(),Constants.ZERO)){ |
| | | if(Constants.equalsInteger(orderLog.getOptUserType(),Constants.ZERO)&& org.apache.commons.lang3.StringUtils.isNotBlank(orders.getReleaseName())){ |
| | | orderLog.setLogInfo(orderLog.getLogInfo().replace("{userName}",orders.getReleaseName())); |
| | | }else if(Constants.equalsInteger(orderLog.getOptUserType(),Constants.ONE)){ |
| | | }else if(Constants.equalsInteger(orderLog.getOptUserType(),Constants.ONE)&& org.apache.commons.lang3.StringUtils.isNotBlank(orders.getAcceptName())){ |
| | | orderLog.setLogInfo(orderLog.getLogInfo().replace("{userName}",orders.getAcceptName())); |
| | | } |
| | | } |
| | |
| | | //查询用户是否有对应身份 |
| | | if(Constants.equalsInteger(orders.getType(),Constants.ZERO)){ |
| | | if(!Constants.equalsInteger(member.getWorkerIdentity(),Constants.TWO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"身份信息异常,请前往个人中心进行身份认证!"); |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"您还未注册该服务,请前往个人信息中提交申请。"); |
| | | } |
| | | }else if(Constants.equalsInteger(orders.getType(),Constants.ONE)){ |
| | | if(!Constants.equalsInteger(member.getDriverIdentity(),Constants.TWO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"身份信息异常,请前往个人中心进行身份认证!"); |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"您还未注册该服务,请前往个人信息中提交申请。"); |
| | | } |
| | | }else{ |
| | | if(!Constants.equalsInteger(member.getChefIdentity(),Constants.TWO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"身份信息异常,请前往个人中心进行身份认证!"); |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"您还未注册该服务,请前往个人信息中提交申请。"); |
| | | } |
| | | } |
| | | |
| | |
| | | .eq(Orders::getReleaseMemberId,member.getId())); |
| | | //查询取消次数 |
| | | if(totalCancelTimes<=cancelTimes){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"今日订单主动取消次数已超出"+totalCancelTimes+"次,无法取消订单,如需处理请联系客服"); |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"今日订单主动取消次数已超出"+totalCancelTimes+"次,无法取消订单"); |
| | | } |
| | | |
| | | Integer cancelTimeHour = Integer.valueOf(systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.RELEASE_CANCEL_TIME).getCode()); |
| | | Long hours = DateUtil.getBetweenHours(new Date(),orders.getStartDate()); |
| | | if(hours < cancelTimeHour){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"距离订单开始时间不足"+cancelTimeHour+"小时,无法取消订单,如需处理请联系客服"); |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"距离订单开始时间不足"+cancelTimeHour+"小时,无法取消订单"); |
| | | } |
| | | return "今日还可主动取消"+(totalCancelTimes-cancelTimes)+"次,是否确认取消"; |
| | | |
| | |
| | | */ |
| | | @Override |
| | | public void autoGrabOrders(){ |
| | | log.error("滴滴滴滴"); |
| | | String autoConfirmTime = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.AUTO_DISPATCH).getCode(); |
| | | List<Orders> ordersList = ordersMapper.selectList(new QueryWrapper<Orders>().lambda() |
| | | List<Orders> ordersList = ordersMapper.selectList(new QueryWrapper<Orders>().lambda().eq(Orders::getDeleted,Constants.ZERO) |
| | | .eq(Orders::getStatus,Constants.ONE).eq(Orders::getCommentStatus,Constants.ZERO) |
| | | .apply(" DATE_ADD(create_time, INTERVAL "+autoConfirmTime+" MINUTE) < now() ") |
| | | .last("limit 100") |
| | |
| | | BigDecimal lat = orders.getLat(); |
| | | BigDecimal lgt = orders.getLgt(); |
| | | //查询范围内的会员 |
| | | List<Member> memberList = memberMapper.selectList(new MPJLambdaWrapper<Member>().selectAll(Member.class) |
| | | .select(" ifnull((select r.level from receive_weight r where r.RECEIVE_MAX > t.RECEIVE_NUM and t.RECEIVE_NUM > r.RECEIVE_MIN limit 1 ),0) " ,Member::getLevel) |
| | | .select( " ifnull( (select CONVERT( ST_Distance_Sphere ( POINT ( ii.lgt, ii.lat ), POINT ( "+lgt+", "+lat+" )) /1000,DECIMAL(15,2)) from identity_info ii where ii.AUDIT_STATUS = 2 and type = 0 and ii.member_id = t.ID limit 1 ),0) ",Member::getDistance ) |
| | | List<Member> memberList = memberMapper.selectList(new MPJLambdaWrapper<Member>() |
| | | .selectAll(Member.class) |
| | | .select(" ifnull((select r.level from receive_weight r where r.RECEIVE_MAX > RECEIVE_NUM and RECEIVE_NUM > r.RECEIVE_MIN limit 1 ),0) " ,Member::getLevel) |
| | | .select( " ifnull( (select CONVERT( ST_Distance_Sphere ( POINT ( ii.lgt, ii.lat ), POINT ( "+lgt+", "+lat+" )) /1000,DECIMAL(15,2)) from identity_info ii where ii.AUDIT_STATUS = 2 and type = 0 and ii.member_id = ID limit 1 ),0) ",Member::getDistance ) |
| | | |
| | | .apply(" id in (" + |
| | | " select ii.member_id from identity_info ii where ii.AUDIT_STATUS = 2 and type = '"+orders.getType()+"' " + |
| | |
| | | ); |
| | | |
| | | //更新接单量 |
| | | memberMapper.update(new UpdateWrapper<Member>().lambda().setSql(" publish_num = (ifnull(publish_num,0) + 1 )").eq(Member::getId,member.getId())); |
| | | memberMapper.update(new UpdateWrapper<Member>().lambda().setSql(" RECEIVE_NUM = (ifnull(RECEIVE_NUM,0) + 1 )").eq(Member::getId,member.getId())); |
| | | |
| | | //创建操作日志 |
| | | Constants.OrdersLog ordersLog = Constants.OrdersLog.AUTO; |