栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

444444

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

444444






  
    select happyuser.user_id userId,
    happyuser.sfzh ,
    happyuser.user_status userStatus,
    bzdm.MC sexName,
    happyuser.pohone,
    happyuser.user_name userName,
    happyuser.sex,
    happyuser.userImg
     from changeHappy_user happyuser
     left join changeHappy_bzdm  bzdm on happyuser.sex =bzdm.id
    where user_id =#{userId,jdbcType=VARCHAR} AND user_status=#{userStatus,jdbcType=VARCHAR}
  

  
    select count(*) from changehappy_user where user_id=#{openId,jdbcType=VARCHAR}
  
  
    insert  into  changehappy_search(user_id,search_txt)
    values
    (
     #{userId},
     #{searchTxt}
    )
  
  
    select user_id userId,search_txt searchTxt
    from changehappy_search
  
  
    update changehappy_user_item
    set alipay_number=#{alipayNumber},alipay_name=#{alipayName}
    where  user_id =#{userId}
  
  
    insert into changehappy_user_item(user_id,alipay_number,alipayName)
    values
    (#{userId},#{alipayNumber},#{alipayName})
  

  


  
  
    insert into changehappy_withdrawal(alipay_number,alipay_name,user_id,create_time,withdrawal_status,withdrawal_amount)
    values
    (#{alipayNumber},#{alipayName},#{userId},#{createTime},#{withdrawalStatus},#{withdrawalAmount})
  

  
  
    select b.id,b.name,b.img,b.status from changehappy_type b where b.status='1'
  

  
    select
    a.id,a.goods_id goodsId,
    a.goods_name goodsName,
    a.user_id userId ,a.goods_price goodsPrice,
    a.goods_type goodsType,
    a.crder_time crderTime,
    a.sales,
    b.name goodsTypeName,
    b.img typeImg,
    c.userImg userImg,
    a.order_type_id orderTypeId,
    a.page_view pageView,
    a.goods_postage goodsPostage,
    a.goods_original_price goodsOriginalPrice

    from changehappy_goods a
    left join changehappy_type b on  a.goods_type=b.id
    left join changehappy_user c on  a.user_id = c.user_id
    where a.stand_up_and_down='1'
    
      and a.goods_type = #{goodsType,jdbcType=INTEGER}
    
    
      and a.sftj = #{sftj,jdbcType=VARCHAR}
    
    
      and a.goods_name like CONCAt('%',#{goodsName,jdbcType=VARCHAR}, '%')
    
    
      and a.order_type_id = #{orderTypeId}
    
    
      and state_id =#{nearbyGoods}
    
    and a.goods_status='1'
    and b.status ='1'
    group by DATE_FORMAT(a.goods_time_recommend, '%Y/%m/%d %H:%i:%s'),a.id
    order by DATE_FORMAT(a.goods_time_recommend, '%Y/%m/%d %H:%i:%s') desc
    
      , a.goods_price+0 desc
    
    
      , a.goods_price+0
    
    
      , DATE_FORMAT(a.crder_time, '%Y/%m/%d %H:%i:%s') desc
    
    
      , page_view desc
    

--     ,a.id desc

    LIMIT #{currPage}, #{pageSize}·
  

  
    select id,goods_name goodsName,goods_id goodsId
    from changehappy_hot_goods
  
  
    select goods_id goodsId from changehappy_collect_goods where user_id = #{userId,jdbcType=VARCHAR}
  
  
    select id,headline_name headlineName,content_txt  contentTxt,goods_id goodsId,headline_type headlineType
    from changehappy_inform where headline_type=#{headlineType}
  
  
    select BZDM bzdm,DM dm,BZ bz,DICT_TYPE dtctType from changehappy_bzdm where BZDM='homeImg'
  
  
    select count(*) from changehappy_attention where user_id =#{userId} and attention_id=#{attentionId} and status ='1'
  

package cn.changeHappy.exchange.servcie;


import cn.changeHappy.exchange.pojo.WithdrawalEntity;

import java.text.ParseException;
import java.util.List;
import java.util.Map;


public interface ExchangeUserService {
    List> selectExchangeUserInfo(Map map) throws Exception;

    Map insertExchangeUser(Map map) throws Exception;

    Map updateExchangeUser(Map map) throws Exception;

    Map deleteExchangeUser(Map map) throws Exception;

    Map insertExchangeUserWeiXinInfo(String jsCode, String userName, String userImg, Map userList) throws Exception;

    Map saveSearch(Map map) throws Exception;

    List> listSearch(Map map) throws Exception;

    List> selectUserAll();

    void updateExchangeUserReezeMoney(Map userMap);

    Map selectExchangeUserByUserId(String sellerUserId);

    void updateExchangeUserReezeMoneyUserMoney(Map userMap);

    Map updateUserItem(Map map);

    Map insertUserItem(Map map);

    Map selectUserItem(Map map);

    Map queryAmountAndFrozenAmount(String userId);

    Map withdrawal(WithdrawalEntity withdrawalEntity);

    List> queryWithdrawalRecord(WithdrawalEntity withdrawalEntity) throws ParseException;
}

package cn.changeHappy.exchange.servcie.impl;

import cn.changeHappy.exchange.mapper.WxVerityMapper;
import cn.changeHappy.exchange.servcie.WxVerityService;
import cn.changeHappy.exchange.utils.HttpClientUtil;
import cn.changeHappy.exchange.utils.MD5Utils;
import cn.changeHappy.exchange.utils.R;
import cn.changeHappy.exchange.utils.SslUtils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import okhttp3.*;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ByteArrayEntity;
import org.apache.http.entity.ContentType;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


@Service
public class WxVerityServiceImpl implements WxVerityService {

    @Value("${appId}")
    private String appId;

    @Value("${secret}")
    private String secret;

    @Value("${grantType}")
    private String grantType;

    @Autowired
    WxVerityMapper wxVerityMapper;

    @Override
    public Map toKen() throws Exception {
        String url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=" + grantType + "&appid=" + appId + "&secret=" + secret + "";
        try {
            URL realUrl = new URL(url);
            if ("https".equalsIgnoreCase(realUrl.getProtocol())) {
                try {
                    SslUtils.ignoreSsl();
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }
        String tokent = HttpClientUtil.get(url);
        Map map = JSON.parseObject(tokent, Map.class);
        return map;
    }

    @Override
    public Map msgSecCheck(Map map) throws Exception {
        Map msgReturnMap = new HashMap<>();
        Map tokenMap = this.toKen();
        String url = "https://api.weixin.qq.com/wxa/msg_sec_check?access_token=" + tokenMap.get("access_token").toString() + "";
        if (tokenMap.containsKey("access_token")) {
            map.put("scene", 2);
            map.put("version", 2);
            try {
                URL realUrl = new URL(url);
                if ("https".equalsIgnoreCase(realUrl.getProtocol())) {
                    try {
                        SslUtils.ignoreSsl();
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            } catch (MalformedURLException e) {
                e.printStackTrace();
            }
            OkHttpClient client = new OkHttpClient().newBuilder()
                    .build();
            MediaType mediaType = MediaType.parse("application/json");
            String param = JSON.toJSonString(map);
            RequestBody body = RequestBody.create(mediaType, param);
            Request request = new Request.Builder()
                    .url(url)
                    .method("POST", body)
                    .addHeader("Content-Type", "application/json")
                    .build();
            Response response = client.newCall(request).execute();
            String string = response.body().string();
            Map msgMap = JSON.parseObject(string, Map.class);

            if (msgMap.containsKey("result")) {
                msgMap.put("code", R.SUCCESS);
                msgMap.put("msg", "");
                return msgMap;
            } else {
                msgReturnMap.put("code", R.ERROR);
                msgReturnMap.put("msg", "");
                msgReturnMap.put("errcode", msgMap.get("errcode"));
                msgReturnMap.put("errmsg", msgMap.get("errmsg"));
                return msgReturnMap;
            }

        }
        return null;
    }

    @Override
    public Map imgCheck(MultipartFile media) throws Exception {
        Map msgReturnMap = new HashMap<>();
        Map tokenMap = this.toKen();
        String url = "https://api.weixin.qq.com/wxa/img_sec_check?access_token=" + tokenMap.get("access_token");
        //上传成功返回完整路径的url
        if (tokenMap.containsKey("access_token")) {
            try {
                URL realUrl = new URL(url);
                if ("https".equalsIgnoreCase(realUrl.getProtocol())) {
                    try {
                        SslUtils.ignoreSsl();
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            } catch (MalformedURLException e) {
                e.printStackTrace();
            }
            CloseableHttpClient httpclient = HttpClients.createDefault();

            CloseableHttpResponse response = null;

            HttpPost request = new HttpPost(url);
            request.addHeader("Content-Type", "application/octet-stream");

            InputStream inputStream = media.getInputStream();

            byte[] byt = new byte[inputStream.available()];
            inputStream.read(byt);
            request.setEntity(new ByteArrayEntity(byt, ContentType.create("image/jpg")));


            response = httpclient.execute(request);
            HttpEntity httpEntity = response.getEntity();
            // 转成string
            String result = EntityUtils.toString(httpEntity, "UTF-8");
            JSonObject jso = JSONObject.parseObject(result);
            Map msgMap = JSON.parseObject(jso.toJSonString(), Map.class);
            if (jso.containsKey("errcode")) {
                msgReturnMap.put("code", msgMap);
            }
            return msgReturnMap;
        }
        return null;
    }

    @Override
    public Map selectExpressage(Map params) throws Exception {
        Map returnMap = new HashMap<>();
        Map postMap = new HashMap<>();
        String secretCode = "s5YkaN62fbex7FazTp"+"f5f8286ffe79414198e9c05a2d94debb";
        String encode = MD5Utils.encode(secretCode);
        postMap.put("secret_key","s5YkaN62fbex7FazTp");
        postMap.put("secret_code","87aff9cff2ff431c8c6280a7eb2b7f09");
        postMap.put("secret_sign",encode);
        postMap.put("companyName",params.get("companyName"));
        postMap.put("sendAddr",params.get("sendAddr"));
        postMap.put("receiveAddr",params.get("receiveAddr"));
        Double weight = new Double(String.valueOf(params.get("weight")));
        postMap.put("weight",weight);

        String post = this.post(postMap);
        Map map = JSON.parseObject(post, Map.class);
        if(map.get("status").equals("200")){
            Map data = (Map) map.get("data");
            returnMap.put("com",data.get("com"));
            List> combos = (List>) data.get("combos");
            for (Map combo:combos){
                String price = String.valueOf(combo.get("price"));
                String productName = String.valueOf(combo.get("productName"));
                returnMap.put("price",price);
                returnMap.put("productName",productName);
            }
        }
        returnMap.put("code",map.get("status"));
        returnMap.put("msg",map.get("message"));
        return returnMap;
    }


 public String post(Map params) {

        StringBuilder response = new StringBuilder("");

        BufferedReader reader = null;

        try {

            StringBuilder builder = new StringBuilder();

                for (Map.Entry < String,Object > param : params.entrySet()) {

                if (builder.length() > 0) {

                    builder.append('&');
                }
                builder.append(URLEncoder.encode(param.getKey(), "UTF-8"));
                builder.append('=');
                builder.append(URLEncoder.encode(String.valueOf(param.getValue()), "UTF-8"));
            }
            byte[] bytes = builder.toString().getBytes("UTF-8");
            URL url = new URL("http://cloud.kuaidi100.com/api");
            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
            conn.setConnectTimeout(3000);
            conn.setReadTimeout(3000);
            conn.setRequestMethod("POST");
            conn.setRequestProperty("accept", "*
@Service
public class ExchangeUserServiceImpl implements ExchangeUserService {

    @Autowired
    ExchangeUserMapper exchangeUserMapper;

    @Bean(name = "remoteRestTemplate")
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }

    @Autowired
    @Qualifier(value = "remoteRestTemplate")
    private RestTemplate rest;

    @Override
    public List> selectExchangeUserInfo(Map map) {
        return exchangeUserMapper.selectExchangeUserInfo(map);
    }

    @Override
    public Map insertExchangeUser(Map map) throws Exception {
        Map map1 = new HashMap<>();
        int count = exchangeUserMapper.insertExchangeUser(map);
        if(count>0){
            map1.put("code", R.SUCCESS);
            map1.put("msg", "");
        }else{
            map1.put("code", R.ERROR);
            map1.put("msg", "");
        }

        return map1;
    }

    @Override
    public Map updateExchangeUser(Map map) throws Exception {
        Map map1 = new HashMap<>();
        int count = exchangeUserMapper.updateExchangeUser(map);
        if(count>0){
            map1.put("code", R.SUCCESS);
            map1.put("msg", "");
        }else{
            map1.put("code", R.ERROR);
            map1.put("msg", "");
        }
        return map1;
    }

    @Override
    public Map deleteExchangeUser(Map map) throws Exception {
        Map map1 = new HashMap<>();
        int count = exchangeUserMapper.deleteExchangeUser(map);
        if(count>0){
            map1.put("code", R.SUCCESS);
            map1.put("msg", "");
        }else{
            map1.put("code", R.ERROR);
            map1.put("msg", "");
        }
        return map1;
    }

    @Override
    public Map insertExchangeUserWeiXinInfo(String jsCode, String userName, String userImg, Map userList)  throws Exception{
        String jsCode1 = String.valueOf(userList.get("jsCode"));
        Map userList1 = (Map) userList.get("userList");
        //Map PayEntity = Utility.getJsonEntity(PayData);

        String url = "https://api.weixin.qq.com/sns/jscode2session?appid="+ WxPayConfig.app_id +"&secret="+WxPayConfig.secretKey+"&js_code=" + jsCode1 + "&grant_type=authorization_code";
        Map requestMap = new HashMap<>();
        try {
            URL realUrl = new URL(url);
            if ("https".equalsIgnoreCase(realUrl.getProtocol())) {
                try {
                    SslUtils.ignoreSsl();
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }
        ResponseEntity responseEntity = rest.getForEntity(url, String.class, requestMap);
        JSonObject jsonObject = JSONObject.parseObject(responseEntity.getBody());
        String openId = jsonObject.getString("openid");
        String unionid = jsonObject.getString("unionid");
        String session_key = jsonObject.getString("session_key");
        String errcode = jsonObject.getString("errcode");
        if (!jsonObject.containsKey("errcode")) {
            int count = exchangeUserMapper.selectUserCount(openId);
            if (count == 0) {
                requestMap.put("userId", openId);
                requestMap.put("unionid", unionid);
                String nickName = String.valueOf(userList1.get("nickName"));
                String avatarUrl = String.valueOf(userList1.get("avatarUrl"));
                String gender = String.valueOf(userList1.get("gender"));
                requestMap.put("userName", nickName);
                requestMap.put("userImg", avatarUrl);
                requestMap.put("sex", gender);
                try {
                    this.insertExchangeUser(requestMap);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }else{
                try {
                    this.updateExchangeUser(requestMap);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
            requestMap.put("code", "200");
            requestMap.put("msg", "");
            requestMap.put("session_key", session_key);
            requestMap.put("userId", openId);
            requestMap.put("unionid", unionid);
        } else {
            requestMap.put("code", "99999");
            requestMap.put("msg", "");
        }
        return requestMap;
    }

    @Override
    public Map saveSearch(Map map) throws Exception{
        Map requestMap = new HashMap<>();
        int count = exchangeUserMapper.saveSearch(map);
        if(count>0){
            requestMap.put("code", R.SUCCESS);
            requestMap.put("msg", "");
        }else{
            requestMap.put("code", R.ERROR);
            requestMap.put("msg", "新增失败");
        }
        return requestMap;
    }

    @Override
    public List> listSearch(Map map) {
        return exchangeUserMapper.listSearch(map);
    }

    @Override
    public List> selectUserAll() {
        return exchangeUserMapper.selectUserAll();
    }

    @Override
    public void updateExchangeUserReezeMoney(Map userMap) {
        exchangeUserMapper.updateExchangeUserReezeMoney(userMap);
    }


    @Override
    public void updateExchangeUserReezeMoneyUserMoney(Map userMap) {
        exchangeUserMapper.updateExchangeUserReezeMoneyUserMoney(userMap);
    }

    @Override
    public Map updateUserItem(Map map) {
        Map userItemMap = new HashMap<>();
        exchangeUserMapper.updateUserItem(map);
        userItemMap.put("code",R.SUCCESS);
        userItemMap.put("msg","");
        return userItemMap;
    }

    @Override
    public Map insertUserItem(Map map) {
        Map userItemMap = new HashMap<>();
        exchangeUserMapper.insertUserItem(map);
        userItemMap.put("code",R.SUCCESS);
        userItemMap.put("msg","");
        return userItemMap;
    }

    @Override
    public Map selectUserItem(Map map) {
        return exchangeUserMapper.selectUserItem(map);
    }


    @Override
    public Map selectExchangeUserByUserId(String sellerUserId) {
        return exchangeUserMapper.selectExchangeUserByUserId(sellerUserId);
    }


    
    @Override
    public Map queryAmountAndFrozenAmount(String userId) {
        return exchangeUserMapper.queryAmountAndFrozenAmount(userId);
    }


    
    @Override
    public Map withdrawal(WithdrawalEntity withdrawalEntity) {

        Map returnMap = new HashMap<>();
        //查询用户当前余额是否大于申请金额
        Map withdrawalMap = exchangeUserMapper.queryAmountAndFrozenAmount(withdrawalEntity.getUserId());
        //用户金额
        BigDecimal userMoney = new BigDecimal(withdrawalMap.get("userMoney").toString());
        //提现金额
        BigDecimal withdrawalAmount = new BigDecimal(withdrawalEntity.getWithdrawalAmount());
        if(userMoney.compareTo(withdrawalAmount) == -1){
            returnMap.put("code",R.ERROR);
            returnMap.put("msg","当前用户余额不足");
            return returnMap;
        }
        SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");
        //申请提现
        withdrawalEntity.setWithdrawalStatus("1");
        withdrawalEntity.setCreateTime(sf.format(new Date()));
        exchangeUserMapper.insertUserWithdrawa(withdrawalEntity);
        returnMap.put("code",R.SUCCESS);
        returnMap.put("msg","申请成功");

        return returnMap;
    }

    @Override
    public List> queryWithdrawalRecord(WithdrawalEntity withdrawalEntity) throws ParseException {

        List> maps = exchangeUserMapper.queryWithdrawalRecord(withdrawalEntity);

        List> withdrawalList = new ArrayList<>();
        for (Map map:maps){
            String createTime = TimeUtil.QQFormatTime(map.get("createTime").toString());
            map.put("createTime",createTime);
            withdrawalList.add(map);
        }
        return withdrawalList;
    }

}

package cn.changeHappy.exchange.mapper;

import cn.changeHappy.exchange.pojo.WithdrawalEntity;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;


@Mapper
public interface ExchangeUserMapper {
    List> selectExchangeUserInfo(Map map);

    int insertExchangeUser(Map map);

    int updateExchangeUser(Map map);

    int deleteExchangeUser(Map map);

    int selectUserCount(String openId);

    int saveSearch(Map map);

    List> listSearch(Map map);

    List> selectUserAll();

    void updateExchangeUserReezeMoney(Map userMap);

    Map selectExchangeUserByUserId(String sellerUserId);

    void updateExchangeUserReezeMoneyUserMoney(Map userMap);

    void updateUserItem(Map map);

    void insertUserItem(Map map);

    Map selectUserItem(Map map);

    Map queryAmountAndFrozenAmount(String userId);

    void insertUserWithdrawa(WithdrawalEntity withdrawalEntity);

    List> queryWithdrawalRecord(WithdrawalEntity withdrawalEntity);
}

package cn.changeHappy.exchange.controller;

import cn.changeHappy.exchange.pojo.WithdrawalEntity;
import cn.changeHappy.exchange.servcie.ExchangeUserService;
import cn.changeHappy.exchange.utils.ValidatorUtils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.text.ParseException;
import java.util.List;
import java.util.Map;


@RestController
@RequestMapping("/user")
public class ExchangeUserController {

    @Autowired
    ExchangeUserService exchangeUserService;

    
    
    @PostMapping("/insertExchangeUserWeiXinInfo")
    public Map insertExchangeUserWeiXinInfo(String jsCode, String userName, String userImg, @RequestBody Map userList) throws Exception {
        Map listMap = exchangeUserService.insertExchangeUserWeiXinInfo(jsCode,userName,userImg,userList);
        return listMap;
    }

    @Data
    public static class SearchUserWeiXinEntity {
        private String jsCode;
    }


    
    @PostMapping("/selectExchangeUserInfo")
    public List> selectExchangeUserInfo(@RequestBody SearchUserAllEntity searchUserAllEntity) throws Exception {
        ValidatorUtils.validateEntity(searchUserAllEntity);
        Map map = JSON.parseObject(JSON.toJSonString(searchUserAllEntity), Map.class);
        List> listMap = exchangeUserService.selectExchangeUserInfo(map);
        return listMap;
    }

    @Data
    public static class SearchUserAllEntity {
        private String userId;
        private String userStatus;
    }

    
    @PostMapping("/insertExchangeUser")
    public Map insertExchangeUser(@RequestBody InsertUserEntity insertUserEntity) throws Exception {
        ValidatorUtils.validateEntity(insertUserEntity);
        Map map = JSON.parseObject(JSON.toJSonString(insertUserEntity), Map.class);
        return exchangeUserService.insertExchangeUser(map);
    }

    @Data
    public static class InsertUserEntity {
        private String userId;
        private String sex;
        private String sfzh;
        private String userName;
        private String pohone;
        private String unionid;
        private String userStatus;
    }

    
    @PostMapping("/updateExchangeUser")
    public Map updateExchangeUser(@RequestBody UpdateUserAEntity updateUserAEntity) throws Exception {
        ValidatorUtils.validateEntity(updateUserAEntity);
        Map map = JSON.parseObject(JSON.toJSonString(updateUserAEntity), Map.class);
        return exchangeUserService.updateExchangeUser(map);
    }

    @Data
    public static class UpdateUserAEntity {
        private String userId;
        private String sex;
        private String sfzh;
        private String userName;
        private String pohone;
        private String userImg;
        private String userStatus;
        private String userInfo;
    }

    
    @PostMapping("/deleteExchangeUser")
    public Map deleteExchangeUser(@RequestBody DeleteUserAEntity deleteUserAEntity) throws Exception {
        ValidatorUtils.validateEntity(deleteUserAEntity);
        Map map = JSON.parseObject(JSON.toJSonString(deleteUserAEntity), Map.class);
        return exchangeUserService.deleteExchangeUser(map);
    }

    @Data
    public static class DeleteUserAEntity {
        private String userId;
        private String userStatus;
    }


    
    @PostMapping("/saveSearch")
    public Map   saveSearch(@RequestBody SaveSearchEntity saveSearchEntity) throws  Exception{
        ValidatorUtils.validateEntity(saveSearchEntity);
        Map map = JSON.parseObject(JSON.toJSonString(saveSearchEntity), Map.class);
        return exchangeUserService.saveSearch(map);
    }


    
    @PostMapping("listSearch")
    public List> listSearch(@RequestBody SaveSearchEntity saveSearchEntity) throws Exception{
        ValidatorUtils.validateEntity(saveSearchEntity);
        Map map = JSON.parseObject(JSON.toJSonString(saveSearchEntity), Map.class);
        return exchangeUserService.listSearch(map);
    }
    @Data
    public static class SaveSearchEntity {
        private String userId;
        private String searchTxt;
    }


    
    @PostMapping("/insertUserItem")
    public Map insertUserItem(@RequestBody InsertUserItemEntity insertUserItemEntity) throws Exception {
        ValidatorUtils.validateEntity(insertUserItemEntity);
        Map map = JSON.parseObject(JSON.toJSonString(insertUserItemEntity), Map.class);
        return exchangeUserService.insertUserItem(map);
    }

    @Data
    public static class InsertUserItemEntity {
        private String userId;
        private String alipayNumber;
        private String alipayName;
    }

    
    @PostMapping("/updateUserItem")
    public Map updateUserItem(@RequestBody UpdateUserItemEntity updateUserAEntity) throws Exception {
        ValidatorUtils.validateEntity(updateUserAEntity);
        Map map = JSON.parseObject(JSON.toJSonString(updateUserAEntity), Map.class);
        return exchangeUserService.updateUserItem(map);
    }

    @Data
    public static class UpdateUserItemEntity {
        private String userId;
        private String alipayNumber;
        private String alipayName;
    }



    
    @PostMapping("/selectUserItem")
    public Map selectUserItem(@RequestBody SelectUserItemEntity selectUserItemEntity) throws Exception {
        ValidatorUtils.validateEntity(selectUserItemEntity);
        Map map = JSON.parseObject(JSON.toJSonString(selectUserItemEntity), Map.class);
        return exchangeUserService.selectUserItem(map);
    }



    @Data
    public static class SelectUserItemEntity {
        private String userId;
    }


    
    @PostMapping("/queryAmountAndFrozenAmount")
    public Map queryAmountAndFrozenAmount(@RequestBody String postData) throws Exception {
        JSonObject jsonObject = JSONObject.parseObject(postData);
        return exchangeUserService.queryAmountAndFrozenAmount(jsonObject.getString("userId"));
    }

    
    @PostMapping("/withdrawal")
    public Map withdrawal(@RequestBody WithdrawalEntity withdrawalEntity) {
        return exchangeUserService.withdrawal(withdrawalEntity);
    }

    
    @PostMapping("/queryWithdrawalRecord")
    public List> queryWithdrawalRecord(@RequestBody WithdrawalEntity withdrawalEntity) throws ParseException {
        return exchangeUserService.queryWithdrawalRecord(withdrawalEntity);
    }
}

package cn.changeHappy.exchange.pojo;

import lombok.Data;

@Data
public class WithdrawalEntity {

    private String userId;
    //提现金额
    private String withdrawalAmount;
    //提现账号
    private String alipayNumber;
    //提现名称
    private String alipayName;
    //创建时间
    private String createTime;
    //提现状态
    private String withdrawalStatus;

}
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/705135.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号