parent
67fb4a6efd
commit
ec2d7bf71d
@ -0,0 +1,23 @@
|
||||
package cc.yunxi.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.client.ClientHttpRequestFactory;
|
||||
import org.springframework.http.client.SimpleClientHttpRequestFactory;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
@Configuration
|
||||
public class RestTemplateConfig {
|
||||
@Bean
|
||||
public RestTemplate restTemplate(ClientHttpRequestFactory factory){
|
||||
return new RestTemplate(factory);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ClientHttpRequestFactory simpleClientHttpRequestFactory(){
|
||||
SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory();
|
||||
factory.setConnectTimeout(15000);
|
||||
factory.setReadTimeout(5000);
|
||||
return factory;
|
||||
}
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package cc.yunxi.controller;
|
||||
|
||||
|
||||
import cc.yunxi.aspect.UserTypeAnnotation;
|
||||
import cc.yunxi.common.domain.CommonResult;
|
||||
import cc.yunxi.common.domain.PageDTO;
|
||||
import cc.yunxi.common.utils.BeanUtils;
|
||||
import cc.yunxi.domain.dto.UserDTO;
|
||||
import cc.yunxi.domain.dto.WxLoginDTO;
|
||||
import cc.yunxi.domain.dto.ZSGLoginDTO;
|
||||
import cc.yunxi.domain.po.Client;
|
||||
import cc.yunxi.domain.po.ClientAccountDetail;
|
||||
import cc.yunxi.domain.query.ClientAccountQuery;
|
||||
import cc.yunxi.domain.query.ClientQuery;
|
||||
import cc.yunxi.domain.vo.client.ClientAccountRespVO;
|
||||
import cc.yunxi.domain.vo.client.ClientRespVO;
|
||||
import cc.yunxi.domain.vo.client.ClientUpdateVO;
|
||||
import cc.yunxi.enums.UserTypeEnum;
|
||||
import cc.yunxi.service.IClientService;
|
||||
import cc.yunxi.service.impl.CommonService;
|
||||
import cc.yunxi.utils.UserContext;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 散户信息 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author ccongli
|
||||
* @since 2024-02-28 06:08:09
|
||||
*/
|
||||
@Api(tags = "小智登录接口")
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class EntranceController {
|
||||
|
||||
private final CommonService commonService;
|
||||
|
||||
@ApiOperation("小智系统请求用户登录接口")
|
||||
@RequestMapping("/login_name")
|
||||
public CommonResult<ZSGLoginDTO> ZSG_Login(@RequestParam(name="loginName",required = true) String loginName) {
|
||||
|
||||
ZSGLoginDTO zsgLoginDTO = commonService.loginByZSG(loginName);
|
||||
return CommonResult.success(zsgLoginDTO,"请求成功");
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
package cc.yunxi.domain.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.models.auth.In;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@Data
|
||||
@ApiModel(description = "小程序认证实体")
|
||||
public class ZSGLoginDTO {
|
||||
|
||||
@ApiModelProperty(value = "序号")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "登陆名称")
|
||||
private String loginName;
|
||||
|
||||
@ApiModelProperty(value = "状态 0:正常 1:冻结 2:删除")
|
||||
private Integer stat;
|
||||
|
||||
@ApiModelProperty(value = "角色 2:设备管理员 4:清运员 9:普通用户")
|
||||
private Integer role;
|
||||
|
||||
@ApiModelProperty(value = "积分")
|
||||
private Integer score;
|
||||
//
|
||||
// @ApiModelProperty(value = "loginType")
|
||||
// @NotBlank(message = "登陆类型:1手机号登陆 2网络登陆(小程序) ")
|
||||
// private String loginType;
|
||||
//
|
||||
// @ApiModelProperty(value = "devid")
|
||||
// @NotBlank(message = "设备id 默认为1代表没有配置文件")
|
||||
// private String devid;
|
||||
//
|
||||
// @ApiModelProperty(value = "clientId")
|
||||
// @NotBlank(message = "小智客户端id")
|
||||
// private String clientId;
|
||||
//
|
||||
// @ApiModelProperty(value = "clientType")
|
||||
// @NotBlank(message = "小智客户端类型")
|
||||
// private String clientType;
|
||||
//
|
||||
// @ApiModelProperty(value = "clientVersion")
|
||||
// @NotBlank(message = "小智客户端版本")
|
||||
// private String clientVersion;
|
||||
//
|
||||
// @ApiModelProperty(value = "appid")
|
||||
// @NotBlank(message = "小程序id")
|
||||
// private String appid;
|
||||
//
|
||||
// @ApiModelProperty(value = "devsn")
|
||||
// @NotBlank(message = "设备编码")
|
||||
// private String devsn;
|
||||
//
|
||||
// @ApiModelProperty(value = "devType")
|
||||
// @NotBlank(message = "设备类型")
|
||||
// private String devType;
|
||||
//
|
||||
// @ApiModelProperty(value = "test")
|
||||
// @NotBlank(message = "测试模式 1为测试模式")
|
||||
// private String test;
|
||||
//
|
||||
// @ApiModelProperty(value = "ltn")
|
||||
// @NotBlank(message = "登陆类型描述 手机号登陆 网络登陆")
|
||||
// private String ltn;
|
||||
//
|
||||
// @ApiModelProperty(value = "ac")
|
||||
// @NotBlank(message = "ac版本1")
|
||||
// private String ac;
|
||||
//
|
||||
// @ApiModelProperty(value = "acc")
|
||||
// @NotBlank(message = "ac版本2")
|
||||
// private String acc;
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package cc.yunxi.domain.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 回收员表
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("base_bill_rule")
|
||||
@ApiModel(value = "BillRule", description = "单据规则")
|
||||
public class BillRule {
|
||||
|
||||
@TableId(value = "f_id", type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty("主键id")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 单据名称
|
||||
*/
|
||||
@TableField("f_full_name")
|
||||
@ApiModelProperty("单据名称")
|
||||
private String fullName;
|
||||
|
||||
/**
|
||||
* 单据编码
|
||||
*/
|
||||
@TableField("f_en_code")
|
||||
@ApiModelProperty("单据编码")
|
||||
private String enCode;
|
||||
|
||||
/**
|
||||
* 单据前缀
|
||||
*/
|
||||
@TableField("f_prefix")
|
||||
@ApiModelProperty("单据前缀")
|
||||
private String prefix;
|
||||
|
||||
/**
|
||||
* 日期格式
|
||||
*/
|
||||
@TableField("f_date_format")
|
||||
@ApiModelProperty("日期格式")
|
||||
private String dateFormat;
|
||||
|
||||
/**
|
||||
* 流水位数
|
||||
*/
|
||||
@TableField("f_digit")
|
||||
@ApiModelProperty("流水位数")
|
||||
private Integer digit;
|
||||
|
||||
/**
|
||||
* 流水起始
|
||||
*/
|
||||
@TableField("f_start_number")
|
||||
@ApiModelProperty("流水起始")
|
||||
private String startNumber;
|
||||
|
||||
/**
|
||||
* 流水范例
|
||||
*/
|
||||
@TableField("f_example")
|
||||
@ApiModelProperty("流水范例")
|
||||
private String example;
|
||||
|
||||
/**
|
||||
* 当前流水号
|
||||
*/
|
||||
@TableField("f_this_number")
|
||||
@ApiModelProperty("当前流水号")
|
||||
private Integer thisNumber;
|
||||
|
||||
/**
|
||||
* 输出流水号
|
||||
*/
|
||||
@TableField("f_output_number")
|
||||
@ApiModelProperty("输出流水号")
|
||||
private String outputNumber;
|
||||
|
||||
/**
|
||||
* 分类
|
||||
*/
|
||||
@TableField("f_category")
|
||||
@ApiModelProperty("分类")
|
||||
private String category;
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package cc.yunxi.mapper;
|
||||
|
||||
import cc.yunxi.domain.po.BillRule;
|
||||
import cc.yunxi.domain.po.Recycler;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 规则表 mapper接口
|
||||
*/
|
||||
@Mapper
|
||||
public interface BillRuleMapper extends BaseMapper<BillRule> {
|
||||
|
||||
}
|
@ -1,14 +1,21 @@
|
||||
package cc.yunxi.mapper;
|
||||
|
||||
import cc.yunxi.domain.po.PriceProduct;
|
||||
import cc.yunxi.domain.po.Recycler;
|
||||
import cc.yunxi.domain.po.Test;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 回收员表 mapper接口
|
||||
*/
|
||||
@Mapper
|
||||
public interface RecyclerMapper extends BaseMapper<Recycler> {
|
||||
|
||||
/**
|
||||
* 根据phone 查询最新一条的有效的回收员
|
||||
* @param phone
|
||||
* @return Price
|
||||
*/
|
||||
Recycler getLatestRecycleByPhone(@Param("phone") String phone);
|
||||
}
|
||||
|
@ -0,0 +1,35 @@
|
||||
package cc.yunxi.service;
|
||||
|
||||
import cc.yunxi.domain.po.BillRule;
|
||||
import cc.yunxi.domain.po.RecycleOrder;
|
||||
import cc.yunxi.domain.query.RecycleOrderQuery;
|
||||
import cc.yunxi.domain.vo.recycleorder.dzorder.DZRecycleOrderCreateVO;
|
||||
import cc.yunxi.domain.vo.recycleorder.shorder.*;
|
||||
import cc.yunxi.domain.vo.recycleorder.tmorder.TMRecycleOrderCreateVO;
|
||||
import cc.yunxi.domain.vo.recycleorder.tmorder.TMRecycleOrderFinishVO;
|
||||
import cc.yunxi.enums.OrderTypeEnum;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 回收站回收订单 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author ccongli
|
||||
* @since 2024-03-01 11:15:39
|
||||
*/
|
||||
public interface IBillRuleService extends IService<BillRule> {
|
||||
|
||||
/**
|
||||
* 规则详情
|
||||
* @param enCode
|
||||
* @return BillRule
|
||||
*/
|
||||
BillRule getBillRuleByCode(String enCode);
|
||||
|
||||
boolean updateById(BillRule billRule);
|
||||
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package cc.yunxi.service;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.*;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
@Service
|
||||
public class RestTemplateToInterface {
|
||||
|
||||
@Autowired
|
||||
private RestTemplate restTemplate;
|
||||
|
||||
/**
|
||||
* exchange
|
||||
* @return
|
||||
*/
|
||||
public String restPost(String url, Integer age, String name){
|
||||
//header参数
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
String token = "asdfaf2322";
|
||||
headers.add("authorization", token);
|
||||
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||
|
||||
//放入body中的json参数
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("age", age);
|
||||
obj.put("name", name);
|
||||
|
||||
//组装
|
||||
HttpEntity<JSONObject> request = new HttpEntity<>(obj, headers);
|
||||
ResponseEntity<String> responseEntity = restTemplate.exchange(url, HttpMethod.POST, request, String.class);
|
||||
String body = responseEntity.getBody();
|
||||
return body;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
package cc.yunxi.service.impl;
|
||||
|
||||
import cc.yunxi.common.domain.LambdaQueryWrapperX;
|
||||
import cc.yunxi.common.exception.BizIllegalException;
|
||||
import cc.yunxi.common.exception.BusinessLogicException;
|
||||
import cc.yunxi.common.exception.ForbiddenException;
|
||||
import cc.yunxi.common.utils.BeanUtils;
|
||||
import cc.yunxi.common.utils.CommonUtil;
|
||||
import cc.yunxi.domain.dto.LocationDTO;
|
||||
import cc.yunxi.domain.po.*;
|
||||
import cc.yunxi.domain.query.RecycleOrderQuery;
|
||||
import cc.yunxi.domain.vo.recycleorder.dzorder.DZRecycleOrderCreateVO;
|
||||
import cc.yunxi.domain.vo.recycleorder.shorder.*;
|
||||
import cc.yunxi.domain.vo.recycleorder.tmorder.TMRecycleOrderCreateVO;
|
||||
import cc.yunxi.domain.vo.recycleorder.tmorder.TMRecycleOrderFinishVO;
|
||||
import cc.yunxi.domain.vo.recycleorderdetail.RecycleOrderDetailCreateVO;
|
||||
import cc.yunxi.domain.vo.recycleorderdetail.RecycleOrderDetailSaveVO;
|
||||
import cc.yunxi.enums.BusinessCodeEnum;
|
||||
import cc.yunxi.enums.OrderStatusEnum;
|
||||
import cc.yunxi.enums.OrderTypeEnum;
|
||||
import cc.yunxi.enums.UserTypeEnum;
|
||||
import cc.yunxi.mapper.BillRuleMapper;
|
||||
import cc.yunxi.mapper.RecycleOrderMapper;
|
||||
import cc.yunxi.service.*;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONArray;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 回收站回收订单 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author ccongli
|
||||
* @since 2024-03-01 11:15:39
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
@Slf4j
|
||||
public class BillRuleServiceImpl extends ServiceImpl<BillRuleMapper, BillRule> implements IBillRuleService {
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public BillRule getBillRuleByCode(String enCode) {
|
||||
LambdaQueryWrapper<BillRule> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(BillRule::getEnCode, enCode);
|
||||
|
||||
BillRule entity = this.getOne(wrapper);
|
||||
return entity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateById(BillRule billRule) {
|
||||
|
||||
return this.updateById(billRule);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -1,5 +1,7 @@
|
||||
<?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="cc.yunxi.mapper.ClientMapper">
|
||||
|
||||
<mapper namespace="cc.yunxi.mapper.RecyclerMapper">
|
||||
<select id="getLatestRecycleByPhone" resultType="Recycler">
|
||||
SELECT * from nx_recycle_station_staff where mobile_phone= #{phone} LIMIT 1;
|
||||
</select>
|
||||
</mapper>
|
||||
|
Loading…
Reference in new issue