Merge branch 'score_shop' into api_score_meger
226 files added
72 files deleted
228 files modified
| | |
| | | .project |
| | | .classpath |
| | | .settings |
| | | .metadata |
| | | .metadata |
| | | .gitignore |
| | |
| | | <env>lhx</env> |
| | | </properties> |
| | | </profile> |
| | | <profile> |
| | | <id>xcshop</id> |
| | | <properties> |
| | | <env>xcshop</env> |
| | | </properties> |
| | | </profile> |
| | | </profiles> |
| | | <dependencies> |
| | | |
| | |
| | | package com.matrix; |
| | | |
| | | |
| | | import java.io.FileWriter; |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | |
| | | public class TestClass { |
| | | public static void main(String[] args) throws IOException { |
| | |
| | | // printer.printRecord(cells); |
| | | // } |
| | | // printer.flush(); |
| | | // printer.close(); |
| | | // printer.close(); |
| | | long t2 = System.currentTimeMillis(); |
| | | System.out.println("CSV: " + (t2 - t1)); |
| | | } |
| | |
| | | * @author jiangyouyao |
| | | */ |
| | | @SpringBootApplication |
| | | |
| | | @ComponentScan(basePackages = {"com.matrix.**"}) |
| | | |
| | | public class ZqErpApplication { |
| | | |
| | | public static void main(String[] args) { |
| | |
| | | package com.matrix.core.rabbitmq; |
| | | package com.matrix.component.rabbitmq; |
| | | |
| | | import com.matrix.core.exception.GlobleExceptionResolver; |
| | | import com.matrix.core.tools.LogUtil; |
| | |
| | | /** |
| | | * 处理类在spring中的bean名称 |
| | | */ |
| | | private com.matrix.core.rabbitmq.DeliverCallbackAdapter handerAdapter; |
| | | private DeliverCallbackAdapter handerAdapter; |
| | | |
| | | /** |
| | | * 自动确认 默认为true |
| | |
| | | this.queue = queue; |
| | | this.routingKey = routingKey; |
| | | if(hander!=null){ |
| | | this.handerAdapter = new com.matrix.core.rabbitmq.DeliverCallbackAdapter(hander,routingKey); |
| | | this.handerAdapter = new DeliverCallbackAdapter(hander,routingKey); |
| | | } |
| | | |
| | | } |
| | |
| | | this.queue = queue; |
| | | this.routingKey = routingKey; |
| | | if(hander!=null){ |
| | | this.handerAdapter = new com.matrix.core.rabbitmq.DeliverCallbackAdapter(hander,routingKey); |
| | | this.handerAdapter = new DeliverCallbackAdapter(hander,routingKey); |
| | | } |
| | | this.autoAck=autoAck; |
| | | |
| | |
| | | return handerAdapter; |
| | | } |
| | | |
| | | public void setHander(com.matrix.core.rabbitmq.DeliverCallbackAdapter hander) { |
| | | public void setHander(DeliverCallbackAdapter hander) { |
| | | this.handerAdapter = hander; |
| | | } |
| | | } |
| | |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.core.tools.UUIDUtil; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.hive.plugin.message.StringUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | * @date:2018年1月19日下午3:17:14 |
| | | */ |
| | | public void loginOut() { |
| | | String toke = getUserToken(); |
| | | redisClient.removeObject(toke); |
| | | String token = getUserToken(); |
| | | redisClient.removeObject(token); |
| | | } |
| | | |
| | | |
| | | |
| | | public void updateUserInfo(Object obj) { |
| | | String token = getUserToken(); |
| | | redisClient.saveValue(token, obj); |
| | | LogUtil.debug("更新redis用户"); |
| | | } |
| | | } |
| | |
| | | |
| | | import java.awt.*; |
| | | import java.awt.image.BufferedImage; |
| | | import java.io.FileNotFoundException; |
| | | import java.io.IOException; |
| | | import java.io.*; |
| | | import java.net.HttpURLConnection; |
| | | import java.net.MalformedURLException; |
| | | import java.net.URL; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.regex.Matcher; |
| | |
| | | System.out.println("系统字体数:" + fontCount); |
| | | } |
| | | |
| | | |
| | | public static void downloadPicture(String imgUrl,String savePath) { |
| | | URL url = null; |
| | | int imageNumber = 0; |
| | | try { |
| | | |
| | | InputStream inputStream = null; |
| | | HttpURLConnection httpURLConnection = (HttpURLConnection) new URL(imgUrl).openConnection(); |
| | | httpURLConnection.setRequestMethod("GET"); |
| | | httpURLConnection.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36"); |
| | | httpURLConnection.setRequestProperty("Accept-Encoding", "gzip"); |
| | | httpURLConnection.setRequestProperty("Referer","no-referrer"); |
| | | httpURLConnection.setRequestProperty("Content-Type","application/x-www-form-urlencoded"); |
| | | httpURLConnection.setConnectTimeout(15000); |
| | | httpURLConnection.setReadTimeout(20000); |
| | | inputStream = httpURLConnection.getInputStream(); |
| | | |
| | | |
| | | |
| | | FileOutputStream fileOutputStream = new FileOutputStream(new File(savePath)); |
| | | ByteArrayOutputStream output = new ByteArrayOutputStream(); |
| | | byte[] buffer = new byte[1024]; |
| | | int length; |
| | | while ((length = inputStream.read(buffer)) > 0) { |
| | | output.write(buffer, 0, length); |
| | | } |
| | | byte[] context=output.toByteArray(); |
| | | fileOutputStream.write(output.toByteArray()); |
| | | inputStream.close(); |
| | | fileOutputStream.close(); |
| | | } catch (MalformedURLException e) { |
| | | e.printStackTrace(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | import java.util.Map; |
| | | |
| | | public class WxacodeUtil { |
| | | /** |
| | | * 小程序秘钥 |
| | | */ |
| | | private static final String XCX_SECRET = "xcx_secret"; |
| | | /** |
| | | * 小程序appid |
| | | */ |
| | | private static final String XCX_APPID = "xcx_appid"; |
| | | |
| | | |
| | | |
| | | /** |
| | | * token获取地址 |
| | | */ |
| | |
| | | */ |
| | | private static final String GET_WXACODE ="https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token="; |
| | | |
| | | public static String getWxacode(String scene,String page,String fileName) throws Exception { |
| | | public static String getWxacode(String scene,String page,String fileName,String appid,String secret) throws Exception { |
| | | LogUtil.debug("scene={},page={},fileName={}",scene,page,fileName); |
| | | //获取token |
| | | String appid = PropertiesUtil.getString(XCX_APPID); |
| | | String secret = PropertiesUtil.getString(XCX_SECRET); |
| | | String result1 = get(TOKEN_URL.replace("APPID", appid).replace("SECRET", secret)); |
| | | String access_token = JSONObject.parseObject(result1).getString("access_token"); |
| | | if(StringUtils.isNotBlank(access_token)) { |
| | |
| | | HttpResponse response; |
| | | response = httpClient.execute(httpPost); |
| | | InputStream inputStream = response.getEntity().getContent(); |
| | | /*Object inputObj= response.getEntity().getContent(); |
| | | if(inputObj instanceof InputStream){ |
| | | String strError = streamToString(inputStream,"GBK"); |
| | | LogUtil.info("-------------二维码生成------"+strError); |
| | | return "error:" + strError; |
| | | }*/ |
| | | |
| | | // 图片保存目录路径 |
| | | String baseSavePath = PropertiesUtil.getString(AppConstance.FILES_TORAGE_PATH); |
| | |
| | | if(!targetFile.exists()){ |
| | | targetFile.mkdirs(); |
| | | } |
| | | |
| | | /*String inputstreamtofile = inputstreamtofile(inputStream, targetFile); |
| | | if(null != inputstreamtofile){ |
| | | return inputstreamtofile; |
| | | }*/ |
| | | |
| | | // 创建图片文件夹 |
| | | baseSavePath += "wxacode" + File.separatorChar; |
| | |
| | | String qrcodePath = baseSavePath + fileName + ".png"; |
| | | FileOutputStream out = new FileOutputStream(qrcodePath); |
| | | LogUtil.debug("qrcodePath:{}",qrcodePath); |
| | | //本地调试创建(不用删) |
| | | /*String filePath = "e:/test.png"; |
| | | File file = new File(filePath); |
| | | if (!file.exists()) { |
| | | file.mkdir(); |
| | | } |
| | | FileOutputStream outs = new FileOutputStream(file);*/ |
| | | |
| | | byte[] buffer = new byte[1024]; |
| | | int bytesRead = 0; |
| | | while((bytesRead = inputStream.read(buffer, 0, 1024)) != -1) { |
| | | out.write(buffer, 0, bytesRead); |
| | | //outs.write(buffer, 0, bytesRead); |
| | | |
| | | } |
| | | out.flush(); |
| | | out.close(); |
| | | //outs.flush(); |
| | | //outs.close(); |
| | | |
| | | return qrcodePath; |
| | | } else { |
New file |
| | |
| | | package com.matrix.component.websoket; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 扫码登录接收参数 |
| | | */ |
| | | @Data |
| | | public class ScanQrCodeLoginDto { |
| | | |
| | | /** |
| | | * 登录操作 1.登录 |
| | | */ |
| | | public static final Integer LOGIN_OPERATION_LOGIN=1; |
| | | |
| | | /** |
| | | * 登录操作 2取消登录 |
| | | */ |
| | | public static final Integer LOGIN_OPERATION_CANCEL=2; |
| | | /** |
| | | * 指令类型 1,已扫码 |
| | | */ |
| | | public static final Integer MSG_TYPE_SCAN=1; |
| | | /** |
| | | * 指令类型 2登录确认 |
| | | */ |
| | | public static final Integer MSG_TYPE_LOGIN=2; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 网页客户端id,浏览器生成 |
| | | */ |
| | | String webClientId; |
| | | |
| | | /** |
| | | * 二维码登录key |
| | | */ |
| | | String loginQrCodeKey; |
| | | |
| | | /** |
| | | * app登录用户ID |
| | | */ |
| | | Long appUserId; |
| | | |
| | | /** |
| | | * 登录操作 1.登录,2取消登录 |
| | | */ |
| | | Integer loginOperation; |
| | | |
| | | /** |
| | | * 指令类型 1,已扫码,2登录确认, |
| | | */ |
| | | Integer msgType; |
| | | |
| | | |
| | | } |
| | |
| | | private static final List<WebSoketMessageObserver> observerList=new ArrayList<>(); |
| | | |
| | | |
| | | |
| | | public WebSocketPushHandler(){ |
| | | LogUtil.info("WebSocketPushHandler初始化"); |
| | | //注册观察者 |
| | | addObserver(new WebSoketMessageRabbitObserver()); |
| | | //addObserver(new WebSoketMessageRabbitObserver()); |
| | | addObserver(new WebSoketScanQrCodeLoginObserver()); |
| | | } |
| | | /** |
| | | * 用户进入系统监听 |
New file |
| | |
| | | package com.matrix.component.websoket; |
| | | |
| | | import cn.hutool.crypto.SecureUtil; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.web.socket.CloseStatus; |
| | | import org.springframework.web.socket.TextMessage; |
| | | import org.springframework.web.socket.WebSocketSession; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 扫码登录soket处理类 |
| | | * @author jyy |
| | | */ |
| | | public class WebSoketScanQrCodeLoginObserver implements WebSoketMessageObserver { |
| | | |
| | | |
| | | private static Map<String,Long> scanCash=new HashMap<>(); |
| | | |
| | | |
| | | @Override |
| | | public void userConnection(WebSocketSession session) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void handleTextMessage(WebSocketSession session, TextMessage message) { |
| | | |
| | | |
| | | ScanQrCodeLoginDto commonMessage = (ScanQrCodeLoginDto) JSONObject.toBean(JSONObject.fromObject(message.getPayload()), ScanQrCodeLoginDto.class); |
| | | |
| | | if(ScanQrCodeLoginDto.MSG_TYPE_LOGIN.equals(commonMessage.getMsgType())){ |
| | | //todo 添加安全校验代码 |
| | | scanCash.put(SecureUtil.md5(commonMessage.getLoginQrCodeKey()),commonMessage.getAppUserId()); |
| | | JSONObject jsonObject=new JSONObject(); |
| | | jsonObject.put("loginOperation",commonMessage.getLoginOperation()); |
| | | jsonObject.put("msgType",commonMessage.getMsgType()); |
| | | WebSocketPushHandler.sendMessageToUser(commonMessage.getWebClientId(), new TextMessage(jsonObject.toString())); |
| | | }else if(ScanQrCodeLoginDto.MSG_TYPE_SCAN.equals(commonMessage.getMsgType())){ |
| | | JSONObject jsonObject=new JSONObject(); |
| | | jsonObject.put("msgType",commonMessage.getMsgType()); |
| | | WebSocketPushHandler.sendMessageToUser(commonMessage.getWebClientId(), new TextMessage(jsonObject.toString())); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void afterConnectionClosed(WebSocketSession session, CloseStatus status) { |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 获取扫码的用户id |
| | | * @param webClientId |
| | | * @return |
| | | */ |
| | | public static Long getScanCashValue(String webClientId){ |
| | | return scanCash.remove(SecureUtil.md5(webClientId)); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | private String signType = ""; |
| | | private String paySign = ""; |
| | | |
| | | public BrandWCPayRequestData(String prepay_id,String appID,String paySecret){ |
| | | public BrandWCPayRequestData(String prepay_id, String appID, String paySecret){ |
| | | //默认必须设置 |
| | | setAppId(appID); |
| | | //随机字符串,不长于32 位 |
| | |
| | | |
| | | import com.matrix.component.wechat.externalInterface.common.RandomStringGenerator; |
| | | import com.matrix.component.wechat.externalInterface.common.Signature; |
| | | import com.matrix.component.wechat.externalInterface.common.WechatConfigure; |
| | | |
| | | import java.lang.reflect.Field; |
| | | import java.util.HashMap; |
| | |
| | | /** |
| | | * 商户号 |
| | | */ |
| | | private String mch_id = ""; |
| | | private String mchid = ""; |
| | | |
| | | private String mch_appid = ""; |
| | | |
| | | /** |
| | | * 商户企业付款单号 |
| | | */ |
| | | private String partner_trade_no = ""; |
| | | |
| | | /** |
| | | * 随机字符串 |
| | | */ |
| | | private String nonce_str = ""; |
| | | |
| | | |
| | | private String check_name = ""; |
| | | |
| | | |
| | | /** |
| | | * 签名 |
| | | */ |
| | | private String sign = ""; |
| | | /** |
| | | * 收款方银行卡号 |
| | | */ |
| | | private String enc_bank_no = ""; |
| | | /** |
| | | * 收款方用户名 |
| | | */ |
| | | private String enc_true_name = ""; |
| | | /** |
| | | * 收款方开户行 |
| | | */ |
| | | private String bank_code = ""; |
| | | |
| | | /** |
| | | * 付款金额 RMB(分) |
| | | */ |
| | |
| | | * 备注 |
| | | */ |
| | | private String desc = ""; |
| | | |
| | | private String openid = ""; |
| | | |
| | | |
| | | public JsApiPayComReqData() { |
| | |
| | | * @param desc 描述 |
| | | * @param outTradeNo 商户企业付款单号 |
| | | * @param totalFee 付款金额 |
| | | * @param bankNo 银行卡号 |
| | | * @param bankTrueName 收款号姓名 |
| | | * @param bankCode 收款号开户行 |
| | | */ |
| | | public JsApiPayComReqData(String mchID,String paySecret ,String desc, String outTradeNo, int totalFee, String bankNo, String bankTrueName, String bankCode) { |
| | | public JsApiPayComReqData(String mchID,String mch_appid,String paySecret ,String desc, String outTradeNo, int totalFee, |
| | | String openid, String check_name, String bankCode) { |
| | | setMch_appid(mch_appid); |
| | | //默认必须设置 |
| | | setMch_id(mchID); |
| | | setMchid(mchID); |
| | | setDesc(desc); |
| | | setPartner_trade_no(outTradeNo); |
| | | setAmount(totalFee); |
| | | setOpenid(openid); |
| | | setCheck_name(check_name); |
| | | //随机字符串,不长于32 位 |
| | | setNonce_str(RandomStringGenerator.getRandomStringByLength(32)); |
| | | //根据API给的签名规则进行签名 【 必须要放在本方法的最后】 |
| | | String sign = Signature.getSign(toMap(),paySecret); |
| | | setSign(sign);//把签名数据设置到Sign这个属性中 |
| | | // setEnc_bank_no(); |
| | | // setEnc_true_name(); |
| | | // setBank_code(); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | public String getMch_id() { |
| | | return mch_id; |
| | | public String getMch_appid() { |
| | | return mch_appid; |
| | | } |
| | | |
| | | public void setMch_id(String mch_id) { |
| | | this.mch_id = mch_id; |
| | | public void setMch_appid(String mch_appid) { |
| | | this.mch_appid = mch_appid; |
| | | } |
| | | |
| | | public String getEnc_bank_no() { |
| | | return enc_bank_no; |
| | | public String getCheck_name() { |
| | | return check_name; |
| | | } |
| | | |
| | | public void setEnc_bank_no(String enc_bank_no) { |
| | | this.enc_bank_no = enc_bank_no; |
| | | public void setCheck_name(String check_name) { |
| | | this.check_name = check_name; |
| | | } |
| | | |
| | | public String getEnc_true_name() { |
| | | return enc_true_name; |
| | | public String getMchid() { |
| | | return mchid; |
| | | } |
| | | |
| | | public void setEnc_true_name(String enc_true_name) { |
| | | this.enc_true_name = enc_true_name; |
| | | } |
| | | |
| | | public String getBank_code() { |
| | | return bank_code; |
| | | } |
| | | |
| | | public void setBank_code(String bank_code) { |
| | | this.bank_code = bank_code; |
| | | public void setMchid(String mchid) { |
| | | this.mchid = mchid; |
| | | } |
| | | |
| | | public String getNonce_str() { |
| | |
| | | this.partner_trade_no = partner_trade_no; |
| | | } |
| | | |
| | | public String getOpenid() { |
| | | return openid; |
| | | } |
| | | |
| | | public void setOpenid(String openid) { |
| | | this.openid = openid; |
| | | } |
| | | |
| | | public int getAmount() { |
| | | return amount; |
| | | } |
| | |
| | | import com.matrix.system.common.interceptor.HostInterceptor; |
| | | import com.matrix.system.shopXcx.api.tools.WxShopOrderUtil; |
| | | import org.apache.log4j.Logger; |
| | | import org.jetbrains.annotations.NotNull; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | * @return 预支付订单返回的结果对象(该结果对象已封装),在H5页面使用该对象信息 |
| | | * @throws Exception |
| | | */ |
| | | public BrandWCPayRequestData createOrder(String desc,String outTradeNo, int price, String openId,String attach) throws Exception { |
| | | public BrandWCPayRequestData createOrder(String desc, String outTradeNo, int price, String openId, String attach) throws Exception { |
| | | Long companyId=HostInterceptor.getCompanyId(); |
| | | BusParameterSettings notifyUrl = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WECHARPAY_NOTIFYURL, companyId); |
| | | return buildBrandWCPayRequestData(desc, outTradeNo, price, openId, attach, notifyUrl); |
| | | } |
| | | |
| | | /** |
| | | * 创建充值订单 |
| | | */ |
| | | public BrandWCPayRequestData createRechargeOrder(String desc, String outTradeNo, int price, String openId, String attach) throws Exception { |
| | | Long companyId=HostInterceptor.getCompanyId(); |
| | | BusParameterSettings notifyUrl = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WECHARPAY_RECHARGE_NOTIFYURL, companyId); |
| | | return buildBrandWCPayRequestData(desc, outTradeNo, price, openId, attach, notifyUrl); |
| | | } |
| | | |
| | | |
| | | |
| | | @NotNull |
| | | private BrandWCPayRequestData buildBrandWCPayRequestData(String desc, String outTradeNo, int price, String openId, String attach, BusParameterSettings notifyUrl) throws Exception { |
| | | // 创建微信支付预付接口 |
| | | JsApiPayBusiness jsApiPayBusiness = new JsApiPayBusiness(); |
| | | String idAddr = getIpAddr(WebUtil.getRequest()); |
| | |
| | | |
| | | BusParameterSettings mchID = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WECHARPAY_MCHID, companyId); |
| | | BusParameterSettings paySecret = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WECHARPAY_SECRET, companyId); |
| | | BusParameterSettings notifyUrl = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WECHARPAY_NOTIFYURL, companyId); |
| | | |
| | | |
| | | BusParameterSettings appId = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.MINIPROGRAM_APPID, companyId); |
| | | |
| | |
| | | LogUtil.error("创建微信支付订单失败msg={}",result.getReturn_msg()); |
| | | throw new GlobleException("创建微信支付订单失败,请检查程序配置"); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /**@Description 支付后,向微信发送请求、查询订单,看订单是否真的支付成功了 |
| | | @date 2017年6月27日 |
| | | @atuhor jiangyouyao |
| | |
| | | * @param openid |
| | | * @return |
| | | */ |
| | | public JsApiPayComResData comPay(String desc, String outTradeNo,int totalFee, String openid){ |
| | | public JsApiPayComResData comPay(String desc, String outTradeNo,int totalFee, String openid,Long companyId){ |
| | | JsApiPayComResData result=null; |
| | | //boolean flag=false; |
| | | try { |
| | | JsApiPayBusiness jsApiPayBusiness = new JsApiPayBusiness(); |
| | | // TODO 企业付款 |
| | | Long companyId=HostInterceptor.getCompanyId(); |
| | | |
| | | BusParameterSettings mchID = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WECHARPAY_MCHID, companyId); |
| | | BusParameterSettings appId = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.MINIPROGRAM_APPID, companyId); |
| | | BusParameterSettings paySecret = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WECHARPAY_SECRET, companyId); |
| | | |
| | | BusParameterSettings certLocalPath = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WECHARPAY_CERTLOCAL_PATH, companyId); |
| | | |
| | | JsApiPayComReqData jsApiPayComReqData=new JsApiPayComReqData(mchID.getParamValue(),paySecret.getParamValue(),"","",0,"","",""); |
| | | JsApiPayComReqData jsApiPayComReqData=new JsApiPayComReqData(mchID.getParamValue(), |
| | | appId.getParamValue(), |
| | | paySecret.getParamValue(), |
| | | desc,outTradeNo,totalFee,openid,"NO_CHECK",""); |
| | | JsApiPayComService jsApiPayComService=new JsApiPayComService(); |
| | | |
| | | HttpsRequest2 request2= (HttpsRequest2) jsApiPayComService.getServiceRequest(); |
| | | request2.setCertLocalPath(certLocalPath.getParamValue()); |
| | | request2.setMchId(mchID.getParamValue()); |
| | | |
| | | |
| | | result = jsApiPayBusiness.payComOrder(jsApiPayComService, jsApiPayComReqData); |
| | | |
| | | LogUtil.info("#提现,企业付款到个人---result:{}",result); |
| | | if (result.getResult_code().equals("SUCCESS")) { |
| | | return result; |
| | |
| | | * @description 容器添加组件 |
| | | * @date 2019-06-14 15:50 |
| | | */ |
| | | @Configuration |
| | | @Configuration() |
| | | @PropertySource("classpath:config/system.properties") |
| | | public class MvcCoreConfig implements WebMvcConfigurer { |
| | | |
| | |
| | | registry.addInterceptor(suAuthorityInterceptor).addPathPatterns("/**/su/**"); |
| | | //小程序公司与域名对应关系拦截 |
| | | registry.addInterceptor(hostInterceptor).addPathPatterns("/**/wxapi/**") |
| | | .excludePathPatterns("/wxCommon/wxapi/wxpayCallback"); |
| | | .excludePathPatterns("/wxCommon/wxapi/wxpayCallback") |
| | | .excludePathPatterns("/wxCommon/wxapi/rechargeCallBack"); |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.matrix.config; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; |
| | | import org.mybatis.spring.annotation.MapperScan; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | /** |
| | | * @author wzy |
| | | * @date 2021-02-22 |
| | | **/ |
| | | @Configuration |
| | | @MapperScan("com.matrix.system.*.dao") |
| | | public class MybatisPlusConfig { |
| | | |
| | | @Bean |
| | | public PaginationInterceptor paginationInterceptor(){ |
| | | return new PaginationInterceptor(); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | public static final String MQ_EXCHANGE_A = "hive_exchange_A"; |
| | | |
| | | //订阅模式 |
| | | public static final String MQ_EXCHANGE_TOPIC = "hive_exchange_fanout"; |
| | | |
| | | @Bean |
| | | VipCreateTask VipCreateTask() { |
| | | return new VipCreateTask(); |
| | | ScoreOrderTask ScoreOrderTask() { |
| | | return new ScoreOrderTask(); |
| | | } |
| | | |
| | | |
| | | |
| | | @Bean |
| | | OrderTask OrderrCreateTask() { |
| | | return new OrderTask(); |
| | | } |
| | | @Bean |
| | | SalesOrderTask SalesOrderTask() { |
| | | return new SalesOrderTask(); |
| | | } |
| | | @Bean |
| | | SalesOrderRefundTask SalesOrderRefundTask() { |
| | | return new SalesOrderRefundTask(); |
| | | } |
| | | |
| | | @Bean |
| | |
| | | |
| | | //声明一个交换机 |
| | | rabiitMqTemplate.exchangeDeclare(MQ_EXCHANGE_A+evn, "direct"); |
| | | rabiitMqTemplate.exchangeDeclare(MQ_EXCHANGE_A+"cf", "direct"); |
| | | rabiitMqTemplate.exchangeDeclare(MQ_EXCHANGE_TOPIC +evn, "topic"); |
| | | |
| | | List<MqTask> taskList = new ArrayList<>(); |
| | | |
| | | //注册RabbitMq任务 |
| | | taskList.add(new MqTask(MQ_EXCHANGE_A + evn, MQTaskRouting.CREATE_VIP + evn, MQTaskRouting.CREATE_VIP + evn, VipCreateTask())); |
| | | taskList.add(new MqTask(MQ_EXCHANGE_A + evn, MQTaskRouting.CREATE_ORDER + evn,MQTaskRouting.CREATE_ORDER + evn,OrderrCreateTask())); |
| | | taskList.add(new MqTask(MQ_EXCHANGE_A + evn, MQTaskRouting.SEND_TEMPLATE_MSG + evn,MQTaskRouting.SEND_TEMPLATE_MSG + evn, TemplateMsgTask())); |
| | | taskList.add(new MqTask(MQ_EXCHANGE_A + evn, MQTaskRouting.ORDER_OUT_SOTORE + evn,MQTaskRouting.ORDER_OUT_SOTORE + evn, OrderOutSotoreTask())); |
| | | taskList.add(new MqTask(MQ_EXCHANGE_A + evn, MQTaskRouting.SEND_UNIFORM_TEMPLATE_MSG + evn,MQTaskRouting.SEND_UNIFORM_TEMPLATE_MSG + evn, UniformMsgSentTask())); |
| | | taskList.add(new MqTask(MQ_EXCHANGE_A + evn, MQTaskRouting.SHOP_ORDER_REFUND + evn,MQTaskRouting.SHOP_ORDER_REFUND + evn, SalesOrderRefundTask())); |
| | | |
| | | //不同任务在不同的队列,但是routingKey一样则可以收到生产者消息 |
| | | taskList.add(new MqTask(MQ_EXCHANGE_TOPIC + evn, MQTaskRouting.CREATE_ORDER + evn,MQTaskRouting.CREATE_ORDER + evn,OrderrCreateTask())); |
| | | taskList.add(new MqTask(MQ_EXCHANGE_TOPIC + evn, MQTaskRouting.SALES_ORDER + evn,MQTaskRouting.CREATE_ORDER + evn,SalesOrderTask())); |
| | | taskList.add(new MqTask(MQ_EXCHANGE_TOPIC + evn, MQTaskRouting.SCORE_ORDER + evn,MQTaskRouting.CREATE_ORDER + evn,ScoreOrderTask())); |
| | | |
| | | |
| | | rabiitMqTemplate.binding(taskList); |
| | | |
| | |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import springfox.documentation.builders.ApiInfoBuilder; |
| | |
| | | .required(false).build(); |
| | | parameters.add(parameterBuilder.build()); |
| | | return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo()).enable(swaggerEnable).select().apis(RequestHandlerSelectors.withClassAnnotation(Api.class)) |
| | | .paths(PathSelectors.any()).build().globalOperationParameters(parameters); |
| | | .paths(PathSelectors.ant("/api/**")).build().globalOperationParameters(parameters).groupName("HIVE"); |
| | | // .ignoredParameterTypes(MemberEntity.class); |
| | | } |
| | | |
| | |
| | | .version("1.0") |
| | | .build(); |
| | | } |
| | | |
| | | @Bean |
| | | public Docket wxRestApi(){ |
| | | // 添加请求参数,我们这里把token作为请求头部参数传入后端 |
| | | ParameterBuilder parameterBuilder = new ParameterBuilder(); |
| | | List<Parameter> parameters = new ArrayList<Parameter>(); |
| | | parameterBuilder.name("token").description("令牌").modelRef(new ModelRef("string")).parameterType("header") |
| | | .required(true).build(); |
| | | parameters.add(parameterBuilder.build()); |
| | | |
| | | ParameterBuilder parameterBuilder2 = new ParameterBuilder(); |
| | | parameterBuilder2.name("companyCode").description("公司编码tangqiaqia.jyymatrix.cc").modelRef(new ModelRef("string")).parameterType("header") |
| | | .required(true).build(); |
| | | parameters.add(parameterBuilder2.build()); |
| | | |
| | | return new Docket(DocumentationType.SWAGGER_2).apiInfo(wxApiInfo()).enable(swaggerEnable).select().apis(RequestHandlerSelectors.withClassAnnotation(Api.class)) |
| | | .paths(PathSelectors.ant("/wxapi/**")).build().globalOperationParameters(parameters).groupName("小程序接口"); |
| | | // .ignoredParameterTypes(MemberEntity.class); |
| | | } |
| | | |
| | | private ApiInfo wxApiInfo(){ |
| | | return new ApiInfoBuilder() |
| | | .title("Hive Wx") |
| | | .description("This is a restful api document of Hive Wx.") |
| | | .version("1.0") |
| | | .build(); |
| | | } |
| | | |
| | | |
| | | @Bean |
| | | public Docket ERPApi(){ |
| | | // 添加请求参数,我们这里把token作为请求头部参数传入后端 |
| | | ParameterBuilder parameterBuilder = new ParameterBuilder(); |
| | | List<Parameter> parameters = new ArrayList<Parameter>(); |
| | | parameterBuilder.name("token").description("令牌").modelRef(new ModelRef("string")).parameterType("header") |
| | | .required(true).build(); |
| | | parameters.add(parameterBuilder.build()); |
| | | |
| | | |
| | | return new Docket(DocumentationType.SWAGGER_2).apiInfo(ERPApiInfo()).enable(swaggerEnable).select().apis(RequestHandlerSelectors.withClassAnnotation(Api.class)) |
| | | .paths(PathSelectors.ant("/admin/**")).build().globalOperationParameters(parameters).groupName("ERP接口"); |
| | | } |
| | | |
| | | private ApiInfo ERPApiInfo(){ |
| | | return new ApiInfoBuilder() |
| | | .title("Hive ERP") |
| | | .description("This is a restful api document of Hive ERP.") |
| | | .version("1.0") |
| | | .build(); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.config; |
| | | |
| | | import com.matrix.core.tools.LogUtil; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Component |
| | | @EnableScheduling |
| | | @ConditionalOnProperty(name = "scheduling.enabled", havingValue= "true") |
| | | public class TaskScheduleConfig { |
| | | |
| | | public TaskScheduleConfig(){ |
| | | LogUtil.debug("**********定时任务启动**********"); |
| | | } |
| | | } |
| | |
| | | LogUtil.info("注册WebSocket处理类"); |
| | | registry.addHandler(createWebSocketPushHandler(), "/webSocketServer") |
| | | .addInterceptors(createHhandshakeInterceptor()).setAllowedOrigins("*"); |
| | | |
| | | registry.addHandler(createWebSocketPushHandler(), "/sockjs/webSocketServer") |
| | | .addInterceptors(createHhandshakeInterceptor()).withSockJS(); |
| | | |
| | |
| | | import com.matrix.system.common.bean.ProjException; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.dao.ProjExceptionDao; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.servlet.HandlerExceptionResolver; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | |
| | | |
| | | private static final String TRUE = "true"; |
| | | |
| | | |
| | | /** |
| | | * 忽略一些特定的异常 |
| | | */ |
| | |
| | | import com.matrix.core.tools.InternationaUtil; |
| | | import com.matrix.core.tools.MdcUtil; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.system.hive.plugin.message.StringUtil; |
| | | import com.matrix.system.fenxiao.vo.ShopSalesmanApplyVo; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.HashMap; |
| | |
| | | * info会被国际化工具先处理,找不到国际化资源则显示原始信息 |
| | | **/ |
| | | private String info; |
| | | |
| | | /** |
| | | * 单个对象返回参数 |
| | | */ |
| | | private Object data; |
| | | |
| | | private Map<Object, Object> mapInfo = new HashMap<>(); |
| | | |
| | | private List<?> rows; |
| | | /** |
| | | * 总记录数 |
| | |
| | | |
| | | private String requestId; |
| | | |
| | | public static AjaxResult buildSuccessInstance(Object data) { |
| | | AjaxResult result= new AjaxResult(STATUS_SUCCESS,""); |
| | | result.data=data; |
| | | return result; |
| | | } |
| | | |
| | | |
| | | public static AjaxResult buildSuccessInstance(Object data, String info) { |
| | | AjaxResult result= new AjaxResult(STATUS_SUCCESS,info); |
| | | result.data=data; |
| | | return result; |
| | | } |
| | | |
| | | |
| | | public static AjaxResult buildSuccessInstance(String info) { |
| | |
| | | public static AjaxResult buildSuccessInstance(List<?> rows, Integer total) { |
| | | return new AjaxResult(STATUS_SUCCESS, rows, total); |
| | | } |
| | | |
| | | public static AjaxResult buildSuccessInstance(List<?> rows, long total) { |
| | | return new AjaxResult(STATUS_SUCCESS, rows, Integer.parseInt(total+"")); |
| | | } |
| | | |
| | | |
| | | public static AjaxResult buildSuccessInstance(List<?> rows) { |
| | | return new AjaxResult(STATUS_SUCCESS, rows); |
| | |
| | | * 设置简单信息,这是一个便捷的方法 |
| | | * |
| | | * @param status |
| | | * @param page |
| | | * @param info |
| | | */ |
| | | public AjaxResult(String status, List<?> rows) { |
| | | this.status = status; |
| | |
| | | } |
| | | this.requestId= MdcUtil.getMdc(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | this.requestId = requestId; |
| | | } |
| | | |
| | | public Object getData() { |
| | | return data; |
| | | } |
| | | |
| | | public void setData(Object data) { |
| | | this.data = data; |
| | | } |
| | | |
| | | /** |
| | | * 在map对象中放置信息 |
| | | * |
New file |
| | |
| | | package com.matrix.core.pojo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.matrix.core.tools.DateUtil; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @ApiModel(value = "BaseQueryDto", description = "通用分页查询参数接收类") |
| | | public class BasePageQueryDto { |
| | | |
| | | |
| | | @NotNull(message = "pageNum参数不能为空") |
| | | @ApiModelProperty(value = "第几页", example = "1") |
| | | private Integer pageNum; |
| | | |
| | | @NotNull(message = "pageSize参数不能为空") |
| | | @ApiModelProperty(value ="数量", example = "10") |
| | | private Integer pageSize; |
| | | |
| | | @ApiModelProperty(value ="排序方式", example = "desc") |
| | | private String order; |
| | | |
| | | @ApiModelProperty(value ="排序字段", example = "create_time") |
| | | private String sort; |
| | | |
| | | @ApiModelProperty(value ="关键字") |
| | | private String keywords; |
| | | |
| | | @JsonFormat(pattern = DateUtil.DATE_FORMAT_MM, timezone = "GMT+8") |
| | | @ApiModelProperty(value = "开始时间") |
| | | private Date beginTime; |
| | | |
| | | @JsonFormat(pattern = DateUtil.DATE_FORMAT_MM, timezone = "GMT+8") |
| | | @ApiModelProperty(value = "结束时间") |
| | | private Date endTime; |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.core.pojo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 通用的验证返回参数 |
| | | */ |
| | | @Data |
| | | public class VerificationResult { |
| | | |
| | | private boolean judgeResult; |
| | | |
| | | private String msg; |
| | | |
| | | private Object info; |
| | | |
| | | private VerificationResult(){ |
| | | |
| | | } |
| | | |
| | | public static VerificationResult buildVerificationResult(boolean judgeResult){ |
| | | VerificationResult obj=new VerificationResult(); |
| | | obj.judgeResult =judgeResult; |
| | | return obj ; |
| | | } |
| | | |
| | | |
| | | public static VerificationResult buildVerificationResult(boolean judgeResult,String msg){ |
| | | VerificationResult obj=new VerificationResult(); |
| | | obj.judgeResult =judgeResult; |
| | | obj.msg=msg; |
| | | return obj ; |
| | | } |
| | | |
| | | |
| | | public static VerificationResult buildVerificationResult(boolean judgeResult,Object info){ |
| | | VerificationResult obj=new VerificationResult(); |
| | | obj.judgeResult =judgeResult; |
| | | obj.info=info; |
| | | return obj ; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | package com.matrix.core.tools; |
| | | |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.util.ArrayList; |
| | | import java.util.Collection; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | import java.util.Random; |
| | | import java.util.UUID; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | |
| | | import com.matrix.core.exception.GlobleException; |
| | | import net.sourceforge.pinyin4j.PinyinHelper; |
| | | import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType; |
| | |
| | | import net.sourceforge.pinyin4j.format.HanyuPinyinVCharType; |
| | | import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination; |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.util.*; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | |
| | | /** |
| | | * 字符串操作类,转换数据类型,切割字符串,对象比较等操作 |
| | |
| | | return sb.toString(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 用逗号分开的存的id是否包含对应的id 如比较 123,123,124 中是否包含12这个主键 比对的方法是 字符串中是否包含"^12$" |
| | | * "^12,.*" 或者 ".+,12$" 或者 ".+,12,$" 或者 ".+,12,.+" 字符串 |
New file |
| | |
| | | package com.matrix.system.activity.action; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.system.activity.dto.ActivitiesListDto; |
| | | import com.matrix.system.activity.dto.AddSignAwardSetDto; |
| | | import com.matrix.system.activity.dto.BeCloseDto; |
| | | import com.matrix.system.activity.dto.BeReadyDto; |
| | | import com.matrix.system.activity.dto.CouponDto; |
| | | import com.matrix.system.activity.dto.DelRowDto; |
| | | import com.matrix.system.activity.dto.GoodsDto; |
| | | import com.matrix.system.activity.dto.SignForUpdateDto; |
| | | import com.matrix.system.activity.dto.SignReceiveListDto; |
| | | import com.matrix.system.activity.dto.UpdateSignAwardSetDto; |
| | | import com.matrix.system.activity.service.ActivitySignAwardSetService; |
| | | import com.matrix.system.activity.vo.ActivitiesListVo; |
| | | import com.matrix.system.activity.vo.CouponVo; |
| | | import com.matrix.system.activity.vo.GoodsVo; |
| | | import com.matrix.system.activity.vo.SignReceiveListVo; |
| | | import com.matrix.system.hive.action.util.QueryUtil; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiResponse; |
| | | import io.swagger.annotations.ApiResponses; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * @description 奖品设置表 |
| | | * @author yourName |
| | | * @date 2021-03-31 16:57 |
| | | */ |
| | | @RestController |
| | | @RequestMapping(value = "admin/activitySignAwardSet") |
| | | public class ActivitySignAwardSetAction { |
| | | |
| | | @Autowired |
| | | private ActivitySignAwardSetService activitySignAwardSetService; |
| | | |
| | | /** |
| | | * 新增签到活动 |
| | | */ |
| | | @PostMapping(value = "/addSignAwardSet") |
| | | public @ResponseBody |
| | | AjaxResult addSignAwardSet(@RequestBody AddSignAwardSetDto addSignAwardSetDto) { |
| | | return activitySignAwardSetService.activitySignAwardSetService(addSignAwardSetDto); |
| | | } |
| | | |
| | | /** |
| | | * 查询优惠券 |
| | | */ |
| | | @ApiOperation(value = "查询优惠券") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "OK", response = CouponVo.class) |
| | | }) |
| | | @PostMapping(value = "/selectCouponList") |
| | | public @ResponseBody |
| | | AjaxResult selectCouponList(@RequestBody CouponDto couponDto) { |
| | | //设置用户公司ID |
| | | QueryUtil.setQueryLimitCom(couponDto); |
| | | //排序 |
| | | if(StringUtils.isBlank(couponDto.getSort())){ |
| | | couponDto.setSort("create_time"); |
| | | couponDto.setOrder("desc"); |
| | | } |
| | | Page<CouponVo> page = new Page(couponDto.getPageNum(), couponDto.getPageSize()); |
| | | IPage<CouponVo> rows = activitySignAwardSetService.selectCouponList(page,couponDto); |
| | | AjaxResult result = AjaxResult.buildSuccessInstance(rows.getRecords(),rows.getTotal()); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 查询商品 |
| | | */ |
| | | @ApiOperation(value = "查询商品") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "OK", response = GoodsVo.class) |
| | | }) |
| | | @PostMapping(value = "/selectGoodsList") |
| | | public @ResponseBody |
| | | AjaxResult selectGoodsList(@RequestBody GoodsDto goodsDto) { |
| | | //设置用户公司ID |
| | | QueryUtil.setQueryLimitCom(goodsDto); |
| | | //排序 |
| | | if(StringUtils.isBlank(goodsDto.getSort())){ |
| | | goodsDto.setSort("create_time"); |
| | | goodsDto.setOrder("desc"); |
| | | } |
| | | Page<GoodsVo> page = new Page(goodsDto.getPageNum(), goodsDto.getPageSize()); |
| | | IPage<GoodsVo> rows = activitySignAwardSetService.selectGoodsList(page,goodsDto); |
| | | AjaxResult result = AjaxResult.buildSuccessInstance(rows.getRecords(),rows.getTotal()); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 查询活动列表 |
| | | */ |
| | | @ApiOperation(value = "查询活动列表") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "OK", response = ActivitiesListVo.class) |
| | | }) |
| | | @PostMapping(value = "/findActivitiesList") |
| | | public @ResponseBody |
| | | AjaxResult findActivitiesList(@RequestBody ActivitiesListDto activitiesListDto) { |
| | | //设置用户公司ID |
| | | QueryUtil.setQueryLimitCom(activitiesListDto); |
| | | //排序 |
| | | if(StringUtils.isBlank(activitiesListDto.getSort())){ |
| | | activitiesListDto.setSort("create_time"); |
| | | activitiesListDto.setOrder("desc"); |
| | | } |
| | | Page<ActivitiesListVo> page = new Page(activitiesListDto.getPageNum(), activitiesListDto.getPageSize()); |
| | | IPage<ActivitiesListVo> rows = activitySignAwardSetService.findActivitiesList(page,activitiesListDto); |
| | | AjaxResult result = AjaxResult.buildSuccessInstance(rows.getRecords(),rows.getTotal()); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | *发布 |
| | | */ |
| | | @ApiOperation(value = "发布") |
| | | @PostMapping(value = "/beReady") |
| | | public @ResponseBody |
| | | AjaxResult beReady(@RequestBody BeReadyDto beReadyDto) { |
| | | return activitySignAwardSetService.beReady(beReadyDto); |
| | | } |
| | | |
| | | /** |
| | | *删除 |
| | | */ |
| | | @ApiOperation(value = "删除") |
| | | @PostMapping(value = "/delRow") |
| | | public @ResponseBody |
| | | AjaxResult delRow(@RequestBody DelRowDto delRowDto) { |
| | | return activitySignAwardSetService.delRow(delRowDto); |
| | | } |
| | | |
| | | /** |
| | | *关闭 |
| | | */ |
| | | @ApiOperation(value = "关闭") |
| | | @PostMapping(value = "/beClose") |
| | | public @ResponseBody |
| | | AjaxResult beClose(@RequestBody BeCloseDto beCloseDto) { |
| | | return activitySignAwardSetService.beClose(beCloseDto); |
| | | } |
| | | |
| | | /** |
| | | * 活动统计 |
| | | */ |
| | | @ApiOperation(value = "活动统计") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "OK", response = SignReceiveListVo.class) |
| | | }) |
| | | @PostMapping(value = "/findSignReceiveList") |
| | | public @ResponseBody |
| | | AjaxResult findSignReceiveList(@RequestBody SignReceiveListDto signReceiveListDto) { |
| | | //设置用户公司ID |
| | | QueryUtil.setQueryLimitCom(signReceiveListDto); |
| | | //排序 |
| | | if(StringUtils.isBlank(signReceiveListDto.getSort())){ |
| | | signReceiveListDto.setSort("create_time"); |
| | | signReceiveListDto.setOrder("desc"); |
| | | } |
| | | Page<SignReceiveListVo> page = new Page(signReceiveListDto.getPageNum(), signReceiveListDto.getPageSize()); |
| | | IPage<SignReceiveListVo> rows = activitySignAwardSetService.findSignReceiveList(page,signReceiveListDto); |
| | | AjaxResult result = AjaxResult.buildSuccessInstance(rows.getRecords(),rows.getTotal()); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | *进入修改 |
| | | */ |
| | | @ApiOperation(value = "进入修改") |
| | | @PostMapping(value = "/findSignForUpdate") |
| | | public @ResponseBody |
| | | AjaxResult findSignForUpdate(@RequestBody SignForUpdateDto signForUpdateDto) { |
| | | return activitySignAwardSetService.findSignForUpdate(signForUpdateDto); |
| | | } |
| | | |
| | | /** |
| | | * 保存 |
| | | */ |
| | | @PostMapping(value = "/updateSignAwardSet") |
| | | public @ResponseBody |
| | | AjaxResult updateSignAwardSet(@RequestBody UpdateSignAwardSetDto updateSignAwardSetDto) { |
| | | return activitySignAwardSetService.updateSignAwardSet(updateSignAwardSetDto); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.action; |
| | | import com.matrix.system.activity.service.ActivitySignReceiveRecordService; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | /** |
| | | * @description 领取记录表 |
| | | * @author yourName |
| | | * @date 2021-03-31 16:57 |
| | | */ |
| | | @RestController |
| | | @RequestMapping(value = "admin/activitySignReceiveRecord") |
| | | public class ActivitySignReceiveRecordAction { |
| | | |
| | | @Autowired |
| | | private ActivitySignReceiveRecordService activitySignReceiveRecordService; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.action; |
| | | |
| | | import com.matrix.system.activity.service.ActivitySignRecordService; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | /** |
| | | * @description 签到记录表 |
| | | * @author yourName |
| | | * @date 2021-03-31 16:57 |
| | | */ |
| | | @RestController |
| | | @RequestMapping(value = "admin/activitySignRecord") |
| | | public class ActivitySignRecordAction { |
| | | |
| | | @Autowired |
| | | private ActivitySignRecordService activitySignRecordService; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.action; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.system.activity.dto.LogisticsSubmitDto; |
| | | import com.matrix.system.activity.dto.SignWriteoffDto; |
| | | import com.matrix.system.activity.dto.SignWriteoffListDto; |
| | | import com.matrix.system.activity.dto.WriteoffCodeSubmitDto; |
| | | import com.matrix.system.activity.service.ActivitySignWriteoffService; |
| | | import com.matrix.system.activity.vo.SignWriteoffListVo; |
| | | import com.matrix.system.hive.action.util.QueryUtil; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiResponse; |
| | | import io.swagger.annotations.ApiResponses; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | /** |
| | | * @description 核销记录 |
| | | * @author yourName |
| | | * @date 2021-04-08 14:25 |
| | | */ |
| | | @RestController |
| | | @RequestMapping(value = "admin/activitySignWriteoff") |
| | | public class ActivitySignWriteoffAction { |
| | | |
| | | @Autowired |
| | | private ActivitySignWriteoffService activitySignWriteoffService; |
| | | |
| | | /** |
| | | * 核销记录 |
| | | */ |
| | | @ApiOperation(value = "核销记录") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "OK", response = SignWriteoffListVo.class) |
| | | }) |
| | | @PostMapping(value = "/findSignWriteoffList") |
| | | public @ResponseBody |
| | | AjaxResult findSignWriteoffList(@RequestBody SignWriteoffListDto signWriteoffListDto) { |
| | | //设置用户公司ID |
| | | QueryUtil.setQueryLimitCom(signWriteoffListDto); |
| | | //排序 |
| | | if(StringUtils.isBlank(signWriteoffListDto.getSort())){ |
| | | signWriteoffListDto.setSort("create_time"); |
| | | signWriteoffListDto.setOrder("desc"); |
| | | } |
| | | Page<SignWriteoffListVo> page = new Page(signWriteoffListDto.getPageNum(), signWriteoffListDto.getPageSize()); |
| | | IPage<SignWriteoffListVo> rows = activitySignWriteoffService.findSignWriteoffList(page,signWriteoffListDto); |
| | | AjaxResult result = AjaxResult.buildSuccessInstance(rows.getRecords(),rows.getTotal()); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | *中奖信息 |
| | | */ |
| | | @ApiOperation(value = "中奖信息") |
| | | @PostMapping(value = "/findSignWriteoff") |
| | | public @ResponseBody |
| | | AjaxResult findSignWriteoff(@RequestBody SignWriteoffDto signWriteoffDto) { |
| | | return activitySignWriteoffService.findSignWriteoff(signWriteoffDto); |
| | | } |
| | | |
| | | /** |
| | | *核销验证 |
| | | */ |
| | | @ApiOperation(value = "核销验证") |
| | | @PostMapping(value = "/writeoffCodeSubmit") |
| | | public @ResponseBody |
| | | AjaxResult writeoffCodeSubmit(@RequestBody WriteoffCodeSubmitDto writeoffCodeSubmitDto) { |
| | | return activitySignWriteoffService.writeoffCodeSubmit(writeoffCodeSubmitDto); |
| | | } |
| | | |
| | | /** |
| | | *物流发货 |
| | | */ |
| | | @ApiOperation(value = "物流发货") |
| | | @PostMapping(value = "/logisticsSubmit") |
| | | public @ResponseBody |
| | | AjaxResult logisticsSubmit(@RequestBody LogisticsSubmitDto logisticsSubmitDto) { |
| | | return activitySignWriteoffService.logisticsSubmit(logisticsSubmitDto); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.constant; |
| | | |
| | | public class ActivitySignConstant { |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.dao; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.matrix.system.activity.entity.ActivitySignAwardSet; |
| | | import com.matrix.system.shopXcx.api.vo.ActivitySignAwardSetVo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @description 奖品设置表 |
| | | * @author yourName |
| | | * @date 2021-03-31 16:57 |
| | | */ |
| | | public interface ActivitySignAwardSetDao extends BaseMapper<ActivitySignAwardSet>{ |
| | | |
| | | List<ActivitySignAwardSetVo> selectListByActIDAndCompanyId(@Param("actId")Long actId, @Param("companyId")Long companyId,@Param("awardState")int awardstateWork); |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.dao; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.matrix.system.activity.dto.CouponDto; |
| | | import com.matrix.system.activity.dto.GoodsDto; |
| | | import com.matrix.system.activity.dto.SignReceiveListDto; |
| | | import com.matrix.system.activity.entity.ActivitySignReceiveRecord; |
| | | import com.matrix.system.activity.vo.CouponVo; |
| | | import com.matrix.system.activity.vo.GoodsVo; |
| | | import com.matrix.system.activity.vo.SignReceiveListVo; |
| | | import com.matrix.system.shopXcx.api.dto.SeeAwardTextDto; |
| | | import com.matrix.system.shopXcx.api.dto.SignAwardDto; |
| | | import com.matrix.system.shopXcx.api.vo.SeeAwardTextVo; |
| | | import com.matrix.system.shopXcx.api.vo.SignAwardListVo; |
| | | import com.matrix.system.shopXcx.vo.SalesOrderVo; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * @author yourName |
| | | * @date 2021-03-31 16:57 |
| | | */ |
| | | public interface ActivitySignReceiveRecordDao extends BaseMapper<ActivitySignReceiveRecord>{ |
| | | |
| | | IPage<SignReceiveListVo> findSignReceiveList(Page<SignReceiveListVo> page, |
| | | @Param("record")SignReceiveListDto signReceiveListDto); |
| | | |
| | | IPage<CouponVo> selectCouponList(Page<CouponVo> page, @Param("record")CouponDto couponDto); |
| | | |
| | | IPage<GoodsVo> selectGoodsList(Page<GoodsVo> page, @Param("record")GoodsDto goodsDto); |
| | | |
| | | int getSignAwardReceiveCount(@Param("userId")Long userId, @Param("companyId")Long companyId); |
| | | |
| | | IPage<SignAwardListVo> selectSignAwardList(Page<SalesOrderVo> page, @Param("record")SignAwardDto signAwardDto); |
| | | |
| | | SeeAwardTextVo selectSeeAwardTextVOById(@Param("record")SeeAwardTextDto seeAwardTextDto); |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.dao; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.matrix.system.activity.entity.ActivitySignRecord; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @description 签到记录表 |
| | | * @author yourName |
| | | * @date 2021-03-31 16:57 |
| | | */ |
| | | public interface ActivitySignRecordDao extends BaseMapper<ActivitySignRecord>{ |
| | | |
| | | ActivitySignRecord selectOneByActIdAndUserIdLikesignTime(@Param("actId")long actId, |
| | | @Param("userId")Long userId, @Param("format")Date format); |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.dao; |
| | | |
| | | |
| | | import com.matrix.system.shopXcx.bean.ShopDeliveryInfo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.matrix.system.activity.dto.SignWriteoffListDto; |
| | | import com.matrix.system.activity.entity.ActivitySignWriteoff; |
| | | import com.matrix.system.activity.vo.SignWriteoffListVo; |
| | | import com.matrix.system.activity.vo.ZjrVo; |
| | | |
| | | /** |
| | | * @description 核销记录 |
| | | * @author yourName |
| | | * @date 2021-04-08 14:25 |
| | | */ |
| | | public interface ActivitySignWriteoffDao extends BaseMapper<ActivitySignWriteoff>{ |
| | | |
| | | IPage<SignWriteoffListVo> findSignWriteoffList(Page<SignWriteoffListVo> page, |
| | | @Param("record")SignWriteoffListDto signWriteoffListDto); |
| | | |
| | | ZjrVo selectUsernameByUserId(@Param("userId")Long userId, @Param("receiveId")Long receiveId); |
| | | |
| | | ShopDeliveryInfo selectShopDeliveryInfoByLogisticsId(@Param("logisticsId")Integer logisticsId); |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.dto; |
| | | |
| | | import com.matrix.core.pojo.BasePageQueryDto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "ActivitiesListDto", description = "查询参数") |
| | | public class ActivitiesListDto extends BasePageQueryDto { |
| | | |
| | | @ApiModelProperty(value ="活动名称") |
| | | private String hdmc; |
| | | |
| | | @ApiModelProperty(value ="活动状态") |
| | | private Integer hdzt; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.dto; |
| | | |
| | | import com.matrix.system.activity.entity.ActivitySignAwardSet; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "AddSignAwardSetDto", description = "查询参数") |
| | | public class AddSignAwardSetDto { |
| | | |
| | | @ApiModelProperty(value ="活动名称") |
| | | private String actName; |
| | | @ApiModelProperty(value ="活动编码") |
| | | private String actCode; |
| | | @ApiModelProperty(value ="活动开始时间") |
| | | private Date beginTime; |
| | | @ApiModelProperty(value ="活动结束时间") |
| | | private Date endTime; |
| | | |
| | | private SignSetBasicJsonDto signSetBasicJsonDto; |
| | | |
| | | private List<ActivitySignAwardSet> activitySignAwardSets; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "BeCloseDto", description = "参数") |
| | | public class BeCloseDto { |
| | | |
| | | @ApiModelProperty(value ="活动主表ID") |
| | | private Long actId; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "BeReadyDto", description = "参数") |
| | | public class BeReadyDto { |
| | | |
| | | @ApiModelProperty(value ="活动主表ID") |
| | | private Long actId; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.dto; |
| | | |
| | | import com.matrix.core.pojo.BasePageQueryDto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "CouponDto", description = "查询参数") |
| | | public class CouponDto extends BasePageQueryDto { |
| | | |
| | | @ApiModelProperty(value ="活动名称") |
| | | private String yhjmc; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "DelRowDto", description = "参数") |
| | | public class DelRowDto { |
| | | |
| | | @ApiModelProperty(value ="活动主表ID") |
| | | private Long actId; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.dto; |
| | | |
| | | import com.matrix.core.pojo.BasePageQueryDto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "GoodsDto", description = "查询参数") |
| | | public class GoodsDto extends BasePageQueryDto { |
| | | |
| | | @ApiModelProperty(value ="商品名称") |
| | | private String cpmc; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "LogisticsSubmitDto", description = "查询参数") |
| | | public class LogisticsSubmitDto { |
| | | |
| | | @ApiModelProperty(value ="核销ID") |
| | | private long writeoffId; |
| | | |
| | | @ApiModelProperty(value ="收货人") |
| | | private String shr; |
| | | @ApiModelProperty(value ="联系电话") |
| | | private String lxdh; |
| | | @ApiModelProperty(value ="收货地址") |
| | | private String shdz; |
| | | @ApiModelProperty(value ="快递公司Code") |
| | | private String kdgs; |
| | | @ApiModelProperty(value ="快递单号") |
| | | private String kddh; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "SignForUpdateDto", description = "参数") |
| | | public class SignForUpdateDto { |
| | | |
| | | @ApiModelProperty(value ="活动主表ID") |
| | | private Long actId; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.dto; |
| | | |
| | | import com.matrix.core.pojo.BasePageQueryDto; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @ApiModel(value = "SignReceiveListDto", description = "参数") |
| | | public class SignReceiveListDto extends BasePageQueryDto { |
| | | |
| | | @ApiModelProperty(value ="活动编码") |
| | | private String yhmc; |
| | | |
| | | @ApiModelProperty(value ="签到开始时间") |
| | | private Date startTime; |
| | | |
| | | @ApiModelProperty(value ="签到结束时间") |
| | | private Date endTime; |
| | | |
| | | @ApiModelProperty(value ="活动主表ID") |
| | | private Long actId; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.dto; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "SignSetBasicJsonDto", description = "查询参数") |
| | | public class SignSetBasicJsonDto { |
| | | |
| | | @ApiModelProperty(value ="标题图片") |
| | | private String imageUrlTitle; |
| | | @ApiModelProperty(value ="头部图片") |
| | | private String imageUrlHead; |
| | | @ApiModelProperty(value ="按钮图片") |
| | | private String imageUrlButton; |
| | | @ApiModelProperty(value ="状态图片") |
| | | private String imageUrlState; |
| | | |
| | | @ApiModelProperty(value ="规则内容") |
| | | private String ruleExplain; |
| | | @ApiModelProperty(value ="字体颜色") |
| | | private String typographyColor; |
| | | @ApiModelProperty(value ="背景颜色") |
| | | private String backgroundColor; |
| | | @ApiModelProperty(value ="字体大小") |
| | | private Integer typographyNum; |
| | | @ApiModelProperty(value ="字体透明度") |
| | | private Integer typographyLight; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "SignWriteoffDto", description = "查询参数") |
| | | public class SignWriteoffDto { |
| | | |
| | | @ApiModelProperty(value ="核销ID") |
| | | private long writeoffId; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.dto; |
| | | |
| | | import com.matrix.core.pojo.BasePageQueryDto; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "SignWriteoffListDto", description = "查询参数") |
| | | public class SignWriteoffListDto extends BasePageQueryDto { |
| | | |
| | | @ApiModelProperty(value ="中奖者姓名") |
| | | private String zjzxm; |
| | | |
| | | @ApiModelProperty(value ="活动名称/编码") |
| | | private String hdmcbm; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.dto; |
| | | |
| | | import com.matrix.system.activity.entity.ActivitySignAwardSet; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "UpdateSignAwardSetDto", description = "查询参数") |
| | | public class UpdateSignAwardSetDto { |
| | | |
| | | @ApiModelProperty(value ="活动名称") |
| | | private String actName; |
| | | @ApiModelProperty(value ="活动编码") |
| | | private String actCode; |
| | | @ApiModelProperty(value ="活动开始时间") |
| | | private Date beginTime; |
| | | @ApiModelProperty(value ="活动结束时间") |
| | | private Date endTime; |
| | | |
| | | private SignSetBasicJsonDto signSetBasicJsonDto; |
| | | |
| | | private List<ActivitySignAwardSet> activitySignAwardSets; |
| | | |
| | | @ApiModelProperty(value ="活动主表ID") |
| | | private Long actMainId; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "WriteoffCodeSubmitDto", description = "查询参数") |
| | | public class WriteoffCodeSubmitDto { |
| | | |
| | | @ApiModelProperty(value ="核销ID") |
| | | private long writeoffId; |
| | | |
| | | @ApiModelProperty(value ="兑奖码") |
| | | private String writeOffCode; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.matrix.core.anotations.Extend; |
| | | import com.matrix.system.score.entity.BaseEntity; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @description 奖品设置表 |
| | | * @author yourName |
| | | * @date 2021-03-31 16:57 |
| | | */ |
| | | @Data |
| | | @TableName("activity_sign_award_set") |
| | | public class ActivitySignAwardSet extends BaseEntity{ |
| | | @Extend |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 奖项类型(1:自定义产品2:积分3:优惠券4:店铺商品) |
| | | */ |
| | | |
| | | @ApiModelProperty(value ="奖项类型(1:自定义产品2:积分3:优惠券4:店铺商品)") |
| | | private int awardType; |
| | | |
| | | |
| | | public static final int AWARDTYPE_CUSTOMIZE = 1; |
| | | public static final int AWARDTYPE_SCORE = 2; |
| | | public static final int AWARDTYPE_COUPON = 3; |
| | | public static final int AWARDTYPE_GOODS = 4; |
| | | |
| | | /** |
| | | * 奖项规则(1:每日奖励(默认)2:累计签到天数) |
| | | */ |
| | | |
| | | |
| | | @ApiModelProperty(value ="奖项规则(1:每日奖励(默认)2:累计签到天数)") |
| | | private int awardRule; |
| | | |
| | | public static final int AWARDRULE_NORMAL = 1; |
| | | public static final int AWARDRULE_CUMULATIVEDAY = 2; |
| | | |
| | | /** |
| | | * 签到累计天数 |
| | | */ |
| | | |
| | | @ApiModelProperty(value ="签到累计天数") |
| | | private int cumulativeDay; |
| | | |
| | | /** |
| | | * 奖项名称 |
| | | */ |
| | | |
| | | @ApiModelProperty(value ="奖项名称") |
| | | private String awardName; |
| | | |
| | | /** |
| | | * 图片介绍 |
| | | */ |
| | | |
| | | @ApiModelProperty(value ="图片介绍") |
| | | private String introduceImg; |
| | | |
| | | /** |
| | | * 文字介绍 |
| | | */ |
| | | |
| | | |
| | | @ApiModelProperty(value ="文字介绍") |
| | | private String introduceTip; |
| | | |
| | | /** |
| | | * 奖项库存数量 |
| | | */ |
| | | |
| | | |
| | | @ApiModelProperty(value ="奖项库存数量") |
| | | private int awardInventoryCnt; |
| | | |
| | | /** |
| | | * 已派发数量 |
| | | */ |
| | | |
| | | |
| | | @ApiModelProperty(value ="已派发数量") |
| | | private int awardDistributeCnt; |
| | | |
| | | /** |
| | | * 兑奖方式(1:线下兑换2:物流配送3:客服兑换) |
| | | */ |
| | | |
| | | |
| | | @ApiModelProperty(value ="兑奖方式(1:线下兑换2:物流配送3:客服兑换)") |
| | | private int awardWay; |
| | | public static final int AWARDWAY_ONE = 1; |
| | | public static final int AWARDWAY_TWO = 2; |
| | | public static final int AWARDWAY_THREE = 3; |
| | | |
| | | /** |
| | | * 奖品是否有效(1:有效 2:无效) |
| | | */ |
| | | @ApiModelProperty(value ="奖品是否有效(1:有效 2:无效)") |
| | | private int awardState; |
| | | public static final int AWARDSTATE_WORK = 1; |
| | | public static final int AWARDSTATE_UNWORK = 2; |
| | | |
| | | /** |
| | | * 操作提示 |
| | | */ |
| | | |
| | | @ApiModelProperty(value ="操作提示") |
| | | private String operationTip; |
| | | |
| | | /** |
| | | * 兑奖地址 |
| | | */ |
| | | |
| | | @ApiModelProperty(value ="兑奖地址") |
| | | private String prizeAddress; |
| | | |
| | | /** |
| | | * 兑奖期限开始日期 |
| | | */ |
| | | |
| | | |
| | | @ApiModelProperty(value ="兑奖期限开始日期") |
| | | private Date prizeStartTime; |
| | | |
| | | /** |
| | | * 兑奖期限结束日期 |
| | | */ |
| | | |
| | | @ApiModelProperty(value ="兑奖期限结束日期") |
| | | private Date prizeEndTime; |
| | | |
| | | /** |
| | | * 客服微信 |
| | | */ |
| | | |
| | | @ApiModelProperty(value ="客服微信") |
| | | private String wechatImg; |
| | | |
| | | /** |
| | | * 积分数量 |
| | | */ |
| | | |
| | | |
| | | @ApiModelProperty(value ="积分数量") |
| | | private int scoreCnt; |
| | | |
| | | /** |
| | | * 优惠券ID |
| | | */ |
| | | |
| | | @ApiModelProperty(value ="优惠券") |
| | | private String couponName; |
| | | |
| | | @ApiModelProperty(value ="优惠券ID") |
| | | private String couponId; |
| | | |
| | | /** |
| | | * 商品ID |
| | | */ |
| | | |
| | | @ApiModelProperty(value ="商品") |
| | | private String goodsName; |
| | | |
| | | @ApiModelProperty(value ="商品ID") |
| | | private String goodsId; |
| | | |
| | | /** |
| | | * 活动主表ID |
| | | */ |
| | | |
| | | |
| | | @ApiModelProperty(value ="活动主表ID") |
| | | private Long activityId; |
| | | |
| | | /** |
| | | * 公司ID |
| | | */ |
| | | |
| | | |
| | | @ApiModelProperty(value ="公司ID") |
| | | private Long companyId; |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.matrix.core.anotations.Extend; |
| | | import com.matrix.system.score.entity.BaseEntity; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @description 领 |
| | | * @author yourName |
| | | * @date 2021-03-31 16:57 |
| | | */ |
| | | @Data |
| | | @TableName("activity_sign_receive_record") |
| | | public class ActivitySignReceiveRecord extends BaseEntity{ |
| | | @Extend |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * userId |
| | | */ |
| | | |
| | | |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 领取时间 |
| | | */ |
| | | |
| | | |
| | | private Date receiveTime; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | |
| | | |
| | | private String remark; |
| | | |
| | | /** |
| | | * 奖品设置表ID |
| | | */ |
| | | |
| | | |
| | | private Long awardId; |
| | | |
| | | /** |
| | | * 是否已领取(1:待领取2:已领取) |
| | | */ |
| | | |
| | | |
| | | private Integer state; |
| | | |
| | | public static final int STATE_ING = 1; |
| | | public static final int STATE_DONE = 2; |
| | | |
| | | /** |
| | | * 核销码 |
| | | */ |
| | | |
| | | |
| | | private String writeOffCode; |
| | | |
| | | /** |
| | | * 活动主表ID |
| | | */ |
| | | |
| | | |
| | | private Long activityId; |
| | | |
| | | /** |
| | | * 公司ID |
| | | */ |
| | | |
| | | |
| | | private Long companyId; |
| | | |
| | | /** |
| | | * 收货人 |
| | | */ |
| | | private String consignee; |
| | | /** |
| | | * 联系电话 |
| | | */ |
| | | private String consigneePhone; |
| | | /** |
| | | * 收货地址 |
| | | */ |
| | | private String consigneeAddress; |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.matrix.core.anotations.Extend; |
| | | import com.matrix.system.score.entity.BaseEntity; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @description 签到记录表 |
| | | * @author yourName |
| | | * @date 2021-03-31 16:57 |
| | | */ |
| | | @Data |
| | | @TableName("activity_sign_record") |
| | | public class ActivitySignRecord extends BaseEntity{ |
| | | @Extend |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * userId |
| | | */ |
| | | |
| | | |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 签到时间 |
| | | */ |
| | | |
| | | |
| | | private Date signTime; |
| | | |
| | | /** |
| | | * 累计签到天数 |
| | | */ |
| | | |
| | | |
| | | private Integer cumulativeDay; |
| | | |
| | | /** |
| | | * 活动主表ID |
| | | */ |
| | | |
| | | |
| | | private Long activityId; |
| | | |
| | | /** |
| | | * 公司ID |
| | | */ |
| | | |
| | | |
| | | private Long companyId; |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.matrix.core.anotations.Extend; |
| | | import com.matrix.system.score.entity.BaseEntity; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * @description 核销记录 |
| | | * @author yourName |
| | | * @date 2021-04-08 14:25 |
| | | */ |
| | | @Data |
| | | @TableName("activity_sign_writeoff") |
| | | public class ActivitySignWriteoff extends BaseEntity{ |
| | | @Extend |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 核销时间 |
| | | */ |
| | | |
| | | |
| | | private Date writeoffTime; |
| | | |
| | | /** |
| | | * 核销员 |
| | | */ |
| | | |
| | | |
| | | private String writeoffUser; |
| | | |
| | | /** |
| | | * 兑奖码 |
| | | */ |
| | | |
| | | |
| | | private String writeoffCode; |
| | | |
| | | /** |
| | | * 活动ID |
| | | */ |
| | | |
| | | |
| | | private Long actId; |
| | | |
| | | /** |
| | | * 奖品ID |
| | | */ |
| | | |
| | | |
| | | private Long awardId; |
| | | |
| | | /** |
| | | * 中奖时间 |
| | | */ |
| | | |
| | | |
| | | private Date winTime; |
| | | |
| | | /** |
| | | * 状态(1:待兑换 2:待发货 3:已兑换 ) |
| | | */ |
| | | private Integer state; |
| | | public static final int STATE_ONE = 1; |
| | | public static final int STATE_TWO = 2; |
| | | public static final int STATE_THREE = 3; |
| | | |
| | | /** |
| | | * 中奖者ID |
| | | */ |
| | | |
| | | |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 物流ID |
| | | */ |
| | | |
| | | |
| | | private Integer logisticsId; |
| | | |
| | | /** |
| | | * 中奖记录ID |
| | | */ |
| | | |
| | | |
| | | private Long receiveId; |
| | | |
| | | /** |
| | | * 公司ID |
| | | */ |
| | | |
| | | |
| | | private Long companyId; |
| | | |
| | | /** |
| | | * 店铺ID |
| | | */ |
| | | |
| | | |
| | | private Long shopId; |
| | | |
| | | /** |
| | | * 核销员ID |
| | | */ |
| | | |
| | | |
| | | private Long writeoffUserid; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.service; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.activity.dao.ActivitySignAwardSetDao; |
| | | import com.matrix.system.activity.dao.ActivitySignReceiveRecordDao; |
| | | import com.matrix.system.activity.dto.*; |
| | | import com.matrix.system.activity.entity.ActivitySignAwardSet; |
| | | import com.matrix.system.activity.vo.ActivitiesListVo; |
| | | import com.matrix.system.activity.vo.AddSignAwardSetVo; |
| | | import com.matrix.system.activity.vo.CouponVo; |
| | | import com.matrix.system.activity.vo.GoodsVo; |
| | | import com.matrix.system.activity.vo.SignReceiveListVo; |
| | | import com.matrix.system.activity.vo.SignSetBasicJsonVo; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.hive.action.util.QueryUtil; |
| | | import com.matrix.system.shopXcx.bean.ShopActivities; |
| | | import com.matrix.system.shopXcx.dao.ShopActivitiesDao; |
| | | 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.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @description 奖品设置表 |
| | | * @author yourName |
| | | * @date 2021-03-31 16:57 |
| | | */ |
| | | @Service |
| | | public class ActivitySignAwardSetService extends ServiceImpl<ActivitySignAwardSetDao, ActivitySignAwardSet>{ |
| | | |
| | | @Autowired |
| | | private ShopActivitiesDao shopActivitiesDao; |
| | | @Autowired |
| | | private ActivitySignAwardSetDao activitySignAwardSetDao; |
| | | @Autowired |
| | | private ActivitySignReceiveRecordDao activitySignReceiveRecordDao; |
| | | |
| | | @Transactional |
| | | public AjaxResult activitySignAwardSetService(AddSignAwardSetDto addSignAwardSetDto) { |
| | | //获取当前登录人员信息 |
| | | SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | Long companyId = user.getCompanyId(); |
| | | /** |
| | | * todo签到活动的唯一性 |
| | | */ |
| | | |
| | | //新增活动主表信息 |
| | | ShopActivities shopActivities = new ShopActivities(); |
| | | shopActivities.setActName(addSignAwardSetDto.getActName()); |
| | | shopActivities.setActCode(addSignAwardSetDto.getActCode()); |
| | | shopActivities.setIsStart(ShopActivities.ACTIVITIES_STATUS_CLOSE); |
| | | shopActivities.setActType(ShopActivities.ACTIVITIES_TYPE_SIGN); |
| | | shopActivities.setActStatus(ShopActivities.ACTSTATUS_STATUS_RELEASE); |
| | | shopActivities.setActBeginTime(addSignAwardSetDto.getBeginTime()); |
| | | shopActivities.setActEndTime(addSignAwardSetDto.getEndTime()); |
| | | shopActivities.setCompanyId(companyId); |
| | | shopActivities.setCreateBy(user.getSuName()); |
| | | shopActivities.setUpdateBy(user.getSuName()); |
| | | //将基本信息转换成JSON字符串存储到活动主表的act_content字段 |
| | | SignSetBasicJsonDto signSetBasicJsonDto = addSignAwardSetDto.getSignSetBasicJsonDto(); |
| | | String json=JSON.toJSONString(signSetBasicJsonDto); |
| | | shopActivities.setActContent(json); |
| | | int insert = shopActivitiesDao.insert(shopActivities); |
| | | if(insert > 0){ |
| | | //新增活动奖品信息 |
| | | List<ActivitySignAwardSet> activitySignAwardSets = addSignAwardSetDto.getActivitySignAwardSets(); |
| | | if(CollUtil.isNotEmpty(activitySignAwardSets)) { |
| | | for(ActivitySignAwardSet activitySignAwardSet : activitySignAwardSets) { |
| | | activitySignAwardSet.setCreateBy(user.getSuName()); |
| | | activitySignAwardSet.setCreateTime(new Date()); |
| | | activitySignAwardSet.setUpdateTime(new Date()); |
| | | activitySignAwardSet.setUpdateBy(user.getSuName()); |
| | | activitySignAwardSet.setCompanyId(companyId); |
| | | activitySignAwardSet.setActivityId(shopActivities.getId()); |
| | | activitySignAwardSet.setAwardState(ActivitySignAwardSet.AWARDSTATE_WORK); |
| | | activitySignAwardSetDao.insert(activitySignAwardSet); |
| | | } |
| | | } |
| | | }else{ |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "保存失败"); |
| | | } |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, "保存成功"); |
| | | } |
| | | |
| | | public IPage<ActivitiesListVo> findActivitiesList(Page<ActivitiesListVo> page, |
| | | ActivitiesListDto activitiesListDto) { |
| | | return shopActivitiesDao.findActivitiesList(page,activitiesListDto); |
| | | } |
| | | |
| | | @Transactional |
| | | public AjaxResult beReady(BeReadyDto beReadyDto) { |
| | | //设置用户公司ID |
| | | QueryUtil.setQueryLimitCom(beReadyDto); |
| | | Long actId = beReadyDto.getActId(); |
| | | ShopActivities shopActivity = shopActivitiesDao.selectById(actId); |
| | | if(ObjectUtil.isEmpty(shopActivity)) { |
| | | return AjaxResult.buildFailInstance("网络不通畅,请刷新页面"); |
| | | } |
| | | /** |
| | | * 未发布状态即使达到活动时间也不进入进行中状态 |
| | | */ |
| | | //未发布状态点击发布,状态变成未开始,且是开启状态 |
| | | shopActivity.setActStatus(ShopActivities.ACTSTATUS_STATUS_READY); |
| | | shopActivity.setIsStart(ShopActivities.ACTIVITIES_STATUS_OPEN); |
| | | shopActivitiesDao.updateByModel(shopActivity); |
| | | return AjaxResult.buildSuccessInstance("操作成功"); |
| | | } |
| | | |
| | | public AjaxResult delRow(DelRowDto delRowDto) { |
| | | //设置用户公司ID |
| | | QueryUtil.setQueryLimitCom(delRowDto); |
| | | Long actId = delRowDto.getActId(); |
| | | ShopActivities shopActivity = shopActivitiesDao.selectById(actId); |
| | | if(ObjectUtil.isEmpty(shopActivity)) { |
| | | return AjaxResult.buildFailInstance("网络不通畅,请刷新页面"); |
| | | } |
| | | /** |
| | | * 删除状态更新状态为已删除,只能查看活动统计 |
| | | */ |
| | | shopActivity.setActStatus(ShopActivities.ACTSTATUS_STATUS_DEL); |
| | | shopActivity.setIsStart(ShopActivities.ACTIVITIES_STATUS_CLOSE); |
| | | shopActivitiesDao.updateByModel(shopActivity); |
| | | return AjaxResult.buildSuccessInstance("操作成功"); |
| | | } |
| | | |
| | | public AjaxResult beClose(BeCloseDto beCloseDto) { |
| | | //设置用户公司ID |
| | | QueryUtil.setQueryLimitCom(beCloseDto); |
| | | Long actId = beCloseDto.getActId(); |
| | | ShopActivities shopActivity = shopActivitiesDao.selectById(actId); |
| | | if(ObjectUtil.isEmpty(shopActivity)) { |
| | | return AjaxResult.buildFailInstance("网络不通畅,请刷新页面"); |
| | | } |
| | | /** |
| | | * 关闭状态 |
| | | */ |
| | | shopActivity.setActStatus(ShopActivities.ACTSTATUS_STATUS_END); |
| | | shopActivity.setIsStart(ShopActivities.ACTIVITIES_STATUS_CLOSE); |
| | | shopActivitiesDao.updateByModel(shopActivity); |
| | | return AjaxResult.buildSuccessInstance("操作成功"); |
| | | } |
| | | |
| | | public IPage<SignReceiveListVo> findSignReceiveList(Page<SignReceiveListVo> page, |
| | | SignReceiveListDto signReceiveListDto) { |
| | | return activitySignReceiveRecordDao.findSignReceiveList(page,signReceiveListDto); |
| | | } |
| | | |
| | | public AjaxResult findSignForUpdate(SignForUpdateDto signForUpdateDto) { |
| | | //设置用户公司ID |
| | | QueryUtil.setQueryLimitCom(signForUpdateDto); |
| | | Long actId = signForUpdateDto.getActId(); |
| | | AjaxResult result= AjaxResult.buildSuccessInstance("查询成功"); |
| | | //获取对应的活动主表信息和对应的奖品设置信息 |
| | | AddSignAwardSetVo addSignAwardSetVo = new AddSignAwardSetVo(); |
| | | ShopActivities shopActivity = shopActivitiesDao.selectById(actId); |
| | | if(ObjectUtil.isNotEmpty(shopActivity)) { |
| | | addSignAwardSetVo.setId(actId); |
| | | addSignAwardSetVo.setActName(shopActivity.getActName()); |
| | | addSignAwardSetVo.setActCode(shopActivity.getActCode()); |
| | | addSignAwardSetVo.setBeginTime(shopActivity.getActBeginTime()); |
| | | addSignAwardSetVo.setEndTime(shopActivity.getActEndTime()); |
| | | |
| | | String actContent = shopActivity.getActContent(); |
| | | SignSetBasicJsonVo signSetBasicJsonVo = JSON.parseObject(actContent, SignSetBasicJsonVo.class); |
| | | addSignAwardSetVo.setSignSetBasicJsonDto(signSetBasicJsonVo); |
| | | |
| | | Map<String, Object> columnMap = new HashMap<String, Object>(); |
| | | columnMap.put("activity_id", actId); |
| | | columnMap.put("company_id", signForUpdateDto.getCompanyId()); |
| | | List<ActivitySignAwardSet> activitySignAwardSets = activitySignAwardSetDao.selectByMap(columnMap); |
| | | addSignAwardSetVo.setActivitySignAwardSets(activitySignAwardSets); |
| | | } |
| | | result.putInMap("addSignAwardSetVo", addSignAwardSetVo); |
| | | return result; |
| | | } |
| | | |
| | | @Transactional |
| | | public AjaxResult updateSignAwardSet(UpdateSignAwardSetDto updateSignAwardSetDto) { |
| | | //获取当前登录人员信息 |
| | | QueryUtil.setQueryLimitCom(updateSignAwardSetDto); |
| | | SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | Long actId = updateSignAwardSetDto.getActMainId(); |
| | | Long companyId = user.getCompanyId(); |
| | | ShopActivities shopActivity = shopActivitiesDao.selectById(actId); |
| | | //更新活动主表信息 |
| | | shopActivity.setActName(updateSignAwardSetDto.getActName()); |
| | | shopActivity.setActCode(updateSignAwardSetDto.getActCode()); |
| | | shopActivity.setActBeginTime(updateSignAwardSetDto.getBeginTime()); |
| | | shopActivity.setActEndTime(updateSignAwardSetDto.getEndTime()); |
| | | shopActivity.setCompanyId(companyId); |
| | | shopActivity.setCreateBy(user.getSuName()); |
| | | shopActivity.setUpdateBy(user.getSuName()); |
| | | //将基本信息转换成JSON字符串存储到活动主表的act_content字段 |
| | | SignSetBasicJsonDto signSetBasicJsonDto = updateSignAwardSetDto.getSignSetBasicJsonDto(); |
| | | String json=JSON.toJSONString(signSetBasicJsonDto); |
| | | shopActivity.setActContent(json); |
| | | shopActivitiesDao.updateByModel(shopActivity); |
| | | /** |
| | | * 比较两个奖品名单,多的新增,减少的更新为已失效,不变的更新 |
| | | */ |
| | | //原有的奖品 |
| | | ArrayList<Long> arrayListOld = new ArrayList<>(); |
| | | Map<String, Object> columnMap = new HashMap<String, Object>(); |
| | | columnMap.put("activity_id", actId); |
| | | columnMap.put("company_id", updateSignAwardSetDto.getCompanyId()); |
| | | List<ActivitySignAwardSet> activitySignAwardSetOld = activitySignAwardSetDao.selectByMap(columnMap); |
| | | if(CollUtil.isNotEmpty(activitySignAwardSetOld)) { |
| | | for(ActivitySignAwardSet activitySignAwardSetUpdate : activitySignAwardSetOld) { |
| | | Long actSubid = activitySignAwardSetUpdate.getId(); |
| | | arrayListOld.add(actSubid); |
| | | } |
| | | } |
| | | //修改后的奖品 |
| | | List<ActivitySignAwardSet> activitySignAwardSetsUpdate = updateSignAwardSetDto.getActivitySignAwardSets(); |
| | | ArrayList<Long> arrayListUpdate = new ArrayList<>(); |
| | | if(CollUtil.isNotEmpty(activitySignAwardSetsUpdate)) { |
| | | for(ActivitySignAwardSet activitySignAwardSetUpdate : activitySignAwardSetsUpdate) { |
| | | Long actSubid = activitySignAwardSetUpdate.getId(); |
| | | //如果ID为空则新增,不为空则修改 |
| | | if(ObjectUtil.isEmpty(actSubid)) { |
| | | activitySignAwardSetUpdate.setCreateBy(user.getSuName()); |
| | | activitySignAwardSetUpdate.setCreateTime(new Date()); |
| | | activitySignAwardSetUpdate.setUpdateTime(new Date()); |
| | | activitySignAwardSetUpdate.setUpdateBy(user.getSuName()); |
| | | activitySignAwardSetUpdate.setCompanyId(companyId); |
| | | activitySignAwardSetUpdate.setActivityId(actId); |
| | | activitySignAwardSetDao.insert(activitySignAwardSetUpdate); |
| | | }else { |
| | | activitySignAwardSetDao.updateById(activitySignAwardSetUpdate); |
| | | arrayListUpdate.add(actSubid); |
| | | } |
| | | } |
| | | } |
| | | //比较获取原来的比现在多出来的奖品,修改状态为失效 |
| | | boolean removeAll = arrayListOld.removeAll(arrayListUpdate); |
| | | if(removeAll && CollUtil.isNotEmpty(arrayListOld)) { |
| | | for(long id : arrayListOld) { |
| | | ActivitySignAwardSet activitySignAwardSetDel = activitySignAwardSetDao.selectById(id); |
| | | activitySignAwardSetDel.setAwardState(ActivitySignAwardSet.AWARDSTATE_UNWORK); |
| | | activitySignAwardSetDao.updateById(activitySignAwardSetDel); |
| | | } |
| | | } |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, "保存成功"); |
| | | } |
| | | |
| | | public IPage<CouponVo> selectCouponList(Page<CouponVo> page, CouponDto couponDto) { |
| | | return activitySignReceiveRecordDao.selectCouponList(page,couponDto); |
| | | } |
| | | |
| | | public IPage<GoodsVo> selectGoodsList(Page<GoodsVo> page, GoodsDto goodsDto) { |
| | | return activitySignReceiveRecordDao.selectGoodsList(page,goodsDto); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.service; |
| | | |
| | | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.matrix.system.activity.dao.ActivitySignReceiveRecordDao; |
| | | import com.matrix.system.activity.entity.ActivitySignReceiveRecord; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | |
| | | /** |
| | | * @description 领 |
| | | * @author yourName |
| | | * @date 2021-03-31 16:57 |
| | | */ |
| | | @Service |
| | | public class ActivitySignReceiveRecordService extends ServiceImpl<ActivitySignReceiveRecordDao, ActivitySignReceiveRecord>{ |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.service; |
| | | |
| | | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.matrix.system.activity.dao.ActivitySignRecordDao; |
| | | import com.matrix.system.activity.entity.ActivitySignRecord; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | |
| | | /** |
| | | * @description 签到记录表 |
| | | * @author yourName |
| | | * @date 2021-03-31 16:57 |
| | | */ |
| | | @Service |
| | | public class ActivitySignRecordService extends ServiceImpl<ActivitySignRecordDao, ActivitySignRecord>{ |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.service; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.activity.dao.ActivitySignAwardSetDao; |
| | | import com.matrix.system.activity.dao.ActivitySignReceiveRecordDao; |
| | | import com.matrix.system.activity.dao.ActivitySignWriteoffDao; |
| | | import com.matrix.system.activity.dto.LogisticsSubmitDto; |
| | | import com.matrix.system.activity.dto.SignWriteoffDto; |
| | | import com.matrix.system.activity.dto.SignWriteoffListDto; |
| | | import com.matrix.system.activity.dto.WriteoffCodeSubmitDto; |
| | | import com.matrix.system.activity.entity.ActivitySignAwardSet; |
| | | import com.matrix.system.activity.entity.ActivitySignReceiveRecord; |
| | | import com.matrix.system.activity.entity.ActivitySignWriteoff; |
| | | import com.matrix.system.activity.vo.LogisticsVo; |
| | | import com.matrix.system.activity.vo.SignWriteoffListVo; |
| | | import com.matrix.system.activity.vo.SignWriteoffVo; |
| | | import com.matrix.system.activity.vo.ZjrVo; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.bean.SystemDictionary; |
| | | import com.matrix.system.common.dao.SystemDictionaryDao; |
| | | import com.matrix.system.hive.action.util.QueryUtil; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import com.matrix.system.shopXcx.bean.ShopActivities; |
| | | import com.matrix.system.shopXcx.bean.ShopDeliveryInfo; |
| | | import com.matrix.system.shopXcx.bean.ShopLogisticsInfo; |
| | | import com.matrix.system.shopXcx.dao.ShopActivitiesDao; |
| | | import com.matrix.system.shopXcx.dao.ShopDeliveryInfoDao; |
| | | import com.matrix.system.shopXcx.dao.ShopLogisticsInfoDao; |
| | | 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.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @description 核销记录 |
| | | * @author yourName |
| | | * @date 2021-04-08 14:25 |
| | | */ |
| | | @Service |
| | | public class ActivitySignWriteoffService extends ServiceImpl<ActivitySignWriteoffDao, ActivitySignWriteoff>{ |
| | | |
| | | @Autowired |
| | | ActivitySignWriteoffDao activitySignWriteoffDao; |
| | | @Autowired |
| | | ShopActivitiesDao shopActivitiesDao; |
| | | @Autowired |
| | | ActivitySignAwardSetDao activitySignAwardSetDao; |
| | | @Autowired |
| | | ActivitySignReceiveRecordDao activitySignReceiveRecordDao; |
| | | @Autowired |
| | | SysVipInfoDao sysVipInfoDao; |
| | | @Autowired |
| | | SystemDictionaryDao systemDictionaryDao; |
| | | @Autowired |
| | | ShopDeliveryInfoDao shopDeliveryInfoDao; |
| | | @Autowired |
| | | ShopLogisticsInfoDao shopLogisticsInfoDao; |
| | | |
| | | public IPage<SignWriteoffListVo> findSignWriteoffList(Page<SignWriteoffListVo> page, |
| | | SignWriteoffListDto signWriteoffListDto) { |
| | | return activitySignWriteoffDao.findSignWriteoffList(page,signWriteoffListDto); |
| | | } |
| | | |
| | | public AjaxResult findSignWriteoff(SignWriteoffDto signWriteoffDto) { |
| | | //设置用户公司ID |
| | | QueryUtil.setQueryLimitCom(signWriteoffDto); |
| | | Long writeoffId = signWriteoffDto.getWriteoffId(); |
| | | AjaxResult result= AjaxResult.buildSuccessInstance("成功"); |
| | | //获取核销信息 |
| | | SignWriteoffVo signWriteoffVo = new SignWriteoffVo(); |
| | | ActivitySignWriteoff activitySignWriteoff = activitySignWriteoffDao.selectById(writeoffId); |
| | | if(ObjectUtil.isNotEmpty(activitySignWriteoff)) { |
| | | //获取奖品信息 |
| | | ActivitySignAwardSet activitySignAwardSet = activitySignAwardSetDao.selectById(activitySignWriteoff.getAwardId()); |
| | | signWriteoffVo.setJpmc(activitySignAwardSet.getAwardName()); |
| | | signWriteoffVo.setJptp(activitySignAwardSet.getIntroduceImg()); |
| | | signWriteoffVo.setSl(1); |
| | | signWriteoffVo.setDjfs(activitySignAwardSet.getAwardWay()); |
| | | //获取中奖人信息 |
| | | ZjrVo zjrVo = activitySignWriteoffDao.selectUsernameByUserId(activitySignWriteoff.getUserId(),activitySignAwardSet.getId()); |
| | | signWriteoffVo.setZjr(zjrVo.getZjr()); |
| | | signWriteoffVo.setZjsj(zjrVo.getZjsj()); |
| | | signWriteoffVo.setDjsj(activitySignWriteoff.getWriteoffTime()); |
| | | signWriteoffVo.setState(activitySignWriteoff.getState()); |
| | | //获取活动主表信息 |
| | | ShopActivities shopActivities = shopActivitiesDao.selectById(activitySignWriteoff.getActId()); |
| | | signWriteoffVo.setHdmc(shopActivities.getActName()); |
| | | signWriteoffVo.setHdbh(shopActivities.getActCode()); |
| | | //获取收货地址信息 |
| | | int awardWay = activitySignAwardSet.getAwardWay(); |
| | | if(ActivitySignAwardSet.AWARDWAY_TWO == awardWay) { |
| | | ActivitySignWriteoff activitySignWriteoffLogistics = activitySignWriteoffDao.selectById(writeoffId); |
| | | Long receiveId = activitySignWriteoffLogistics.getReceiveId(); |
| | | ActivitySignReceiveRecord activitySignReceiveRecordLogistic = activitySignReceiveRecordDao.selectById(receiveId); |
| | | signWriteoffVo.setConsignee(activitySignReceiveRecordLogistic.getConsignee()); |
| | | signWriteoffVo.setConsigneePhone(activitySignReceiveRecordLogistic.getConsigneePhone()); |
| | | signWriteoffVo.setConsigneeAddress(activitySignReceiveRecordLogistic.getConsigneeAddress()); |
| | | |
| | | //物流跟踪 |
| | | Integer logisticsId = activitySignWriteoffLogistics.getLogisticsId(); |
| | | if(ObjectUtil.isNotEmpty(logisticsId)) { |
| | | List<ShopLogisticsInfo> shopLogisticsInfos = shopLogisticsInfoDao.selectByDelieryId(logisticsId); |
| | | if(CollUtil.isNotEmpty(shopLogisticsInfos)) { |
| | | ArrayList<LogisticsVo> logisticsVos = new ArrayList<>(); |
| | | for(ShopLogisticsInfo shopLogistics : shopLogisticsInfos) { |
| | | LogisticsVo logisticsVo = new LogisticsVo(); |
| | | logisticsVo.setContent(shopLogistics.getDescribe()); |
| | | logisticsVo.setTimestamp(shopLogistics.getLogisticsTime()); |
| | | logisticsVos.add(logisticsVo); |
| | | } |
| | | signWriteoffVo.setActivities(logisticsVos); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | result.putInMap("signWriteoffVo", signWriteoffVo); |
| | | return result; |
| | | } |
| | | |
| | | @Transactional |
| | | public AjaxResult writeoffCodeSubmit(WriteoffCodeSubmitDto writeoffCodeSubmitDto) { |
| | | //设置用户公司ID |
| | | QueryUtil.setQueryLimitCom(writeoffCodeSubmitDto); |
| | | SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); |
| | | Long writeoffId = writeoffCodeSubmitDto.getWriteoffId(); |
| | | String writeOffCode = writeoffCodeSubmitDto.getWriteOffCode(); |
| | | /** |
| | | * 验证核销码是不是匹配 |
| | | * 更新核销记录 |
| | | * 更新领取记录 |
| | | */ |
| | | //验证核销码是不是匹配 |
| | | ActivitySignWriteoff activitySignWriteoff = activitySignWriteoffDao.selectById(writeoffId); |
| | | if(ObjectUtil.isNotEmpty(activitySignWriteoff)) { |
| | | String writeoffCodeReal = activitySignWriteoff.getWriteoffCode(); |
| | | if(!writeoffCodeReal.equals(writeOffCode)) { |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "兑奖码无效"); |
| | | } |
| | | } |
| | | //更新核销记录 |
| | | activitySignWriteoff.setState(ActivitySignWriteoff.STATE_THREE); |
| | | activitySignWriteoff.setWriteoffTime(new Date()); |
| | | activitySignWriteoff.setWriteoffUser(sysUsers.getSuName()); |
| | | activitySignWriteoff.setWriteoffUserid(sysUsers.getSuId()); |
| | | activitySignWriteoffDao.updateById(activitySignWriteoff); |
| | | //更新领取记录 |
| | | ActivitySignReceiveRecord activitySignReceiveRecord = activitySignReceiveRecordDao.selectById(activitySignWriteoff.getReceiveId()); |
| | | activitySignReceiveRecord.setState(ActivitySignReceiveRecord.STATE_DONE); |
| | | activitySignReceiveRecordDao.updateById(activitySignReceiveRecord); |
| | | |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, "核销成功"); |
| | | } |
| | | |
| | | @Transactional |
| | | public AjaxResult logisticsSubmit(LogisticsSubmitDto logisticsSubmitDto) { |
| | | //设置用户公司ID |
| | | QueryUtil.setQueryLimitCom(logisticsSubmitDto); |
| | | SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); |
| | | Long writeoffId = logisticsSubmitDto.getWriteoffId(); |
| | | /** |
| | | * 更新领取记录表的收货信息和状态 |
| | | * 更新核销记录表的状态和物流ID |
| | | */ |
| | | ActivitySignWriteoff activitySignWriteoff = activitySignWriteoffDao.selectById(writeoffId); |
| | | //新增一条物流信息 |
| | | ShopDeliveryInfo shopDeliveryInfo = new ShopDeliveryInfo(); |
| | | Long receiveId = activitySignWriteoff.getReceiveId(); |
| | | SystemDictionary systemDictionary = systemDictionaryDao.selectByCode(logisticsSubmitDto.getKdgs()); |
| | | if (ObjectUtil.isEmpty(systemDictionary)) { |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "没有找到物流公司信息!"); |
| | | } |
| | | shopDeliveryInfo.setUserId(activitySignWriteoff.getUserId()); |
| | | shopDeliveryInfo.setReceiveId(receiveId); |
| | | shopDeliveryInfo.setReceiveAddress(logisticsSubmitDto.getShdz()); |
| | | |
| | | shopDeliveryInfo.setLogisticsCompany(systemDictionary.getName()); |
| | | shopDeliveryInfo.setLogisticsCompanyCode(systemDictionary.getCode()); |
| | | shopDeliveryInfo.setDeliveryWay("物流配送"); |
| | | |
| | | shopDeliveryInfo.setWaybillNo(logisticsSubmitDto.getKddh()); |
| | | shopDeliveryInfo.setUpdateBy(sysUsers.getSuName()); |
| | | shopDeliveryInfo.setCreateBy(sysUsers.getSuName()); |
| | | |
| | | shopDeliveryInfo.setDeliveryTime(new Date()); |
| | | shopDeliveryInfoDao.insert(shopDeliveryInfo); |
| | | // Integer id = shopDeliveryInfo.getId(); |
| | | // if(ObjectUtil.isNotEmpty(id)) { |
| | | // List<ShopLogisticsInfo> shopLogisticsList = new ArrayList<ShopLogisticsInfo>(); |
| | | // AjaxResult result = new AjaxResult(); |
| | | // Map<String, String> logisticsInfo = new HashMap<String, String>(); |
| | | // try { |
| | | // if (shopDeliveryInfo == null) { |
| | | // return new AjaxResult(AjaxResult.STATUS_FAIL, "找不到发货信息"); |
| | | // } |
| | | // if (!StringUtils.isNotBlank(shopDeliveryInfo.getWaybillNo()) || !StringUtils.isNotBlank(shopDeliveryInfo.getLogisticsCompanyCode())) { |
| | | // return new AjaxResult(AjaxResult.STATUS_FAIL, "物流公司信息为空"); |
| | | // } |
| | | // logisticsInfo.put("logisticsCompany", shopDeliveryInfo.getLogisticsCompany()); |
| | | // logisticsInfo.put("waybillNo", shopDeliveryInfo.getWaybillNo()); |
| | | // |
| | | // //如果已经签收直接查数据库 |
| | | // if (AppConstance.LOGISTICS_STATUS_OF_SIGN_FOR.equals(shopDeliveryInfo.getLogisticsStatus())) { |
| | | // |
| | | // List<ShopLogisticsInfo> shopLogisticsInfos = shopLogisticsInfoDao.selectByDelieryId(shopDeliveryInfo.getId()); |
| | | // logisticsInfo.put("logisticsStatus", String.valueOf(AppConstance.LOGISTICS_STATUS_OF_SIGN_FOR)); |
| | | // result.setStatus(AjaxResult.STATUS_SUCCESS); |
| | | // result.setRows(shopLogisticsInfos); |
| | | // result.putInMap("logisticsInfo", logisticsInfo); |
| | | // return result; |
| | | // } |
| | | // Map<String, String> param = new HashMap<String, String>(); |
| | | // param.put("ShipperCode", shopDeliveryInfo.getLogisticsCompanyCode()); |
| | | // param.put("LogisticCode", shopDeliveryInfo.getWaybillNo()); |
| | | // Map<String, String> paramsUrl = getparams(param); |
| | | // LogUtil.info("物流查询参数" + paramsUrl); |
| | | // String logisticsResult = HttpCurlUtil.sendPost(logisticsUrl, paramsUrl); |
| | | // LogUtil.info("查询物流返回信息" + logisticsResult); |
| | | // LogisticsInfoVo logisticsInfoVo = JSON.parseObject(logisticsResult, LogisticsInfoVo.class); |
| | | // if (logisticsInfoVo.isSuccess()) { |
| | | // ShopDeliveryInfo shopDelivery = new ShopDeliveryInfo(); |
| | | // shopDelivery.setLogisticsStatus(Integer.valueOf(logisticsInfoVo.getState())); |
| | | // shopDelivery.setId(shopDeliveryInfo.getId()); |
| | | // logisticsInfo.put("logisticsStatus", logisticsInfoVo.getState()); |
| | | // //更新物流状态 |
| | | // shopDeliveryInfoDao.updateByModel(shopDelivery); |
| | | // if (CollectionUtils.isNotEmpty(logisticsInfoVo.getTraces())) { |
| | | // List<Map<String, String>> mapTraces = logisticsInfoVo.getTraces(); |
| | | // for (int i = 0; i < mapTraces.size(); i++) { |
| | | // ShopLogisticsInfo shopLogisticsInfo = new ShopLogisticsInfo(); |
| | | // shopLogisticsInfo.setCreateBy(AppConstance.SYSTEM_USER); |
| | | // shopLogisticsInfo.setUpdateBy(AppConstance.SYSTEM_USER); |
| | | // shopLogisticsInfo.setLogisticsTime(mapTraces.get(i).get("AcceptTime")); |
| | | // String acceptStation = mapTraces.get(i).get("AcceptStation"); |
| | | // shopLogisticsInfo.setDescribe(acceptStation); |
| | | // shopLogisticsInfo.setDelieryId(shopDeliveryInfo.getId()); |
| | | // if (acceptStation.indexOf(AppConstance.KDN_IS_SIGN) != -1) { |
| | | // shopLogisticsInfo.setState(AppConstance.LOGISTICS_STATUS_OF_SIGN_FOR); |
| | | // } else if (acceptStation.indexOf(AppConstance.KDN_IS_RECEIVE) != -1) { |
| | | // shopLogisticsInfo.setState(AppConstance.LOGISTICS_STATUS_OF_RECEIVE); |
| | | // } else if (acceptStation.indexOf(AppConstance.KDN_IS_ON_WAY) != -1) { |
| | | // shopLogisticsInfo.setState(AppConstance.LOGISTICS_STATUS_OF_ON_WAY); |
| | | // } else if (acceptStation.indexOf(AppConstance.KDN_IS_MISTAKE) != -1) { |
| | | // shopLogisticsInfo.setState(AppConstance.LOGISTICS_STATUS_OF_MISTAKE); |
| | | // } else { |
| | | // shopLogisticsInfo.setState(AppConstance.LOGISTICS_STATUS_OF_NONE); |
| | | // } |
| | | // shopLogisticsList.add(shopLogisticsInfo); |
| | | // } |
| | | // shopLogisticsInfoDao.deleteByDelieryId(shopDeliveryInfo.getId()); |
| | | // if (CollectionUtils.isNotEmpty(shopLogisticsList)) { |
| | | // shopLogisticsInfoDao.batchInsert(shopLogisticsList); |
| | | // } |
| | | // } |
| | | // } else { |
| | | // throw new GlobleException(logisticsInfoVo.getReason()); |
| | | // } |
| | | // |
| | | // } catch (Exception e) { |
| | | // throw new GlobleException("物流信息查询失败"); |
| | | // } |
| | | //更新核销记录 |
| | | activitySignWriteoff.setState(ActivitySignWriteoff.STATE_THREE); |
| | | activitySignWriteoff.setWriteoffTime(new Date()); |
| | | activitySignWriteoff.setWriteoffUser(sysUsers.getSuName()); |
| | | activitySignWriteoff.setWriteoffUserid(sysUsers.getSuId()); |
| | | activitySignWriteoff.setLogisticsId(shopDeliveryInfo.getId()); |
| | | activitySignWriteoffDao.updateById(activitySignWriteoff); |
| | | //更新领取记录 |
| | | ActivitySignReceiveRecord activitySignReceiveRecord = activitySignReceiveRecordDao.selectById(receiveId); |
| | | activitySignReceiveRecord.setState(ActivitySignReceiveRecord.STATE_DONE); |
| | | activitySignReceiveRecord.setConsignee(logisticsSubmitDto.getShr()); |
| | | activitySignReceiveRecord.setConsigneeAddress(logisticsSubmitDto.getShdz()); |
| | | activitySignReceiveRecord.setConsigneePhone(logisticsSubmitDto.getLxdh()); |
| | | activitySignReceiveRecordDao.updateById(activitySignReceiveRecord); |
| | | // } |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, "发货成功"); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class ActivitiesListVo { |
| | | |
| | | /** |
| | | * 活动类型 团购 |
| | | */ |
| | | public static final int ACTIVITIES_TYPE_GROUP = 1; |
| | | |
| | | /** |
| | | * 活动类型 秒杀 |
| | | */ |
| | | public static final int ACTIVITIES_TYPE_SECKILL = 2; |
| | | |
| | | /** |
| | | * 活动类型 沙龙 |
| | | */ |
| | | public static final int ACTIVITIES_TYPE_SALON = 3; |
| | | /** |
| | | * 活动类型 签到 |
| | | */ |
| | | public static final int ACTIVITIES_TYPE_SIGN = 4; |
| | | |
| | | /** |
| | | * 活动状态 开启 |
| | | */ |
| | | public static final int ACTIVITIES_STATUS_OPEN = 1; |
| | | |
| | | /** |
| | | * 活动状态 关闭 |
| | | */ |
| | | public static final int ACTIVITIES_STATUS_CLOSE = 2; |
| | | /** |
| | | * 主键 |
| | | */ |
| | | private Long id; |
| | | |
| | | |
| | | /** |
| | | * 活动名称 |
| | | */ |
| | | @ApiModelProperty(value = "活动名称") |
| | | private String actName; |
| | | /** |
| | | * 活动编码 |
| | | */ |
| | | @ApiModelProperty(value = "活动编码") |
| | | private String actCode; |
| | | |
| | | |
| | | /** |
| | | * 活动类型 |
| | | */ |
| | | @ApiModelProperty(value = "活动类型") |
| | | private Integer actType; |
| | | |
| | | |
| | | /** |
| | | * 开始时间 |
| | | */ |
| | | @ApiModelProperty(value = "开始时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone="GMT+8") |
| | | private Date actBeginTime; |
| | | |
| | | |
| | | /** |
| | | * 结束时间 |
| | | */ |
| | | @ApiModelProperty(value = "结束时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone="GMT+8") |
| | | private Date actEndTime; |
| | | /** |
| | | * 活动状态 |
| | | */ |
| | | @ApiModelProperty(value = "活动状态") |
| | | private Integer actStatus; |
| | | |
| | | //未发布 |
| | | public static final int ACTSTATUS_STATUS_RELEASE = 1; |
| | | //未开始 |
| | | public static final int ACTSTATUS_STATUS_READY = 2; |
| | | //进行中 |
| | | public static final int ACTSTATUS_STATUS_ING = 3; |
| | | //已结束 |
| | | public static final int ACTSTATUS_STATUS_END = 4; |
| | | @ApiModelProperty(value = "创建人") |
| | | private String createBy; |
| | | /** |
| | | * 活动说明 |
| | | */ |
| | | @ApiModelProperty(value = "活动说明") |
| | | private String actRemark; |
| | | |
| | | /** |
| | | * 公司ID |
| | | */ |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.vo; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.matrix.system.activity.entity.ActivitySignAwardSet; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class AddSignAwardSetVo { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value ="活动名称") |
| | | private String actName; |
| | | @ApiModelProperty(value ="活动编码") |
| | | private String actCode; |
| | | @ApiModelProperty(value ="活动开始时间") |
| | | private Date beginTime; |
| | | @ApiModelProperty(value ="活动结束时间") |
| | | private Date endTime; |
| | | |
| | | private SignSetBasicJsonVo signSetBasicJsonDto; |
| | | |
| | | private List<ActivitySignAwardSet> activitySignAwardSets; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.vo; |
| | | |
| | | import java.util.Date; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class CouponVo { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | private Integer id; |
| | | |
| | | |
| | | /** |
| | | * 优惠券名称 |
| | | */ |
| | | @ApiModelProperty(value = "优惠券名称") |
| | | private String cName; |
| | | |
| | | /** |
| | | * 结束时间 |
| | | */ |
| | | @ApiModelProperty(value = "结束时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone="GMT+8") |
| | | private Date endTime; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class GoodsVo { |
| | | |
| | | private Long id; |
| | | /** |
| | | * 产品名称 |
| | | */ |
| | | private String name; |
| | | |
| | | /** |
| | | * 商品分类 组合商品/家居产品/项目/充值卡/综合卡 |
| | | */ |
| | | private String goodType; |
| | | |
| | | /** |
| | | * 产品编码 |
| | | */ |
| | | private String code; |
| | | |
| | | /** |
| | | * 售价/本金 |
| | | */ |
| | | private Double sealPice; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class LogisticsVo { |
| | | |
| | | @ApiModelProperty(value ="内容") |
| | | private String content; |
| | | |
| | | @ApiModelProperty(value ="时间戳") |
| | | @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone="GMT+8") |
| | | private String timestamp; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class SignReceiveListVo { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "用户") |
| | | private String nickName; |
| | | |
| | | @ApiModelProperty(value = "签到时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone="GMT+8") |
| | | private Date reciveTime; |
| | | |
| | | @ApiModelProperty(value = "连续签到天数") |
| | | private Integer cumulativeDay; |
| | | |
| | | @ApiModelProperty(value = "奖励类型") |
| | | private String awardType; |
| | | |
| | | @ApiModelProperty(value = "获得奖励") |
| | | private String awardName; |
| | | |
| | | @ApiModelProperty(value ="奖项规则(1:每日奖励(默认)2:累计签到天数)") |
| | | private int awardRule; |
| | | @ApiModelProperty(value ="是否已领取(1:待领取2:已领取)") |
| | | private int state; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.vo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class SignSetBasicJsonVo { |
| | | |
| | | @ApiModelProperty(value ="标题图片") |
| | | private String imageUrlTitle; |
| | | @ApiModelProperty(value ="头部图片") |
| | | private String imageUrlHead; |
| | | @ApiModelProperty(value ="按钮图片") |
| | | private String imageUrlButton; |
| | | @ApiModelProperty(value ="状态图片") |
| | | private String imageUrlState; |
| | | |
| | | @ApiModelProperty(value ="规则内容") |
| | | private String ruleExplain; |
| | | @ApiModelProperty(value ="字体颜色") |
| | | private String typographyColor; |
| | | @ApiModelProperty(value ="背景颜色") |
| | | private String backgroundColor; |
| | | @ApiModelProperty(value ="字体大小") |
| | | private Integer typographyNum; |
| | | @ApiModelProperty(value ="字体透明度") |
| | | private Integer typographyLight; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class SignWriteoffListVo { |
| | | |
| | | |
| | | private Long id; |
| | | |
| | | /** |
| | | * 核销时间 |
| | | */ |
| | | @ApiModelProperty(value ="核销时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone="GMT+8") |
| | | private Date writeoffTime; |
| | | |
| | | /** |
| | | * 核销员 |
| | | */ |
| | | @ApiModelProperty(value ="核销员") |
| | | private String writeoffUser; |
| | | |
| | | /** |
| | | * 兑奖码 |
| | | */ |
| | | @ApiModelProperty(value ="兑奖码") |
| | | private String writeoffCode; |
| | | |
| | | /** |
| | | * 活动名称 |
| | | */ |
| | | @ApiModelProperty(value ="活动名称") |
| | | private String actName; |
| | | |
| | | /** |
| | | * 奖品名称 |
| | | */ |
| | | @ApiModelProperty(value ="奖品名称") |
| | | private String awardName; |
| | | |
| | | /** |
| | | * 中奖时间 |
| | | */ |
| | | @ApiModelProperty(value ="中奖时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone="GMT+8") |
| | | private Date winTime; |
| | | |
| | | /** |
| | | * 状态 |
| | | */ |
| | | @ApiModelProperty(value ="状态(1:待兑换 2:待发货 3:已兑换)") |
| | | private int state; |
| | | |
| | | /** |
| | | * 兑奖方式 |
| | | */ |
| | | @ApiModelProperty(value ="兑奖方式(1:线下兑换2:物流配送3:客服兑换)") |
| | | private int awardWay; |
| | | |
| | | /** |
| | | * 中奖者 |
| | | */ |
| | | @ApiModelProperty(value ="中奖者") |
| | | private String receiveName; |
| | | |
| | | /** |
| | | * 收货地址 |
| | | */ |
| | | @ApiModelProperty(value ="收货地址") |
| | | private String receiveAddress; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class SignWriteoffVo { |
| | | |
| | | @ApiModelProperty(value ="奖品名称") |
| | | private String jpmc; |
| | | |
| | | @ApiModelProperty(value ="奖品图片") |
| | | private String jptp; |
| | | |
| | | @ApiModelProperty(value ="数量") |
| | | private int sl; |
| | | |
| | | @ApiModelProperty(value ="中奖人") |
| | | private String zjr; |
| | | |
| | | @ApiModelProperty(value ="中奖时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone="GMT+8") |
| | | private Date zjsj; |
| | | |
| | | @ApiModelProperty(value ="活动名称") |
| | | private String hdmc; |
| | | |
| | | @ApiModelProperty(value ="活动编号") |
| | | private String hdbh; |
| | | |
| | | @ApiModelProperty(value ="兑奖方式") |
| | | private int djfs; |
| | | |
| | | @ApiModelProperty(value ="兑奖状态") |
| | | private int state; |
| | | |
| | | @ApiModelProperty(value ="兑奖时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd hh:mm", timezone="GMT+8") |
| | | private Date djsj; |
| | | |
| | | @ApiModelProperty(value ="收货人") |
| | | private String consignee; |
| | | |
| | | @ApiModelProperty(value ="联系电话") |
| | | private String consigneePhone; |
| | | |
| | | @ApiModelProperty(value ="收货地址") |
| | | private String consigneeAddress; |
| | | |
| | | @ApiModelProperty(value ="物流单号") |
| | | private String logisticsNum; |
| | | |
| | | @ApiModelProperty(value ="物流公司") |
| | | private String logisticsCompany; |
| | | |
| | | private List<LogisticsVo> activities; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.activity.vo; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | @Data |
| | | public class ZjrVo { |
| | | |
| | | @ApiModelProperty(value ="中奖人") |
| | | private String zjr; |
| | | |
| | | @ApiModelProperty(value ="中奖时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone="GMT+8") |
| | | private Date zjsj; |
| | | |
| | | } |
| | |
| | | import com.matrix.system.app.dto.UploadPhotoDto; |
| | | import com.matrix.system.app.utils.Sms106Send; |
| | | import com.matrix.system.app.vo.UserInfoVo; |
| | | import com.matrix.system.common.authority.DefaultAuthorityManager; |
| | | import com.matrix.system.common.authority.strategy.AccountPasswordLogin; |
| | | import com.matrix.system.common.authority.strategy.LoginStrategy; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.common.service.SysUsersService; |
| | | import com.matrix.system.common.tools.PasswordUtil; |
| | | import com.matrix.system.common.tools.UploadUtil; |
| | |
| | | |
| | | @Autowired |
| | | private AppAuthorityManager authorityManager; |
| | | |
| | | @Autowired |
| | | private BusParameterSettingsDao busParameterSettingsDao; |
| | | |
| | | @Autowired |
| | | private RedisClient redisClient; |
| | |
| | | public AjaxResult findAppVersion() { |
| | | return AjaxResult.buildSuccessInstance(sysUsersService.findAppVersion()); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | queryUse.setTaocanId(null); |
| | | queryUse.setType(Dictionary.SHOPPING_GOODS_TYPE_TC); |
| | | List<SysProjUse> taoCanList = projUseService.findInPage(queryUse, null); |
| | | // List<SysProjUse> taoCanList = projUseService.findInPage(queryUse, null); |
| | | List<SysProjUse> taoCanList = projUseService.findTaocaoProjUseWithProj(queryUse); |
| | | List<ServiceTcVo> serviceTcVos = SysProjUseMapper.INSTANCE.entityListToTcVoList(taoCanList); |
| | | |
| | | if (CollectionUtils.isNotEmpty(serviceTcVos)) { |
| | | serviceTcVos.forEach(item -> { |
| | | List<SysProjUse> sysProjUses = projUseService.selectTaocanProjUse(item.getId(), queryUse.getStatus()); |
| | | List<ServiceProjVo> taocanProj = SysProjUseMapper.INSTANCE.entityListToProjVoList(sysProjUses); |
| | | // List<SysProjUse> sysProjUses = projUseService.selectTaocanProjUse(item.getId(), queryUse.getStatus()); |
| | | List<ServiceProjVo> taocanProj = SysProjUseMapper.INSTANCE.entityListToProjVoList(item.getTaocanProjUse()); |
| | | item.setTaocanProjUse(null); |
| | | item.setProj(taocanProj); |
| | | }); |
| | | } |
| | |
| | | throw new GlobleException("请选择服务"); |
| | | } |
| | | SysVipInfo vipInfo = sysVipInfoService.findById(serviceOrderDto.getVipId()); |
| | | // if (StringUtils.isBlank(vipInfo.getPassWord())) { |
| | | // return AjaxResult.buildFailInstance("未设置资金密码"); |
| | | // } |
| | | |
| | | |
| | | if (StringUtils.isNotBlank(vipInfo.getPassWord())) { |
| | | if (!vipInfo.getPassWord().equals(serviceOrderDto.getPassword())) { |
New file |
| | |
| | | package com.matrix.system.app.action; |
| | | |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.hive.bean.AppVersion; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiResponse; |
| | | import io.swagger.annotations.ApiResponses; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.CrossOrigin; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * @author jyy |
| | | * @date 2020-12-21 |
| | | **/ |
| | | @CrossOrigin(origins = "*") |
| | | @Api(value = "ApiSettingAction", tags = "配置查询类") |
| | | @RestController |
| | | @RequestMapping(value = "/api/setting") |
| | | public class ApiSettingAction { |
| | | |
| | | |
| | | @Autowired |
| | | private BusParameterSettingsDao busParameterSettingsDao; |
| | | |
| | | |
| | | @ApiOperation(value = "获取app配置", notes = "获取app配置") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "ok", response = AppVersion.class) |
| | | }) |
| | | @GetMapping(value = "/findAppSettings") |
| | | public AjaxResult findAppSettings() { |
| | | SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | AjaxResult result = AjaxResult.buildSuccessInstance("查询成功"); |
| | | result.putInMap(AppConstance.APP_BANNER_GL, busParameterSettingsDao.selectCompanyParamByCode(AppConstance.APP_BANNER_GL,user.getCompanyId())); |
| | | return result; |
| | | } |
| | | |
| | | } |
| | |
| | | return tjVipSumDao.selectProjConsumeCnt(timeSpaceParam, shopId, null); |
| | | case "20" : |
| | | return tjVipSumDao.selectTimeLength(timeSpaceParam, shopId, null); |
| | | case "21" : |
| | | return tjVipSumDao.selectCardAmount(timeSpaceParam, shopId, null); |
| | | case "22" : |
| | | return tjVipSumDao.selectFreeAmount(timeSpaceParam, shopId, null); |
| | | default : |
| | | return tjVipSumDao.selectBusinessInCome(timeSpaceParam, shopId, null); |
| | | } |
| | |
| | | return tjVipSumDao.selectProjConsumeCnt(timeSpaceParam, null, companyId); |
| | | case "20" : |
| | | return tjVipSumDao.selectTimeLength(timeSpaceParam, null, companyId); |
| | | case "21" : |
| | | return tjVipSumDao.selectCardAmount(timeSpaceParam, null, companyId); |
| | | case "22" : |
| | | return tjVipSumDao.selectFreeAmount(timeSpaceParam, null, companyId); |
| | | default : |
| | | return tjVipSumDao.selectBusinessInCome(timeSpaceParam, null, companyId); |
| | | } |
| | |
| | | package com.matrix.system.app.authority; |
| | | |
| | | import cn.hutool.crypto.SecureUtil; |
| | | import cn.hutool.json.JSONArray; |
| | | import cn.hutool.json.JSONObject; |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.matrix.component.redis.RedisClient; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.StringUtils; |
| | |
| | | private static final int DEFAULT_2 = 2; |
| | | |
| | | @Autowired |
| | | RedisClient redisClient; |
| | | |
| | | @Autowired |
| | | SysFunctionService sysFunctionService; |
| | | |
| | | public static final String USER_POWER_REDISKEY_APP = "USER_POWER_APP"; |
| | | |
| | | public static final String USERFUNCTION = "userFunction"; |
| | | /** 用户所有路径权限的记录 **/ |
| | |
| | | List<String> userUrlMapping = new ArrayList<>(); |
| | | |
| | | |
| | | // 获取用户所有权限 |
| | | getUserFunction(user,userFunction, userUrlMapping); |
| | | String redisKey = USER_POWER_REDISKEY_APP + SecureUtil.md5(user.getSuId()+""); |
| | | String cachedValue = redisClient.getCachedValue(redisKey); |
| | | if (StringUtils.isNotBlank(cachedValue)) { |
| | | //从缓存中获取用户权限 |
| | | JSONObject powerMap = JSONUtil.parseObj(cachedValue); |
| | | String userFunctionMapStr = powerMap.get(USERFUNCTION).toString(); |
| | | JSONObject userFunctionMap = JSONUtil.parseObj(userFunctionMapStr); |
| | | Set<String> userFunctionMapKeys = userFunctionMap.keySet(); |
| | | userFunctionMapKeys.forEach(key -> { |
| | | userFunction.put(key, userFunctionMap.get(key, SysFunction.class)); |
| | | }); |
| | | |
| | | String userUrlMappingListStr = powerMap.get(USER_URL_MAPPING).toString(); |
| | | JSONArray userUrlMappingArray = JSONUtil.parseArray(userUrlMappingListStr); |
| | | for (int i = 0; i < userUrlMappingArray.size(); i++) { |
| | | userUrlMapping.add(userUrlMappingArray.get(i, String.class)); |
| | | } |
| | | } else { |
| | | // 获取用户所有权限 |
| | | getUserFunction(user,userFunction, userUrlMapping); |
| | | |
| | | Map<String ,Object> powerMap=new HashMap<>(); |
| | | powerMap.put(USERFUNCTION, userFunction); |
| | | powerMap.put(USER_URL_MAPPING, userUrlMapping); |
| | | redisClient.saveValue(redisKey,JSONUtil.parseObj(powerMap,true)); |
| | | } |
| | | |
| | | |
| | | // TODO 这里的用户权限应该放到redis缓存中,在拦截器中做权限拦截 |
| | |
| | | @ApiModelProperty(value = "卡项业绩") |
| | | private BigDecimal cardAchieve; |
| | | |
| | | @ApiModelProperty(value = "储值卡本金扣款") |
| | | private BigDecimal cardAmount; |
| | | |
| | | @ApiModelProperty(value = "储值卡增金扣款") |
| | | private BigDecimal cardFreeAmount; |
| | | |
| | | @ApiModelProperty(value = "退款") |
| | | private BigDecimal refund; |
| | | |
| | |
| | | public void setTimeLength(BigDecimal timeLength) { |
| | | this.timeLength = timeLength; |
| | | } |
| | | |
| | | public BigDecimal getCardAmount() { |
| | | return cardAmount; |
| | | } |
| | | |
| | | public void setCardAmount(BigDecimal cardAmount) { |
| | | this.cardAmount = cardAmount; |
| | | } |
| | | |
| | | public BigDecimal getCardFreeAmount() { |
| | | return cardFreeAmount; |
| | | } |
| | | |
| | | public void setCardFreeAmount(BigDecimal cardFreeAmount) { |
| | | this.cardFreeAmount = cardFreeAmount; |
| | | } |
| | | } |
New file |
| | |
| | | package com.matrix.system.app.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * jyy |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "ParameterSettingVo", description = "配置返回参数类") |
| | | public class ParameterSettingVo { |
| | | |
| | | @ApiModelProperty(value = "参数编码ID") |
| | | private Long paramId; |
| | | |
| | | |
| | | @ApiModelProperty(value = "参数编码") |
| | | private String paramCode; |
| | | |
| | | |
| | | |
| | | @ApiModelProperty(value = "参数值") |
| | | private String paramValue; |
| | | |
| | | |
| | | @ApiModelProperty(value = "值1") |
| | | private String paramValue1; |
| | | |
| | | |
| | | @ApiModelProperty(value = "值2") |
| | | private String paramValue2; |
| | | |
| | | |
| | | @ApiModelProperty(value = "值3") |
| | | private String paramValue3; |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.matrix.core.tools.DateUtil; |
| | | import com.matrix.system.hive.bean.SysProjUse; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | |
| | | @ApiModelProperty(value = "快过期 1-是 2-否") |
| | | private String isInvalid; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private List<SysProjUse> taocanProjUse; |
| | | |
| | | public List<SysProjUse> getTaocanProjUse() { |
| | | return taocanProjUse; |
| | | } |
| | | |
| | | public void setTaocanProjUse(List<SysProjUse> taocanProjUse) { |
| | | this.taocanProjUse = taocanProjUse; |
| | | } |
| | | |
| | | public String getIsInvalid() { |
| | | Date date = DateUtil.getDateAfterMonth(new Date(), 1); |
| | | if (invalidTime != null) { |
| | |
| | | import com.matrix.system.common.service.SysUsersService; |
| | | import com.matrix.system.common.tools.PasswordUtil; |
| | | import com.matrix.system.common.tools.ResponseHeadUtil; |
| | | import com.matrix.system.constance.SystemConstance; |
| | | import com.matrix.system.hive.action.util.QueryUtil; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | |
| | | import java.net.URLEncoder; |
| | | import java.security.NoSuchAlgorithmException; |
| | | import java.util.ArrayList; |
| | | import java.util.LinkedList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | import static com.matrix.system.common.constance.AppConstance.SAFEPATH; |
| | | |
| | | /** |
| | | * @author 姜ø友瑶 |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询历史搜索人数 |
| | | * |
| | | * @return |
| | | * @author luoyuanhong |
| | | */ |
| | | @SuppressWarnings("unchecked") |
| | | @RequestMapping(value = "/showHistoryUser") |
| | | public @ResponseBody |
| | | AjaxResult showHistoryUser() { |
| | | if (WebUtil.getSession().getAttribute(SystemConstance.HISTORY_CUSTOMER) != null) { |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, |
| | | (LinkedList<SysVipInfo>) WebUtil.getSession().getAttribute(SystemConstance.HISTORY_CUSTOMER), 0); |
| | | } else { |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, null, 0); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | |
| | | import com.matrix.system.common.authority.DefaultAuthorityManager; |
| | | import com.matrix.system.common.authority.strategy.AccountPasswordLogin; |
| | | import com.matrix.system.common.authority.strategy.LoginStrategy; |
| | | import com.matrix.system.common.authority.strategy.ScanQrCodeLogin; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.common.dao.ProjExceptionDao; |
| | | import com.matrix.system.common.dto.WebLoginDto; |
| | | import com.matrix.system.common.service.SysUsersService; |
| | | import com.matrix.system.hive.dao.SysShopInfoDao; |
| | | import com.matrix.system.hive.statistics.StatisticsBusinessDataJob; |
| | |
| | | * |
| | | * 登录验证 |
| | | * @author:姜友瑶 |
| | | * @param user |
| | | * @return 返回类型 AjaxResult |
| | | * @date 2016年8月30日 |
| | | */ |
| | | @RequestMapping(value = "/dologin") |
| | | public @ResponseBody AjaxResult dologin(SysUsers user) { |
| | | long sqlStart = System.currentTimeMillis(); |
| | | decryptAccountAndPassword(user); |
| | | LoginStrategy apLogin = new AccountPasswordLogin(user, sysUsersService); |
| | | public @ResponseBody AjaxResult dologin(WebLoginDto webLoginDto) { |
| | | |
| | | user = authorityManager.login(apLogin); |
| | | long sqlStart = System.currentTimeMillis(); |
| | | SysUsers user=null; |
| | | if(WebLoginDto.ACCOUNT_LOGIN.equals(webLoginDto.getLoginType())){ |
| | | user= decryptAccountAndPassword(webLoginDto); |
| | | LoginStrategy apLogin = new AccountPasswordLogin(user, sysUsersService); |
| | | user = authorityManager.login(apLogin); |
| | | }else { |
| | | ScanQrCodeLogin apLogin = new ScanQrCodeLogin( sysUsersService,webLoginDto.getLoginQrCodeKey()); |
| | | user = authorityManager.login(apLogin); |
| | | } |
| | | |
| | | |
| | | if(user.getShopId()!=null){ |
| | |
| | | * @author JIANGYOUYAO |
| | | * @email 935090232@qq.com |
| | | * @date 2017年12月11日 |
| | | * @param user |
| | | */ |
| | | private void decryptAccountAndPassword(SysUsers user) { |
| | | private SysUsers decryptAccountAndPassword(WebLoginDto webLoginDto) { |
| | | |
| | | String privateKey = WebUtil.getSessionAttribute(MatrixConstance.PRIVATE_KEY); |
| | | if (StringUtils.isBlank(privateKey)) { |
| | | throw new GlobleException(SystemErrorCode.REQUEST_INVALID); |
| | | } |
| | | |
| | | SysUsers user=new SysUsers(); |
| | | try { |
| | | // 账号解密 |
| | | byte[] acccountData = RSAUtils.decryptByPrivateKey(user.getSuAccount(), privateKey); |
| | | byte[] acccountData = RSAUtils.decryptByPrivateKey(webLoginDto.getSuAccount(), privateKey); |
| | | user.setSuAccount(new String(acccountData)); |
| | | // 密码解密 |
| | | byte[] passWordData = RSAUtils.decryptByPrivateKey(user.getSuPassword(), privateKey); |
| | | byte[] passWordData = RSAUtils.decryptByPrivateKey(webLoginDto.getSuPassword(), privateKey); |
| | | user.setSuPassword(new String(passWordData)); |
| | | |
| | | } catch (Exception e) { |
| | | LogUtil.error("用户账号密码解密失败", e); |
| | | throw new GlobleException(SystemErrorCode.LOGIN_FAIL); |
| | | } |
| | | |
| | | return user; |
| | | } |
| | | |
| | | |
| | |
| | | return "admin/hive/mobile/mobileLogin"; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 移动端登录 |
| | | * @param user |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/doHiveMobilelogin") |
| | | public @ResponseBody AjaxResult doHiveMobilelogin(SysUsers user) { |
| | | long sqlStart = System.currentTimeMillis(); |
| | | decryptAccountAndPassword(user); |
| | | LoginStrategy apLogin = new AccountPasswordLogin(user, sysUsersService); |
| | | user = authorityManager.login(apLogin); |
| | | // 获取该账户的岗位信息,并判断是否为店长 |
| | | if(user.getShopId()!=null){ |
| | | user.setShopName(sysShopInfoDao.selectById(user.getShopId()).getShopName()); |
| | | } |
| | | |
| | | AjaxResult result = new AjaxResult(); |
| | | authorityManager.initUserPower(result); |
| | | result.setStatus(AjaxResult.STATUS_SUCCESS); |
| | | LogUtil.info("#用户登录成功 账号={}#", user.getSuAccount()); |
| | | switch (user.getSuUserType()) { |
| | | // 企业管理员 |
| | | case AppConstance.USER_TYPE_ADMIN: |
| | | result.setPage(HIVE_MOBILE_REDIRECT_INDEX); |
| | | break; |
| | | // 企业用户 |
| | | case AppConstance.USER_TYPE_EMPLOYEE: |
| | | result.setPage(HIVE_MOBILE_REDIRECT_INDEX); |
| | | break; |
| | | default:// 不能识别的用户 |
| | | result.setPage("common/redirect/404"); |
| | | } |
| | | long endStart = System.currentTimeMillis(); |
| | | LogUtil.info("本次登录耗时#{}毫秒", (endStart-sqlStart)+""); |
| | | return result; |
| | | } |
| | | |
| | | @GetMapping(value = "/hiveMobileLoginOut") |
New file |
| | |
| | | package com.matrix.system.common.actions; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.core.tools.UUIDUtil; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import org.apache.commons.fileupload.FileUploadException; |
| | | import org.apache.log4j.Logger; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.util.FileCopyUtils; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import org.springframework.web.multipart.MultipartHttpServletRequest; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.Map; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | |
| | | /** |
| | | * 多文件上传控制器 |
| | | * |
| | | * @author jiangyouyao |
| | | * @email 512061637@qq.com |
| | | * @date 2019年2月25日 |
| | | */ |
| | | @Controller |
| | | @RequestMapping(value = "admin/multipleUploadFile") |
| | | public class MultipleFileUploadAction { |
| | | Logger log = Logger.getLogger(MultipleFileUploadAction.class); |
| | | |
| | | @Value("${file_storage_path}") |
| | | private String fileStoragePath; |
| | | @Value("${static_resource_url}") |
| | | private String nginxUrl; |
| | | |
| | | /** |
| | | * 最大值 |
| | | */ |
| | | private Long maxSize = 1024*1024*100L; |
| | | |
| | | /** |
| | | * 多文件上传方法 |
| | | * |
| | | * @author jiangyouyao |
| | | * @email 512061637@qq.com |
| | | * @date 2019年2月25日 |
| | | * @param response |
| | | * @param request |
| | | * @return |
| | | * @throws IOException |
| | | * @throws FileUploadException |
| | | */ |
| | | @RequestMapping(value = "/doUpload") |
| | | public @ResponseBody JSONObject doFileUpload(HttpServletResponse response, MultipartHttpServletRequest request, Integer data) |
| | | throws IOException, FileUploadException { |
| | | // 文件保存目录路径 |
| | | String savePath = fileStoragePath; |
| | | // 文件保存目录URL |
| | | String saveUrl = nginxUrl; |
| | | // String msgPag = "common/fileUploadResult"; |
| | | JSONObject object = new JSONObject(); |
| | | response.setContentType("text/html; charset=UTF-8"); |
| | | request.setCharacterEncoding("UTF-8"); |
| | | |
| | | // 保存和访问路径检查 |
| | | if (StringUtils.isBlank(saveUrl) || StringUtils.isBlank(savePath)) { |
| | | object.put("status", "err"); |
| | | object.put("msg", "文件上传失败错误代码:001"); |
| | | return object; |
| | | } |
| | | // 检查目录 |
| | | File uploadDir = new File(savePath); |
| | | if (!uploadDir.isDirectory()) { |
| | | uploadDir.mkdir(); |
| | | } |
| | | // 检查目录写权限 |
| | | // if (!uploadDir.canWrite()) { |
| | | // object.put("status", "err"); |
| | | // object.put("msg", "上传目录没有写权限"); |
| | | // return object; |
| | | // } |
| | | |
| | | Map<String, MultipartFile> fileMaps = request.getFileMap(); |
| | | for (String key : fileMaps.keySet()) { |
| | | MultipartFile file = fileMaps.get(key); |
| | | |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); |
| | | String ymd = sdf.format(new Date()); |
| | | savePath += ymd + "/"; |
| | | saveUrl += ymd + "/"; |
| | | File dirFile = new File(savePath); |
| | | if (!dirFile.exists()) { |
| | | dirFile.mkdirs(); |
| | | } |
| | | log.info("上传文件名:" + file.getOriginalFilename()); |
| | | log.info("上传文件大小:" + file.getBytes().length); |
| | | log.info("上传文件大小限制:" + maxSize); |
| | | log.info("上传文件大小是否超过限制:" + (file.getBytes().length > maxSize)); |
| | | if (file.getBytes().length > maxSize) { |
| | | object.put("status", "err"); |
| | | object.put("msg", "上传文件大小超过限制"); |
| | | return object; |
| | | } |
| | | String fileName = file.getOriginalFilename(); |
| | | String fileExt = fileName.substring(fileName.lastIndexOf(".") + 1).toLowerCase(); |
| | | |
| | | fileName = fileName.replace("." + fileExt, ""); |
| | | fileName = getSensitive(fileName); |
| | | String newFileName = UUIDUtil.getRandomID() + UUIDUtil.getRandomID() + "." + fileExt; |
| | | File uploadedFile = new File(savePath, newFileName); |
| | | try { |
| | | FileCopyUtils.copy(file.getBytes(), uploadedFile); |
| | | } catch (Exception e) { |
| | | object.put("status", "err"); |
| | | object.put("msg", "上传文件失败 "+e.getMessage()); |
| | | return object; |
| | | } |
| | | log.info("saveUrl:" + saveUrl); |
| | | String visitPath = saveUrl + newFileName; |
| | | log.info("上传一个文件:" + newFileName); |
| | | log.info("访问路径:" + visitPath); |
| | | // 获取回调函数 |
| | | /* |
| | | * String callBack = request.getParameter("callBack"); String inputId = |
| | | * request.getParameter("inputId"); request.setAttribute("status", "200"); |
| | | * request.setAttribute("callBack", callBack); request.setAttribute("inputId", |
| | | * inputId); request.setAttribute("url", visitPath); |
| | | */ |
| | | object.put("path", visitPath); |
| | | object.put("fileName", fileName); |
| | | object.put("status", 200); |
| | | if (data != null) { |
| | | object.put("index", data); |
| | | } |
| | | } |
| | | return object; |
| | | } |
| | | |
| | | /** |
| | | * 检查文件名,过滤特殊字符 |
| | | * |
| | | * @author jiangyouyao |
| | | * @email 512061637@qq.com |
| | | * @date 2019年2月25日 |
| | | * @param globWords |
| | | * @return |
| | | */ |
| | | public String getSensitive(String globWords) { |
| | | |
| | | String sensitive = ""; |
| | | Pattern pattern = Pattern.compile(AppConstance.SPECIAL_CHARACTERS); |
| | | Matcher matcher = pattern.matcher(globWords); |
| | | while (matcher.find()) { |
| | | sensitive += matcher.group(); |
| | | } |
| | | /* |
| | | * if(sensitive=="" || sensitive.length()<3 ){ |
| | | * sensitive=StringUtils.getRandomString(8); } |
| | | */ |
| | | return sensitive; |
| | | } |
| | | } |
| | |
| | | package com.matrix.system.common.actions; |
| | | |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.pojo.PaginationVO; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.common.bean.ProjException; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.common.dao.ProjExceptionDao; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author 姜友瑶 |
| | |
| | | ProjExceptionDao projExceptionDao; |
| | | |
| | | @RequestMapping(value = "/showException") |
| | | public @ResponseBody |
| | | AjaxResult showException(Long id) { |
| | | public |
| | | ModelAndView showException(Long id) { |
| | | ProjException projException = projExceptionDao.selectById(id); |
| | | return AjaxResult.buildSuccessInstance(Arrays.asList(projException)); |
| | | ModelAndView mv = new ModelAndView("common/showprojException"); |
| | | mv.addObject("obj", projException); |
| | | return mv; |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @RequestMapping(value = "/projException/del") |
| | | public @ResponseBody |
| | | AjaxResult del(@RequestBody ProjException projException) { |
| | |
| | | package com.matrix.system.common.actions; |
| | | |
| | | import com.matrix.component.redis.RedisClient; |
| | | import com.matrix.core.anotations.RemoveRequestToken; |
| | | import com.matrix.core.anotations.SaveRequestToken; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.core.web.BaseAction; |
| | | import com.matrix.system.common.authority.DefaultAuthorityManager; |
| | | import com.matrix.system.common.bean.SysFnBtnRel; |
| | | import com.matrix.system.common.bean.SysFunction; |
| | | import com.matrix.system.common.bean.SysRole; |
| | |
| | | import com.matrix.system.common.constance.AppVocabularyCode; |
| | | import com.matrix.system.common.service.SysFunctionService; |
| | | import com.matrix.system.common.service.SysRoleService; |
| | | import com.matrix.system.constance.Dictionary; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | private SysFunctionService sysFunctionService; |
| | | |
| | | public static final String BEV = "SYSROLE_BEV"; |
| | | |
| | | @Autowired |
| | | RedisClient redisClient; |
| | | /** |
| | | * 列表显示 |
| | | * |
| | |
| | | } |
| | | AjaxResult result = modify(sysRoleService, WebUtil.getSessionAttribute(BEV), sysRole, AppVocabularyCode.ROLE); |
| | | WebUtil.removeSessionAttribute(BEV); |
| | | redisClient.batchDel(DefaultAuthorityManager.USER_POWER_REDISKEY); |
| | | return result; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 进入修改界面 |
| | | * |
New file |
| | |
| | | package com.matrix.system.common.actions; |
| | | |
| | | import com.matrix.component.wechat.externalInterface.weixinUtil.WeixinServiceUtil; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.web.BaseAction; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | /** |
| | | * 测试一下 |
| | | */ |
| | | @RequestMapping(value = "/testb") |
| | | @Controller |
| | | public class TestActionBB extends BaseAction { |
| | | |
| | | @Autowired |
| | | WeixinServiceUtil weixinServiceUtil; |
| | | |
| | | |
| | | @GetMapping(value = "/testPay/{no}") |
| | | @ResponseBody |
| | | public AjaxResult hiveMobileLoginOut(@PathVariable String no) { |
| | | weixinServiceUtil.comPay("提现", no,1,"oJkRK4yelehsY4S7I6Ee1ydWtQMI",36L); |
| | | return AjaxResult.buildSuccessInstance(""); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | package com.matrix.system.common.authority; |
| | | |
| | | import cn.hutool.crypto.SecureUtil; |
| | | import cn.hutool.json.JSONArray; |
| | | import cn.hutool.json.JSONObject; |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.matrix.component.redis.RedisClient; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.common.authority.strategy.LoginStrategy; |
| | |
| | | |
| | | import java.util.*; |
| | | import java.util.Map.Entry; |
| | | import java.util.logging.Logger; |
| | | |
| | | /** |
| | | * DefaultAuthorityManager 实现了权限控制接口 |
| | |
| | | |
| | | private static final int DEFAULT_2 = 2; |
| | | |
| | | public static final String USER_POWER_REDISKEY = "USER_POWER_"; |
| | | public static final String USER_POWER_REDISKEY_PC = "USER_POWER_PC"; |
| | | |
| | | @Autowired |
| | | SysFunctionService sysFunctionService; |
| | | |
| | | public static final String USERFUNCTION = "userFunction"; |
| | | public static final String MENUSFUNCTION = "menusFunction"; |
| | | /** 用户所有路径权限的记录 **/ |
| | | /** |
| | | * 用户所有路径权限的记录 |
| | | **/ |
| | | public static final String USER_URL_MAPPING = "userUrlMapping"; |
| | | |
| | | @Autowired |
| | | RedisClient redisClient; |
| | | |
| | | private DefaultAuthorityManager() { |
| | | } |
| | |
| | | |
| | | /** |
| | | * 判断用户是否具有功能权限 |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | |
| | | /** |
| | | * 初始化用户权限 |
| | | * |
| | | * @param result |
| | | * @author JIANGYOUYAO |
| | | * @email 935090232@qq.com |
| | | * @date 2017年12月5日 |
| | | * @param result |
| | | */ |
| | | public void initUserPower(AjaxResult result) { |
| | | |
| | |
| | | // 用户的所有功能权限用id记录,方便后面查询菜单树形结构 |
| | | Map<String, SysFunction> menuFunctionMap = new TreeMap<>(); |
| | | |
| | | // 获取用户所有权限 |
| | | getUserFunction(userFunction, menuFunctionMap, userUrlMapping); |
| | | SysUsers sysUser = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | |
| | | // 组装菜单 |
| | | assembleMenu(menuFunction, menuFunctionMap); |
| | | String redisKey = USER_POWER_REDISKEY_PC + SecureUtil.md5(sysUser.getSuId()+""); |
| | | String cachedValue = redisClient.getCachedValue(redisKey); |
| | | if (StringUtils.isNotBlank(cachedValue)) { |
| | | //从缓存中获取用户权限 |
| | | JSONObject powerMap = JSONUtil.parseObj(cachedValue); |
| | | String userFunctionMapStr = powerMap.get(USERFUNCTION).toString(); |
| | | JSONObject userFunctionMap = JSONUtil.parseObj(userFunctionMapStr); |
| | | Set<String> userFunctionMapKeys = userFunctionMap.keySet(); |
| | | userFunctionMapKeys.forEach(key -> { |
| | | userFunction.put(key, userFunctionMap.get(key, SysFunction.class)); |
| | | }); |
| | | String menusFunctionListStr = powerMap.get(MENUSFUNCTION).toString(); |
| | | JSONArray menusFunctionArray = JSONUtil.parseArray(menusFunctionListStr); |
| | | for (int i = 0; i < menusFunctionArray.size(); i++) { |
| | | menuFunction.add(menusFunctionArray.get(i, SysFunction.class)); |
| | | } |
| | | String userUrlMappingListStr = powerMap.get(USER_URL_MAPPING).toString(); |
| | | JSONArray userUrlMappingArray = JSONUtil.parseArray(userUrlMappingListStr); |
| | | for (int i = 0; i < userUrlMappingArray.size(); i++) { |
| | | userUrlMapping.add(userUrlMappingArray.get(i, String.class)); |
| | | } |
| | | } else { |
| | | // 获取用户所有权限 |
| | | getUserFunction(userFunction, menuFunctionMap, userUrlMapping); |
| | | |
| | | // 组装菜单 |
| | | assembleMenu(menuFunction, menuFunctionMap); |
| | | |
| | | Map<String ,Object> powerMap=new HashMap<>(); |
| | | powerMap.put(USERFUNCTION, userFunction); |
| | | powerMap.put(MENUSFUNCTION, menuFunction); |
| | | powerMap.put(USER_URL_MAPPING, userUrlMapping); |
| | | redisClient.saveValue(redisKey,JSONUtil.parseObj(powerMap,true)); |
| | | } |
| | | |
| | | |
| | | // 把用户菜单和用户的功能都存在session中。 |
| | | WebUtil.setSessionAttribute(USERFUNCTION, userFunction); |
| | |
| | | /** |
| | | * 获取用的功能,包括菜单功能和非菜单功能 |
| | | * |
| | | * @author JIANGYOUYAO |
| | | * @email 935090232@qq.com |
| | | * @date 2017年12月5日 |
| | | * @param userFunctionMap |
| | | * @param menuFunctionMap |
| | | * @param userUrlMapping |
| | | * @author JIANGYOUYAO |
| | | * @email 935090232@qq.com |
| | | * @date 2017年12月5日 |
| | | */ |
| | | private void getUserFunction(Map<String, SysFunction> userFunctionMap, Map<String, SysFunction> menuFunctionMap, |
| | | List<String> userUrlMapping) { |
| | |
| | | |
| | | userFunctionMap.put(sysFunction.getFnCode(), sysFunction); |
| | | // 注册访问路径 |
| | | registerUrlMapping(userUrlMapping, sysFunction,true); |
| | | registerUrlMapping(userUrlMapping, sysFunction, true); |
| | | |
| | | // 如果是菜单功能单独记录 |
| | | if (AppConstance.IS_Y.equals(sysFunction.getFnShowMenu())) { |
| | |
| | | List<SysFunction> userFunctionList = sysFunctionService.findFunctionByRoleIds(sysUser.getRoleIds()); |
| | | for (SysFunction sysFunction : userFunctionList) { |
| | | // TODO注册访问路径 |
| | | registerUrlMapping(userUrlMapping, sysFunction,false); |
| | | registerUrlMapping(userUrlMapping, sysFunction, false); |
| | | |
| | | |
| | | if (userFunctionMap.containsKey(sysFunction.getFnCode())) { |
| | |
| | | /** |
| | | * 注册功能和按钮的访问路径 |
| | | * |
| | | * @param userUrlMapping |
| | | * @param sysFunction |
| | | * @author JIANGYOUYAO |
| | | * @email 935090232@qq.com |
| | | * @date 2017年12月8日 |
| | | * @param userUrlMapping |
| | | * @param sysFunction |
| | | */ |
| | | private void registerUrlMapping(List<String> userUrlMapping, SysFunction sysFunction, boolean isAdmin) { |
| | | String path = sysFunction.getFnPath(); |
| | |
| | | if (CollectionUtils.isNotEmpty(btnRels)) { |
| | | for (SysFnBtnRel sysFnBtnRel : btnRels) { |
| | | //公司管理员可以添加所有按钮权限否则只能添加员工自己所有拥有的权限 |
| | | if(isAdmin ||StringUtils.isContentSet(sysFnBtnRel.getBtnValue(),sysFunction.getRpfBns())){ |
| | | if (isAdmin || StringUtils.isContentSet(sysFnBtnRel.getBtnValue(), sysFunction.getRpfBns())) { |
| | | String btnPath = sysFnBtnRel.getFbPath(); |
| | | if (StringUtils.isNotBlank(btnPath) && !userUrlMapping.contains(btnPath)) { |
| | | userUrlMapping.add(btnPath); |
| | |
| | | /** |
| | | * 把菜单组装成树形结构 |
| | | * |
| | | * @param menuFunction |
| | | * @param menuFunctionMap |
| | | * @author JIANGYOUYAO |
| | | * @email 935090232@qq.com |
| | | * @date 2017年12月5日 |
| | | * @param menuFunction |
| | | * @param menuFunctionMap |
| | | */ |
| | | private void assembleMenu(List<SysFunction> menuFunction, Map<String, SysFunction> menuFunctionMap) { |
| | | // 将map.entrySet()转换成list,并按照功能的FnSequence倒序 |
| | |
| | | } else { |
| | | // 非一级节点找到父节点后存入 |
| | | SysFunction parentFn = menuFunctionMap.get(String.valueOf(function.getFnParentId())); |
| | | if(parentFn!=null){ |
| | | if (parentFn != null) { |
| | | List<SysFunction> childs = parentFn.getChilds(); |
| | | if (childs == null) { |
| | | parentFn.setChilds(new ArrayList<SysFunction>()); |
New file |
| | |
| | | package com.matrix.system.common.authority.strategy; |
| | | |
| | | import com.matrix.component.websoket.WebSoketScanQrCodeLoginObserver; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.common.bean.SysUserLoginRecord; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.common.constance.AppMessageCode; |
| | | import com.matrix.system.common.service.SysUsersService; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 账号密码登录策略 |
| | | * |
| | | * @author JIANGYOUYAO |
| | | * @email 935090232@qq.com |
| | | * @date 2017年12月9日 |
| | | */ |
| | | public class ScanQrCodeLogin implements LoginStrategy { |
| | | |
| | | private SysUsersService sysUsersService; |
| | | |
| | | |
| | | private String loginQrCodeKey; |
| | | |
| | | public ScanQrCodeLogin(SysUsersService sysUsersService, String loginQrCodeKey) { |
| | | |
| | | this.sysUsersService = sysUsersService; |
| | | this.loginQrCodeKey = loginQrCodeKey; |
| | | } |
| | | |
| | | @Override |
| | | public Object login() { |
| | | |
| | | Long loginUserId = WebSoketScanQrCodeLoginObserver.getScanCashValue(loginQrCodeKey); |
| | | |
| | | if (loginUserId != null) { |
| | | SysUsers loginUser = sysUsersService.findById(loginUserId); |
| | | if (loginUser != null) { |
| | | addErrorLoginRecord(loginUser,AppConstance.LOGIN_SUCCESS); |
| | | return loginUser; |
| | | } else { |
| | | LogUtil.error("登录失败"); |
| | | throw new GlobleException(AppMessageCode.User.ACCOUNT_NOT_EXIST); |
| | | } |
| | | } |
| | | |
| | | LogUtil.error("登录失败"); |
| | | throw new GlobleException(AppMessageCode.User.ACCOUNT_NOT_EXIST); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加登录记录 |
| | | * |
| | | * @param loginUser |
| | | * @param loginResult |
| | | * @author JIANGYOUYAO |
| | | * @email 935090232@qq.com |
| | | * @date 2017年12月12日 |
| | | */ |
| | | private void addErrorLoginRecord(SysUsers loginUser, int loginResult) { |
| | | |
| | | if (AppConstance.LOGIN_SUCCESS.equals(loginResult)) { |
| | | sysUsersService.cleanUserTodayErrorLoginTime(loginUser.getSuAccount()); |
| | | } |
| | | SysUserLoginRecord loginRecord = new SysUserLoginRecord(); |
| | | loginRecord.setCreateBy(MatrixConstance.SYSTEM_USER); |
| | | loginRecord.setUpdateBy(MatrixConstance.SYSTEM_USER); |
| | | loginRecord.setLrLoginTime(new Date()); |
| | | loginRecord.setLrId(null); |
| | | loginRecord.setUserAccount(loginUser.getSuAccount()); |
| | | loginRecord.setLrResult(loginResult); |
| | | loginRecord.setLrIp(WebUtil.getCustomerIp()); |
| | | loginRecord.setLrValid(AppConstance.RECORD_VALID); |
| | | sysUsersService.addUserLoginRecord(loginRecord); |
| | | } |
| | | } |
| | |
| | | package com.matrix.system.common.bean; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.matrix.core.anotations.Extend; |
| | | import com.matrix.core.pojo.EntityDTO; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 功能按钮关系表 |
| | |
| | | * @email 935090232@qq.com |
| | | * @date 2017年12月3日 |
| | | */ |
| | | public class SysFnBtnRel extends EntityDTO { |
| | | public class SysFnBtnRel { |
| | | |
| | | @Extend |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | |
| | | private String createBy; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone="GMT+8") |
| | | private Date createTime; |
| | | |
| | | private String updateBy; |
| | | |
| | | private Date updateTime; |
| | | |
| | | |
| | | /** 主键:这个关系表物理主键在修改比较中不参与比较 **/ |
| | | @Extend |
| | | private Long fbId; |
| | |
| | | public void setBtnKey(String btnKey) { |
| | | this.btnKey = btnKey; |
| | | } |
| | | |
| | | public String getCreateBy() { |
| | | return createBy; |
| | | } |
| | | |
| | | public void setCreateBy(String createBy) { |
| | | this.createBy = createBy; |
| | | } |
| | | |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public String getUpdateBy() { |
| | | return updateBy; |
| | | } |
| | | |
| | | public void setUpdateBy(String updateBy) { |
| | | this.updateBy = updateBy; |
| | | } |
| | | |
| | | public Date getUpdateTime() { |
| | | return updateTime; |
| | | } |
| | | |
| | | public void setUpdateTime(Date updateTime) { |
| | | this.updateTime = updateTime; |
| | | } |
| | | } |
| | |
| | | package com.matrix.system.common.bean; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.matrix.core.anotations.Extend; |
| | | import com.matrix.core.pojo.EntityDTO; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | * @email 935090232@qq.com |
| | | * @date 2017年12月3日 |
| | | */ |
| | | public class SysFunction extends EntityDTO { |
| | | public class SysFunction { |
| | | |
| | | @Extend |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | private String createBy; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone="GMT+8") |
| | | private Date createTime; |
| | | |
| | | private String updateBy; |
| | | |
| | | private Date updateTime; |
| | | |
| | | private Long fnId; |
| | | |
| | |
| | | this.fnCode = fnCode; |
| | | } |
| | | |
| | | public String getCreateBy() { |
| | | return createBy; |
| | | } |
| | | |
| | | public void setCreateBy(String createBy) { |
| | | this.createBy = createBy; |
| | | } |
| | | |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public String getUpdateBy() { |
| | | return updateBy; |
| | | } |
| | | |
| | | public void setUpdateBy(String updateBy) { |
| | | this.updateBy = updateBy; |
| | | } |
| | | |
| | | public Date getUpdateTime() { |
| | | return updateTime; |
| | | } |
| | | |
| | | public void setUpdateTime(Date updateTime) { |
| | | this.updateTime = updateTime; |
| | | } |
| | | |
| | | public boolean isHasThisFn() { |
| | | return hasThisFn; |
| | | } |
| | | } |
| | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 有效*/ |
| | | @Extend |
| | | public static final String VALID_Y="Y"; |
| | | |
| | | /** 无效*/ |
| | | @Extend |
| | | public static final String VALID_N="N"; |
| | | |
| | | private Long suId; |
| | |
| | | public static final String WX_ORDER_FLAG = "微商城同步订单"; |
| | | public static final String ZONGDIAN = "总店"; |
| | | |
| | | |
| | | |
| | | private AppConstance() { |
| | | } |
| | | |
| | |
| | | */ |
| | | public static final String WECHARPAY_NOTIFYURL = "wecharPaynotifyUrl"; |
| | | /** |
| | | * 充值支付通知地址 |
| | | */ |
| | | public static final String WECHARPAY_RECHARGE_NOTIFYURL = "wecharpayRechargeNotifyurl"; |
| | | |
| | | |
| | | /** |
| | | * 支付证书地址 |
| | | */ |
| | | public static final String WECHARPAY_CERTLOCAL_PATH = "certLocalPath"; |
| | | |
| | | /** |
| | | * APP管理模块Banner |
| | | */ |
| | | public static final String APP_BANNER_GL = "APP_BANNER_GL"; |
| | | |
| | | |
| | | /** |
| | | * 是否管理产品库存 |
| | | */ |
| | | public static final String WAREHOUSE_MANAGE_STOCK = "WAREHOUSE_MANAGE_STOCK"; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 家居产品销售是否生成消耗业绩 |
| | | */ |
| | | public static final String SHOP_MANAGE_JJCPAS_CONSUME = "shopManageJjcpasConsume"; |
| | | |
| | | |
| | | |
| | |
| | | package com.matrix.system.common.dao; |
| | | |
| | | import com.matrix.core.pojo.PaginationVO; |
| | | import com.matrix.system.common.bean.BusParameterSettings; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | | * This field was generated by Zking.software.Codegen. |
| | | * @date 2016-11-28 16:55 |
| | | */ |
| | | |
| | | |
| | | public interface BusParameterSettingsDao { |
| | | |
| | | public int insert(BusParameterSettings busParameterSettings); |
| | | |
| | | public int batchInsert(@Param("list") List<BusParameterSettings> busParameterSettingsList); |
| | | |
| | | public int updateByMap(Map<String, Object> modifyMap); |
| | | |
| | | public int updateByModel(BusParameterSettings busParameterSettings); |
| | | |
| | | public int deleteByIds(@Param("list") List<Long> list); |
| | | |
| | | public int deleteById(Long paramId); |
| | | |
| | | public int deleteByModel(@Param("record") BusParameterSettings busParameterSettings); |
| | | |
| | | public List<BusParameterSettings> selectInPage(@Param("record") BusParameterSettings busParameterSettings, @Param("pageVo") PaginationVO pageVo); |
| | | |
| | | public List<BusParameterSettings> selectByModel(@Param("record") BusParameterSettings busParameterSettings); |
| | | |
| | | public int selectTotalRecord(@Param("record") BusParameterSettings busParameterSettings); |
| | | |
| | | public BusParameterSettings selectById(Long paramId); |
| | | |
| | | public BusParameterSettings selectForUpdate(Long paramId); |
| | | |
| | | List<BusParameterSettings> selectByCodes(@Param("list")List<String> codeList, @Param("companyId")Long companyId,@Param("shopId")Long shopId); |
| | | |
| | | |
| | | |
| | | BusParameterSettings selectByCode(@Param("code")String code, @Param("companyId")Long companyId,@Param("shopId")Long shopId); |
| | | |
| | | BusParameterSettings selectCompanyParamByCode(@Param("code")String code, @Param("companyId")Long companyId); |
| | | |
| | | int updateParams(@Param("list")List<BusParameterSettings> parameterSettings, @Param("companyId")Long companyId); |
| | | package com.matrix.system.common.dao;
|
| | |
|
| | | import com.matrix.core.pojo.PaginationVO;
|
| | | import com.matrix.system.common.bean.BusParameterSettings;
|
| | | import org.apache.ibatis.annotations.Param;
|
| | |
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | |
|
| | | /**
|
| | | * This field was generated by Zking.software.Codegen.
|
| | | * @date 2016-11-28 16:55
|
| | | */
|
| | | |
| | |
|
| | | public interface BusParameterSettingsDao {
|
| | |
|
| | | public int insert(BusParameterSettings busParameterSettings);
|
| | | |
| | | public int batchInsert(@Param("list") List<BusParameterSettings> busParameterSettingsList);
|
| | | |
| | | public int updateByMap(Map<String, Object> modifyMap);
|
| | | |
| | | public int updateByModel(BusParameterSettings busParameterSettings);
|
| | | |
| | | public int deleteByIds(@Param("list") List<Long> list);
|
| | | |
| | | public int deleteById(Long paramId);
|
| | |
|
| | | public int deleteByModel(@Param("record") BusParameterSettings busParameterSettings);
|
| | | |
| | | public List<BusParameterSettings> selectInPage(@Param("record") BusParameterSettings busParameterSettings, @Param("pageVo") PaginationVO pageVo);
|
| | |
|
| | | public List<BusParameterSettings> selectByModel(@Param("record") BusParameterSettings busParameterSettings);
|
| | | |
| | | public int selectTotalRecord(@Param("record") BusParameterSettings busParameterSettings);
|
| | | |
| | | public BusParameterSettings selectById(Long paramId);
|
| | | |
| | | public BusParameterSettings selectForUpdate(Long paramId);
|
| | |
|
| | | List<BusParameterSettings> selectByCodes(@Param("list")List<String> codeList, @Param("companyId")Long companyId,@Param("shopId")Long shopId);
|
| | |
|
| | | List<BusParameterSettings> selectByCodesAndCompanyId(@Param("list")List<String> codeList, @Param("companyId")Long companyId);
|
| | |
|
| | | BusParameterSettings selectByCode(@Param("code")String code, @Param("companyId")Long companyId,@Param("shopId")Long shopId);
|
| | |
|
| | | BusParameterSettings selectCompanyParamByCode(@Param("code")String code, @Param("companyId")Long companyId);
|
| | |
|
| | | int updateParams(@Param("list")List<BusParameterSettings> parameterSettings, @Param("companyId")Long companyId);
|
| | | } |
New file |
| | |
| | | package com.matrix.system.common.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class WebLoginDto { |
| | | |
| | | public static final Integer ACCOUNT_LOGIN=1; |
| | | |
| | | public static final Integer SCANQRCORD_LOGIN=2; |
| | | |
| | | |
| | | /** |
| | | * 账号 |
| | | */ |
| | | private String suAccount; |
| | | |
| | | /** |
| | | * 密码 |
| | | */ |
| | | private String suPassword; |
| | | |
| | | /** |
| | | * 登录方式1,账号密码,2扫码 |
| | | */ |
| | | private Integer loginType; |
| | | /** |
| | | * 终端标识 |
| | | */ |
| | | private String loginQrCodeKey; |
| | | |
| | | } |
| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.matrix.component.redis.RedisClient; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.LogUtil; |
| | |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.dao.SysUsersDao; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | |
| | | @Override |
| | | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { |
| | | /*if ("dev".equals(evn)) { |
| | | SysUsers sysUsers = sysUsersDao.selectById(1012L); |
| | | if ("dev".equals(evn)) { |
| | | SysUsers sysUsers = sysUsersDao.selectById(1060L); |
| | | request.getSession().setAttribute(MatrixConstance.LOGIN_KEY, sysUsers); |
| | | return true; |
| | | }*/ |
| | | } |
| | | |
| | | String token = resolveToken(request,privateKey); |
| | | AjaxResult ajaxResult = new AjaxResult(); |
New file |
| | |
| | | package com.matrix.system.common.service.impl;
|
| | |
|
| | | import com.matrix.system.common.bean.BusParameterSettings;
|
| | | import com.matrix.system.common.bean.SysCompany;
|
| | | import com.matrix.system.common.dao.BusParameterSettingsDao;
|
| | | import com.matrix.system.fenxiao.constant.FenxiaoSettingConstant;
|
| | | import com.matrix.system.score.constant.ScoreSettingConstant;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | |
|
| | | @Service
|
| | | public class InitBusParameterSettingService {
|
| | |
|
| | | @Autowired
|
| | | private BusParameterSettingsDao busParameterSettingsDao;
|
| | |
|
| | | /**
|
| | | * 初始化默认积分规则设置
|
| | | */
|
| | | public void initBusParameterSetting(SysCompany sysCompany) {
|
| | | long companyId = sysCompany.getComId();
|
| | | List<BusParameterSettings> ruleSettings=new ArrayList<>();
|
| | |
|
| | | ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.VALID_PERIOD_POINTS, companyId));
|
| | | ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.CREDIT_POINTS_CASH, companyId));
|
| | |
|
| | | ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.CASH_CONSUMPTION, companyId));
|
| | | ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.PRINCIPAL_BALANCE_CONSUMPTION, companyId));
|
| | | ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.BONUS_BALANCE_CONSUMPTION, companyId));
|
| | | ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.PRINCIPAL_CONSUMPTION, companyId));
|
| | | ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.GIVE_CONSUMPTION, companyId));
|
| | | ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.REFERRALS_CONSUMPTION, companyId));
|
| | |
|
| | | ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.CASH_CONSUMPTION_SHOP, companyId));
|
| | | ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.RESERVATION_SERVICE_SHOP, companyId));
|
| | | ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.EVALUATUIN_ORDER_SHOP, companyId));
|
| | |
|
| | | busParameterSettingsDao.batchInsert(ruleSettings);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 初始化默认分销规则设置
|
| | | */
|
| | | public void initBusParameterFenxiaoSetting(SysCompany sysCompany) {
|
| | | long companyId = sysCompany.getComId();
|
| | | List<BusParameterSettings> ruleSettings=new ArrayList<>();
|
| | | ruleSettings.add(addScoreRuleSetting(FenxiaoSettingConstant.FX_SWITCH, companyId));
|
| | | ruleSettings.add(addScoreRuleSetting(FenxiaoSettingConstant.FX_MODEL, companyId));
|
| | | ruleSettings.add(addScoreRuleSetting(FenxiaoSettingConstant.FX_APPLY_WAY, companyId));
|
| | | ruleSettings.add(addScoreRuleSetting(FenxiaoSettingConstant.FX_AUDIT_METHOD, companyId));
|
| | | ruleSettings.add(addScoreRuleSetting(FenxiaoSettingConstant.FX_APPLY_CONDITION, companyId));
|
| | | ruleSettings.add(addScoreRuleSetting(FenxiaoSettingConstant.FX_TG_PLAN, companyId));
|
| | | ruleSettings.add(addScoreRuleSetting(FenxiaoSettingConstant.FX_TG_POSTER, companyId));
|
| | | ruleSettings.add(addScoreRuleSetting(FenxiaoSettingConstant.FX_ZGFY, companyId));
|
| | | busParameterSettingsDao.batchInsert(ruleSettings);
|
| | | }
|
| | |
|
| | | private BusParameterSettings addScoreRuleSetting(String code,long companyId) {
|
| | | BusParameterSettings busParameterSetting = new BusParameterSettings();
|
| | | busParameterSetting.setParamCode(code);
|
| | | busParameterSetting.setCompanyId(companyId);
|
| | | return busParameterSetting;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | package com.matrix.system.common.service.impl; |
| | | |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.constance.SystemErrorCode; |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.pojo.PaginationVO; |
| | | import com.matrix.core.tools.ModelUtils; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.common.bean.*; |
| | | import com.matrix.system.common.dao.SysCompanyDao; |
| | | import com.matrix.system.common.dao.SysRoleDao; |
| | | import com.matrix.system.common.dao.SysRolePwoerFnDao; |
| | | import com.matrix.system.common.service.SysCompanyService; |
| | | import com.matrix.system.hive.bean.SysShopInfo; |
| | | import com.matrix.system.hive.bean.Warehouse; |
| | | import com.matrix.system.hive.dao.SysShopInfoDao; |
| | | import com.matrix.system.hive.dao.WarehouseDao; |
| | | 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.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 公司管理 |
| | | * |
| | | * @author JIANGYOUYAO |
| | | * @email 935090232@qq.com |
| | | * @date Dec 11, 2017 |
| | | */ |
| | | @Service |
| | | public class SysCompanyServiceImpl implements SysCompanyService { |
| | | |
| | | @Autowired |
| | | private SysCompanyDao sysCompanyDao; |
| | | @Autowired |
| | | private SysRoleDao sysRoleDao; |
| | | @Autowired |
| | | private SysRolePwoerFnDao rolePwoerFnDao; |
| | | |
| | | @Autowired |
| | | private SysShopInfoDao shopInfoDao; |
| | | |
| | | |
| | | @Autowired |
| | | private InitCustomerDataDictionaryService initCustomerDataDictionaryService; |
| | | |
| | | |
| | | @Autowired |
| | | private InitShoppingGoodsCategoryService initShoppingGoodsCategoryService; |
| | | |
| | | |
| | | @Autowired |
| | | private InitRolePowerService initRolePowerService; |
| | | |
| | | @Autowired |
| | | private InitGoodsTypeService initGoodsTypeService; |
| | | |
| | | @Autowired |
| | | private InitShopProductCateService initShopProductCateService; |
| | | |
| | | |
| | | @Transactional |
| | | @Override |
| | | public int add(SysCompany sysCompany) { |
| | | SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | sysCompany.setCreateBy(user.getSuName()); |
| | | sysCompany.setUpdateBy(user.getSuName()); |
| | | int i= sysCompanyDao.insert(sysCompany); |
| | | SysShopInfo zbShop= addZbShop(sysCompany); |
| | | initCustomerDataDictionaryService.initCustomerDataDictionary(sysCompany); |
| | | initShoppingGoodsCategoryService.initShoppingGoodsCategory(sysCompany,zbShop); |
| | | initRolePowerService.initRolePower(sysCompany); |
| | | initGoodsTypeService.initRolePower(sysCompany); |
| | | initShopProductCateService.initShopProductCate(sysCompany); |
| | | |
| | | return i; |
| | | |
| | | } |
| | | |
| | | |
| | | @Autowired |
| | | private WarehouseDao warehouseDao; |
| | | /** |
| | | * 为新公司创建一个总部 |
| | | * @param sysCompany |
| | | */ |
| | | private SysShopInfo addZbShop(SysCompany sysCompany) { |
| | | SysShopInfo zbShopInfo=new SysShopInfo(); |
| | | zbShopInfo.setShopType(SysShopInfo.SHOP_TYPE_ZONGBU); |
| | | zbShopInfo.setShopName(sysCompany.getComName()+"(总部)"); |
| | | zbShopInfo.setCompanyId(sysCompany.getComId()); |
| | | zbShopInfo.setShopTel(sysCompany.getComTel()); |
| | | zbShopInfo.setShopShortName("总部"); |
| | | zbShopInfo.setIsOpenNet(SysShopInfo.CLOSE_NET); |
| | | zbShopInfo.setShopNo(StringUtils.getRandomString(10)); |
| | | shopInfoDao.insert(zbShopInfo); |
| | | |
| | | //新增一个总部仓库 |
| | | Warehouse warehouse=new Warehouse(); |
| | | warehouse.setCompanyId(sysCompany.getComId()); |
| | | warehouse.setName("总部仓库"); |
| | | warehouse.setShopId(zbShopInfo.getId()); |
| | | warehouse.setSort("1"); |
| | | warehouseDao.insert(warehouse); |
| | | return zbShopInfo; |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public int modifyByMap(SysCompany oldSysCompany, SysCompany newSysCompany) { |
| | | SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | newSysCompany.setUpdateBy(user.getSuName()); |
| | | |
| | | updatePower(newSysCompany); |
| | | Map<String, Object> modifyMap = null; |
| | | try { |
| | | if (!ModelUtils.isModified(oldSysCompany, newSysCompany)) { |
| | | return MatrixConstance.DML_SUCCESSS; |
| | | } |
| | | |
| | | modifyMap = ModelUtils.comparePojo2Map(oldSysCompany, newSysCompany); |
| | | } catch (Exception e) { |
| | | throw new GlobleException(SystemErrorCode.DATA_UPDATE_FAIL, e, newSysCompany.getComName()); |
| | | } |
| | | if (modifyMap.size() > 0) { |
| | | modifyMap.put("comId", oldSysCompany.getComId()); |
| | | return sysCompanyDao.updateByMap(modifyMap); |
| | | } |
| | | return MatrixConstance.DML_SUCCESSS; |
| | | } |
| | | |
| | | /** |
| | | * 更新公司员工权限 |
| | | * |
| | | * @author JIANGYOUYAO |
| | | * @email 935090232@qq.com |
| | | * @date 2017年12月5日 |
| | | * @param newSysCompany |
| | | */ |
| | | private void updatePower(SysCompany newSysCompany) { |
| | | List<String> oldFunctions = null; |
| | | String functions = sysCompanyDao.selectById(newSysCompany.getComId()).getComFunctions(); |
| | | if (functions == null || functions.equals("")) { |
| | | oldFunctions = new ArrayList<>(); |
| | | } else { |
| | | oldFunctions = StringUtils |
| | | .strToCollToString(sysCompanyDao.selectById(newSysCompany.getComId()).getComFunctions(), ","); |
| | | } |
| | | List<String> newFunctions = new ArrayList<>(); |
| | | if (StringUtils.isNotBlank(newSysCompany.getComFunctions())) { |
| | | newFunctions = StringUtils.strToCollToString(newSysCompany.getComFunctions(), ","); |
| | | } |
| | | |
| | | for (String old : oldFunctions) { |
| | | // 如果新权限中不包含这个老的功能,则要更新改企业下所有的角色权限 |
| | | if (!newFunctions.contains(old)) { |
| | | SysRole role = new SysRole(); |
| | | role.setCompanyId(newSysCompany.getComId()); |
| | | List<SysRole> roles = sysRoleDao.selectByModel(role); |
| | | // 获取该公司下所有的权限信息 |
| | | List<SysRolePwoerFn> compalyRolePwoer = new ArrayList<>(); |
| | | for (SysRole tempRole : roles) { |
| | | SysRolePwoerFn r = new SysRolePwoerFn(); |
| | | r.setRoleId(tempRole.getRoleId()); |
| | | compalyRolePwoer.addAll(rolePwoerFnDao.selectByModel(r)); |
| | | } |
| | | // 记录要删除的id |
| | | List<String> delRolePwoer = new ArrayList<>(); |
| | | for (SysRolePwoerFn rolePwoer : compalyRolePwoer) { |
| | | // 如果有一个老权限则删除这个权限 |
| | | if (rolePwoer.getFnId() != null && rolePwoer.getFnId().equals(old)) { |
| | | delRolePwoer.add(rolePwoer.getRpfId()+""); |
| | | } |
| | | } |
| | | // 如果获取到了就删除 |
| | | if (!delRolePwoer.isEmpty()) { |
| | | rolePwoerFnDao.deleteByIds(delRolePwoer); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public int modifyByModel(SysCompany sysCompany) { |
| | | |
| | | return sysCompanyDao.updateByModel(sysCompany); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public int remove(List<String> list) { |
| | | |
| | | return sysCompanyDao.deleteByIds(list); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public int removeById(String comId) { |
| | | |
| | | return sysCompanyDao.deleteById(Long.parseLong(comId)); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public int removeByModel(SysCompany sysCompany) { |
| | | |
| | | return sysCompanyDao.deleteByModel(sysCompany); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public List<SysCompany> findInPage(SysCompany sysCompany, PaginationVO pageVo) { |
| | | |
| | | return sysCompanyDao.selectInPage(sysCompany, pageVo); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public List<SysCompany> findByModel(SysCompany sysCompany) { |
| | | |
| | | return sysCompanyDao.selectByModel(sysCompany); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public int findTotal(SysCompany sysCompany) { |
| | | |
| | | return sysCompanyDao.selectTotalRecord(sysCompany); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public SysCompany findById(String comId) { |
| | | |
| | | return sysCompanyDao.selectById(Long.parseLong(comId)); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | package com.matrix.system.common.service.impl;
|
| | |
|
| | | import com.matrix.core.constance.MatrixConstance;
|
| | | import com.matrix.core.constance.SystemErrorCode;
|
| | | import com.matrix.core.exception.GlobleException;
|
| | | import com.matrix.core.pojo.PaginationVO;
|
| | | import com.matrix.core.tools.ModelUtils;
|
| | | import com.matrix.core.tools.StringUtils;
|
| | | import com.matrix.core.tools.WebUtil;
|
| | | import com.matrix.system.common.bean.*;
|
| | | import com.matrix.system.common.dao.SysCompanyDao;
|
| | | import com.matrix.system.common.dao.SysRoleDao;
|
| | | import com.matrix.system.common.dao.SysRolePwoerFnDao;
|
| | | import com.matrix.system.common.service.SysCompanyService;
|
| | | import com.matrix.system.hive.bean.SysShopInfo;
|
| | | import com.matrix.system.hive.bean.Warehouse;
|
| | | import com.matrix.system.hive.dao.SysShopInfoDao;
|
| | | import com.matrix.system.hive.dao.WarehouseDao;
|
| | | 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.List;
|
| | | import java.util.Map;
|
| | |
|
| | | /**
|
| | | * 公司管理
|
| | | * |
| | | * @author JIANGYOUYAO
|
| | | * @email 935090232@qq.com
|
| | | * @date Dec 11, 2017
|
| | | */
|
| | | @Service
|
| | | public class SysCompanyServiceImpl implements SysCompanyService {
|
| | |
|
| | | @Autowired
|
| | | private SysCompanyDao sysCompanyDao;
|
| | | @Autowired
|
| | | private SysRoleDao sysRoleDao;
|
| | | @Autowired
|
| | | private SysRolePwoerFnDao rolePwoerFnDao;
|
| | |
|
| | | @Autowired
|
| | | private SysShopInfoDao shopInfoDao;
|
| | |
|
| | |
|
| | | @Autowired
|
| | | private InitCustomerDataDictionaryService initCustomerDataDictionaryService;
|
| | |
|
| | |
|
| | | @Autowired
|
| | | private InitShoppingGoodsCategoryService initShoppingGoodsCategoryService;
|
| | |
|
| | |
|
| | | @Autowired
|
| | | private InitRolePowerService initRolePowerService;
|
| | |
|
| | | @Autowired
|
| | | private InitGoodsTypeService initGoodsTypeService;
|
| | |
|
| | | @Autowired
|
| | | private InitShopProductCateService initShopProductCateService;
|
| | |
|
| | | @Autowired
|
| | | private InitBusParameterSettingService initBusParameterSettingService;
|
| | |
|
| | |
|
| | | @Transactional
|
| | | @Override
|
| | | public int add(SysCompany sysCompany) {
|
| | | SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY);
|
| | | sysCompany.setCreateBy(user.getSuName());
|
| | | sysCompany.setUpdateBy(user.getSuName());
|
| | | int i= sysCompanyDao.insert(sysCompany);
|
| | | SysShopInfo zbShop= addZbShop(sysCompany);
|
| | | initCustomerDataDictionaryService.initCustomerDataDictionary(sysCompany);
|
| | | initShoppingGoodsCategoryService.initShoppingGoodsCategory(sysCompany,zbShop);
|
| | | initRolePowerService.initRolePower(sysCompany);
|
| | | initGoodsTypeService.initRolePower(sysCompany);
|
| | | initShopProductCateService.initShopProductCate(sysCompany);
|
| | | initBusParameterSettingService.initBusParameterSetting(sysCompany);
|
| | | initBusParameterSettingService.initBusParameterFenxiaoSetting(sysCompany);
|
| | |
|
| | | return i;
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | | @Autowired
|
| | | private WarehouseDao warehouseDao;
|
| | | /**
|
| | | * 为新公司创建一个总部
|
| | | * @param sysCompany
|
| | | */
|
| | | private SysShopInfo addZbShop(SysCompany sysCompany) {
|
| | | SysShopInfo zbShopInfo=new SysShopInfo();
|
| | | zbShopInfo.setShopType(SysShopInfo.SHOP_TYPE_ZONGBU);
|
| | | zbShopInfo.setShopName(sysCompany.getComName()+"(总部)");
|
| | | zbShopInfo.setCompanyId(sysCompany.getComId());
|
| | | zbShopInfo.setShopTel(sysCompany.getComTel());
|
| | | zbShopInfo.setShopShortName("总部");
|
| | | zbShopInfo.setIsOpenNet(SysShopInfo.CLOSE_NET);
|
| | | zbShopInfo.setShopNo(StringUtils.getRandomString(10));
|
| | | shopInfoDao.insert(zbShopInfo);
|
| | |
|
| | | //新增一个总部仓库
|
| | | Warehouse warehouse=new Warehouse();
|
| | | warehouse.setCompanyId(sysCompany.getComId());
|
| | | warehouse.setName("总部仓库");
|
| | | warehouse.setShopId(zbShopInfo.getId());
|
| | | warehouse.setSort("1");
|
| | | warehouseDao.insert(warehouse);
|
| | | return zbShopInfo;
|
| | | }
|
| | |
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public int modifyByMap(SysCompany oldSysCompany, SysCompany newSysCompany) {
|
| | | SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY);
|
| | | newSysCompany.setUpdateBy(user.getSuName());
|
| | |
|
| | | updatePower(newSysCompany);
|
| | | Map<String, Object> modifyMap = null;
|
| | | try {
|
| | | if (!ModelUtils.isModified(oldSysCompany, newSysCompany)) {
|
| | | return MatrixConstance.DML_SUCCESSS;
|
| | | }
|
| | |
|
| | | modifyMap = ModelUtils.comparePojo2Map(oldSysCompany, newSysCompany);
|
| | | } catch (Exception e) {
|
| | | throw new GlobleException(SystemErrorCode.DATA_UPDATE_FAIL, e, newSysCompany.getComName());
|
| | | }
|
| | | if (modifyMap.size() > 0) {
|
| | | modifyMap.put("comId", oldSysCompany.getComId());
|
| | | return sysCompanyDao.updateByMap(modifyMap);
|
| | | }
|
| | | return MatrixConstance.DML_SUCCESSS;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 更新公司员工权限
|
| | | * |
| | | * @author JIANGYOUYAO
|
| | | * @email 935090232@qq.com
|
| | | * @date 2017年12月5日
|
| | | * @param newSysCompany
|
| | | */
|
| | | private void updatePower(SysCompany newSysCompany) {
|
| | | List<String> oldFunctions = null;
|
| | | String functions = sysCompanyDao.selectById(newSysCompany.getComId()).getComFunctions();
|
| | | if (functions == null || functions.equals("")) {
|
| | | oldFunctions = new ArrayList<>();
|
| | | } else {
|
| | | oldFunctions = StringUtils
|
| | | .strToCollToString(sysCompanyDao.selectById(newSysCompany.getComId()).getComFunctions(), ",");
|
| | | }
|
| | | List<String> newFunctions = new ArrayList<>();
|
| | | if (StringUtils.isNotBlank(newSysCompany.getComFunctions())) {
|
| | | newFunctions = StringUtils.strToCollToString(newSysCompany.getComFunctions(), ",");
|
| | | }
|
| | |
|
| | | for (String old : oldFunctions) {
|
| | | // 如果新权限中不包含这个老的功能,则要更新改企业下所有的角色权限
|
| | | if (!newFunctions.contains(old)) {
|
| | | SysRole role = new SysRole();
|
| | | role.setCompanyId(newSysCompany.getComId());
|
| | | List<SysRole> roles = sysRoleDao.selectByModel(role);
|
| | | // 获取该公司下所有的权限信息
|
| | | List<SysRolePwoerFn> compalyRolePwoer = new ArrayList<>();
|
| | | for (SysRole tempRole : roles) {
|
| | | SysRolePwoerFn r = new SysRolePwoerFn();
|
| | | r.setRoleId(tempRole.getRoleId());
|
| | | compalyRolePwoer.addAll(rolePwoerFnDao.selectByModel(r));
|
| | | }
|
| | | // 记录要删除的id
|
| | | List<String> delRolePwoer = new ArrayList<>();
|
| | | for (SysRolePwoerFn rolePwoer : compalyRolePwoer) {
|
| | | // 如果有一个老权限则删除这个权限
|
| | | if (rolePwoer.getFnId() != null && rolePwoer.getFnId().equals(old)) {
|
| | | delRolePwoer.add(rolePwoer.getRpfId()+"");
|
| | | }
|
| | | }
|
| | | // 如果获取到了就删除
|
| | | if (!delRolePwoer.isEmpty()) {
|
| | | rolePwoerFnDao.deleteByIds(delRolePwoer);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public int modifyByModel(SysCompany sysCompany) {
|
| | |
|
| | | return sysCompanyDao.updateByModel(sysCompany);
|
| | |
|
| | | }
|
| | |
|
| | | @Override
|
| | | public int remove(List<String> list) {
|
| | |
|
| | | return sysCompanyDao.deleteByIds(list);
|
| | |
|
| | | }
|
| | |
|
| | | @Override
|
| | | public int removeById(String comId) {
|
| | |
|
| | | return sysCompanyDao.deleteById(Long.parseLong(comId));
|
| | |
|
| | | }
|
| | |
|
| | | @Override
|
| | | public int removeByModel(SysCompany sysCompany) {
|
| | |
|
| | | return sysCompanyDao.deleteByModel(sysCompany);
|
| | |
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<SysCompany> findInPage(SysCompany sysCompany, PaginationVO pageVo) {
|
| | |
|
| | | return sysCompanyDao.selectInPage(sysCompany, pageVo);
|
| | |
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<SysCompany> findByModel(SysCompany sysCompany) {
|
| | |
|
| | | return sysCompanyDao.selectByModel(sysCompany);
|
| | |
|
| | | }
|
| | |
|
| | | @Override
|
| | | public int findTotal(SysCompany sysCompany) {
|
| | |
|
| | | return sysCompanyDao.selectTotalRecord(sysCompany);
|
| | |
|
| | | }
|
| | |
|
| | | @Override
|
| | | public SysCompany findById(String comId) {
|
| | |
|
| | | return sysCompanyDao.selectById(Long.parseLong(comId));
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | } |
| | |
| | | import com.matrix.core.constance.SystemErrorCode; |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.pojo.PaginationVO; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.core.tools.ModelUtils; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.common.authority.DefaultAuthorityManager; |
| | |
| | | } else { |
| | | // 非一级节点找到父节点后存入 |
| | | SysFunction parentFn = allFnMap.get(String.valueOf(function.getFnParentId())); |
| | | List<SysFunction> childs = parentFn.getChilds(); |
| | | if (childs == null) { |
| | | parentFn.setChilds(new ArrayList<SysFunction>()); |
| | | if(parentFn!=null){ |
| | | List<SysFunction> childs = parentFn.getChilds(); |
| | | if (childs == null) { |
| | | parentFn.setChilds(new ArrayList<SysFunction>()); |
| | | } |
| | | parentFn.getChilds().add(function); |
| | | } |
| | | parentFn.getChilds().add(function); |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | package com.matrix.system.common.service.impl; |
| | | |
| | | import cn.hutool.crypto.SecureUtil; |
| | | import com.matrix.component.redis.RedisClient; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.constance.SystemErrorCode; |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.pojo.PaginationVO; |
| | | import com.matrix.core.tools.DateUtil; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.core.tools.ModelUtils; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.common.authority.DefaultAuthorityManager; |
| | | import com.matrix.system.common.bean.SysUserLoginRecord; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | |
| | | import com.matrix.system.hive.bean.SysProjServices; |
| | | import com.matrix.system.hive.bean.SysShopInfo; |
| | | import com.matrix.system.hive.dao.SysShopInfoDao; |
| | | import com.matrix.system.hive.plugin.util.CollectionUtils; |
| | | import com.matrix.core.tools.DateUtil; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | private static final String SU_ID = "su_id"; |
| | | |
| | | private static final String SU_ACCOUNT = "su_account"; |
| | | |
| | | @Autowired |
| | | RedisClient redisClient; |
| | | @Autowired |
| | | private SysUsersDao sysUsersDao; |
| | | |
| | |
| | | } |
| | | if (modifyMap.size() > 0) { |
| | | modifyMap.put("suId", oldSysUsers.getSuId()); |
| | | return sysUsersDao.updateByMap(modifyMap); |
| | | sysUsersDao.updateByMap(modifyMap); |
| | | } |
| | | //删除用户权限缓存 |
| | | String redisKey=DefaultAuthorityManager.USER_POWER_REDISKEY+ SecureUtil.md5(oldSysUsers.getSuId()+""); |
| | | redisClient.removeObject(redisKey); |
| | | |
| | | return MatrixConstance.DML_SUCCESSS; |
| | | } |
| | | |
| | |
| | | * 支付方式-现金支付 |
| | | */ |
| | | String PAY_TYPE_MOENY = "现金"; |
| | | /** |
| | | * 支付方式-现金支付 |
| | | */ |
| | | String PAY_TYPE_MOENY_CARD = "会员卡"; |
| | | |
| | | /** |
| | | * 支付方式-卡支付 |
| | | */ |
| | |
| | | String SEX_WOMAN ="女"; |
| | | |
| | | String[] COLORS = { "#57c5d2", "#e3565e", "#2f343a", "#4d98db", "#4fbc9d", "#be9d4c"}; |
| | | |
| | | String SERVICE_OVER_BEGIN_END = "SERVICE_OVER_BEGIN_END"; |
| | | } |
| | |
| | | public class SystemConstance { |
| | | |
| | | |
| | | /** |
| | | * 当前进行操作的用户 |
| | | */ |
| | | public static final String CURRENT_CUSTOMER = "CURRENT_CUSTOMER"; |
| | | |
| | | |
| | | /** |
| | |
| | | */ |
| | | public static final String SYSTEM_USER = "SYSTEM"; |
| | | |
| | | /** |
| | | * 查询历史记录 |
| | | */ |
| | | public static final String HISTORY_CUSTOMER = "HISTORY_CUSTOMER"; |
| | | |
| | | /** |
| | | * 登陆前要访问的地址 |
| | | */ |
New file |
| | |
| | | package com.matrix.system.fenxiao.action; |
| | | |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.system.fenxiao.dto.LoadFenxiaoOrderBasicDto; |
| | | import com.matrix.system.fenxiao.dto.LoadFenxiaoOrderListDto; |
| | | import com.matrix.system.fenxiao.dto.LoadSetOrderListDtoDto; |
| | | import com.matrix.system.fenxiao.dto.UpdateSetOrderDoneDto; |
| | | import com.matrix.system.fenxiao.service.ShopSalesmanOrderService; |
| | | import com.matrix.system.fenxiao.vo.LoadFenxiaoOrderBasicVo; |
| | | import com.matrix.system.fenxiao.vo.LoadFenxiaoOrderListVo; |
| | | import com.matrix.system.fenxiao.vo.LoadSetOrderListDtoVo; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiResponse; |
| | | import io.swagger.annotations.ApiResponses; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | @RestController |
| | | @RequestMapping(value = "/fenXiao/fenXiaoOrder") |
| | | public class FenXiaoOrderAction { |
| | | |
| | | @Autowired |
| | | private ShopSalesmanOrderService shopSalesmanOrderService; |
| | | |
| | | /** |
| | | * 分销订单基本信息 |
| | | */ |
| | | @ApiOperation(value = "分销订单基本信息") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "OK", response = LoadFenxiaoOrderBasicVo.class) |
| | | }) |
| | | @PostMapping(value = "/loadFenxiaoOrderBasic") |
| | | public @ResponseBody |
| | | AjaxResult loadFenxiaoOrderBasic(@RequestBody LoadFenxiaoOrderBasicDto loadFenxiaoOrderBasicDto) { |
| | | return shopSalesmanOrderService.loadFenxiaoOrderBasic(loadFenxiaoOrderBasicDto); |
| | | } |
| | | |
| | | /** |
| | | * 分销订单 |
| | | */ |
| | | @ApiOperation(value = "分销订单") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "OK", response = LoadFenxiaoOrderListVo.class) |
| | | }) |
| | | @PostMapping(value = "/loadFenxiaoOrderList") |
| | | public @ResponseBody |
| | | AjaxResult loadFenxiaoOrderList(@RequestBody LoadFenxiaoOrderListDto loadFenxiaoOrderListDto) { |
| | | return shopSalesmanOrderService.loadFenxiaoOrderList(loadFenxiaoOrderListDto); |
| | | } |
| | | |
| | | /** |
| | | *批量结算分销订单 |
| | | */ |
| | | @ApiOperation(value = "批量结算分销订单") |
| | | @PostMapping(value = "/updateSetOrderDone") |
| | | public @ResponseBody |
| | | AjaxResult updateSetOrderDone(@RequestBody UpdateSetOrderDoneDto updateSetOrderDoneDto) { |
| | | return shopSalesmanOrderService.updateSetOrderDone(updateSetOrderDoneDto); |
| | | } |
| | | |
| | | /** |
| | | * 结算记录 |
| | | */ |
| | | @ApiOperation(value = "结算记录") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "OK", response = LoadSetOrderListDtoVo.class) |
| | | }) |
| | | @PostMapping(value = "/loadSetOrderList") |
| | | public @ResponseBody |
| | | AjaxResult loadSetOrderList(@RequestBody LoadSetOrderListDtoDto loadSetOrderListDto) { |
| | | return shopSalesmanOrderService.loadSetOrderList(loadSetOrderListDto); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.action; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.pojo.PaginationVO; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.common.bean.BusParameterSettings; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.fenxiao.constant.FenxiaoSettingConstant; |
| | | import com.matrix.system.fenxiao.service.FenXiaoSettingService; |
| | | import com.matrix.system.fenxiao.vo.FenXiaoSettingVo; |
| | | import com.matrix.system.hive.action.util.QueryUtil; |
| | | import com.matrix.system.hive.dao.ShoppingGoodsDao; |
| | | import com.matrix.system.shopXcx.bean.ShopProduct; |
| | | import com.matrix.system.shopXcx.dao.ShopProductDao; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @RequestMapping(value = "/fenXiao/ruleSetting") |
| | | public class FenXiaoSettingAction { |
| | | |
| | | @Autowired |
| | | private FenXiaoSettingService fenXiaoSettingService; |
| | | |
| | | @Autowired |
| | | private BusParameterSettingsDao busParameterSettingsDao; |
| | | |
| | | @Autowired |
| | | private ShoppingGoodsDao shoppingGoodsDao; |
| | | |
| | | @Autowired |
| | | private SysVipInfoDao sysVipInfoDao; |
| | | |
| | | @Autowired |
| | | private ShopProductDao shopProductDao; |
| | | |
| | | /** |
| | | *查询分销配置 |
| | | */ |
| | | @RequestMapping(value = "/selectFenXiaoSetting") |
| | | public AjaxResult selectFenXiaoSetting() { |
| | | |
| | | AjaxResult result= AjaxResult.buildSuccessInstance("查询成功"); |
| | | SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | Long companyId = user.getCompanyId(); |
| | | |
| | | //分销开关 |
| | | String[] FXKGCode={FenxiaoSettingConstant.FX_SWITCH}; |
| | | String[] FXKGName={"分销开关"}; |
| | | List<FenXiaoSettingVo> fxkgRuleSettingsVo = getRuleSettingsVo(FXKGCode,FXKGName,companyId); |
| | | result.putInMap("fxkg", fxkgRuleSettingsVo); |
| | | //自购返佣 |
| | | String[] ZGFYCode={FenxiaoSettingConstant.FX_ZGFY}; |
| | | String[] ZGFYName={"自购返佣"}; |
| | | List<FenXiaoSettingVo> zgfyRuleSettingsVo = getRuleSettingsVo(ZGFYCode,ZGFYName,companyId); |
| | | result.putInMap("zgfy", zgfyRuleSettingsVo); |
| | | |
| | | //分销模式 |
| | | String[] FXMSCode={FenxiaoSettingConstant.FX_MODEL}; |
| | | String[] FXMSName={"分销模式"}; |
| | | List<FenXiaoSettingVo> fxmsRuleSettingsVo = getRuleSettingsVo(FXMSCode,FXMSName,companyId); |
| | | result.putInMap("fxms", fxmsRuleSettingsVo); |
| | | //申请方式 |
| | | String[] sqfsCode={FenxiaoSettingConstant.FX_APPLY_WAY}; |
| | | String[] sqfsName={"申请方式"}; |
| | | List<FenXiaoSettingVo> sqfsRuleSettingsVo = getRuleSettingsVo(sqfsCode,sqfsName,companyId); |
| | | result.putInMap("sqfs", sqfsRuleSettingsVo); |
| | | //审核方式 |
| | | String[] shfsCode={FenxiaoSettingConstant.FX_AUDIT_METHOD}; |
| | | String[] shfsName={"审核方式"}; |
| | | List<FenXiaoSettingVo> shfsRuleSettingsVo = getRuleSettingsVo(shfsCode,shfsName,companyId); |
| | | result.putInMap("shfs", shfsRuleSettingsVo); |
| | | //申请条件 |
| | | String[] sqtjCode={FenxiaoSettingConstant.FX_APPLY_CONDITION}; |
| | | String[] sqtjName={"申请条件"}; |
| | | List<FenXiaoSettingVo> sqtjRuleSettingsVo = getRuleSettingsVo(sqtjCode,sqtjName,companyId); |
| | | result.putInMap("sqtj", sqtjRuleSettingsVo); |
| | | if(CollUtil.isNotEmpty(sqtjRuleSettingsVo)){ |
| | | for(FenXiaoSettingVo fenXiaoSettingVo : sqtjRuleSettingsVo) { |
| | | //选择申请条件条件3时,获得选中产品集合 |
| | | if(FenxiaoSettingConstant.FX_APPLY_CONDITION_XFZDCP.equals(fenXiaoSettingVo.getParamValue())) { |
| | | String paramValue1 = fenXiaoSettingVo.getParamValue1(); |
| | | if(StrUtil.isNotEmpty(paramValue1)) { |
| | | List<Integer> idsList = new ArrayList<>(); |
| | | List<String> idsStringList = Arrays.asList(paramValue1.split(",")); |
| | | if(CollUtil.isNotEmpty(idsStringList)){ |
| | | for(String string : idsStringList) { |
| | | Integer parseInt = Integer.parseInt(string); |
| | | idsList.add(parseInt); |
| | | } |
| | | } |
| | | //List<ShoppingGoods> list = shoppingGoodsDao.selectByIds(idsList); |
| | | List<ShopProduct> shopProducts = shopProductDao.selectByIds(idsList); |
| | | result.putInMap("order", shopProducts); |
| | | } |
| | | }else{ |
| | | List<ShopProduct> shopProducts = new ArrayList<>(); |
| | | result.putInMap("order", shopProducts); |
| | | } |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 列表显示 |
| | | */ |
| | | @RequestMapping(value = "/selectProduct") |
| | | public @ResponseBody |
| | | AjaxResult selectProduct(ShopProduct shopProduct, PaginationVO pageVo) { |
| | | QueryUtil.setQueryLimitCom(shopProduct); |
| | | pageVo.setSort("createTime"); |
| | | pageVo.setOrder("desc"); |
| | | shopProduct.setDelFlag(AppConstance.DATA_USEABLE); |
| | | shopProduct.setCompanyId(shopProduct.getCompanyId()); |
| | | List<ShopProduct> dataList = shopProductDao.selectInPage(shopProduct, pageVo); |
| | | AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, dataList, |
| | | shopProductDao.selectTotalRecord(shopProduct)); |
| | | return result; |
| | | |
| | | } |
| | | |
| | | /** |
| | | *获取对应的规则设置数据 |
| | | * @param ArrayCode |
| | | * @param ArrayName |
| | | * @param companyId |
| | | * @return |
| | | */ |
| | | private List<FenXiaoSettingVo> getRuleSettingsVo(String[] ArrayCode,String[] ArrayName,Long companyId){ |
| | | List<BusParameterSettings> dataList = busParameterSettingsDao.selectByCodesAndCompanyId(Arrays.asList(ArrayCode), companyId); |
| | | List<FenXiaoSettingVo> scoreRuleSettingsVos=new ArrayList<FenXiaoSettingVo>(); |
| | | int index=0; |
| | | for (BusParameterSettings item:dataList){ |
| | | FenXiaoSettingVo paramVo=new FenXiaoSettingVo(); |
| | | BeanUtils.copyProperties(item,paramVo); |
| | | paramVo.setParamName(ArrayName[index]); |
| | | scoreRuleSettingsVos.add(paramVo); |
| | | index++; |
| | | } |
| | | return scoreRuleSettingsVos; |
| | | } |
| | | |
| | | /** |
| | | * 修改公司维度的分销规则 |
| | | */ |
| | | @PostMapping(value = "/updateFenXiaoSetting") |
| | | public @ResponseBody |
| | | AjaxResult updateFenXiaoSetting(@RequestBody List<BusParameterSettings> busParameterSettings) { |
| | | return fenXiaoSettingService.updateFenXiaoSettingByCompanyId(busParameterSettings); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.action; |
| | | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.common.bean.BusParameterSettings; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.fenxiao.constant.FenxiaoSettingConstant; |
| | | import com.matrix.system.fenxiao.dao.ShopSalesmanApplyDao; |
| | | import com.matrix.system.fenxiao.dao.ShopSalesmanGradeDao; |
| | | import com.matrix.system.fenxiao.dto.*; |
| | | import com.matrix.system.fenxiao.entity.ShopSalesmanApply; |
| | | import com.matrix.system.fenxiao.service.ShopSalesmanApplyService; |
| | | import com.matrix.system.fenxiao.vo.*; |
| | | import com.matrix.system.hive.action.util.QueryUtil; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiResponse; |
| | | import io.swagger.annotations.ApiResponses; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @RequestMapping(value = "/fenXiao/fenXiaoUser") |
| | | public class FenXiaoUserAction { |
| | | |
| | | @Autowired |
| | | private ShopSalesmanApplyService shopSalesmanApplyService; |
| | | @Autowired |
| | | private ShopSalesmanApplyDao shopSalesmanApplyDao; |
| | | @Autowired |
| | | private SysVipInfoDao sysVipInfoDao; |
| | | @Autowired |
| | | private ShopSalesmanGradeDao shopSalesmanGradeDao; |
| | | @Autowired |
| | | private BusParameterSettingsDao busParameterSettingsDao; |
| | | |
| | | /** |
| | | * 分销员详情页面信息 |
| | | */ |
| | | @ApiOperation(value = "分销员详情页面信息") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "OK", response = ShopSalesmanDetailVo.class) |
| | | }) |
| | | @PostMapping(value = "/loadParamSettingBasic") |
| | | public @ResponseBody |
| | | AjaxResult findShopSalesmanDetail(@RequestBody LoadParamSettingBasicDto loadParamSettingBasicDto) { |
| | | //设置用户公司ID |
| | | QueryUtil.setQueryLimitCom(loadParamSettingBasicDto); |
| | | AjaxResult result= AjaxResult.buildSuccessInstance("查询成功"); |
| | | SalesmanBasicDetailVo salesmanBasicDetailVo = shopSalesmanApplyService.selectShopSalesmanDetailByOpenId(loadParamSettingBasicDto.getUserId(),loadParamSettingBasicDto.getApplyId()); |
| | | result.putInMap("basicdetail", salesmanBasicDetailVo); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 分销员详情页面绑定客户 |
| | | */ |
| | | @ApiOperation(value = "分销员详情页面绑定客户") |
| | | @PostMapping(value = "/loadParamSetting") |
| | | public @ResponseBody |
| | | AjaxResult loadParamSetting(@RequestBody LoadParamSettingDto loadParamSettingDto) { |
| | | //设置用户公司ID |
| | | QueryUtil.setQueryLimitCom(loadParamSettingDto); |
| | | AjaxResult result= AjaxResult.buildSuccessInstance("查询成功"); |
| | | //排序 |
| | | if(StringUtils.isBlank(loadParamSettingDto.getSort())){ |
| | | loadParamSettingDto.setSort("create_time"); |
| | | loadParamSettingDto.setOrder("desc"); |
| | | } |
| | | //查询绑定客户信息 |
| | | Page<ShopCustomDetailVo> page = new Page(loadParamSettingDto.getPageNum(), loadParamSettingDto.getPageSize()); |
| | | IPage<ShopCustomDetailVo> customDetailRows = shopSalesmanApplyService.findCustomDetail(page,loadParamSettingDto); |
| | | result.putInMap("customDetailRecords", customDetailRows.getRecords()); |
| | | result.putInMap("customDetailTotal", customDetailRows.getTotal()); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 分销员详情页面邀请下级 |
| | | */ |
| | | @ApiOperation(value = "分销员详情页面邀请下级") |
| | | @PostMapping(value = "/loadParamSettinglow") |
| | | public @ResponseBody |
| | | AjaxResult loadParamSettinglow(@RequestBody ShopSalesmanDetailDto shopSalesmanDetailDto) { |
| | | //设置用户公司ID |
| | | QueryUtil.setQueryLimitCom(shopSalesmanDetailDto); |
| | | AjaxResult result= AjaxResult.buildSuccessInstance("查询成功"); |
| | | //排序 |
| | | if(StringUtils.isBlank(shopSalesmanDetailDto.getSort())){ |
| | | shopSalesmanDetailDto.setSort("create_time"); |
| | | shopSalesmanDetailDto.setOrder("desc"); |
| | | } |
| | | //查询邀请下级信息 |
| | | Page<ShopCustomDetailVo> pageLow = new Page(shopSalesmanDetailDto.getPageNum(), shopSalesmanDetailDto.getPageSize()); |
| | | IPage<ShopCustomDetailVo> customLowRows = shopSalesmanApplyService.findCustomLow(pageLow,shopSalesmanDetailDto); |
| | | result.putInMap("customLowRecords", customLowRows.getRecords()); |
| | | result.putInMap("customLowTotal", customLowRows.getTotal()); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 分销员详情页面收益订单 |
| | | */ |
| | | @ApiOperation(value = "分销员详情页面收益订单") |
| | | @PostMapping(value = "/loadParamSettingOrder") |
| | | public @ResponseBody |
| | | AjaxResult loadParamSettingOrder(@RequestBody ShopSalesmanDetailDto shopSalesmanDetailDto) { |
| | | //设置用户公司ID |
| | | QueryUtil.setQueryLimitCom(shopSalesmanDetailDto); |
| | | AjaxResult result= AjaxResult.buildSuccessInstance("查询成功"); |
| | | //排序 |
| | | if(StringUtils.isBlank(shopSalesmanDetailDto.getSort())){ |
| | | shopSalesmanDetailDto.setSort("create_time"); |
| | | shopSalesmanDetailDto.setOrder("desc"); |
| | | } |
| | | //查询收益订单 |
| | | Page<ShopOrderDetailVo> pageOrder = new Page(shopSalesmanDetailDto.getPageNum(), shopSalesmanDetailDto.getPageSize()); |
| | | IPage<ShopOrderDetailVo> orderRows = shopSalesmanApplyService.findShopOrderDetail(pageOrder,shopSalesmanDetailDto); |
| | | result.putInMap("orderRecords", orderRows.getRecords()); |
| | | result.putInMap("orderTotal", orderRows.getTotal()); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | *修改等级 |
| | | */ |
| | | @ApiOperation(value = "修改等级") |
| | | @PostMapping(value = "/changeSaleManGrade") |
| | | public @ResponseBody |
| | | AjaxResult changeSaleManGrade(@RequestBody ChangeSaleManGradeDto changeSaleManGradeDto) { |
| | | return shopSalesmanApplyService.changeSaleManGrade(changeSaleManGradeDto); |
| | | } |
| | | |
| | | /** |
| | | *解绑 |
| | | */ |
| | | @ApiOperation(value = "解绑") |
| | | @PostMapping(value = "/unbundlingSaleMan") |
| | | public @ResponseBody |
| | | AjaxResult unbundlingSaleMan(@RequestBody UnbundlingSaleManDto unbundlingSaleManDto) { |
| | | return shopSalesmanApplyService.unbundlingSaleMan(unbundlingSaleManDto); |
| | | } |
| | | |
| | | /** |
| | | *推广图片 |
| | | */ |
| | | @ApiOperation(value = "推广图片") |
| | | @PostMapping(value = "/updateTgtp") |
| | | public @ResponseBody |
| | | AjaxResult updateTgtp(@RequestBody UpdateTgtpDto updateTgtpDto) { |
| | | return shopSalesmanApplyService.updateTgtp(updateTgtpDto); |
| | | } |
| | | |
| | | /** |
| | | *推广图片 |
| | | */ |
| | | @RequestMapping(value = "/loadTgtpSetting") |
| | | public AjaxResult loadTgtpSetting() { |
| | | |
| | | AjaxResult result= AjaxResult.buildSuccessInstance("查询成功"); |
| | | SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | Long companyId = user.getCompanyId(); |
| | | |
| | | //推广文案 |
| | | String[] FXKGCode={FenxiaoSettingConstant.FX_TG_POSTER}; |
| | | String[] FXKGName={"推广图片"}; |
| | | List<FenXiaoSettingVo> fxkgRuleSettingsVo = getRuleSettingsVo(FXKGCode,FXKGName,companyId); |
| | | result.putInMap("tgtp", fxkgRuleSettingsVo.get(0)); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | *推广计划更新 |
| | | */ |
| | | @ApiOperation(value = "推广计划更新") |
| | | @PostMapping(value = "/updateTgjh") |
| | | public @ResponseBody |
| | | AjaxResult updateTgjh(@RequestBody UpdateTgjhDto updateTgjhDto) { |
| | | return shopSalesmanApplyService.updateTgjh(updateTgjhDto); |
| | | } |
| | | /** |
| | | *查询推广计划 |
| | | */ |
| | | @RequestMapping(value = "/loadTgwaSetting") |
| | | public AjaxResult loadTgwaSetting() { |
| | | |
| | | AjaxResult result= AjaxResult.buildSuccessInstance("查询成功"); |
| | | SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | Long companyId = user.getCompanyId(); |
| | | |
| | | //推广文案 |
| | | String[] FXKGCode={FenxiaoSettingConstant.FX_TG_PLAN}; |
| | | String[] FXKGName={"推广文案"}; |
| | | List<FenXiaoSettingVo> fxkgRuleSettingsVo = getRuleSettingsVo(FXKGCode,FXKGName,companyId); |
| | | result.putInMap("tgwa", fxkgRuleSettingsVo.get(0)); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | *获取对应的规则设置数据 |
| | | * @param ArrayCode |
| | | * @param ArrayName |
| | | * @param companyId |
| | | * @return |
| | | */ |
| | | private List<FenXiaoSettingVo> getRuleSettingsVo(String[] ArrayCode,String[] ArrayName,Long companyId){ |
| | | List<BusParameterSettings> dataList = busParameterSettingsDao.selectByCodesAndCompanyId(Arrays.asList(ArrayCode), companyId); |
| | | List<FenXiaoSettingVo> scoreRuleSettingsVos=new ArrayList<FenXiaoSettingVo>(); |
| | | int index=0; |
| | | for (BusParameterSettings item:dataList){ |
| | | FenXiaoSettingVo paramVo=new FenXiaoSettingVo(); |
| | | BeanUtils.copyProperties(item,paramVo); |
| | | paramVo.setParamName(ArrayName[index]); |
| | | scoreRuleSettingsVos.add(paramVo); |
| | | index++; |
| | | } |
| | | return scoreRuleSettingsVos; |
| | | } |
| | | |
| | | /** |
| | | * 分佣方案 |
| | | */ |
| | | @ApiOperation(value = "查询分佣方案") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "OK", response = FyfaManageVo.class) |
| | | }) |
| | | @PostMapping(value = "/findFyfaManageList") |
| | | public @ResponseBody |
| | | AjaxResult findFyfaManageList(@RequestBody FyfaManageDto fyfaManageDto) { |
| | | //设置用户公司ID |
| | | QueryUtil.setQueryLimitCom(fyfaManageDto); |
| | | //排序 |
| | | if(StringUtils.isBlank(fyfaManageDto.getSort())){ |
| | | fyfaManageDto.setSort("create_time"); |
| | | fyfaManageDto.setOrder("asc"); |
| | | } |
| | | Page<FyfaManageVo> page = new Page(fyfaManageDto.getPageNum(), fyfaManageDto.getPageSize()); |
| | | IPage<FyfaManageVo> rows = shopSalesmanApplyService.findFyfaManageList(page,fyfaManageDto); |
| | | AjaxResult result = AjaxResult.buildSuccessInstance(rows.getRecords(),rows.getTotal()); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | *新增分佣方案 |
| | | */ |
| | | @ApiOperation(value = "新增分佣方案") |
| | | @RequestMapping(value = "/addFyfa") |
| | | private @ResponseBody AjaxResult addFyfa(){ |
| | | SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | shopSalesmanApplyService.addFyfa(user); |
| | | return AjaxResult.buildSuccessInstance("新增成功"); |
| | | } |
| | | |
| | | /** |
| | | *修改分佣方案 |
| | | */ |
| | | @ApiOperation(value = "修改分佣方案") |
| | | @PostMapping(value = "/updateFyfa") |
| | | public @ResponseBody |
| | | AjaxResult updateFyfa(@RequestBody UpdateFyfaDto updateFyfaDto) { |
| | | return shopSalesmanApplyService.updateFyfa(updateFyfaDto); |
| | | } |
| | | |
| | | /** |
| | | *删除分佣方案 |
| | | */ |
| | | @ApiOperation(value = "删除分佣方案") |
| | | @PostMapping(value = "/delFyfaApply") |
| | | public @ResponseBody |
| | | AjaxResult delFyfaApply(@RequestBody DelFyfaApplyDto delFyfaApplyDto) { |
| | | return shopSalesmanApplyService.delFyfaApply(delFyfaApplyDto); |
| | | } |
| | | |
| | | /** |
| | | * 查询分销员审核记录 |
| | | */ |
| | | @ApiOperation(value = "查询分销员审核记录") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "OK", response = ShopSalesmanApplyVo.class) |
| | | }) |
| | | @PostMapping(value = "/findShopSalesmanApplyList") |
| | | public @ResponseBody |
| | | AjaxResult findShopSalesmanApplyList(@RequestBody ShopSalesmanApplyDto shopSalesmanApplyDto) { |
| | | //设置用户公司ID |
| | | QueryUtil.setQueryLimitCom(shopSalesmanApplyDto); |
| | | //排序 |
| | | if(StringUtils.isBlank(shopSalesmanApplyDto.getSort())){ |
| | | shopSalesmanApplyDto.setSort("create_time"); |
| | | shopSalesmanApplyDto.setOrder("desc"); |
| | | } |
| | | Page<ShopSalesmanApplyVo> page = new Page(shopSalesmanApplyDto.getPageNum(), shopSalesmanApplyDto.getPageSize()); |
| | | IPage<ShopSalesmanApplyVo> rows = shopSalesmanApplyService.findShopSalesmanApplyList(page,shopSalesmanApplyDto); |
| | | AjaxResult result = AjaxResult.buildSuccessInstance(rows.getRecords(),rows.getTotal()); |
| | | |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | *获取分销员待审核记录 |
| | | */ |
| | | @ApiOperation(value = "获取分销员待审核记录") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "OK", response = ShopSalesmanAppliingVo.class) |
| | | }) |
| | | @PostMapping(value = "/findShopSalesmanAppliingList") |
| | | public @ResponseBody |
| | | AjaxResult findShopSalesmanAppliingList(@RequestBody ShopSalesmanAppliingDto shopSalesmanAppliingDto) { |
| | | //设置用户公司ID |
| | | QueryUtil.setQueryLimitCom(shopSalesmanAppliingDto); |
| | | //排序 |
| | | if(StringUtils.isBlank(shopSalesmanAppliingDto.getSort())){ |
| | | shopSalesmanAppliingDto.setSort("create_time"); |
| | | shopSalesmanAppliingDto.setOrder("desc"); |
| | | } |
| | | |
| | | Page<ShopSalesmanAppliingVo> page = new Page(shopSalesmanAppliingDto.getPageNum(), shopSalesmanAppliingDto.getPageSize()); |
| | | IPage<ShopSalesmanAppliingVo> rows = shopSalesmanApplyService.selectBizUserApplyList(page,shopSalesmanAppliingDto); |
| | | |
| | | //IPage<ShopSalesmanAppliingVo> rows = shopSalesmanApplyService.findShopSalesmanAppliingList(page,shopSalesmanAppliingDto); |
| | | AjaxResult result = AjaxResult.buildSuccessInstance(rows.getRecords(),rows.getTotal()); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | *新增分销员 |
| | | */ |
| | | @ApiOperation(value = "新增分销员") |
| | | @PostMapping(value = "/addSaleManApply") |
| | | public @ResponseBody |
| | | AjaxResult addSaleManApply(@RequestBody AddSaleManApplyDto addSaleManApplyDto) { |
| | | |
| | | if(addSaleManApplyDto.getGradeId()==null) { |
| | | return AjaxResult.buildFailInstance("请选择分销等级"); |
| | | } |
| | | |
| | | shopSalesmanApplyService.addSaleManApply(addSaleManApplyDto.getUserId(), addSaleManApplyDto.getGradeId()); |
| | | return AjaxResult.buildSuccessInstance("设置成功"); |
| | | } |
| | | |
| | | /** |
| | | *删除---设置成不是分销员 |
| | | */ |
| | | @ApiOperation(value = "删除---设置成不是分销员") |
| | | @PostMapping(value = "/delSaleManGradeApply") |
| | | public @ResponseBody |
| | | AjaxResult delSaleManGradeApply(@RequestBody DelSaleManGradeApplyDto delSaleManGradeApplyDto) { |
| | | return shopSalesmanApplyService.delSaleManGradeApply(delSaleManGradeApplyDto); |
| | | } |
| | | |
| | | /** |
| | | *审核分销员 |
| | | */ |
| | | @ApiOperation(value = "审核分销员") |
| | | @PostMapping(value = "/examineSaleManApply") |
| | | public @ResponseBody |
| | | AjaxResult examineSaleManApply(@RequestBody ExamineSaleManApplyDto examineSaleManApplyDto) { |
| | | //设置用户公司ID |
| | | QueryUtil.setQueryLimitCom(examineSaleManApplyDto); |
| | | //待审核状态才允许提交 |
| | | ShopSalesmanApply shopSalesmanApply = shopSalesmanApplyDao.selectById(examineSaleManApplyDto.getApplyId()); |
| | | if(ObjectUtil.isEmpty(shopSalesmanApply)) { |
| | | return AjaxResult.buildFailInstance("当前记录有误"); |
| | | } |
| | | |
| | | SysVipInfo sysVipInfo = sysVipInfoDao.selectById(examineSaleManApplyDto.getUserId()); |
| | | if(ObjectUtil.isEmpty(sysVipInfo)) { |
| | | return AjaxResult.buildFailInstance("当前记录有误"); |
| | | } |
| | | |
| | | Integer applyStatus = shopSalesmanApply.getApplyStatus(); |
| | | if(ObjectUtil.isNotEmpty(applyStatus) && ShopSalesmanApply.APPLY_STATUS_DSH == applyStatus) { |
| | | Integer applyState = examineSaleManApplyDto.getApplyState(); |
| | | shopSalesmanApplyService.examineSaleManApply(shopSalesmanApply,applyState); |
| | | return AjaxResult.buildSuccessInstance("审核成功"); |
| | | }else{ |
| | | return AjaxResult.buildFailInstance("当前记录不是待审核状态"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | *获取对应的分销员等级 |
| | | */ |
| | | @RequestMapping(value = "/getShopSalesmanGrade") |
| | | private @ResponseBody AjaxResult getShopSalesmanGradeVo(){ |
| | | AjaxResult result= AjaxResult.buildSuccessInstance("查询成功"); |
| | | SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | |
| | | List<ShopSalesmanGradeVo> dataList = shopSalesmanApplyService.getShopSalesmanGradeVo(user.getCompanyId()); |
| | | result.putInMap("salesGrade", dataList); |
| | | return result; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.constant; |
| | | |
| | | public class FenxiaoSettingConstant { |
| | | /** |
| | | * 分销开关 |
| | | */ |
| | | public final static String FX_SWITCH = "FX_SWITCH"; |
| | | /** |
| | | * 分销模式 |
| | | */ |
| | | public final static String FX_MODEL = "FX_MODEL"; |
| | | /** |
| | | * 自购返佣 1:是 2:否 |
| | | */ |
| | | public final static String FX_ZGFY = "FX_ZGFY"; |
| | | |
| | | public final static String FX_ZGFY_YES = "1"; |
| | | public final static String FX_ZGFY_NO = "2"; |
| | | /** |
| | | * 申请方式 |
| | | */ |
| | | public final static String FX_APPLY_WAY = "FX_APPLY_WAY"; |
| | | /** |
| | | * 申请方式 1自动申请通过 |
| | | */ |
| | | public final static String FX_APPLY_WAY_AUTO = "1"; |
| | | /** |
| | | * 申请方式 2需要主动申请 |
| | | */ |
| | | public final static String FX_APPLY_WAY_CUSTOMER = "2"; |
| | | /** |
| | | * 审核方式 1系统自动审核,2人工审核 |
| | | */ |
| | | public final static String FX_AUDIT_METHOD = "FX_AUDIT_METHOD"; |
| | | /** |
| | | * 申请条件 |
| | | */ |
| | | public final static String FX_APPLY_CONDITION = "FX_APPLY_CONDITION"; |
| | | /** |
| | | * 申请条件 1 无条件 |
| | | */ |
| | | public final static String FX_APPLY_CONDITION_WTJ = "1"; |
| | | /** |
| | | * 申请条件 2 消费任意产品 |
| | | */ |
| | | public final static String FX_APPLY_CONDITION_XFRYCP = "2"; |
| | | /** |
| | | * 申请条件 3 消费指定产品 |
| | | */ |
| | | public final static String FX_APPLY_CONDITION_XFZDCP = "3"; |
| | | /** |
| | | * 申请条件 4 消费指定金额 |
| | | */ |
| | | public final static String FX_APPLY_CONDITION_XCZDJE = "4"; |
| | | /** |
| | | * 推广计划 |
| | | */ |
| | | public final static String FX_TG_PLAN = "FX_TG_PLAN"; |
| | | |
| | | public static final String FX_TG_POSTER ="FX_TG_POSTER"; |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.matrix.system.fenxiao.entity.BizUser; |
| | | |
| | | /** |
| | | * @description 推广员申请记录 |
| | | * @author jyy |
| | | * @date 2021-03-10 15:22 |
| | | */ |
| | | public interface BizUserDao extends BaseMapper<BizUser> { |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.matrix.system.fenxiao.entity.FenXiaoSettingEntity; |
| | | |
| | | public interface FenXiaoSettingDao extends BaseMapper<FenXiaoSettingEntity> { |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.matrix.system.fenxiao.entity.ShopRevenueFlow; |
| | | import com.matrix.system.shopXcx.api.dto.RevenueFlowDto; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * @description 收益流水 |
| | | * @author jyy |
| | | * @date 2021-03-10 15:22 |
| | | */ |
| | | public interface ShopRevenueFlowDao extends BaseMapper<ShopRevenueFlow> { |
| | | |
| | | IPage<ShopRevenueFlow> selectRevenuFlowList(Page<ShopRevenueFlow> page, @Param("record") RevenueFlowDto revenueFlowDto); |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.matrix.system.fenxiao.entity.ShopSalemanSettlement; |
| | | |
| | | /** |
| | | * @description 订单结算记录 |
| | | * @author jyy |
| | | * @date 2021-03-10 15:22 |
| | | */ |
| | | public interface ShopSalemanSettlementDao extends BaseMapper<ShopSalemanSettlement> { |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.matrix.system.fenxiao.dto.LoadParamSettingDto; |
| | | import com.matrix.system.fenxiao.dto.ShopSalesmanAppliingDto; |
| | | import com.matrix.system.fenxiao.dto.ShopSalesmanApplyDto; |
| | | import com.matrix.system.fenxiao.dto.ShopSalesmanDetailDto; |
| | | import com.matrix.system.fenxiao.entity.ShopSalesmanApply; |
| | | import com.matrix.system.fenxiao.vo.SalesmanBasicDetailVo; |
| | | import com.matrix.system.fenxiao.vo.ShopCustomDetailVo; |
| | | import com.matrix.system.fenxiao.vo.ShopOrderDetailVo; |
| | | import com.matrix.system.fenxiao.vo.ShopSalesmanAppliingVo; |
| | | import com.matrix.system.fenxiao.vo.ShopSalesmanApplyVo; |
| | | import com.matrix.system.shopXcx.vo.SalesmanCenterInfo; |
| | | import com.matrix.system.shopXcx.vo.SalesmanVo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * @description 推广员申请记录 |
| | | * @author jyy |
| | | * @date 2021-03-10 15:22 |
| | | */ |
| | | public interface ShopSalesmanApplyDao extends BaseMapper<ShopSalesmanApply> { |
| | | |
| | | IPage<SalesmanVo> selectInvitationuserInPage(Page<SalesmanVo> page, @Param("userId") Long userId, @Param("isSales")String isSales); |
| | | |
| | | IPage<SalesmanVo> selectInvitationuserInPage(Page<SalesmanVo> page, @Param("userId") Long userId); |
| | | |
| | | IPage<ShopSalesmanApplyVo> findShopSalesmanApplyList(Page<ShopSalesmanApplyVo> page, |
| | | @Param("record")ShopSalesmanApplyDto shopSalesmanApplyDto); |
| | | //根据公司ID、审核状态、会员昵称查询对应的记录 |
| | | IPage<ShopSalesmanAppliingVo> findShopSalesmanAppliingList(Page<ShopSalesmanAppliingVo> page, |
| | | @Param("record")ShopSalesmanAppliingDto shopSalesmanAppliingDto); |
| | | |
| | | IPage<ShopSalesmanAppliingVo> selectBizUserApplyList(Page<ShopSalesmanAppliingVo> page, |
| | | @Param("record")ShopSalesmanAppliingDto shopSalesmanAppliingDto); |
| | | |
| | | SalesmanCenterInfo selectSalesmanCenterInfo(Long id); |
| | | |
| | | SalesmanBasicDetailVo selectShopSalesmanDetailByOpenId(@Param("userId")Long userId, |
| | | @Param("companyId")Long companyId,@Param("applyId")long applyId); |
| | | |
| | | IPage<ShopCustomDetailVo> findCustomDetail(Page<ShopCustomDetailVo> page, |
| | | @Param("record")LoadParamSettingDto loadParamSettingDto); |
| | | |
| | | IPage<ShopCustomDetailVo> findCustomLow(Page<ShopCustomDetailVo> pageLow, |
| | | @Param("record")ShopSalesmanDetailDto shopSalesmanDetailDto); |
| | | |
| | | IPage<ShopOrderDetailVo> findShopOrderDetail(Page<ShopOrderDetailVo> pageOrder, |
| | | @Param("record")ShopSalesmanDetailDto shopSalesmanDetailDto); |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.matrix.system.fenxiao.dto.FyfaManageDto; |
| | | import com.matrix.system.fenxiao.entity.ShopSalesmanGrade; |
| | | import com.matrix.system.fenxiao.vo.FyfaManageVo; |
| | | import com.matrix.system.fenxiao.vo.ShopSalesmanGradeVo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @description 推广员等级 |
| | | * @author jyy |
| | | * @date 2021-03-10 15:22 |
| | | */ |
| | | public interface ShopSalesmanGradeDao extends BaseMapper<ShopSalesmanGrade> { |
| | | |
| | | List<ShopSalesmanGradeVo> getShopSalesmanGradeVo(@Param("companyId")Long companyId); |
| | | |
| | | IPage<FyfaManageVo> findFyfaManageList(Page<FyfaManageVo> page,@Param("record")FyfaManageDto fyfaManageDto); |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.matrix.system.fenxiao.dto.LoadFenxiaoOrderListDto; |
| | | import com.matrix.system.fenxiao.dto.LoadSetOrderListDtoDto; |
| | | import com.matrix.system.fenxiao.entity.ShopSalesmanOrder; |
| | | import com.matrix.system.fenxiao.vo.LoadFenxiaoOrderBasicVo; |
| | | import com.matrix.system.fenxiao.vo.LoadFenxiaoOrderListVo; |
| | | import com.matrix.system.fenxiao.vo.LoadSetOrderListDtoVo; |
| | | import com.matrix.system.shopXcx.api.dto.SaleOrderDto; |
| | | import com.matrix.system.shopXcx.vo.SalesOrderVo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * @description 分销订单 |
| | | * @author jyy |
| | | * @date 2021-03-10 15:22 |
| | | */ |
| | | public interface ShopSalesmanOrderDao extends BaseMapper<ShopSalesmanOrder> { |
| | | |
| | | /** |
| | | * 查询推广订单 |
| | | * @param page |
| | | * @param saleOrderDto |
| | | * @return |
| | | */ |
| | | IPage<SalesOrderVo> selectSalesManOrder(Page<SalesOrderVo> page, @Param("record") SaleOrderDto saleOrderDto); |
| | | |
| | | LoadFenxiaoOrderBasicVo selectFenxiaoOrderBasicByCompanyId(@Param("companyId")Long companyId); |
| | | |
| | | IPage<LoadFenxiaoOrderListVo> findFenxiaoOrderList(Page<LoadFenxiaoOrderListVo> page, |
| | | @Param("record")LoadFenxiaoOrderListDto loadFenxiaoOrderListDto); |
| | | |
| | | IPage<LoadSetOrderListDtoVo> findSetOrderList(Page<LoadSetOrderListDtoVo> page, |
| | | @Param("record")LoadSetOrderListDtoDto loadSetOrderListDto); |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.matrix.system.fenxiao.entity.ShopSalesmanOrderItem; |
| | | |
| | | /** |
| | | * @description 分销单明细 |
| | | * @author yourName |
| | | * @date 2021-03-12 13:17 |
| | | */ |
| | | public interface ShopSalesmanOrderItemDao extends BaseMapper<ShopSalesmanOrderItem> { |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "AddSaleManApplyDto", description = "查询参数") |
| | | public class AddSaleManApplyDto { |
| | | |
| | | @ApiModelProperty(value ="会员ID") |
| | | private Long userId; |
| | | |
| | | |
| | | @ApiModelProperty(value ="等级ID") |
| | | private Long gradeId; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "ChangeSaleManGradeDto", description = "查询参数") |
| | | public class ChangeSaleManGradeDto { |
| | | |
| | | @ApiModelProperty(value ="会员id") |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty(value ="等级ID") |
| | | private Long gradeId; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "DelFyfaApplyDto", description = "参数") |
| | | public class DelFyfaApplyDto { |
| | | |
| | | @ApiModelProperty(value ="申请记录ID") |
| | | private Long gradeId; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "DelSaleManGradeApplyDto", description = "查询参数") |
| | | public class DelSaleManGradeApplyDto { |
| | | |
| | | @ApiModelProperty(value ="会员id") |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty(value ="申请记录ID") |
| | | private Long applyId; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | @ApiModel(value = "ExamineSaleManApplyDto", description = "查询参数") |
| | | public class ExamineSaleManApplyDto { |
| | | |
| | | @NotNull |
| | | @ApiModelProperty(value ="会员ID") |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty(value = "申请记录ID") |
| | | private Long applyId; |
| | | |
| | | @ApiModelProperty(value ="审核状态 2:同意 3:不同意") |
| | | private Integer applyState; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.dto; |
| | | |
| | | import com.matrix.core.pojo.BasePageQueryDto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "FyfaManageDto", description = "查询参数") |
| | | public class FyfaManageDto extends BasePageQueryDto { |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | @ApiModelProperty(value ="会员ID") |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty(value ="申请记录ID") |
| | | private Long applyId; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "LoadFenxiaoOrderBasicDto", description = "查询参数") |
| | | public class LoadFenxiaoOrderBasicDto { |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.dto; |
| | | |
| | | import com.matrix.core.pojo.BasePageQueryDto; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @ApiModel(value = "LoadFenxiaoOrderListDto", description = "查询参数") |
| | | public class LoadFenxiaoOrderListDto extends BasePageQueryDto { |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | @ApiModelProperty(value ="订单状态") |
| | | private Integer ddType; |
| | | |
| | | @ApiModelProperty(value ="结算状态") |
| | | private Integer orderType; |
| | | |
| | | @ApiModelProperty(value ="客户名称") |
| | | private String userName; |
| | | |
| | | @ApiModelProperty(value ="推广员名称") |
| | | private String tgy; |
| | | |
| | | @ApiModelProperty(value ="开始时间") |
| | | private Date startTime; |
| | | |
| | | @ApiModelProperty(value ="结束时间") |
| | | private Date endTime; |
| | | |
| | | @ApiModelProperty(value ="结算编号") |
| | | private String jsbh; |
| | | |
| | | @ApiModelProperty(value ="订单号") |
| | | private String ddh; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "LoadParamSettingBasicDto", description = "查询参数") |
| | | public class LoadParamSettingBasicDto { |
| | | |
| | | @ApiModelProperty(value ="会员ID") |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty(value ="申请记录ID") |
| | | private Long applyId; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.dto; |
| | | |
| | | import com.matrix.core.pojo.BasePageQueryDto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "LoadParamSettingDto", description = "查询参数") |
| | | public class LoadParamSettingDto extends BasePageQueryDto { |
| | | |
| | | @ApiModelProperty(value ="会员姓名") |
| | | private String userName; |
| | | |
| | | @ApiModelProperty(value ="会员ID") |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty(value ="申请记录ID") |
| | | private Long applyId; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.dto; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.matrix.core.pojo.BasePageQueryDto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "LoadSetOrderListDtoDto", description = "查询参数") |
| | | public class LoadSetOrderListDtoDto extends BasePageQueryDto { |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | @ApiModelProperty(value ="会员姓名") |
| | | private String userName; |
| | | |
| | | @ApiModelProperty(value ="开始时间") |
| | | private Date startTime; |
| | | |
| | | @ApiModelProperty(value ="结束时间") |
| | | private Date endTime; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.dto; |
| | | |
| | | import com.matrix.core.pojo.BasePageQueryDto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "ShopSalesmanAppliingDto", description = "查询参数") |
| | | public class ShopSalesmanAppliingDto extends BasePageQueryDto { |
| | | |
| | | @ApiModelProperty(value ="会员名称") |
| | | private String nickName; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.dto; |
| | | |
| | | import com.matrix.core.pojo.BasePageQueryDto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "ShopSalesmanApplyDto", description = "查询参数") |
| | | public class ShopSalesmanApplyDto extends BasePageQueryDto { |
| | | |
| | | @ApiModelProperty(value ="审核状态") |
| | | private Integer shenheState; |
| | | @ApiModelProperty(value ="分销员等级") |
| | | private Long salemanGrade; |
| | | @ApiModelProperty(value ="会员姓名") |
| | | private String userName; |
| | | |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.dto; |
| | | |
| | | import com.matrix.core.pojo.BasePageQueryDto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "ShopSalesmanDetailDto", description = "查询参数") |
| | | public class ShopSalesmanDetailDto extends BasePageQueryDto { |
| | | |
| | | @ApiModelProperty(value ="会员姓名") |
| | | private String userName; |
| | | |
| | | @ApiModelProperty(value ="会员ID") |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty(value ="申请记录ID") |
| | | private Long applyId; |
| | | |
| | | @ApiModelProperty(value = " 结算状态1,待结算,2,已结算,3已退款") |
| | | private Integer orderType; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "UnbundlingSaleManDto", description = "查询参数") |
| | | public class UnbundlingSaleManDto { |
| | | |
| | | @ApiModelProperty(value ="会员ID") |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "UpdateFyfaDto", description = "参数") |
| | | public class UpdateFyfaDto { |
| | | |
| | | @ApiModelProperty(value = "id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "方案名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "自购返佣%") |
| | | private Double selfCommission; |
| | | |
| | | @ApiModelProperty(value = "推广提成%") |
| | | private Double sealesCommission; |
| | | |
| | | @ApiModelProperty(value = "邀请提成 %") |
| | | private Double invitationCommission; |
| | | |
| | | @ApiModelProperty(value = "等级条件(推广金额)") |
| | | private Double gradeCondition; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "UpdateSetOrderDoneDto", description = "查询参数") |
| | | public class UpdateSetOrderDoneDto { |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | @ApiModelProperty(value ="需要处理的IDs(字符串逗号隔开)") |
| | | private String orderIds; |
| | | |
| | | @ApiModelProperty(value ="结算方式1,线下结算,2余额结算") |
| | | private Integer setType; |
| | | |
| | | @ApiModelProperty(value ="结算人数") |
| | | private Integer manCount; |
| | | |
| | | @ApiModelProperty(value ="结算单数") |
| | | private Integer orderCount; |
| | | |
| | | @ApiModelProperty(value ="结算金额") |
| | | private Double amount; |
| | | |
| | | @ApiModelProperty(value ="备注") |
| | | private String remark; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "UpdateTgjhDto", description = "参数") |
| | | public class UpdateTgjhDto { |
| | | |
| | | @ApiModelProperty(value = "方案名称") |
| | | private String tgfa; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "UpdateTgjhDto", description = "参数") |
| | | public class UpdateTgtpDto { |
| | | |
| | | @ApiModelProperty(value = "方案名称") |
| | | private String imageUrl; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.matrix.core.anotations.Extend; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @description 用户表 |
| | | * @author jyy |
| | | */ |
| | | @Data |
| | | @TableName("biz_user") |
| | | public class BizUser { |
| | | @Extend |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | private String userId; |
| | | |
| | | |
| | | /** |
| | | * 真实姓名 |
| | | */ |
| | | private String userName; |
| | | |
| | | |
| | | /** |
| | | * 密码 |
| | | */ |
| | | private String userPassword; |
| | | |
| | | |
| | | /** |
| | | * 用户昵称 |
| | | */ |
| | | private String nickName; |
| | | |
| | | |
| | | /** |
| | | * 头像 |
| | | */ |
| | | private String avatarUrl; |
| | | |
| | | |
| | | /** |
| | | * 微信openid用户唯一标识 |
| | | */ |
| | | private String openId; |
| | | |
| | | |
| | | /** |
| | | * 用户在开发平台的唯一标识符 |
| | | */ |
| | | private String unionId; |
| | | |
| | | |
| | | /** |
| | | * 性别 1、男 2、女 0、未知 |
| | | */ |
| | | private String gender; |
| | | |
| | | |
| | | /** |
| | | * 手机号码 |
| | | */ |
| | | private String phoneNumber; |
| | | |
| | | |
| | | /** |
| | | * 用户所在地 |
| | | */ |
| | | private String area; |
| | | |
| | | |
| | | /** |
| | | * 用户所在城市 |
| | | */ |
| | | private String city; |
| | | |
| | | |
| | | /** |
| | | * 用户所在省份 |
| | | */ |
| | | private String province; |
| | | |
| | | |
| | | /** |
| | | * 用户所在国家 |
| | | */ |
| | | private String country; |
| | | |
| | | |
| | | /** |
| | | * 会话密匙 |
| | | */ |
| | | private String sessionKey; |
| | | |
| | | |
| | | /** |
| | | * 最后登录时间 |
| | | */ |
| | | private Date lastLoginTime; |
| | | |
| | | |
| | | /** |
| | | * 用户状态 |
| | | */ |
| | | private Integer userStatus; |
| | | |
| | | |
| | | /** |
| | | * vip等级 |
| | | */ |
| | | private Integer userVip; |
| | | |
| | | |
| | | /** |
| | | * 到期时间 |
| | | */ |
| | | private Date userExpiryTime; |
| | | |
| | | |
| | | /** |
| | | * 认证信息 |
| | | */ |
| | | private String userAuthentication; |
| | | |
| | | |
| | | /** |
| | | * 用户是否授权 1、是 2、否 |
| | | */ |
| | | private Integer userIsAuthorize; |
| | | |
| | | |
| | | /** |
| | | * 用户临时名称 |
| | | */ |
| | | private String userTempName; |
| | | |
| | | |
| | | /** |
| | | * 用户临时头像 |
| | | */ |
| | | private String userTempAvatarUrl; |
| | | |
| | | |
| | | /** |
| | | * 用户类型 1、普通用户 2、会员 3、游客 |
| | | */ |
| | | private Integer userType; |
| | | |
| | | |
| | | /** |
| | | * 用户总积分 |
| | | */ |
| | | private Integer totalScore; |
| | | |
| | | |
| | | /** |
| | | * 用户当前积分 |
| | | */ |
| | | private Integer currentScore; |
| | | |
| | | |
| | | /** |
| | | * 上级用户openId |
| | | */ |
| | | private String parentOpenId; |
| | | |
| | | |
| | | /** |
| | | * 绑定上级用户时间 |
| | | */ |
| | | private Date bindingParentTime; |
| | | |
| | | |
| | | /** |
| | | * 是否是销售员(1=是,0=否) |
| | | */ |
| | | private Integer isSales; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.matrix.system.score.entity.BaseEntity; |
| | | |
| | | @TableName("score_order") |
| | | public class FenXiaoSettingEntity extends BaseEntity { |
| | | |
| | | private String orderNo; |
| | | |
| | | public String getOrderNo() { |
| | | return orderNo; |
| | | } |
| | | |
| | | public void setOrderNo(String orderNo) { |
| | | this.orderNo = orderNo; |
| | | } |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.matrix.core.anotations.Extend; |
| | | import com.matrix.system.score.entity.BaseEntity; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @description 收益流水 |
| | | * @author yourName |
| | | * @date 2021-03-10 17:34 |
| | | */ |
| | | @Data |
| | | @TableName("shop_revenue_flow") |
| | | public class ShopRevenueFlow extends BaseEntity { |
| | | @Extend |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 推广收益类型 推广收益 |
| | | */ |
| | | public static final String TYPE_TGSY = "推广收益"; |
| | | /** |
| | | * 推广收益类型 邀请收益 |
| | | */ |
| | | |
| | | public static final String TYPE_YQSY = "邀请收益"; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 用户id |
| | | */ |
| | | @ApiModelProperty(hidden = true) |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 收益说明 |
| | | */ |
| | | |
| | | @ApiModelProperty(value = "收益说明") |
| | | private String revenueContent; |
| | | |
| | | /** |
| | | * 收益金额 |
| | | */ |
| | | |
| | | @ApiModelProperty(value = "收益金额") |
| | | private Double amount; |
| | | |
| | | /** |
| | | * 原始订单ID |
| | | */ |
| | | |
| | | @ApiModelProperty(value = "原始订单ID") |
| | | private Long businessId; |
| | | |
| | | /** |
| | | * 公司ID |
| | | */ |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.matrix.core.anotations.Extend; |
| | | import com.matrix.system.score.entity.BaseEntity; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @description 订单结算记录 |
| | | * @author yourName |
| | | * @date 2021-03-10 17:34 |
| | | */ |
| | | @Data |
| | | @TableName("shop_saleman_settlement") |
| | | public class ShopSalemanSettlement extends BaseEntity { |
| | | @Extend |
| | | private static final long serialVersionUID = 1L; |
| | | /** |
| | | * 结算编号头部编码 |
| | | */ |
| | | public static final String ORDERNO_START = "J"; |
| | | |
| | | /** |
| | | * 结算方式 1 线下结算 |
| | | */ |
| | | public static final Integer SETTLEMENTWAY_XXJS = 1; |
| | | |
| | | /** |
| | | * 结算方式 2 微信余额结算 |
| | | */ |
| | | public static final Integer SETTLEMENTWAY_YEJS = 2; |
| | | |
| | | |
| | | /** |
| | | * 结算编号 |
| | | */ |
| | | |
| | | |
| | | private String orderNo; |
| | | |
| | | /** |
| | | * 结算方式1,线下结算,2余额结算 |
| | | */ |
| | | |
| | | |
| | | private Integer settlementWay; |
| | | |
| | | /** |
| | | * 结算人数 |
| | | */ |
| | | |
| | | |
| | | private Integer manCount; |
| | | |
| | | /** |
| | | * 结算单数 |
| | | */ |
| | | |
| | | |
| | | private Integer orderCount; |
| | | |
| | | /** |
| | | * 结算金额 |
| | | */ |
| | | |
| | | |
| | | private Double amount; |
| | | |
| | | /** |
| | | * 结算人 |
| | | */ |
| | | |
| | | |
| | | private Integer userId; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | |
| | | |
| | | private String remark; |
| | | |
| | | /** |
| | | * 公司ID |
| | | */ |
| | | |
| | | |
| | | private Long companyId; |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.matrix.system.score.entity.BaseEntity; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @description 推广员申请记录 |
| | | * @author yourName |
| | | * @date 2021-03-10 17:34 |
| | | */ |
| | | @Data |
| | | @TableName("shop_salesman_apply") |
| | | public class ShopSalesmanApply extends BaseEntity { |
| | | /** |
| | | * 审核状态-1、待审核 |
| | | */ |
| | | public static final int APPLY_STATUS_DSH = 1; |
| | | /** |
| | | * 审核状态-2通过 |
| | | */ |
| | | public static final int APPLY_STATUS_TG= 2; |
| | | /** |
| | | * 审核状态-3未通过 |
| | | */ |
| | | public static final int APPLY_STATUS_WTG = 3; |
| | | /** |
| | | * 审核状态-4系统删除 |
| | | */ |
| | | public static final int APPLY_STATUS_XTQX = 4; |
| | | |
| | | |
| | | /** |
| | | * 申请方式1、自主申请 |
| | | */ |
| | | public static final int APPLY_WAY_SELF=1; |
| | | /** |
| | | * 申请方式2、自动添加 |
| | | */ |
| | | public static final int APPLY_WAY_AUTO_ADD=2; |
| | | /** |
| | | * 申请方式3上级邀请 |
| | | */ |
| | | public static final int APPLY_WAY_INVITATION=3; |
| | | /** |
| | | * 申请方式 4、手动添加 |
| | | */ |
| | | public static final int APPLY_WAY_HAND_ADD=4; |
| | | |
| | | |
| | | |
| | | @ApiModelProperty(value = "申请方式1、自主申请,2、自动添加,3上级邀请,4、手动添加") |
| | | private Integer applyWay; |
| | | |
| | | @ApiModelProperty(value = "申请用户id") |
| | | private Long userId; |
| | | |
| | | |
| | | @ApiModelProperty(value = "邀请用户ID") |
| | | private Long parentUserId; |
| | | |
| | | |
| | | @ApiModelProperty(value = "申请状态1、待审核,2通过,3未通过") |
| | | private Integer applyStatus; |
| | | |
| | | @ApiModelProperty(value = "备注") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(value = "等级ID") |
| | | private long gradeId; |
| | | |
| | | /** |
| | | * 公司ID |
| | | */ |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.matrix.core.anotations.Extend; |
| | | import com.matrix.system.score.entity.BaseEntity; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @description 推广员等级 |
| | | * @author yourName |
| | | * @date 2021-03-10 17:34 |
| | | */ |
| | | @Data |
| | | @TableName("shop_salesman_grade") |
| | | public class ShopSalesmanGrade extends BaseEntity { |
| | | @Extend |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 等级名称 |
| | | */ |
| | | |
| | | |
| | | private String name; |
| | | |
| | | /** |
| | | * 推广提成% |
| | | */ |
| | | |
| | | |
| | | private Double sealesCommission; |
| | | |
| | | /** |
| | | * 自购返佣比例% |
| | | */ |
| | | |
| | | private Double selfCommission; |
| | | |
| | | |
| | | /** |
| | | * 邀请提成 % |
| | | */ |
| | | |
| | | |
| | | private Double invitationCommission; |
| | | |
| | | /** |
| | | * 等级条件(推广金额额) |
| | | */ |
| | | |
| | | |
| | | private Double gradeCondition; |
| | | |
| | | /** |
| | | * 默认等级1是,2不是 |
| | | */ |
| | | |
| | | |
| | | private Integer isDefault; |
| | | |
| | | /** |
| | | * 公司ID |
| | | */ |
| | | |
| | | |
| | | private Long companyId; |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.matrix.core.anotations.Extend; |
| | | import com.matrix.system.score.entity.BaseEntity; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @description 分销订单 |
| | | * @author yourName |
| | | * @date 2021-03-10 17:34 |
| | | */ |
| | | @Data |
| | | @TableName("shop_salesman_order") |
| | | public class ShopSalesmanOrder extends BaseEntity { |
| | | /** |
| | | * 推广收益类型1推广收益 |
| | | */ |
| | | public static final Integer REVENUE_TYPE_SALES = 1; |
| | | |
| | | /** |
| | | * 推广收益类型2邀请收益 |
| | | */ |
| | | public static final Integer REVENUE_TYPE_INVITATION = 2; |
| | | /** |
| | | * 分销单状态1待结算 |
| | | */ |
| | | public static final Integer STATUS_DJS = 1; |
| | | /** |
| | | * 分销单状态2已结算 |
| | | */ |
| | | public static final Integer STATUS_YJS = 2; |
| | | /** |
| | | * 分销单状态3已退款 |
| | | */ |
| | | public static final Integer STATUS_YTK = 3; |
| | | |
| | | |
| | | @Extend |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 订单id |
| | | */ |
| | | |
| | | |
| | | private Long orderId ; |
| | | |
| | | /** |
| | | * 用户id |
| | | */ |
| | | |
| | | |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 收益人id |
| | | */ |
| | | |
| | | |
| | | private Long salesUserId; |
| | | |
| | | /** |
| | | * 收益类型1,推广收益,2邀请收益 |
| | | */ |
| | | |
| | | |
| | | private Integer revenueType; |
| | | |
| | | /** |
| | | * 收益金额 |
| | | */ |
| | | |
| | | |
| | | private Double amount; |
| | | |
| | | /** |
| | | * 结算状态 1,待结算,2,已结算,3已退款 |
| | | */ |
| | | private Integer orderStatus; |
| | | |
| | | /** |
| | | * 结算单ID |
| | | */ |
| | | |
| | | |
| | | private Long settlementId; |
| | | |
| | | /** |
| | | * 公司ID |
| | | */ |
| | | |
| | | |
| | | private Long companyId; |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.matrix.core.anotations.Extend; |
| | | import com.matrix.system.score.entity.BaseEntity; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @description 分销单明细 |
| | | * @author yourName |
| | | * @date 2021-03-12 13:17 |
| | | */ |
| | | @Data |
| | | @TableName("shop_salesman_order_item") |
| | | public class ShopSalesmanOrderItem extends BaseEntity { |
| | | @Extend |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 订单id |
| | | */ |
| | | |
| | | |
| | | private Long orderId ; |
| | | |
| | | /** |
| | | * 分销订单id |
| | | */ |
| | | |
| | | |
| | | private Long salesmanOrderId; |
| | | |
| | | /** |
| | | * 订单明细id |
| | | */ |
| | | |
| | | |
| | | private Long orderItemId; |
| | | |
| | | /** |
| | | * 收益金额 |
| | | */ |
| | | |
| | | |
| | | private Double amount; |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.service; |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.common.bean.BusParameterSettings; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.fenxiao.dao.FenXiaoSettingDao; |
| | | import com.matrix.system.fenxiao.entity.FenXiaoSettingEntity; |
| | | import com.matrix.system.hive.bean.ShoppingGoods; |
| | | |
| | | @Service |
| | | public class FenXiaoSettingService extends ServiceImpl<FenXiaoSettingDao, FenXiaoSettingEntity> { |
| | | |
| | | @Autowired |
| | | private BusParameterSettingsDao busParameterSettingsDao; |
| | | |
| | | public AjaxResult updateFenXiaoSettingByCompanyId(List<BusParameterSettings> busParameterSettings) { |
| | | //获取当前登录人员信息 |
| | | SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | for (BusParameterSettings busParameterSetting:busParameterSettings ) { |
| | | String paramCode = busParameterSetting.getParamCode(); |
| | | if(StringUtils.isNotBlank(paramCode)){ |
| | | //删除原有code |
| | | BusParameterSettings delParanm=new BusParameterSettings(); |
| | | delParanm.setCompanyId(user.getCompanyId()); |
| | | delParanm.setParamCode(paramCode); |
| | | busParameterSettingsDao.deleteByModel(delParanm); |
| | | //添加新的code |
| | | BusParameterSettings newParam=new BusParameterSettings(); |
| | | newParam.setParamCode(paramCode); |
| | | newParam.setCompanyId(user.getCompanyId()); |
| | | newParam.setParamValue(busParameterSetting.getParamValue()); |
| | | newParam.setParamValue1(busParameterSetting.getParamValue1()); |
| | | newParam.setParamValue2(busParameterSetting.getParamValue2()); |
| | | busParameterSettingsDao.insert(newParam); |
| | | }else{ |
| | | return AjaxResult.buildFailInstance("code不能为空"); |
| | | } |
| | | } |
| | | AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, "更新成功"); |
| | | return result; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.matrix.system.fenxiao.dao.ShopRevenueFlowDao; |
| | | import com.matrix.system.fenxiao.entity.ShopRevenueFlow; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @description 收益流水 |
| | | * @author jyy |
| | | * @date 2021-03-10 15:22 |
| | | */ |
| | | @Service |
| | | public class ShopRevenueFlowService extends ServiceImpl<ShopRevenueFlowDao, ShopRevenueFlow>{ |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.matrix.system.fenxiao.dao.ShopSalemanSettlementDao; |
| | | import com.matrix.system.fenxiao.entity.ShopSalemanSettlement; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @description 订单结算记录 |
| | | * @author jyy |
| | | * @date 2021-03-10 15:22 |
| | | */ |
| | | @Service |
| | | public class ShopSalemanSettlementService extends ServiceImpl<ShopSalemanSettlementDao, ShopSalemanSettlement>{ |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.service; |
| | | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.pojo.VerificationResult; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.common.bean.BusParameterSettings; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.fenxiao.constant.FenxiaoSettingConstant; |
| | | import com.matrix.system.fenxiao.dao.ShopSalesmanApplyDao; |
| | | import com.matrix.system.fenxiao.dao.ShopSalesmanGradeDao; |
| | | import com.matrix.system.fenxiao.dto.*; |
| | | import com.matrix.system.fenxiao.entity.ShopSalesmanApply; |
| | | import com.matrix.system.fenxiao.entity.ShopSalesmanGrade; |
| | | import com.matrix.system.fenxiao.vo.*; |
| | | import com.matrix.system.hive.action.util.QueryUtil; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import com.matrix.system.hive.service.SysVipInfoService; |
| | | import com.matrix.system.shopXcx.dao.ShopOrderV2Dao; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @description 推广员申请记录 |
| | | * @author jyy |
| | | * @date 2021-03-10 15:22 |
| | | */ |
| | | @Service |
| | | public class ShopSalesmanApplyService extends ServiceImpl<ShopSalesmanApplyDao, ShopSalesmanApply>{ |
| | | |
| | | |
| | | @Autowired |
| | | BusParameterSettingsDao busParameterSettingsDao; |
| | | |
| | | @Autowired |
| | | ShopSalesmanApplyDao shopSalesmanApplyDao; |
| | | |
| | | @Autowired |
| | | ShopSalesmanGradeDao shopSalesmanGradeDao; |
| | | |
| | | @Autowired |
| | | SysVipInfoDao sysVipInfoDao; |
| | | |
| | | @Autowired |
| | | SysVipInfoService sysVipInfoService; |
| | | |
| | | @Autowired |
| | | ShopOrderV2Dao shopOrderV2Dao; |
| | | |
| | | /** |
| | | * 申请成为推广员 |
| | | * @param userId |
| | | * @param invitationId |
| | | * @return |
| | | */ |
| | | public ShopSalesmanApply applyToBeAnSalesman(Long userId,Long gradeId,Long invitationId,int applyWay) { |
| | | |
| | | SysVipInfo loginUser=sysVipInfoDao.selectById(userId); |
| | | //验证申请条件 |
| | | VerificationResult verificationResult = isAbleToBeAnSalesman(userId,loginUser.getCompanyId()); |
| | | if(verificationResult.isJudgeResult()){ |
| | | //校验审核状态,和是否重复发起 |
| | | QueryWrapper<ShopSalesmanApply> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("user_id",loginUser.getId()); |
| | | queryWrapper.in("apply_status",Arrays.asList("1,2".split(","))); |
| | | ShopSalesmanApply checkApply = shopSalesmanApplyDao.selectOne(queryWrapper); |
| | | if(checkApply==null|| |
| | | checkApply.getApplyStatus()==ShopSalesmanApply.APPLY_STATUS_WTG){ |
| | | |
| | | ShopSalesmanApply shopSalesmanApply=new ShopSalesmanApply(); |
| | | shopSalesmanApply.setUserId(userId); |
| | | |
| | | shopSalesmanApply.setCreateBy(MatrixConstance.SYSTEM_USER); |
| | | shopSalesmanApply.setApplyWay(ShopSalesmanApply.APPLY_WAY_SELF); |
| | | |
| | | shopSalesmanApply.setCompanyId(loginUser.getCompanyId()); |
| | | shopSalesmanApply.setUpdateBy(MatrixConstance.SYSTEM_USER); |
| | | Date date = new Date(); |
| | | shopSalesmanApply.setCreateTime(date); |
| | | shopSalesmanApply.setUpdateTime(date); |
| | | |
| | | if(invitationId!=null){ |
| | | shopSalesmanApply.setParentUserId(invitationId); |
| | | }else if(loginUser.getRecommendId()!=null){ |
| | | //如果曾经是被邀请进来的则自动绑定为之前邀请人的下级 |
| | | shopSalesmanApply.setParentUserId(loginUser.getRecommendId()); |
| | | } |
| | | if(gradeId!=null){ |
| | | shopSalesmanApply.setGradeId(gradeId); |
| | | }else{ |
| | | //获取初始等级ID(公司id,是否为初始等级) |
| | | QueryWrapper<ShopSalesmanGrade> queryWrapperOrepool = new QueryWrapper<>(); |
| | | queryWrapperOrepool.eq("company_id", loginUser.getCompanyId()); |
| | | queryWrapperOrepool.eq("is_default", 1); |
| | | ShopSalesmanGrade shopSalesmanGrade = shopSalesmanGradeDao.selectOne(queryWrapperOrepool); |
| | | shopSalesmanApply.setGradeId(shopSalesmanGrade.getId()); |
| | | } |
| | | shopSalesmanApply.setApplyWay(applyWay); |
| | | |
| | | BusParameterSettings busParameterSettings = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_AUDIT_METHOD, loginUser.getCompanyId()); |
| | | if(busParameterSettings!=null |
| | | &&busParameterSettings.getParamValue().equals("1")){ |
| | | //自动审核 |
| | | //初始等级ID(公司id,是否为初始等级) |
| | | QueryWrapper<ShopSalesmanGrade> queryWrapperOrepool = new QueryWrapper<>(); |
| | | queryWrapperOrepool.eq("company_id", loginUser.getCompanyId()); |
| | | queryWrapperOrepool.eq("is_default", 1); |
| | | ShopSalesmanGrade shopSalesmanGrade = shopSalesmanGradeDao.selectOne(queryWrapperOrepool); |
| | | shopSalesmanApply.setApplyStatus(ShopSalesmanApply.APPLY_STATUS_TG); |
| | | sysVipInfoService.setToBeAnSalesman(loginUser.getId(),invitationId,shopSalesmanGrade.getId()); |
| | | |
| | | }else{ |
| | | shopSalesmanApply.setApplyStatus(ShopSalesmanApply.APPLY_STATUS_DSH); |
| | | } |
| | | shopSalesmanApplyDao.insert(shopSalesmanApply); |
| | | return shopSalesmanApply; |
| | | }else{ |
| | | throw new GlobleException("不能重复申请"); |
| | | } |
| | | }else{ |
| | | throw new GlobleException(verificationResult.getMsg()); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 判断是否满足申请成为分销员的条件 |
| | | */ |
| | | public VerificationResult isAbleToBeAnSalesman(Long userId,Long companyId) { |
| | | |
| | | VerificationResult verificationResult=null; |
| | | |
| | | //申请模式 |
| | | BusParameterSettings applyWay = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_APPLY_WAY, companyId); |
| | | if (FenxiaoSettingConstant.FX_APPLY_WAY_AUTO.equals(applyWay.getParamValue())) { |
| | | verificationResult= VerificationResult.buildVerificationResult(true); |
| | | }else{ |
| | | //申请条件 |
| | | BusParameterSettings applyCondition = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_APPLY_CONDITION, companyId); |
| | | switch (applyCondition.getParamValue()){ |
| | | case FenxiaoSettingConstant.FX_APPLY_CONDITION_WTJ: |
| | | verificationResult= VerificationResult.buildVerificationResult(true); |
| | | break; |
| | | case FenxiaoSettingConstant.FX_APPLY_CONDITION_XFZDCP: |
| | | int buyZdcpCount= shopOrderV2Dao.countBuyZdcp(userId,applyCondition.getParamValue1()); |
| | | if(buyZdcpCount>0){ |
| | | verificationResult= VerificationResult.buildVerificationResult(true); |
| | | }else{ |
| | | verificationResult= VerificationResult.buildVerificationResult(false,"不符合申请条件,请消费指定产品后再申请!"); |
| | | } |
| | | break; |
| | | case FenxiaoSettingConstant.FX_APPLY_CONDITION_XFRYCP: |
| | | //判断用户是否有确认收货的产品 |
| | | int receivedOrderCount= shopOrderV2Dao.selectReceivedOrderCount(userId); |
| | | if(receivedOrderCount>0){ |
| | | verificationResult= VerificationResult.buildVerificationResult(true); |
| | | }else{ |
| | | verificationResult= VerificationResult.buildVerificationResult(false,"不符合申请条件,请消费任意产品后再申请!"); |
| | | } |
| | | break; |
| | | case FenxiaoSettingConstant.FX_APPLY_CONDITION_XCZDJE: |
| | | Double zdje=Double.parseDouble(applyCondition.getParamValue2()); |
| | | Double yxfje=shopOrderV2Dao.countOrderAmount(userId); |
| | | if(zdje<yxfje){ |
| | | verificationResult=VerificationResult.buildVerificationResult(true); |
| | | }else{ |
| | | verificationResult= VerificationResult.buildVerificationResult(false,"不符合申请条件,请消费满"+zdje+"元后再申请!"); |
| | | } |
| | | break; |
| | | default: |
| | | verificationResult= VerificationResult.buildVerificationResult(true); |
| | | } |
| | | } |
| | | return verificationResult; |
| | | } |
| | | |
| | | |
| | | public IPage<ShopSalesmanApplyVo> findShopSalesmanApplyList(Page<ShopSalesmanApplyVo> page, ShopSalesmanApplyDto shopSalesmanApplyDto) { |
| | | return shopSalesmanApplyDao.findShopSalesmanApplyList(page,shopSalesmanApplyDto); |
| | | } |
| | | |
| | | public IPage<ShopSalesmanAppliingVo> findShopSalesmanAppliingList(Page<ShopSalesmanAppliingVo> page, |
| | | ShopSalesmanAppliingDto shopSalesmanAppliingDto) { |
| | | return shopSalesmanApplyDao.findShopSalesmanAppliingList(page,shopSalesmanAppliingDto); |
| | | } |
| | | |
| | | public IPage<ShopSalesmanAppliingVo> selectBizUserApplyList(Page<ShopSalesmanAppliingVo> page, ShopSalesmanAppliingDto shopSalesmanAppliingDto) { |
| | | return shopSalesmanApplyDao.selectBizUserApplyList(page,shopSalesmanAppliingDto); |
| | | } |
| | | |
| | | public List<ShopSalesmanGradeVo> getShopSalesmanGradeVo(Long companyId) { |
| | | return shopSalesmanGradeDao.getShopSalesmanGradeVo(companyId); |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void addSaleManApply(Long userId,Long gradeId) { |
| | | SysVipInfo user = sysVipInfoDao.selectById(userId); |
| | | applyToBeAnSalesman(user.getId(),gradeId, null,ShopSalesmanApply.APPLY_WAY_HAND_ADD); |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void examineSaleManApply(ShopSalesmanApply shopSalesmanApply, Integer applyState) { |
| | | Long userId = shopSalesmanApply.getUserId(); |
| | | Long parentUserId = shopSalesmanApply.getParentUserId(); |
| | | SysVipInfo sysVipInfo = sysVipInfoDao.selectById(userId); |
| | | //修改审核记录 |
| | | if(ShopSalesmanApply.APPLY_STATUS_TG == applyState) { |
| | | shopSalesmanApply.setApplyStatus(ShopSalesmanApply.APPLY_STATUS_TG); |
| | | sysVipInfo.setIsSales(SysVipInfo.IS_SALES); |
| | | }else { |
| | | shopSalesmanApply.setApplyStatus(ShopSalesmanApply.APPLY_STATUS_WTG); |
| | | sysVipInfo.setIsSales(SysVipInfo.NOT_SALES); |
| | | } |
| | | shopSalesmanApplyDao.updateById(shopSalesmanApply); |
| | | //修改USER的状态 |
| | | sysVipInfo.setRecommendId(parentUserId); |
| | | sysVipInfo.setBindingParentTime(new Date()); |
| | | sysVipInfo.setSalesmanGrade(shopSalesmanApply.getGradeId()); |
| | | sysVipInfoDao.update(sysVipInfo); |
| | | } |
| | | |
| | | public IPage<ShopSalesmanApplyVo> findShopSalesmanDetail(Page<ShopSalesmanApplyVo> page, |
| | | ShopSalesmanDetailDto shopSalesmanDetailDto) { |
| | | // TODO Auto-generated method stub |
| | | return null; |
| | | } |
| | | |
| | | public SalesmanBasicDetailVo selectShopSalesmanDetailByOpenId(Long userId, long applyId) { |
| | | //获取个人信息 |
| | | SysVipInfo sysVipInfo = sysVipInfoDao.selectById(userId); |
| | | Long companyId = sysVipInfo.getCompanyId(); |
| | | return shopSalesmanApplyDao.selectShopSalesmanDetailByOpenId(sysVipInfo.getId(),companyId,applyId); |
| | | } |
| | | |
| | | public IPage<ShopCustomDetailVo> findCustomDetail(Page<ShopCustomDetailVo> page,LoadParamSettingDto loadParamSettingDto) { |
| | | return shopSalesmanApplyDao.findCustomDetail(page,loadParamSettingDto); |
| | | } |
| | | |
| | | public IPage<ShopCustomDetailVo> findCustomLow(Page<ShopCustomDetailVo> pageLow, |
| | | ShopSalesmanDetailDto shopSalesmanDetailDto) { |
| | | return shopSalesmanApplyDao.findCustomLow(pageLow,shopSalesmanDetailDto); |
| | | } |
| | | |
| | | public IPage<ShopOrderDetailVo> findShopOrderDetail(Page<ShopOrderDetailVo> pageOrder, |
| | | ShopSalesmanDetailDto shopSalesmanDetailDto) { |
| | | return shopSalesmanApplyDao.findShopOrderDetail(pageOrder,shopSalesmanDetailDto); |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult changeSaleManGrade(ChangeSaleManGradeDto changeSaleManGradeDto) { |
| | | |
| | | SysVipInfo vipInfo = sysVipInfoDao.selectById(changeSaleManGradeDto.getUserId()); |
| | | |
| | | //获取对应的公司的等级 |
| | | QueryWrapper<ShopSalesmanGrade> queryWrapperOrepool = new QueryWrapper<>(); |
| | | queryWrapperOrepool.eq("is_default", 1); |
| | | queryWrapperOrepool.eq("company_id", vipInfo.getCompanyId()); |
| | | ShopSalesmanGrade shopSalesmanGrade = shopSalesmanGradeDao.selectOne(queryWrapperOrepool); |
| | | |
| | | //不是分销员不允许修改 |
| | | Integer isSales = vipInfo.getIsSales(); |
| | | if(SysVipInfo.IS_SALES != isSales) { |
| | | return AjaxResult.buildFailInstance("当前用户未通过审核,不允许修改"); |
| | | } |
| | | |
| | | //修改申请记录的等级 |
| | | QueryWrapper<ShopSalesmanApply> queryShopSalesmanApply = new QueryWrapper<>(); |
| | | queryShopSalesmanApply.eq("apply_status", 2); |
| | | queryShopSalesmanApply.eq("user_id", vipInfo.getId()); |
| | | queryShopSalesmanApply.eq("company_id", vipInfo.getCompanyId()); |
| | | ShopSalesmanApply shopSalesmanApply = shopSalesmanApplyDao.selectOne(queryShopSalesmanApply); |
| | | Long gradeId = changeSaleManGradeDto.getGradeId(); |
| | | if(ObjectUtil.isEmpty(gradeId)) { |
| | | vipInfo.setSalesmanGrade(shopSalesmanGrade.getId()); |
| | | shopSalesmanApply.setGradeId(shopSalesmanGrade.getId()); |
| | | }else { |
| | | vipInfo.setSalesmanGrade(gradeId); |
| | | shopSalesmanApply.setGradeId(gradeId); |
| | | } |
| | | sysVipInfoDao.update(vipInfo); |
| | | shopSalesmanApplyDao.updateById(shopSalesmanApply); |
| | | |
| | | return AjaxResult.buildSuccessInstance("修改等级成功"); |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult unbundlingSaleMan(UnbundlingSaleManDto unbundlingSaleManDto) { |
| | | |
| | | Long userId = unbundlingSaleManDto.getUserId(); |
| | | sysVipInfoDao.unbundlingSaleMan(userId); |
| | | return AjaxResult.buildSuccessInstance("解绑成功"); |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult delSaleManGradeApply(DelSaleManGradeApplyDto delSaleManGradeApplyDto) { |
| | | //设置用户公司ID |
| | | QueryUtil.setQueryLimitCom(delSaleManGradeApplyDto); |
| | | |
| | | |
| | | //将biz_user的is_sale设置成否 |
| | | SysVipInfo vipInfo = sysVipInfoDao.selectById(delSaleManGradeApplyDto.getUserId()); |
| | | if(ObjectUtil.isEmpty(vipInfo)) { |
| | | return AjaxResult.buildFailInstance("当前用户已不存在"); |
| | | } |
| | | vipInfo.setIsSales(SysVipInfo.NOT_SALES); |
| | | sysVipInfoDao.update(vipInfo); |
| | | //将记录设置成系统取消 |
| | | ShopSalesmanApply selectById = shopSalesmanApplyDao.selectById(delSaleManGradeApplyDto.getApplyId()); |
| | | selectById.setApplyStatus(ShopSalesmanApply.APPLY_STATUS_XTQX); |
| | | shopSalesmanApplyDao.updateById(selectById); |
| | | return AjaxResult.buildSuccessInstance("操作成功"); |
| | | } |
| | | |
| | | public IPage<FyfaManageVo> findFyfaManageList(Page<FyfaManageVo> page, FyfaManageDto fyfaManageDto) { |
| | | return shopSalesmanGradeDao.findFyfaManageList(page,fyfaManageDto); |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void addFyfa(SysUsers user) { |
| | | ShopSalesmanGrade shopSalesmanGrade = new ShopSalesmanGrade(); |
| | | shopSalesmanGrade.setIsDefault(2); |
| | | shopSalesmanGrade.setCreateBy(user.getSuName()); |
| | | shopSalesmanGrade.setUpdateBy(user.getSuName()); |
| | | shopSalesmanGrade.setCreateTime(new Date()); |
| | | shopSalesmanGrade.setUpdateTime(new Date()); |
| | | shopSalesmanGrade.setCompanyId(user.getCompanyId()); |
| | | shopSalesmanGradeDao.insert(shopSalesmanGrade); |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult delFyfaApply(DelFyfaApplyDto delFyfaApplyDto) { |
| | | //设置用户公司ID |
| | | QueryUtil.setQueryLimitCom(delFyfaApplyDto); |
| | | Long gradeId = delFyfaApplyDto.getGradeId(); |
| | | ShopSalesmanGrade selectById = shopSalesmanGradeDao.selectById(gradeId); |
| | | if(ObjectUtil.isEmpty(selectById)) { |
| | | return AjaxResult.buildFailInstance("当前行数据不存在,请刷新页面"); |
| | | } |
| | | shopSalesmanGradeDao.deleteById(gradeId); |
| | | return AjaxResult.buildSuccessInstance("操作成功"); |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult updateFyfa(UpdateFyfaDto updateFyfaDto) { |
| | | //设置用户公司ID |
| | | QueryUtil.setQueryLimitCom(updateFyfaDto); |
| | | ShopSalesmanGrade selectById = shopSalesmanGradeDao.selectById(updateFyfaDto.getId()); |
| | | String name = updateFyfaDto.getName(); |
| | | if(StrUtil.isEmpty(name)) { |
| | | return AjaxResult.buildFailInstance("请输入方案名称"); |
| | | } |
| | | Double selfCommission = updateFyfaDto.getSelfCommission(); |
| | | if(ObjectUtil.isEmpty(selfCommission)) { |
| | | return AjaxResult.buildFailInstance("请输入正确的自购返佣"); |
| | | } |
| | | Double sealesCommission = updateFyfaDto.getSealesCommission(); |
| | | if(ObjectUtil.isEmpty(sealesCommission)) { |
| | | return AjaxResult.buildFailInstance("请输入正确的推广提成"); |
| | | } |
| | | Double invitationCommission = updateFyfaDto.getInvitationCommission(); |
| | | if(ObjectUtil.isEmpty(invitationCommission)) { |
| | | return AjaxResult.buildFailInstance("请输入正确的邀请提成"); |
| | | } |
| | | if(ObjectUtil.isEmpty(selectById)) { |
| | | SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | ShopSalesmanGrade shopSalesmanGrade = new ShopSalesmanGrade(); |
| | | shopSalesmanGrade.setCompanyId(updateFyfaDto.getCompanyId()); |
| | | shopSalesmanGrade.setName(updateFyfaDto.getName()); |
| | | shopSalesmanGrade.setSelfCommission(selfCommission); |
| | | shopSalesmanGrade.setSealesCommission(sealesCommission); |
| | | shopSalesmanGrade.setInvitationCommission(invitationCommission); |
| | | shopSalesmanGrade.setGradeCondition(updateFyfaDto.getGradeCondition()); |
| | | shopSalesmanGrade.setIsDefault(2); |
| | | shopSalesmanGrade.setCreateBy(user.getSuName()); |
| | | shopSalesmanGrade.setUpdateBy(user.getSuName()); |
| | | shopSalesmanGrade.setCreateTime(new Date()); |
| | | shopSalesmanGrade.setUpdateTime(new Date()); |
| | | shopSalesmanGrade.setCompanyId(user.getCompanyId()); |
| | | shopSalesmanGradeDao.insert(shopSalesmanGrade); |
| | | return AjaxResult.buildSuccessInstance("操作成功"); |
| | | } |
| | | selectById.setCompanyId(updateFyfaDto.getCompanyId()); |
| | | selectById.setName(updateFyfaDto.getName()); |
| | | selectById.setSelfCommission(selfCommission); |
| | | selectById.setSealesCommission(sealesCommission); |
| | | selectById.setInvitationCommission(invitationCommission); |
| | | selectById.setGradeCondition(updateFyfaDto.getGradeCondition()); |
| | | shopSalesmanGradeDao.updateById(selectById); |
| | | return AjaxResult.buildSuccessInstance("操作成功"); |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult updateTgjh(UpdateTgjhDto updateTgjhDto) { |
| | | //设置用户公司ID |
| | | QueryUtil.setQueryLimitCom(updateTgjhDto); |
| | | //获取推广计划的Param |
| | | Long companyId = updateTgjhDto.getCompanyId(); |
| | | BusParameterSettings busParameterSettings = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_TG_PLAN, companyId); |
| | | busParameterSettings.setParamValue3(updateTgjhDto.getTgfa()); |
| | | busParameterSettingsDao.updateByModel(busParameterSettings); |
| | | return AjaxResult.buildSuccessInstance("保存成功"); |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult updateTgtp(UpdateTgtpDto updateTgtpDto) { |
| | | //设置用户公司ID |
| | | QueryUtil.setQueryLimitCom(updateTgtpDto); |
| | | //获取推广计划的Param |
| | | Long companyId = updateTgtpDto.getCompanyId(); |
| | | BusParameterSettings busParameterSettings = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_TG_POSTER, companyId); |
| | | busParameterSettings.setParamValue(updateTgtpDto.getImageUrl()); |
| | | busParameterSettingsDao.updateByModel(busParameterSettings); |
| | | return AjaxResult.buildSuccessInstance("保存成功"); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.matrix.system.fenxiao.dao.ShopSalesmanGradeDao; |
| | | import com.matrix.system.fenxiao.entity.ShopSalesmanGrade; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @description 推广员等级 |
| | | * @author jyy |
| | | * @date 2021-03-10 15:22 |
| | | */ |
| | | @Service |
| | | public class ShopSalesmanGradeService extends ServiceImpl<ShopSalesmanGradeDao, ShopSalesmanGrade>{ |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.matrix.system.fenxiao.dao.ShopSalesmanOrderItemDao; |
| | | import com.matrix.system.fenxiao.entity.ShopSalesmanOrderItem; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @description 分销单明细 |
| | | * @author yourName |
| | | * @date 2021-03-12 13:17 |
| | | */ |
| | | @Service |
| | | public class ShopSalesmanOrderItemService extends ServiceImpl<ShopSalesmanOrderItemDao, ShopSalesmanOrderItem>{ |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.service; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.fenxiao.dao.ShopRevenueFlowDao; |
| | | import com.matrix.system.fenxiao.dao.ShopSalemanSettlementDao; |
| | | import com.matrix.system.fenxiao.dao.ShopSalesmanOrderDao; |
| | | import com.matrix.system.fenxiao.dto.LoadFenxiaoOrderBasicDto; |
| | | import com.matrix.system.fenxiao.dto.LoadFenxiaoOrderListDto; |
| | | import com.matrix.system.fenxiao.dto.LoadSetOrderListDtoDto; |
| | | import com.matrix.system.fenxiao.dto.UpdateSetOrderDoneDto; |
| | | import com.matrix.system.fenxiao.entity.ShopRevenueFlow; |
| | | import com.matrix.system.fenxiao.entity.ShopSalemanSettlement; |
| | | import com.matrix.system.fenxiao.entity.ShopSalesmanOrder; |
| | | import com.matrix.system.fenxiao.vo.LoadFenxiaoOrderBasicVo; |
| | | import com.matrix.system.fenxiao.vo.LoadFenxiaoOrderListVo; |
| | | import com.matrix.system.fenxiao.vo.LoadSetOrderListDtoVo; |
| | | import com.matrix.system.hive.action.util.QueryUtil; |
| | | import com.matrix.system.hive.service.CodeService; |
| | | import com.matrix.system.shopXcx.bean.ShopOrder; |
| | | import com.matrix.system.shopXcx.dao.ShopOrderDao; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @description 分销订单 |
| | | * @author jyy |
| | | * @date 2021-03-10 15:22 |
| | | */ |
| | | @Service |
| | | public class ShopSalesmanOrderService extends ServiceImpl<ShopSalesmanOrderDao, ShopSalesmanOrder>{ |
| | | |
| | | @Autowired |
| | | ShopSalesmanOrderDao shopSalesmanOrderDao; |
| | | @Autowired |
| | | CodeService codeService; |
| | | @Autowired |
| | | ShopSalemanSettlementDao shopSalemanSettlementDao; |
| | | @Autowired |
| | | ShopRevenueFlowDao shopRevenueFlowDao; |
| | | @Autowired |
| | | ShopOrderDao shopOrderDao; |
| | | @Autowired |
| | | SysVipInfoDao sysVipInfoDao; |
| | | |
| | | public AjaxResult loadFenxiaoOrderBasic(LoadFenxiaoOrderBasicDto loadFenxiaoOrderBasicDto) { |
| | | //设置用户公司ID |
| | | QueryUtil.setQueryLimitCom(loadFenxiaoOrderBasicDto); |
| | | AjaxResult result= AjaxResult.buildSuccessInstance("查询成功"); |
| | | //根据OPENID查询基础信息 |
| | | Long companyId = loadFenxiaoOrderBasicDto.getCompanyId(); |
| | | LoadFenxiaoOrderBasicVo loadFenxiaoOrderBasicVo = shopSalesmanOrderDao.selectFenxiaoOrderBasicByCompanyId(companyId); |
| | | result.putInMap("basicdetail", loadFenxiaoOrderBasicVo); |
| | | return result; |
| | | } |
| | | |
| | | public AjaxResult loadFenxiaoOrderList(LoadFenxiaoOrderListDto loadFenxiaoOrderListDto) { |
| | | //设置用户公司ID |
| | | QueryUtil.setQueryLimitCom(loadFenxiaoOrderListDto); |
| | | //排序 |
| | | if(StringUtils.isBlank(loadFenxiaoOrderListDto.getSort())){ |
| | | loadFenxiaoOrderListDto.setSort("create_time"); |
| | | loadFenxiaoOrderListDto.setOrder("desc"); |
| | | } |
| | | Page<LoadFenxiaoOrderListVo> page = new Page(loadFenxiaoOrderListDto.getPageNum(), loadFenxiaoOrderListDto.getPageSize()); |
| | | IPage<LoadFenxiaoOrderListVo> loadFenxiaoOrderListVos = shopSalesmanOrderDao.findFenxiaoOrderList(page,loadFenxiaoOrderListDto); |
| | | return AjaxResult.buildSuccessInstance(loadFenxiaoOrderListVos.getRecords(),loadFenxiaoOrderListVos.getTotal()); |
| | | } |
| | | |
| | | public AjaxResult loadSetOrderList(LoadSetOrderListDtoDto loadSetOrderListDto) { |
| | | //设置用户公司ID |
| | | QueryUtil.setQueryLimitCom(loadSetOrderListDto); |
| | | //排序 |
| | | if(StringUtils.isBlank(loadSetOrderListDto.getSort())){ |
| | | loadSetOrderListDto.setSort("create_time"); |
| | | loadSetOrderListDto.setOrder("desc"); |
| | | } |
| | | Page<LoadSetOrderListDtoVo> page = new Page(loadSetOrderListDto.getPageNum(), loadSetOrderListDto.getPageSize()); |
| | | IPage<LoadSetOrderListDtoVo> loadFenxiaoOrderListVos = shopSalesmanOrderDao.findSetOrderList(page,loadSetOrderListDto); |
| | | return AjaxResult.buildSuccessInstance(loadFenxiaoOrderListVos.getRecords(),loadFenxiaoOrderListVos.getTotal()); |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult updateSetOrderDone(UpdateSetOrderDoneDto updateSetOrderDoneDto) { |
| | | //设置用户公司ID |
| | | QueryUtil.setQueryLimitCom(updateSetOrderDoneDto); |
| | | SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | Long companyId = updateSetOrderDoneDto.getCompanyId(); |
| | | Integer setType = updateSetOrderDoneDto.getSetType(); |
| | | |
| | | String orderIds = updateSetOrderDoneDto.getOrderIds(); |
| | | if(StrUtil.isNotEmpty(orderIds)){ |
| | | List<String> idsStringList = Arrays.asList(orderIds.split(",")); |
| | | if(CollUtil.isEmpty(idsStringList)) { |
| | | return AjaxResult.buildFailInstance("请至少选择一条记录"); |
| | | } |
| | | //产生订单结算记录 |
| | | ShopSalemanSettlement shopSalemanSettlement = new ShopSalemanSettlement(); |
| | | shopSalemanSettlement.setCompanyId(companyId); |
| | | shopSalemanSettlement.setCreateBy(MatrixConstance.SYSTEM_USER); |
| | | shopSalemanSettlement.setUpdateBy(MatrixConstance.SYSTEM_USER); |
| | | shopSalemanSettlement.setCreateTime(new Date()); |
| | | shopSalemanSettlement.setUpdateTime(new Date()); |
| | | shopSalemanSettlement.setOrderNo(codeService.getCodeByTyle(ShopSalemanSettlement.ORDERNO_START)); |
| | | shopSalemanSettlement.setSettlementWay(setType); |
| | | shopSalemanSettlement.setManCount(updateSetOrderDoneDto.getManCount()); |
| | | shopSalemanSettlement.setOrderCount(updateSetOrderDoneDto.getOrderCount()); |
| | | shopSalemanSettlement.setUserId(user.getSuId().intValue()); |
| | | shopSalemanSettlement.setAmount(updateSetOrderDoneDto.getAmount()); |
| | | shopSalemanSettlement.setRemark(updateSetOrderDoneDto.getRemark()); |
| | | shopSalemanSettlement.setCompanyId(companyId); |
| | | shopSalemanSettlementDao.insert(shopSalemanSettlement); |
| | | |
| | | for(String idString : idsStringList) { |
| | | long id = Long.parseLong(idString); |
| | | //更新分销订单 |
| | | ShopSalesmanOrder shopSalesmanOrder = shopSalesmanOrderDao.selectById(id); |
| | | if(!ShopSalesmanOrder.STATUS_DJS.equals(shopSalesmanOrder.getOrderStatus())) { |
| | | return AjaxResult.buildFailInstance("选中记录中存在【已结算】的记录"); |
| | | } |
| | | //判断原始订单的状态【4=待评价, 5=已评价】才能结算 |
| | | ShopOrder shopOrder = shopOrderDao.selectById(shopSalesmanOrder.getOrderId().intValue()); |
| | | if(ShopOrder.ORDER_STATUS_WAIT_REMARK != shopOrder.getOrderStatus() && |
| | | ShopOrder.ORDER_STATUS_ALREADY_REMARK != shopOrder.getOrderStatus()) { |
| | | return AjaxResult.buildFailInstance("未收货订单不允许结算"); |
| | | } |
| | | shopSalesmanOrder.setOrderStatus(ShopSalesmanOrder.STATUS_YJS); |
| | | shopSalesmanOrder.setSettlementId(shopSalemanSettlement.getId()); |
| | | shopSalesmanOrderDao.updateById(shopSalesmanOrder); |
| | | //记录流水 |
| | | ShopRevenueFlow salesRevenueFlow=new ShopRevenueFlow(); |
| | | salesRevenueFlow.setCompanyId(companyId); |
| | | salesRevenueFlow.setCreateBy(MatrixConstance.SYSTEM_USER); |
| | | salesRevenueFlow.setUpdateBy(MatrixConstance.SYSTEM_USER); |
| | | salesRevenueFlow.setCreateTime(new Date()); |
| | | salesRevenueFlow.setUpdateTime(new Date()); |
| | | salesRevenueFlow.setAmount(shopSalesmanOrder.getAmount()); |
| | | salesRevenueFlow.setUserId(shopSalesmanOrder.getSalesUserId()); |
| | | if(ShopSalesmanOrder.REVENUE_TYPE_SALES.equals(shopSalesmanOrder.getRevenueType())) { |
| | | salesRevenueFlow.setRevenueContent(ShopRevenueFlow.TYPE_TGSY); |
| | | } |
| | | if(ShopSalesmanOrder.REVENUE_TYPE_INVITATION.equals(shopSalesmanOrder.getRevenueType())) { |
| | | salesRevenueFlow.setRevenueContent(ShopRevenueFlow.TYPE_YQSY); |
| | | } |
| | | salesRevenueFlow.setBusinessId(shopSalesmanOrder.getId()); |
| | | shopRevenueFlowDao.insert(salesRevenueFlow); |
| | | //选择微信余额支付,更新用户的金额 |
| | | if(ShopSalemanSettlement.SETTLEMENTWAY_YEJS == updateSetOrderDoneDto.getSetType()) { |
| | | SysVipInfo vipInfo = sysVipInfoDao.selectById(shopSalesmanOrder.getSalesUserId()); |
| | | if(ObjectUtil.isEmpty(vipInfo)) { |
| | | return AjaxResult.buildFailInstance("收益人信息不存在"); |
| | | } |
| | | Double withdrawalCash = vipInfo.getWithdrawalCash(); |
| | | Double amount = shopSalesmanOrder.getAmount(); |
| | | withdrawalCash = (withdrawalCash == null?0:withdrawalCash)+(amount== null?0:amount); |
| | | vipInfo.setWithdrawalCash(withdrawalCash); |
| | | sysVipInfoDao.update(vipInfo); |
| | | } |
| | | } |
| | | } |
| | | return AjaxResult.buildSuccessInstance("操作成功"); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.vo; |
| | | |
| | | import com.matrix.core.anotations.Extend; |
| | | |
| | | public class FenXiaoSettingVo { |
| | | @Extend |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | |
| | | private Long paramId; |
| | | /** |
| | | * 参数名称 |
| | | */ |
| | | private String paramName; |
| | | /** |
| | | * 参数编码 |
| | | */ |
| | | private String paramCode; |
| | | |
| | | /** |
| | | * switch按钮 |
| | | */ |
| | | private Boolean paramSwitch; |
| | | |
| | | |
| | | /** |
| | | * 参数值 |
| | | */ |
| | | private String paramValue; |
| | | |
| | | |
| | | /** |
| | | * 值1 |
| | | */ |
| | | private String paramValue1; |
| | | |
| | | |
| | | /** |
| | | * 值2 |
| | | */ |
| | | private String paramValue2; |
| | | |
| | | |
| | | /** |
| | | * 值3 |
| | | */ |
| | | private String paramValue3; |
| | | |
| | | private Long companyId; |
| | | |
| | | private Long shopId; |
| | | |
| | | |
| | | public Long getShopId() { |
| | | return shopId; |
| | | } |
| | | |
| | | public void setShopId(Long shopId) { |
| | | this.shopId = shopId; |
| | | } |
| | | |
| | | public Long getCompanyId() { |
| | | return companyId; |
| | | } |
| | | |
| | | public void setCompanyId(Long companyId) { |
| | | this.companyId = companyId; |
| | | } |
| | | |
| | | public Long getParamId() { |
| | | return paramId; |
| | | } |
| | | |
| | | public void setParamId(Long paramId) { |
| | | this.paramId = paramId; |
| | | } |
| | | |
| | | |
| | | public String getParamCode() { |
| | | return paramCode; |
| | | } |
| | | |
| | | public void setParamCode(String paramCode) { |
| | | this.paramCode = paramCode; |
| | | } |
| | | |
| | | |
| | | public String getParamValue() { |
| | | return paramValue; |
| | | } |
| | | |
| | | public void setParamValue(String paramValue) { |
| | | this.paramValue = paramValue; |
| | | } |
| | | |
| | | |
| | | public String getParamValue1() { |
| | | return paramValue1; |
| | | } |
| | | |
| | | public void setParamValue1(String paramValue1) { |
| | | this.paramValue1 = paramValue1; |
| | | } |
| | | |
| | | |
| | | public String getParamValue2() { |
| | | return paramValue2; |
| | | } |
| | | |
| | | public void setParamValue2(String paramValue2) { |
| | | this.paramValue2 = paramValue2; |
| | | } |
| | | |
| | | |
| | | public String getParamValue3() { |
| | | return paramValue3; |
| | | } |
| | | |
| | | public void setParamValue3(String paramValue3) { |
| | | this.paramValue3 = paramValue3; |
| | | } |
| | | |
| | | public String getParamName() { |
| | | return paramName; |
| | | } |
| | | |
| | | public void setParamName(String paramName) { |
| | | this.paramName = paramName; |
| | | } |
| | | |
| | | public Boolean getParamSwitch() { |
| | | return paramSwitch; |
| | | } |
| | | |
| | | public void setParamSwitch(Boolean paramSwitch) { |
| | | this.paramSwitch = paramSwitch; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "FyfaManageVo", description = "分佣方案信息返回类") |
| | | public class FyfaManageVo { |
| | | |
| | | @ApiModelProperty(value = "id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "方案名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "自购返佣%") |
| | | private Double selfCommission; |
| | | |
| | | @ApiModelProperty(value = "推广提成%") |
| | | private Double sealesCommission; |
| | | |
| | | @ApiModelProperty(value = "邀请提成 %") |
| | | private Double invitationCommission; |
| | | |
| | | @ApiModelProperty(value = "等级条件(推广金额)") |
| | | private Double gradeCondition; |
| | | |
| | | @ApiModelProperty(value = "默认等级1是,2不是") |
| | | private Integer isDefault; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | @ApiModel(value = "LoadFenxiaoOrderBasicVo", description = "返回类") |
| | | public class LoadFenxiaoOrderBasicVo { |
| | | |
| | | @ApiModelProperty(value = "待计算金额") |
| | | private BigDecimal balance; |
| | | @ApiModelProperty(value = "待结算人数") |
| | | private Integer waitNum; |
| | | @ApiModelProperty(value = "待结算订单") |
| | | private Integer waitOrderNum; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @ApiModel(value = "LoadFenxiaoOrderListVo", description = "返回类") |
| | | public class LoadFenxiaoOrderListVo { |
| | | |
| | | @ApiModelProperty(value = "订单ID") |
| | | private Long id; |
| | | @ApiModelProperty(value = "订单编号") |
| | | private String orderNo; |
| | | @ApiModelProperty(value = "订单状态") |
| | | private Integer orderState; |
| | | @ApiModelProperty(value = "实付金额(元)") |
| | | private BigDecimal actualBalance; |
| | | @ApiModelProperty(value = "下单门店") |
| | | private String address; |
| | | @ApiModelProperty(value = "客户") |
| | | private String custom; |
| | | @ApiModelProperty(value = "客户openId") |
| | | private String customUserId; |
| | | @ApiModelProperty(value = "推广员") |
| | | private String parentSale; |
| | | @ApiModelProperty(value = "收益类型") |
| | | private Integer profitType; |
| | | @ApiModelProperty(value = "收益金额") |
| | | private BigDecimal profitBalance; |
| | | @ApiModelProperty(value = "结算状态") |
| | | private Integer settleType; |
| | | @ApiModelProperty(value = "结算编号") |
| | | private String settleNo; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") |
| | | @ApiModelProperty(value = "结算时间") |
| | | private Date settleTime; |
| | | @ApiModelProperty(value = "结算人") |
| | | private String settler; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @ApiModel(value = "LoadSetOrderListDtoVo", description = "返回类") |
| | | public class LoadSetOrderListDtoVo { |
| | | |
| | | @ApiModelProperty(value = "ID") |
| | | private Long id; |
| | | @ApiModelProperty(value = "结算编号") |
| | | private String orderNo; |
| | | @ApiModelProperty(value = "结算金额") |
| | | private BigDecimal actualBalance; |
| | | @ApiModelProperty(value = "结算订单数") |
| | | private String setNum; |
| | | @ApiModelProperty(value = "结算人数") |
| | | private String setManNum; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") |
| | | @ApiModelProperty(value = "结算时间") |
| | | private Date setTime; |
| | | @ApiModelProperty(value = "结算人") |
| | | private String setMan; |
| | | @ApiModelProperty(value = "结算方式") |
| | | private BigDecimal settlementWay; |
| | | @ApiModelProperty(value = "备注") |
| | | private String remark; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.vo; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "SalesmanBasicDetailVo", description = "分销员基本信息的返参") |
| | | public class SalesmanBasicDetailVo { |
| | | |
| | | @ApiModelProperty(value = "申请用户id") |
| | | private String userId; |
| | | @ApiModelProperty(value = "头像") |
| | | private String avatarUrl; |
| | | @ApiModelProperty(value = "分销员") |
| | | private String nickname; |
| | | @ApiModelProperty(value = "等级") |
| | | private String grade; |
| | | @ApiModelProperty(value = "手机号码") |
| | | private String phone; |
| | | @ApiModelProperty(value = "加入时间") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm",timezone="GMT+8") |
| | | private Date createTime; |
| | | @ApiModelProperty(value = "邀请人") |
| | | private String parentUser; |
| | | @ApiModelProperty(value = "申请方式1、自主申请,2、自动添加,3上级邀请,4、手动添加(来源)") |
| | | private Integer applyWay; |
| | | @ApiModelProperty(value = "申请状态1、待审核,2通过,3未通过") |
| | | private Integer applyStatus; |
| | | |
| | | @ApiModelProperty(value = "绑定客户") |
| | | private Integer lowerLevelNum; |
| | | @ApiModelProperty(value = "邀请下级") |
| | | private Integer invitedNum; |
| | | @ApiModelProperty(value = "累计收益") |
| | | private BigDecimal totalRevenue; |
| | | @ApiModelProperty(value = "待结算") |
| | | private BigDecimal balance; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @ApiModel(value = "ShopCustomDetailVo", description = "分销员客户基本信息的返参") |
| | | public class ShopCustomDetailVo { |
| | | @ApiModelProperty(value = "申请用户id") |
| | | private String userId; |
| | | @ApiModelProperty(value = "头像") |
| | | private String avatarUrl; |
| | | @ApiModelProperty(value = "分销员") |
| | | private String nickname; |
| | | @ApiModelProperty(value = "绑定时间") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm",timezone="GMT+8") |
| | | private Date createTime; |
| | | @ApiModelProperty(value = "绑定方式1、自主申请,2、自动添加,3上级邀请,4、手动添加(来源)") |
| | | private Integer applyWay; |
| | | @ApiModelProperty(value = "待成交次数") |
| | | private Integer doneNum; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @ApiModel(value = "ShopOrderDetailVo", description = "订单收益信息返回类") |
| | | public class ShopOrderDetailVo { |
| | | |
| | | @ApiModelProperty(value = "订单id") |
| | | private Long orderId ; |
| | | |
| | | @ApiModelProperty(value = "订单编号") |
| | | private String orderNo; |
| | | |
| | | @ApiModelProperty(value = "实付金额") |
| | | private Double orderMoney; |
| | | |
| | | @ApiModelProperty(value = "订单状态") |
| | | private Integer orderState; |
| | | |
| | | @ApiModelProperty(value = "下单门店") |
| | | private String storeName; |
| | | |
| | | @ApiModelProperty(value = "创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") |
| | | private Date createTime; |
| | | |
| | | @ApiModelProperty(value = "头像") |
| | | private String avatarUrl; |
| | | |
| | | @ApiModelProperty(value = "昵称") |
| | | private String nickName; |
| | | |
| | | @ApiModelProperty(value = " 收益类型1,推广收益,2邀请收益") |
| | | private Integer revenueType; |
| | | |
| | | @ApiModelProperty(value = "收益金额") |
| | | private Double amount; |
| | | |
| | | @ApiModelProperty(value = " 结算状态1,待结算,2,已结算,3已退款") |
| | | private Integer orderStatus; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @ApiModel(value = "ShopSalesmanAppliingVo", description = "获取分销员待审核记录的返参") |
| | | public class ShopSalesmanAppliingVo { |
| | | |
| | | @ApiModelProperty(value = "申请用户id") |
| | | private String userId; |
| | | |
| | | |
| | | @ApiModelProperty(value = "分销员") |
| | | private String nickname; |
| | | |
| | | @ApiModelProperty(value = "创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") |
| | | private Date createTime; |
| | | |
| | | @ApiModelProperty(value = "头像") |
| | | private String avatarUrl; |
| | | |
| | | @ApiModelProperty(value = "手机号码") |
| | | private String phone; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.vo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class ShopSalesmanApplyVo { |
| | | |
| | | /** |
| | | * 审核状态-1、待审核 |
| | | */ |
| | | public static final int APPLY_STATUS_DSH = 1; |
| | | /** |
| | | * 审核状态-2通过 |
| | | */ |
| | | public static final int APPLY_STATUS_TG= 2; |
| | | /** |
| | | * 审核状态-3未通过 |
| | | */ |
| | | public static final int APPLY_STATUS_WTG = 3; |
| | | /** |
| | | * 审核状态-4系统删除 |
| | | */ |
| | | public static final int APPLY_STATUS_XTQX = 4; |
| | | |
| | | |
| | | /** |
| | | * 申请方式1、自主申请 |
| | | */ |
| | | public static final int APPLY_WAY_SELF=1; |
| | | /** |
| | | * 申请方式2、自动添加 |
| | | */ |
| | | public static final int APPLY_WAY_AUTO_ADD=2; |
| | | /** |
| | | * 申请方式3上级邀请 |
| | | */ |
| | | public static final int APPLY_WAY_INVITATION=3; |
| | | /** |
| | | * 申请方式 4、手动添加 |
| | | */ |
| | | public static final int APPLY_WAY_HAND_ADD=4; |
| | | |
| | | @ApiModelProperty(value = "申请记录ID") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "申请方式1、自主申请,2、自动添加,3上级邀请,4、手动添加(来源)") |
| | | private Integer applyWay; |
| | | |
| | | @ApiModelProperty(value = "申请用户id") |
| | | private String userId; |
| | | |
| | | |
| | | @ApiModelProperty(value = "邀请用户ID") |
| | | private String parentUserId; |
| | | |
| | | |
| | | @ApiModelProperty(value = "申请状态1、待审核,2通过,3未通过") |
| | | private Integer applyStatus; |
| | | |
| | | @ApiModelProperty(value = "备注") |
| | | private String remark; |
| | | |
| | | /** |
| | | * 公司ID |
| | | */ |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | @ApiModelProperty(value = "分销员") |
| | | private String nickname; |
| | | @ApiModelProperty(value = "头像") |
| | | private String avatarUrl; |
| | | @ApiModelProperty(value = "注册邀请人") |
| | | private String parentUser; |
| | | @ApiModelProperty(value = "当前上级") |
| | | private String parentUserNow; |
| | | @ApiModelProperty(value = "推广客户") |
| | | private Integer lowerLevelNum; |
| | | @ApiModelProperty(value = "邀请下级") |
| | | private Integer invitedNum; |
| | | |
| | | @ApiModelProperty(value = "累计收益") |
| | | private BigDecimal totalRevenue; |
| | | @ApiModelProperty(value = "待结算") |
| | | private BigDecimal balance; |
| | | @ApiModelProperty(value = "等级") |
| | | private String grade; |
| | | |
| | | @ApiModelProperty(value = "加入时间") |
| | | private Date createTime; |
| | | @ApiModelProperty(value = "状态") |
| | | private Integer state; |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.vo; |
| | | |
| | | public class ShopSalesmanDetailVo { |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.fenxiao.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "ShopSalesmanGradeVo", description = "返参") |
| | | public class ShopSalesmanGradeVo { |
| | | |
| | | @ApiModelProperty(value = "id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "等级名称") |
| | | private String name; |
| | | |
| | | } |
| | |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.constance.SystemConstance; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.plugin.util.BaseServices; |
| | | |
| | | import java.util.List; |
| | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 获取当前操作的会员对象 |
| | | * @author 姜友瑶 |
| | | * @date 2016/7/5 |
| | | */ |
| | | public SysVipInfo getCurrentVioInfo() { |
| | | return (SysVipInfo) (WebUtil.getSession().getAttribute(SystemConstance.CURRENT_CUSTOMER)); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.hive.action; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import com.matrix.system.hive.dto.ScoreChangeDto; |
| | | import com.matrix.system.score.dao.ScoreUseRecordDao; |
| | | import com.matrix.system.score.dao.ScoreVipDetailDao; |
| | | import com.matrix.system.score.entity.ScoreVipDetail; |
| | | import com.matrix.system.score.service.ScoreVipDetailService; |
| | | import com.matrix.system.shopXcx.api.dto.ScoreFlowDto; |
| | | import com.matrix.system.shopXcx.api.vo.ScoreUseRecordVo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiResponse; |
| | | import io.swagger.annotations.ApiResponses; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * @author jyy |
| | | * @date 2021-03-22 15:10 |
| | | */ |
| | | @Api(tags = "用户积分接口类") |
| | | @RestController |
| | | @RequestMapping(value = "/admin/score") |
| | | public class ErpShopScoreAction { |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | ScoreUseRecordDao scoreUseRecordDao; |
| | | |
| | | @Autowired |
| | | ScoreVipDetailDao scoreVipDetailDao; |
| | | |
| | | @Autowired |
| | | ScoreVipDetailService scoreVipDetailService; |
| | | |
| | | @Autowired |
| | | SysVipInfoDao sysVipInfoDao; |
| | | |
| | | @ApiOperation(value = "获取积分流水", notes = "") |
| | | @PostMapping(value = "/getFlowList") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "ok", response = ScoreUseRecordVo.class) |
| | | }) |
| | | AjaxResult getFlowList(@RequestBody ScoreFlowDto scoreFlowDto) { |
| | | SysVipInfo vipInfo = sysVipInfoDao.selectById(scoreFlowDto.getVipId()); |
| | | scoreFlowDto.setVipId(vipInfo.getId()); |
| | | Page<ScoreUseRecordVo> page=new Page<>(scoreFlowDto.getPageNum(),scoreFlowDto.getPageSize()); |
| | | IPage<ScoreUseRecordVo> shopScoreRecord = scoreUseRecordDao.selectFlowList(page,scoreFlowDto); |
| | | AjaxResult result=AjaxResult.buildSuccessInstance(shopScoreRecord.getRecords(),shopScoreRecord.getTotal()); |
| | | return result; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @ApiOperation(value = "调整用户积分", notes = "") |
| | | @PostMapping(value = "/changeUserScore") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "ok", response = AjaxResult.class) |
| | | }) |
| | | AjaxResult changeUserScore(@RequestBody @Validated ScoreChangeDto scoreChangeDto) { |
| | | SysVipInfo vipInfo = sysVipInfoDao.selectById(scoreChangeDto.getVipId()); |
| | | SysUsers sysUsers = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | |
| | | if(scoreChangeDto.getAmount()>0){ |
| | | scoreVipDetailService.addScore(vipInfo.getId(),sysUsers.getSuId(),sysUsers.getShopId(),scoreChangeDto.getAmount(),0L, ScoreVipDetail.SCORE_VIP_TYPE_USERCHANGE,scoreChangeDto.getRemarks()); |
| | | }else if (scoreChangeDto.getAmount()<0){ |
| | | scoreVipDetailService.deductionScore(vipInfo.getId(),sysUsers.getSuId(),sysUsers.getShopId(),Math.abs(scoreChangeDto.getAmount()),0L,ScoreVipDetail.SCORE_VIP_TYPE_USERCHANGE,scoreChangeDto.getRemarks()); |
| | | } |
| | | AjaxResult result=AjaxResult.buildSuccessInstance("调整成功"); |
| | | return result; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @ApiOperation(value = "获取用户积分", notes = "") |
| | | @PostMapping(value = "/getUserScore/{vipId}") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "ok", response = AjaxResult.class) |
| | | }) |
| | | AjaxResult getUserScore(@PathVariable Long vipId) { |
| | | AjaxResult result=AjaxResult.buildSuccessInstance(scoreVipDetailDao.selectUserTotalScore(vipId)); |
| | | return result; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.matrix.system.hive.action; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import com.matrix.component.rabbitmq.RabiitMqTemplate; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.exception.GlobleException; |
| | |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.tools.ResponseHeadUtil; |
| | | import com.matrix.system.constance.Dictionary; |
| | | import com.matrix.system.constance.SystemConstance; |
| | | import com.matrix.system.hive.bean.*; |
| | | import com.matrix.system.hive.dao.*; |
| | | import com.matrix.system.hive.plugin.util.CollectionUtils; |
| | | import com.matrix.system.hive.pojo.ShoppingCarItem; |
| | | import com.matrix.system.hive.pojo.ShoppingCarItemsVo; |
| | | import com.matrix.system.hive.service.*; |
| | | import com.matrix.system.shopXcx.mqTask.MQTaskRouting; |
| | | import com.matrix.system.wechart.templateMsg.UniformMsgParam; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Controller; |
| | |
| | | import java.net.URLEncoder; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | public class OrderController extends BaseController { |
| | | @Resource |
| | | private SysOrderService orderService; |
| | | @Autowired |
| | | ShoppingGoodsDao shoppingGoodsDao; |
| | | |
| | | @Autowired |
| | | private CodeService codeService; |
| | | |
| | | @Autowired |
| | | private SysOrderItemDao orderItemDao; |
| | |
| | | |
| | | @Autowired |
| | | RabiitMqTemplate rabiitMqTemplate; |
| | | |
| | | @Autowired |
| | | private SysProjServicesDao sysProjServicesDao; |
| | | |
| | | @Value("${evn}") |
| | | private String evn; |
| | | |
| | |
| | | AjaxResult payOrder(@RequestBody SysOrder sysOrder) { |
| | | SysUsers user = getMe(); |
| | | sysOrder.setShopId(user.getShopId()); |
| | | sysOrder.setOrderType(SysOrder.ORDER_TYPE_SEAL); |
| | | sysOrder.setIsHasRefund(SysOrder.IS_HAS_REFUND_N); |
| | | //校验订单是否满足结算调价,新订单则保存订单,已有订单则删除后更新 |
| | | sysOrder = orderService.checkAndSaveOrder(sysOrder); |
| | | orderService.updateReceiptMoney(sysOrder); |
| | | |
| | | //发送微信公众号提醒 |
| | | // UniformMsgParam uniformMsgParam=new UniformMsgParam(user.getCompanyId(),UniformMsgParam.GZH_GMCG); |
| | | // uniformMsgParam.put("orderId",sysOrder.getId()); |
| | | // rabiitMqTemplate.sendMsg(MQTaskRouting.SEND_UNIFORM_TEMPLATE_MSG+evn,uniformMsgParam.toJSONString()); |
| | | UniformMsgParam uniformMsgParam=new UniformMsgParam(user.getCompanyId(),UniformMsgParam.GZH_GMCG); |
| | | uniformMsgParam.put("orderId",sysOrder.getId()); |
| | | rabiitMqTemplate.sendMsg(MQTaskRouting.SEND_UNIFORM_TEMPLATE_MSG+evn,uniformMsgParam.toJSONString()); |
| | | |
| | | |
| | | //处理用户购买的产品 |
| | |
| | | */ |
| | | @RequestMapping(value = "/refundOrder") |
| | | @ResponseBody |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult refundOrder(@RequestBody SysOrder sysOrder) { |
| | | //储值卡订单不能通过退款渠道退款 |
| | | if(CollectionUtils.isNotEmpty(sysOrder.getItems())){ |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | SysUsers user = getMe(); |
| | | sysOrder.setShopId(user.getShopId()); |
| | | sysOrder.setStatu(Dictionary.ORDER_STATU_TK); |
| | | sysOrder.setOrderTime(new Date()); |
| | | |
| | | |
| | | //校验订单是否满足结算调价,新订单则保存订单,已有订单则删除后更新 |
| | | sysOrder = orderService.checkAndSaveOrder(sysOrder); |
| | | orderService.refundOrderMoney(sysOrder); |
| | | //处理用户购买的产品 |
| | | return AjaxResult.buildSuccessInstance(Arrays.asList(sysOrder), "订单退款成功"); |
| | |
| | | return AjaxResult.buildSuccessInstance(Arrays.asList(sysOrder), "订单保存成功"); |
| | | } |
| | | |
| | | /** |
| | | * 新建订单 |
| | | * |
| | | * @author jiangyouyao |
| | | */ |
| | | @RequestMapping(value = "/addOrder") |
| | | public @ResponseBody |
| | | AjaxResult addOrder(ShoppingCarItemsVo car) { |
| | | |
| | | List<ShoppingCarItem> sessionCarItems = (List<ShoppingCarItem>) WebUtil.getSession().getAttribute( |
| | | SystemConstance.SHOPPING_CAR); |
| | | |
| | | List<ShoppingCarItem> carItems = new ArrayList<>(); |
| | | |
| | | // 设置购车中的具体类型信息,过滤没有被选中的商品 |
| | | for (ShoppingCarItem carItem : car.getCarItems()) { |
| | | |
| | | for (ShoppingCarItem sessionCar : sessionCarItems) { |
| | | |
| | | if (carItem.getId().equals(sessionCar.getId())) { |
| | | //已最后提交的数量为准 |
| | | sessionCar.setCount(carItem.getCount()); |
| | | carItems.add(sessionCar); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | //设置过滤后的购物车条目 |
| | | car.setCarItems(carItems); |
| | | |
| | | SysVipInfo info = (SysVipInfo) WebUtil.getSession().getAttribute(SystemConstance.CURRENT_CUSTOMER); |
| | | car.setVipId(info.getId()); |
| | | |
| | | // 添加新订单 |
| | | int i = orderService.createOrder(WebUtil.getSession(), car); |
| | | |
| | | if (i > 0) { |
| | | WebUtil.getSession().removeAttribute(SystemConstance.SHOPPING_CAR); |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, "下单成功"); |
| | | } else { |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "下单添加失败"); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | if(orderVo.getId()!=null){ |
| | | WebUtil.getRequest().setAttribute("orderParam", orderVo.getId()); |
| | | WebUtil.getRequest().setAttribute("orderId", orderVo.getId()); |
| | | }else if(StringUtils.isNotBlank(orderVo.getOrderNo())){ |
| | | WebUtil.getRequest().setAttribute("orderParam", orderVo.getOrderNo()); |
| | | WebUtil.getRequest().setAttribute("orderNo", orderVo.getOrderNo()); |
| | | } |
| | | return "admin/hive/beautySalon/orderXq-form"; |
| | | } |
| | |
| | | if (order == null) { |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "订单不存在!"); |
| | | } |
| | | orderService.cancelOrder(id); |
| | | if (del > 0) { |
| | | orderService.removeById(id); |
| | | result.setInfo("删除成功!"); |
| | | } else { |
| | | result.setInfo("取消成功!"); |
| | | |
| | | List<SysOrderItem> items = orderItemDao.selectByOrderId(id); |
| | | for (SysOrderItem item : items) { |
| | | List<SysProjServices> sysProjServices = sysProjServicesDao.selectProjServicesByOrderItemId(item.getId()); |
| | | if (CollUtil.isNotEmpty(sysProjServices)) { |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "订单存在进行中的服务单无法取消/删除"); |
| | | } |
| | | } |
| | | |
| | | orderService.cancelOrder(id); |
| | | // if (del > 0) { |
| | | // orderService.removeById(id); |
| | | // result.setInfo("删除成功!"); |
| | | // } else { |
| | | result.setInfo("取消成功!"); |
| | | // } |
| | | result.setStatus(AjaxResult.STATUS_SUCCESS); |
| | | |
| | | return result; |
| | |
| | | package com.matrix.system.hive.action; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.matrix.core.anotations.RemoveRequestToken; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.exception.GlobleException; |
| | |
| | | } |
| | | //补充服务单扩展信息=============== |
| | | List<SysBeauticianState> beauticianStateList = beauticianStateDao.selectBySerIds(id); |
| | | if (CollUtil.isNotEmpty(beauticianStateList)) { |
| | | for (SysBeauticianState sysBeauticianState : beauticianStateList) { |
| | | if (sysBeauticianState.getProjUse().getTaocanId() != null) { |
| | | SysProjUse sysProjUse = projUseService.findById(sysBeauticianState.getProjUse().getTaocanId()); |
| | | sysBeauticianState.getProjInfo().setName(sysProjUse.getProjName()+"--"+sysBeauticianState.getProjInfo().getName()); |
| | | } |
| | | } |
| | | } |
| | | projServices.setServiceItems(beauticianStateList); |
| | | SysBedState sysBedState = sysBedStateDao.selectBySerIdAndBedId(projServices.getId(), projServices.getBedId()); |
| | | projServices.setBedState(sysBedState); |
| | |
| | | AjaxResult result = AjaxResult.buildSuccessInstance("查询成功"); |
| | | |
| | | SysProjUse queryUse = new SysProjUse(); |
| | | if(Objects.nonNull(vipId)){ |
| | | queryUse.setVipId(vipId); |
| | | }else{ |
| | | SysVipInfo vipInfo = getCurrentVioInfo(); |
| | | queryUse.setVipId(vipInfo.getId()); |
| | | } |
| | | |
| | | queryUse.setVipId(vipId); |
| | | queryUse.setType(Dictionary.SHOPPING_GOODS_TYPE_XM); |
| | | queryUse.setTaocanId(-1L); |
| | | queryUse.setStatus(Dictionary.TAOCAN_STATUS_YX); |
| | |
| | | return "admin/hive/beautySalon/yypb-form"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 进入预约排班详情 |
| | | * |
| | |
| | | |
| | | //补充服务单扩展信息=============== |
| | | List<SysBeauticianState> beauticianStateList = beauticianStateDao.selectBySerIds(projServices.getId()); |
| | | if (CollUtil.isNotEmpty(beauticianStateList)) { |
| | | for (SysBeauticianState sysBeauticianState : beauticianStateList) { |
| | | if (sysBeauticianState.getProjUse().getTaocanId() != null) { |
| | | SysProjUse sysProjUse = projUseService.findById(sysBeauticianState.getProjUse().getTaocanId()); |
| | | if(sysProjUse != null) { |
| | | sysBeauticianState.getProjInfo().setName(sysProjUse.getProjName() + "--" + sysBeauticianState.getProjInfo().getName()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | projServices.setServiceItems(beauticianStateList); |
| | | |
| | | SysBedState sysBedState = sysBedStateDao.selectBySerIdAndBedId(projServices.getId(), projServices.getBedId()); |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据id取消预约 |
| | | */ |
| | |
| | | @RequestMapping(value = "/addService") |
| | | public @ResponseBody |
| | | AjaxResult servicceAdd(@RequestBody SysProjServices sysProjServices) { |
| | | SysVipInfo vipInfo = getCurrentVioInfo(); |
| | | sysProjServices.setVipId(vipInfo.getId()); |
| | | |
| | | |
| | | if (CollectionUtils.isEmpty(sysProjServices.getServiceItems())) { |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "没有选中可消耗的项目"); |
| | |
| | | if (balanceverifyResult.isError()) { |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, balanceverifyResult.getMsg()); |
| | | } |
| | | sysProjServices.setState(Dictionary.SERVICE_STATU_YYCG); |
| | | if (StrUtil.isEmpty(sysProjServices.getState())) { |
| | | sysProjServices.setState(Dictionary.SERVICE_STATU_DYY); |
| | | } |
| | | SysProjServices newSysProjServices = sysProjServicesService.addSysProjServices(sysProjServices); |
| | | if (newSysProjServices != null) { |
| | | return AjaxResult.buildSuccessInstance(Arrays.asList(newSysProjServices)); |
| | |
| | | @RequestMapping(value = "/addServiceForForm") |
| | | public @ResponseBody |
| | | AjaxResult servicceAddForForm(SysProjServices sysProjServices) { |
| | | SysVipInfo vipInfo = getCurrentVioInfo(); |
| | | sysProjServices.setVipId(vipInfo.getId()); |
| | | |
| | | |
| | | |
| | | if (CollectionUtils.isEmpty(sysProjServices.getServiceItems())) { |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "没有选中可消耗的项目"); |
| | |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/addServiceProj") |
| | | @ResponseBody |
| | | public AjaxResult addServiceProj(SysProjServices sysProjServices) { |
| | | |
| | | return AjaxResult.buildSuccessInstance("保存成功"); |
| | | } |
| | | |
| | | /** |
| | | * 删除服务单项目/套餐 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/delServiceOrderItems") |
| | | @ResponseBody |
| | | public AjaxResult delServiceOrderItems(Long id) { |
| | | sysProjServicesService.deleteProjServiceItemById(id); |
| | | return AjaxResult.buildSuccessInstance("删除成功"); |
| | | } |
| | | |
| | | |
| | | // 准备页面数据 |
| | | private void pageDate() { |
| | | // 根据岗位名称查询员工 |
| | |
| | | import com.matrix.system.hive.dao.ShoppingGoodsDao; |
| | | import com.matrix.system.hive.dao.SysProjUseDao; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import com.matrix.system.hive.plugin.message.StringUtil; |
| | | import com.matrix.system.hive.plugin.util.CollectionUtils; |
| | | import com.matrix.system.hive.service.MoneyCardUseService; |
| | | import com.matrix.system.hive.service.SysProjUseService; |
| | |
| | | Object tel = objects.get(1); |
| | | if (tel != null) { |
| | | String telStr = tel.toString(); |
| | | SysVipInfo vipInfo = vipInfoDao.selectByPhone(telStr); |
| | | SysVipInfo vipInfo = vipInfoDao.selectByPhone(telStr,sysUsers.getCompanyId()); |
| | | if (vipInfo == null) { |
| | | vipInfo = new SysVipInfo(); |
| | | vipInfo.setShopId(sysUsers.getShopId()); |
| | |
| | | Object tel = objects.get(1); |
| | | if (tel != null) { |
| | | String telStr = tel.toString(); |
| | | SysVipInfo vipInfo = vipInfoDao.selectByPhone(telStr); |
| | | SysVipInfo vipInfo = vipInfoDao.selectByPhone(telStr,sysUsers.getCompanyId()); |
| | | if (vipInfo == null) { |
| | | vipInfo = new SysVipInfo(); |
| | | vipInfo.setShopId(sysUsers.getShopId()); |
| | |
| | | import com.matrix.core.tools.excl.ExcelSheetPO; |
| | | import com.matrix.core.tools.excl.ExcelUtil; |
| | | import com.matrix.core.tools.excl.ExcelVersion; |
| | | import com.matrix.system.common.bean.CustomerDataDictionary; |
| | | import com.matrix.system.common.bean.SystemDictionary; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.bean.SystemDictionary; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.common.dao.CustomerDataDictionaryDao; |
| | | import com.matrix.system.common.service.SystemDictionaryService; |
| | | import com.matrix.system.common.service.SysUsersService; |
| | | import com.matrix.system.common.service.SystemDictionaryService; |
| | | import com.matrix.system.common.tools.ResponseHeadUtil; |
| | | import com.matrix.system.constance.Dictionary; |
| | | import com.matrix.system.constance.SystemConstance; |
| | | import com.matrix.system.hive.action.util.QueryUtil; |
| | | import com.matrix.system.hive.bean.*; |
| | | import com.matrix.system.hive.bean.Question; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.bean.SysVipLevel; |
| | | import com.matrix.system.hive.bean.VipAnswer; |
| | | import com.matrix.system.hive.dao.MoneyCardUseDao; |
| | | import com.matrix.system.hive.dao.SysVipLabelDao; |
| | | import com.matrix.system.hive.dao.VipAnswerDao; |
| | | import com.matrix.core.tools.DateUtil; |
| | | import com.matrix.system.hive.pojo.RegisterInfo; |
| | | import com.matrix.system.hive.service.*; |
| | | import com.matrix.system.score.dao.ScoreVipDetailDao; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.ModelMap; |
| | |
| | | import java.net.URLDecoder; |
| | | import java.net.URLEncoder; |
| | | import java.security.NoSuchAlgorithmException; |
| | | import java.util.*; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Calendar; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | |
| | | @Resource |
| | | private SysOrderService sysOrderService; |
| | | |
| | | @Autowired |
| | | private ScoreVipDetailDao scoreVipDetailDao; |
| | | |
| | | |
| | | @RequestMapping(value = "/showVipLevel") |
| | | public @ResponseBody |
| | |
| | | @RequestMapping(value = "/showVipInfo") |
| | | public @ResponseBody |
| | | AjaxResult findByModel(String keyWord) { |
| | | LinkedList<SysVipInfo> userList = null; |
| | | // 获取最近查询客户 |
| | | if (WebUtil.getSession().getAttribute(SystemConstance.HISTORY_CUSTOMER) == null) { |
| | | userList = new LinkedList<SysVipInfo>(); |
| | | WebUtil.getSession().setAttribute(SystemConstance.HISTORY_CUSTOMER, userList); |
| | | } else { |
| | | userList = (LinkedList<SysVipInfo>) WebUtil.getSession().getAttribute(SystemConstance.HISTORY_CUSTOMER); |
| | | } |
| | | |
| | | List<SysVipInfo> vips = vipInfoService.findByVipNoOrTel(keyWord); |
| | | if (vips.size() > 0) { |
| | | // 在session存放当前查询的客户 |
| | | vips.get(0).setPointAll(scoreVipDetailDao.selectUserTotalScore(vips.get(0).getId())); |
| | | vips.get(0).setSysOrder(sysOrderService.findSysOrderTjByVipId(vips.get(0).getId())); |
| | | vips.get(0).setLevelCard(cardUseService.findByVipId(vips.get(0).getId())); |
| | | WebUtil.getSession().setAttribute(SystemConstance.CURRENT_CUSTOMER, vips.get(0)); |
| | | // 满20后删除一个 |
| | | if (userList.size() == 20) { |
| | | userList.poll(); |
| | | } |
| | | // 去重标志 |
| | | boolean isNoRepeat = true; |
| | | for (SysVipInfo sysVipInfo : userList) { |
| | | if (vips.get(0).getPhone().equals(sysVipInfo.getPhone())) { |
| | | isNoRepeat = false; |
| | | } |
| | | } |
| | | if (isNoRepeat) { |
| | | userList.add(vips.get(0)); |
| | | } |
| | | vips.get(0).setLabels(sysVipLabelDao.selectByVipId(vips.get(0).getId())); |
| | | vips.get(0).setAge(DateUtil.getAgeForBirthDay(vips.get(0).getBirthday1())); |
| | | vips.get(0).setBalance(moneyCardUseDao.selectVipCardTotalMoney(vips.get(0).getId())); |
| | |
| | | vipInfo.setVipState(Dictionary.VIP_STATE_HY); |
| | | vipInfo.setStaffId(getMe().getSuId()); |
| | | vipInfo.setShopId(getMe().getShopId()); |
| | | vipInfo.setCompanyId(getMe().getCompanyId()); |
| | | vipInfo.setVipType(Dictionary.VIP_TYPE_NOCARD); |
| | | vipInfoService.add(vipInfo); |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, "会员信息注册成功"); |
| | |
| | | @RequestMapping(value = "/findUserByPhoneOrNo") |
| | | public @ResponseBody |
| | | AjaxResult findUserByPhoneOrNo(String keyWord) { |
| | | LinkedList<SysVipInfo> userList = null; |
| | | // 获取最近查询客户 |
| | | if (WebUtil.getSession().getAttribute(SystemConstance.HISTORY_CUSTOMER) == null) { |
| | | userList = new LinkedList<SysVipInfo>(); |
| | | WebUtil.getSession().setAttribute(SystemConstance.HISTORY_CUSTOMER, userList); |
| | | } else { |
| | | userList = (LinkedList<SysVipInfo>) WebUtil.getSession().getAttribute(SystemConstance.HISTORY_CUSTOMER); |
| | | } |
| | | List<SysVipInfo> vips = vipInfoService.findByVipNoOrTel(keyWord); |
| | | if (vips.size() > 0) { |
| | | // 在session存放当前查询的客户 |
| | | WebUtil.getSession().setAttribute(SystemConstance.CURRENT_CUSTOMER, vips.get(0)); |
| | | // 满20后删除一个 |
| | | if (userList.size() == 20) { |
| | | userList.poll(); |
| | | } |
| | | // 去重标志 |
| | | boolean isNoRepeat = true; |
| | | for (SysVipInfo sysVipInfo : userList) { |
| | | if (vips.get(0).getPhone().equals(sysVipInfo.getPhone())) { |
| | | isNoRepeat = false; |
| | | } |
| | | } |
| | | if (isNoRepeat) { |
| | | userList.add(vips.get(0)); |
| | | } |
| | | } |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, vips, 0); |
| | | |
| | | } |
| | |
| | | * 客户id |
| | | */ |
| | | private Long vipId; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 购买业绩 |
| | | */ |
| | | private Double goodsCash; |
| | | |
| | | private Double cardCash; |
| | | |
| | | /** |
| | | * 赠送消耗 |
| | |
| | | */ |
| | | private Double hisConsume; |
| | | |
| | | |
| | | /** |
| | | * 划扣金额 从卡中划扣钱买东西 |
| | | */ |
| | | private Double consume; |
| | | |
| | | |
| | | /** |
| | | * 卡项,套餐,充值,开会籍卡 |
| | | */ |
| | | private Double cardCash; |
| | | |
| | | |
| | | /** |
| | | * 现金单次,购买项目的业绩 |
| | | */ |
| | | private Double projCash; |
| | | |
| | | |
| | | /** |
| | | * 现金产品,购买家居产品的钱 |
| | | */ |
| | | private Double goodsCash; |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | * 总金额 |
| | | */ |
| | | private Double zkTotal; |
| | | |
| | | /** |
| | | * 公司id |
| | | */ |
| | | private Long companyId; |
| | | |
| | | |
| | | private String t1; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * 业绩种类 1-现金业绩 2-划扣业绩 |
| | | * 业绩类型 |
| | | */ |
| | | private String t3; |
| | | |
| | | |
| | | private String achieveType; |
| | | |
| | | |
| | | private String t4; |
| | | |
| | | |
| | |
| | | private Date endTime; |
| | | |
| | | |
| | | /** |
| | | * 分配的业绩金额 |
| | | */ |
| | | @Extend |
| | | private Double achieveMoney; |
| | | |
| | | private String goodsNo; |
| | | |
| | | private String goodsName; |
| | | |
| | | private String type; |
| | | |
| | | private String payMethod; |
| | | |
| | | private String cateName; |
| | | |
| | | public Double getCardCash() { |
| | | return cardCash; |
| | | } |
| | | |
| | | public void setCardCash(Double cardCash) { |
| | | this.cardCash = cardCash; |
| | | } |
| | | |
| | | public String getCateName() { |
| | | return cateName; |
| | | } |
| | | |
| | | public void setCateName(String cateName) { |
| | | this.cateName = cateName; |
| | | } |
| | | |
| | | public String getPayMethod() { |
| | | return payMethod; |
| | | } |
| | | |
| | | public void setPayMethod(String payMethod) { |
| | | this.payMethod = payMethod; |
| | | } |
| | | |
| | | public String getType() { |
| | | return type; |
| | |
| | | this.companyId = companyId; |
| | | } |
| | | |
| | | public Double getAchieveMoney() { |
| | | return achieveMoney; |
| | | } |
| | | |
| | | public void setAchieveMoney(Double achieveMoney) { |
| | | this.achieveMoney = achieveMoney; |
| | | } |
| | | |
| | | public Date getBeginTime() { |
| | | return beginTime; |
| | |
| | | public void setHisConsume(Double hisConsume) { |
| | | this.hisConsume = hisConsume; |
| | | } |
| | | public Double getConsume() { |
| | | return consume; |
| | | } |
| | | public void setConsume(Double consume) { |
| | | this.consume = consume; |
| | | } |
| | | public Double getCardCash() { |
| | | return cardCash; |
| | | } |
| | | public void setCardCash(Double cardCash) { |
| | | this.cardCash = cardCash; |
| | | } |
| | | public Double getProjCash() { |
| | | return projCash; |
| | | } |
| | | public void setProjCash(Double projCash) { |
| | | this.projCash = projCash; |
| | | } |
| | | |
| | | |
| | | public Double getGoodsCash() { |
| | | return goodsCash; |
| | | } |
| | |
| | | public void setT2(String t2) { |
| | | this.t2 = t2; |
| | | } |
| | | public String getT3() { |
| | | return t3; |
| | | |
| | | public String getAchieveType() { |
| | | return achieveType; |
| | | } |
| | | public void setT3(String t3) { |
| | | this.t3 = t3; |
| | | |
| | | public void setAchieveType(String achieveType) { |
| | | this.achieveType = achieveType; |
| | | } |
| | | |
| | | public String getT4() { |
| | | return t4; |
| | | } |
| | |
| | | package com.matrix.system.hive.bean; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.matrix.core.anotations.Extend; |
| | | import com.matrix.core.tools.DateUtil; |
| | | import com.matrix.system.constance.Dictionary; |
| | | import com.matrix.system.hive.plugin.util.MoneyUtil; |
| | | import com.matrix.system.hive.pojo.MoneyCardUserVo; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * |
| | | * @date 2016-09-17 10:17 |
| | | */ |
| | | public class MoneyCardUse extends MoneyCardUserVo implements Serializable{ |
| | | public class MoneyCardUse { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | |
| | | private Long id; |
| | | |
| | | |
| | | |
| | | |
| | | private String createBy; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createTime; |
| | | |
| | | private String updateBy; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * 剩余次数 |
| | | */ |
| | | @TableField(exist = false) |
| | | String lastCountName; |
| | | /** |
| | | * 数据来源 |
| | | */ |
| | | @TableField(exist = false) |
| | | String sourceName; |
| | | |
| | | /*vo对象************/ |
| | | |
| | | /** |
| | | * 剩余次数 |
| | | */ |
| | | |
| | | private Integer lastCount; |
| | | |
| | | /** |
| | | * 来源,购买,转让,赠送 |
| | | */ |
| | | private String source; |
| | | /** |
| | | * 是会籍卡? Y 是,N否 |
| | | */ |
| | | private String isVipCar; |
| | | |
| | | /** |
| | | * 订单明细id |
| | | */ |
| | |
| | | private Integer useTotal; |
| | | |
| | | |
| | | /** |
| | | * 剩余次数 |
| | | */ |
| | | |
| | | private Integer lastCount; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 本金 |
| | |
| | | private String status; |
| | | |
| | | |
| | | /** |
| | | * 来源,购买,转让,赠送 |
| | | */ |
| | | private String source; |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | @JsonFormat(pattern = DateUtil.DATE_FORMAT_DD, timezone = "GMT+8") |
| | | @DateTimeFormat(pattern= DateUtil.DATE_FORMAT_DD) |
| | | private Date failTime; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 充值卡的id |
| | |
| | | /** |
| | | * 订单ID |
| | | */ |
| | | @TableField(exist = false) |
| | | private Long orderId; |
| | | |
| | | |
| | |
| | | */ |
| | | private String isOver; |
| | | |
| | | /** |
| | | * 是默认储值卡? Y 是,N否 |
| | | */ |
| | | private String isVipCar; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | |
| | | /** |
| | | * 前台输入的退款金额 |
| | | */ |
| | | @TableField(exist = false) |
| | | private String returnMonery; |
| | | |
| | | /** |
| | |
| | | public void setRemark(String remark) { |
| | | this.remark = remark; |
| | | } |
| | | |
| | | /** |
| | | * 当大于10000时使用次数为不限,或者为会籍卡时 |
| | | * @return |
| | | */ |
| | | public String getLastCountName() { |
| | | if(getLastCount()==null){ |
| | | return ""; |
| | | } |
| | | if(Dictionary.FLAG_YES.equals(getIsVipCar())||getLastCount()>Dictionary.MAX_USE_COUNT_SIGN){ |
| | | lastCountName=Dictionary.MAX_USE_STRING; |
| | | }else{ |
| | | lastCountName=getLastCount().toString(); |
| | | } |
| | | return lastCountName; |
| | | } |
| | | |
| | | public String getCreateBy() { |
| | | return createBy; |
| | | } |
| | | |
| | | public void setCreateBy(String createBy) { |
| | | this.createBy = createBy; |
| | | } |
| | | |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public String getUpdateBy() { |
| | | return updateBy; |
| | | } |
| | | |
| | | public void setUpdateBy(String updateBy) { |
| | | this.updateBy = updateBy; |
| | | } |
| | | |
| | | public Date getUpdateTime() { |
| | | return updateTime; |
| | | } |
| | | |
| | | public void setUpdateTime(Date updateTime) { |
| | | this.updateTime = updateTime; |
| | | } |
| | | |
| | | public void setLastCountName(String lastCountName) { |
| | | this.lastCountName = lastCountName; |
| | | } |
| | | |
| | | public String getSourceName() { |
| | | if(getSource()==null){ |
| | | return ""; |
| | | } |
| | | if(getSource().contains(Dictionary.TAOCAN_SOURCE_ZS)){ |
| | | sourceName=Dictionary.FLAG_YES; |
| | | }else{ |
| | | sourceName=Dictionary.FLAG_NO;; |
| | | } |
| | | return sourceName; |
| | | } |
| | | |
| | | public void setSourceName(String sourceName) { |
| | | this.sourceName = sourceName; |
| | | } |
| | | |
| | | |
| | | public String getIsVipCar() { |
| | | return isVipCar; |
| | | } |
| | | |
| | | public void setIsVipCar(String isVipCar) { |
| | | this.isVipCar = isVipCar; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 扩展对象 |
| | | */ |
| | |
| | | /** |
| | | * 会员信息 |
| | | */ |
| | | @TableField(exist = false) |
| | | private SysVipInfo vipInfo; |
| | | |
| | | /** |
| | | * 调整说明 |
| | | */ |
| | | @Extend |
| | | @TableField(exist = false) |
| | | private String changeRemark; |
| | | |
| | | |
| | |
| | | this.changeRemark = changeRemark; |
| | | } |
| | | |
| | | public String getIsVipCar() { |
| | | return isVipCar; |
| | | } |
| | | |
| | | public void setIsVipCar(String isVipCar) { |
| | | this.isVipCar = isVipCar; |
| | | } |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | |
| | | public void setId(Long id) { |
| | | this.id=id; |
| | | } |
| | | |
| | | |
| | | |
| | | public Long getOrderItemId() { |
| | | return orderItemId; |
| | | } |
| | | |
| | | |
| | | public void setOrderItemId(Long orderItemId) { |
| | | this.orderItemId=orderItemId; |
| | | } |
| | | |
| | | |
| | | |
| | | public Integer getUseTotal() { |
| | | return useTotal; |
| | | } |
| | | |
| | | |
| | | public void setUseTotal(Integer useTotal) { |
| | | this.useTotal=useTotal; |
| | | } |
| | | |
| | | |
| | | |
| | | public Integer getLastCount() { |
| | | return lastCount; |
| | | } |
| | | |
| | | |
| | | public void setLastCount(Integer lastCount) { |
| | | this.lastCount=lastCount; |
| | | } |
| | | |
| | | |
| | | |
| | | public Double getRealMoney() { |
| | | return realMoney; |
| | | } |
| | | |
| | | |
| | | public void setRealMoney(Double realMoney) { |
| | | this.realMoney=realMoney; |
| | | } |
| | | |
| | | |
| | | |
| | | public Double getGiftMoney() { |
| | | return giftMoney; |
| | | } |
| | | |
| | | |
| | | public void setGiftMoney(Double giftMoney) { |
| | | this.giftMoney=giftMoney; |
| | | } |
| | | |
| | | |
| | | |
| | | public String getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | |
| | | public void setStatus(String status) { |
| | | this.status=status; |
| | | } |
| | | |
| | | |
| | | |
| | | public String getSource() { |
| | | return source; |
| | | } |
| | | |
| | | |
| | | public void setSource(String source) { |
| | | this.source=source; |
| | | } |
| | | |
| | | |
| | | |
| | | public Date getFailTime() { |
| | | return failTime; |
| | | } |
| | | |
| | | |
| | | public void setFailTime(Date failTime) { |
| | | this.failTime=failTime; |
| | | } |
| | | |
| | | |
| | | |
| | | public Long getGoodsId() { |
| | | return goodsId; |
| | | } |
| | | |
| | | |
| | | public void setGoodsId(Long goodsId) { |
| | | this.goodsId=goodsId; |
| | | } |
| | | |
| | | |
| | | |
| | | public Long getVipId() { |
| | | return vipId; |
| | | } |
| | | |
| | | |
| | | public void setVipId(Long vipId) { |
| | | this.vipId=vipId; |
| | | } |
| | | |
| | | |
| | | |
| | | public String getIsOver() { |
| | | return isOver; |
| | | } |
| | | |
| | | |
| | | public void setIsOver(String isOver) { |
| | | this.isOver=isOver; |
| | | } |
| | |
| | | return MoneyUtil.add(realMoney,giftMoney); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | package com.matrix.system.hive.bean; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | /** |
| | |
| | | * 订单编号 |
| | | */ |
| | | private String orderNo; |
| | | |
| | | |
| | | /** |
| | | * 微信支付编号 |
| | | */ |
| | | private String payNo; |
| | | |
| | | |
| | | /** |
| | | * 操作员id |
| | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") |
| | | private Date createTime; |
| | | |
| | | /** |
| | |
| | | public void setTimes(Integer times) { |
| | | this.times = times; |
| | | } |
| | | |
| | | public String getPayNo() { |
| | | return payNo; |
| | | } |
| | | |
| | | public void setPayNo(String payNo) { |
| | | this.payNo = payNo; |
| | | } |
| | | } |
| | |
| | | package com.matrix.system.hive.bean; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.matrix.core.tools.DateUtil; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | |
| | | */ |
| | | public class SysOrder implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | /** |
| | | * 订单类型-销售订单 |
| | | */ |
| | | public static final int ORDER_TYPE_SEAL= 1; |
| | | |
| | | /** |
| | | * 订单类型-退款订单 |
| | | */ |
| | | public static final int ORDER_TYPE_REFUND= 2; |
| | | |
| | | /** |
| | | * 序号 |
| | |
| | | /** |
| | | * 订单总价 |
| | | */ |
| | | private double total; |
| | | private Double total; |
| | | /** |
| | | * 折后价 |
| | | */ |
| | | private double zkTotal; |
| | | private Double zkTotal; |
| | | |
| | | /** |
| | | * 现金支付金额 |
| | | */ |
| | | private double cashPay; |
| | | private Double cashPay; |
| | | /** |
| | | * 现金支付金额 |
| | | */ |
| | | private double cardPay; |
| | | private Double cardPay; |
| | | /** |
| | | * 欠款金额 |
| | | */ |
| | | private double arrears; |
| | | private Double arrears; |
| | | |
| | | /** |
| | | * 店铺id |
| | |
| | | * 会员姓名 |
| | | */ |
| | | private String vipNo; |
| | | |
| | | |
| | | /** |
| | | * 订单类型1,销售订单,2退款订单 |
| | | */ |
| | | private Integer orderType; |
| | | |
| | | /* 会员手机号 |
| | | */ |
| | | private String vipPhone; |
| | |
| | | */ |
| | | private Integer times; |
| | | |
| | | |
| | | private String type; |
| | | |
| | | /** |
| | | * 原有订单ID 退款时使用 |
| | | */ |
| | | private Long oldOrderId; |
| | | |
| | | /** |
| | | * 该订单有退款 |
| | | */ |
| | | public static final Integer IS_HAS_REFUND_Y = 1; |
| | | |
| | | /** |
| | | * 该订单无退款 |
| | | */ |
| | | public static final Integer IS_HAS_REFUND_N = 2; |
| | | |
| | | /** |
| | | * 是否发生退款 1-是 2-否 |
| | | */ |
| | | private Integer isHasRefund; |
| | | |
| | | public Integer getIsHasRefund() { |
| | | return isHasRefund; |
| | | } |
| | | |
| | | public void setIsHasRefund(Integer isHasRefund) { |
| | | this.isHasRefund = isHasRefund; |
| | | } |
| | | |
| | | public Long getOldOrderId() { |
| | | return oldOrderId; |
| | |
| | | |
| | | public void setShopShortName(String shopShortName) { |
| | | this.shopShortName = shopShortName; |
| | | } |
| | | |
| | | public Integer getOrderType() { |
| | | return orderType; |
| | | } |
| | | |
| | | public void setOrderType(Integer orderType) { |
| | | this.orderType = orderType; |
| | | } |
| | | |
| | | public String getType() { |
| | |
| | | this.searchShop = searchShop; |
| | | } |
| | | |
| | | public double getArrears() { |
| | | public Double getArrears() { |
| | | return arrears; |
| | | } |
| | | |
| | | public void setArrears(double arrears) { |
| | | public void setArrears(Double arrears) { |
| | | this.arrears = arrears; |
| | | } |
| | | |
| | | public double getCardPay() { |
| | | public Double getCardPay() { |
| | | return cardPay; |
| | | } |
| | | |
| | | public void setCardPay(double cardPay) { |
| | | public void setCardPay(Double cardPay) { |
| | | this.cardPay = cardPay; |
| | | } |
| | | |
| | |
| | | public void setEndTimeVo(Date endTimeVo) { |
| | | this.endTimeVo = endTimeVo; |
| | | } |
| | | public double getCashPay() { |
| | | public Double getCashPay() { |
| | | return cashPay; |
| | | } |
| | | |
| | | public void setCashPay(double cashPay) { |
| | | public void setCashPay(Double cashPay) { |
| | | this.cashPay = cashPay; |
| | | } |
| | | |
| | |
| | | this.activity = activity; |
| | | } |
| | | |
| | | public double getTotal() { |
| | | public Double getTotal() { |
| | | return total; |
| | | } |
| | | |
| | | public void setTotal(double total) { |
| | | public void setTotal(Double total) { |
| | | this.total = total; |
| | | } |
| | | |
| | |
| | | this.changeId = changeId; |
| | | } |
| | | |
| | | public double getZkTotal() { |
| | | public Double getZkTotal() { |
| | | return zkTotal; |
| | | } |
| | | |
| | | public void setZkTotal(double zkTotal) { |
| | | public void setZkTotal(Double zkTotal) { |
| | | this.zkTotal = zkTotal; |
| | | } |
| | | |
| | |
| | | private Integer count; |
| | | |
| | | |
| | | /** |
| | | * 退款数量 |
| | | */ |
| | | private Integer refundCount; |
| | | |
| | | |
| | | /** |
| | | * 是否为赠送和 是否 |
| | |
| | | * 欠款金额 |
| | | */ |
| | | private Double arrears; |
| | | |
| | | |
| | | |
| | | |
| | | //页面参数使用 |
| | | |
| | | /** |
| | | * 付款方式 |
| | | */ |
| | |
| | | */ |
| | | private Long cardId; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 是否为综合卡创建的订单明细 |
| | | * 1是 |
| | |
| | | return preCount; |
| | | } |
| | | |
| | | public Integer getRefundCount() { |
| | | return refundCount; |
| | | } |
| | | |
| | | public void setRefundCount(Integer refundCount) { |
| | | this.refundCount = refundCount; |
| | | } |
| | | |
| | | public void setPreCount(int preCount) { |
| | | this.preCount = preCount; |
| | | } |
| | |
| | | /** |
| | | * 业绩计算 |
| | | */ |
| | | private List<AchieveNew> achaeveList; |
| | | private List<AchieveNew> achieveList; |
| | | |
| | | public List<AchieveNew> getAchaeveList() { |
| | | return achaeveList; |
| | | |
| | | public List<AchieveNew> getAchieveList() { |
| | | return achieveList; |
| | | } |
| | | |
| | | public void setAchaeveList(List<AchieveNew> achaeveList) { |
| | | this.achaeveList = achaeveList; |
| | | public void setAchieveList(List<AchieveNew> achieveList) { |
| | | this.achieveList = achieveList; |
| | | } |
| | | |
| | | public String getPayMethodDetail() { |
| | |
| | | * 床位 |
| | | */ |
| | | private Long bedId; |
| | | /** |
| | | * 床位 |
| | | */ |
| | | |
| | | private Long companyId; |
| | | |
| | | /** |
| | |
| | | package com.matrix.system.hive.bean; |
| | | |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.google.gson.annotations.Expose; |
| | | import com.matrix.core.tools.DateUtil; |
| | | import com.matrix.system.hive.plugin.util.ExcelAnnotation; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * @Title: SysVipInfo.java |
| | | * @Package com.zkingsoft.model |
| | | * @description |
| | | * @author jyy |
| | | * @email 18075895212@qq.com |
| | | * @date 2016年7月14日 上午10:59:29 |
| | | */ |
| | | |
| | | @Data |
| | | public class SysVipInfo implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | /** |
| | | * 是销售员 |
| | | */ |
| | | public static final int IS_SALES = 1; |
| | | /** |
| | | * 不是销售员 |
| | | */ |
| | | public static final int NOT_SALES = 2; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 1、成交客户 |
| | | * **/ |
| | |
| | | |
| | | private SysOrder sysOrder; |
| | | |
| | | public String getProvince() { |
| | | return province; |
| | | } |
| | | /** |
| | | * 可提现金额 |
| | | */ |
| | | private Double withdrawalCash; |
| | | /** |
| | | *推广员等级 |
| | | */ |
| | | private Long salesmanGrade; |
| | | |
| | | public void setProvince(String province) { |
| | | this.province = province; |
| | | } |
| | | |
| | | public String getCity() { |
| | | return city; |
| | | } |
| | | |
| | | public void setCity(String city) { |
| | | this.city = city; |
| | | } |
| | | |
| | | public String getArea() { |
| | | return area; |
| | | } |
| | | |
| | | public void setArea(String area) { |
| | | this.area = area; |
| | | } |
| | | |
| | | public Long getRecommendId() { |
| | | return recommendId; |
| | | } |
| | | |
| | | public void setRecommendId(Long recommendId) { |
| | | this.recommendId = recommendId; |
| | | } |
| | | |
| | | public SysOrder getSysOrder() { |
| | | return sysOrder; |
| | | } |
| | | |
| | | public void setSysOrder(SysOrder sysOrder) { |
| | | this.sysOrder = sysOrder; |
| | | } |
| | | |
| | | public Integer getIsDeal() { |
| | | return isDeal; |
| | | } |
| | | |
| | | public void setIsDeal(Integer isDeal) { |
| | | this.isDeal = isDeal; |
| | | } |
| | | |
| | | public Long getParentId() { |
| | | return parentId; |
| | | } |
| | | |
| | | public void setParentId(Long parentId) { |
| | | this.parentId = parentId; |
| | | } |
| | | |
| | | public Date getCreateDistributionTime() { |
| | | return createDistributionTime; |
| | | } |
| | | |
| | | public void setCreateDistributionTime(Date createDistributionTime) { |
| | | this.createDistributionTime = createDistributionTime; |
| | | } |
| | | |
| | | public Date getHandleTime() { |
| | | return handleTime; |
| | | } |
| | | |
| | | public void setHandleTime(Date handleTime) { |
| | | this.handleTime = handleTime; |
| | | } |
| | | /** |
| | | * 用户昵称 |
| | | */ |
| | | private String nickName; |
| | | |
| | | |
| | | /** 扩展信息 **/ |
| | | /** |
| | | * 头像 |
| | | */ |
| | | private String avatarUrl; |
| | | |
| | | /** |
| | | * 性别 1、男 2、女 0、未知 |
| | | */ |
| | | private Integer gender; |
| | | |
| | | /** |
| | | * 用户所在国家 |
| | | */ |
| | | private String country; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 用户是否授权 1、是 2、否 |
| | | */ |
| | | private Integer userIsAuthorize; |
| | | |
| | | |
| | | /** |
| | | * 绑定上级用户时间 |
| | | */ |
| | | private Date bindingParentTime; |
| | | |
| | | |
| | | /** |
| | | * 是否是销售员(1=是,2=否) |
| | | */ |
| | | private Integer isSales; |
| | | |
| | | /** |
| | | * 用户类型 1、待审核 2、审核通过 0、审核未通过 |
| | | */ |
| | | private Integer fenxiaoState; |
| | | |
| | | private String sessionKey; |
| | | |
| | | |
| | | /** |
| | | * 会员等级id |
| | | */ |
| | |
| | | * 页面上的入会时间 |
| | | */ |
| | | private String inDateVo; |
| | | |
| | | |
| | | /** |
| | | * 页面上的生日 |
| | | */ |
| | |
| | | /** |
| | | * 美疗师集合 |
| | | */ |
| | | @Expose(serialize = false) |
| | | private List<MyBeatician> beauticains; |
| | | |
| | | |
| | | /** |
| | | * 会员问卷信息-答案,传递数据使用 |
| | | */ |
| | | @Expose(serialize = false) |
| | | List<VipAnswer> vipAnswers; |
| | | |
| | | /** |
| | | * 会员标签 |
| | | */ |
| | | @Expose(serialize = false) |
| | | List<SysVipLabel> labels; |
| | | |
| | | public List<SysVipLabel> getLabels() { |
| | | return labels; |
| | | } |
| | | |
| | | public void setLabels(List<SysVipLabel> labels) { |
| | | this.labels = labels; |
| | | } |
| | | |
| | | public String getAge() { |
| | | return age; |
| | | } |
| | | |
| | | public void setAge(String age) { |
| | | this.age = age; |
| | | } |
| | | |
| | | public Long getCompanyId() { |
| | | return companyId; |
| | | } |
| | | |
| | | public void setCompanyId(Long companyId) { |
| | | this.companyId = companyId; |
| | | } |
| | | |
| | | public String getOpenId() { |
| | | return openId; |
| | | } |
| | | |
| | | public void setOpenId(String openId) { |
| | | this.openId = openId; |
| | | } |
| | | |
| | | public String getPayTotal() { |
| | | return payTotal; |
| | | } |
| | | |
| | | public void setPayTotal(String payTotal) { |
| | | this.payTotal = payTotal; |
| | | } |
| | | |
| | | public Integer getCostTotal() { |
| | | return costTotal; |
| | | } |
| | | |
| | | public void setCostTotal(Integer costTotal) { |
| | | this.costTotal = costTotal; |
| | | } |
| | | |
| | | public String getCostNum() { |
| | | return costNum; |
| | | } |
| | | |
| | | public void setCostNum(String costNum) { |
| | | this.costNum = costNum; |
| | | } |
| | | |
| | | public String getTimeStart() { |
| | | return timeStart; |
| | | } |
| | | |
| | | public void setTimeStart(String timeStart) { |
| | | this.timeStart = timeStart; |
| | | } |
| | | |
| | | public String getTimeEnd() { |
| | | return timeEnd; |
| | | } |
| | | |
| | | public void setTimeEnd(String timeEnd) { |
| | | this.timeEnd = timeEnd; |
| | | } |
| | | |
| | | public Integer getVipNum() { |
| | | return vipNum; |
| | | } |
| | | |
| | | public void setVipNum(Integer vipNum) { |
| | | this.vipNum = vipNum; |
| | | } |
| | | |
| | | |
| | | public String getPhoto() { |
| | | return photo; |
| | | } |
| | | |
| | | public void setPhoto(String photo) { |
| | | this.photo = photo; |
| | | } |
| | | |
| | | public String getYear() { |
| | | return year; |
| | | } |
| | | |
| | | public void setYear(String year) { |
| | | this.year = year; |
| | | } |
| | | |
| | | public boolean isQdSign() { |
| | | return qdSign; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 会员所有的充值卡 |
| | | */ |
| | | @Expose(serialize = false,deserialize = false) |
| | | private List<MoneyCardUse> cards; |
| | | |
| | | |
| | | |
| | | |
| | | public List<MoneyCardUse> getCards() { |
| | | return cards; |
| | | } |
| | | |
| | | public void setCards(List<MoneyCardUse> cards) { |
| | | this.cards = cards; |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | * 没签到false |
| | | */ |
| | | private boolean qdSign; |
| | | |
| | | private String name; |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public boolean getQdSign() { |
| | | return qdSign; |
| | | } |
| | | |
| | | public void setQdSign(boolean qdSign) { |
| | | this.qdSign = qdSign; |
| | | } |
| | | |
| | | public String getUuid() { |
| | | return uuid; |
| | | } |
| | | |
| | | public void setUuid(String uuid) { |
| | | this.uuid = uuid; |
| | | } |
| | | |
| | | public String getDisease() { |
| | | return disease; |
| | | } |
| | | |
| | | public void setDisease(String disease) { |
| | | this.disease = disease; |
| | | } |
| | | |
| | | public Date getStartTime() { |
| | | return startTime; |
| | | } |
| | | |
| | | public Integer getRankType() { |
| | | return rankType; |
| | | } |
| | | |
| | | public void setRankType(Integer rankType) { |
| | | this.rankType = rankType; |
| | | } |
| | | |
| | | public void setStartTime(Date startTime) { |
| | | this.startTime = startTime; |
| | | } |
| | | |
| | | public Date getEndTime() { |
| | | return endTime; |
| | | } |
| | | |
| | | |
| | | |
| | | public void setEndTime(Date endTime) { |
| | | this.endTime = endTime; |
| | | } |
| | | |
| | | public Integer getRanking() { |
| | | return ranking; |
| | | } |
| | | |
| | | public void setRanking(Integer ranking) { |
| | | this.ranking = ranking; |
| | | } |
| | | |
| | | public String getEmail() { |
| | | return email; |
| | | } |
| | | |
| | | public void setEmail(String email) { |
| | | this.email = email; |
| | | } |
| | | |
| | | public String getShopName() { |
| | | return shopName; |
| | | } |
| | | |
| | | public String getInDateVo() { |
| | | return inDateVo; |
| | | } |
| | | |
| | | public void setInDateVo(String inDateVo) { |
| | | this.inDateVo = inDateVo; |
| | | } |
| | | |
| | | public String getBirthday1Vo() { |
| | | return birthday1Vo; |
| | | } |
| | | |
| | | public void setBirthday1Vo(String birthday1Vo) { |
| | | this.birthday1Vo = birthday1Vo; |
| | | } |
| | | |
| | | public void setShopName(String shopName) { |
| | | this.shopName = shopName; |
| | | } |
| | | |
| | | public Long getShopId() { |
| | | return shopId; |
| | | } |
| | | |
| | | public void setShopId(Long shopId) { |
| | | this.shopId = shopId; |
| | | } |
| | | public Long getStaffId() { |
| | | return staffId; |
| | | } |
| | | |
| | | public void setStaffId(Long staffId) { |
| | | this.staffId = staffId; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | public String getStaffName() { |
| | | return staffName; |
| | | } |
| | | |
| | | public void setStaffName(String staffName) { |
| | | this.staffName = staffName; |
| | | } |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getVipNo() { |
| | | return vipNo; |
| | | } |
| | | |
| | | public void setVipNo(String vipNo) { |
| | | this.vipNo = vipNo; |
| | | } |
| | | |
| | | public String getVipName() { |
| | | return vipName; |
| | | } |
| | | |
| | | public void setVipName(String vipName) { |
| | | this.vipName = vipName; |
| | | } |
| | | |
| | | |
| | | public String getZjm() { |
| | | return zjm; |
| | | } |
| | | |
| | | public void setZjm(String zjm) { |
| | | this.zjm = zjm; |
| | | } |
| | | |
| | | public String getPhone() { |
| | | return phone; |
| | | } |
| | | |
| | | public void setPhone(String phone) { |
| | | this.phone = phone; |
| | | } |
| | | |
| | | |
| | | public String getSex() { |
| | | return sex; |
| | | } |
| | | |
| | | public void setSex(String sex) { |
| | | this.sex = sex; |
| | | } |
| | | |
| | | public Date getBirthday1() { |
| | | return birthday1; |
| | | } |
| | | |
| | | public void setBirthday1(Date birthday1) { |
| | | this.birthday1 = birthday1; |
| | | } |
| | | |
| | | public String getAddr() { |
| | | return addr; |
| | | } |
| | | |
| | | public void setAddr(String addr) { |
| | | this.addr = addr; |
| | | } |
| | | |
| | | public String getConstell() { |
| | | return constell; |
| | | } |
| | | |
| | | public void setConstell(String constell) { |
| | | this.constell = constell; |
| | | } |
| | | |
| | | public String getAnimalSign() { |
| | | return animalSign; |
| | | } |
| | | |
| | | public void setAnimalSign(String animalSign) { |
| | | this.animalSign = animalSign; |
| | | } |
| | | |
| | | public String getArrivalWay() { |
| | | return arrivalWay; |
| | | } |
| | | |
| | | public void setArrivalWay(String arrivalWay) { |
| | | this.arrivalWay = arrivalWay; |
| | | } |
| | | |
| | | public String getVipType() { |
| | | return vipType; |
| | | } |
| | | |
| | | public void setVipType(String vipType) { |
| | | this.vipType = vipType; |
| | | } |
| | | |
| | | public String getVipState() { |
| | | return vipState; |
| | | } |
| | | |
| | | public void setVipState(String vipState) { |
| | | this.vipState = vipState; |
| | | } |
| | | |
| | | public String getIsDelete() { |
| | | return isDelete; |
| | | } |
| | | |
| | | public void setIsDelete(String isDelete) { |
| | | this.isDelete = isDelete; |
| | | } |
| | | |
| | | public Integer getPointAll() { |
| | | return pointAll; |
| | | } |
| | | |
| | | public void setPointAll(Integer pointAll) { |
| | | this.pointAll = pointAll; |
| | | } |
| | | |
| | | public Double getCommissionAll() { |
| | | return commissionAll; |
| | | } |
| | | |
| | | public void setCommissionAll(Double commissionAll) { |
| | | this.commissionAll = commissionAll; |
| | | } |
| | | |
| | | public Date getInDate() { |
| | | return inDate; |
| | | } |
| | | |
| | | public void setInDate(Date inDate) { |
| | | this.inDate = inDate; |
| | | } |
| | | |
| | | public String getRemark() { |
| | | return remark; |
| | | } |
| | | |
| | | public void setRemark(String remark) { |
| | | this.remark = remark; |
| | | } |
| | | |
| | | public String getPassWord() { |
| | | return passWord; |
| | | } |
| | | |
| | | public void setPassWord(String passWord) { |
| | | this.passWord = passWord; |
| | | } |
| | | |
| | | |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public Long getLevelId() { |
| | | return levelId; |
| | | } |
| | | |
| | | public void setLevelId(Long levelId) { |
| | | this.levelId = levelId; |
| | | } |
| | | |
| | | public SysVipLevel getVipLevel() { |
| | | return vipLevel; |
| | | } |
| | | |
| | | public void setVipLevel(SysVipLevel vipLevel) { |
| | | this.vipLevel = vipLevel; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | public String getStatu() { |
| | | return statu; |
| | | } |
| | | |
| | | public void setStatu(String statu) { |
| | | this.statu = statu; |
| | | } |
| | | |
| | | public Double getBalance() { |
| | | return balance; |
| | | } |
| | | |
| | | public void setBalance(Double balance) { |
| | | this.balance = balance; |
| | | } |
| | | |
| | | |
| | | |
| | | public MoneyCardUse getLevelCard() { |
| | | return levelCard; |
| | | } |
| | | |
| | | public void setLevelCard(MoneyCardUse levelCard) { |
| | | this.levelCard = levelCard; |
| | | } |
| | | |
| | | public String getBeatuyId() { |
| | | return beatuyId; |
| | | } |
| | | |
| | | public void setBeatuyId(String beatuyId) { |
| | | this.beatuyId = beatuyId; |
| | | } |
| | | |
| | | public List<MyBeatician> getBeauticains() { |
| | | return beauticains; |
| | | } |
| | | |
| | | public void setBeauticains(List<MyBeatician> beauticains) { |
| | | this.beauticains = beauticains; |
| | | } |
| | | |
| | | public String getBlood() { |
| | | return blood; |
| | | } |
| | | |
| | | public void setBlood(String blood) { |
| | | this.blood = blood; |
| | | } |
| | | |
| | | public String getSfCard() { |
| | | return sfCard; |
| | | } |
| | | |
| | | public void setSfCard(String sfCard) { |
| | | this.sfCard = sfCard; |
| | | } |
| | | |
| | | public String getLink() { |
| | | return link; |
| | | } |
| | | |
| | | public void setLink(String link) { |
| | | this.link = link; |
| | | } |
| | | |
| | | public String getMarry() { |
| | | return marry; |
| | | } |
| | | |
| | | public void setMarry(String marry) { |
| | | this.marry = marry; |
| | | } |
| | | |
| | | public String getVocation() { |
| | | return vocation; |
| | | } |
| | | |
| | | public void setVocation(String vocation) { |
| | | this.vocation = vocation; |
| | | } |
| | | |
| | | public List<VipAnswer> getVipAnswers() { |
| | | return vipAnswers; |
| | | } |
| | | |
| | | public void setVipAnswers(List<VipAnswer> vipAnswers) { |
| | | this.vipAnswers = vipAnswers; |
| | | } |
| | | |
| | | |
| | | public Integer getBirthdayType() { |
| | | return birthdayType; |
| | | } |
| | | |
| | | public void setBirthdayType(Integer birthdayType) { |
| | | this.birthdayType = birthdayType; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "SysVipInfo [id=" + id + ", vipNo=" + vipNo + ", vipName=" |
| | | + vipName + ", phone=" + phone + ", vipType=" + vipType |
| | | + ", shopName=" + shopName + ", vipState=" + vipState |
| | | + ", passWord=" + passWord + ", beatuyId=" + beatuyId |
| | | + ", sex=" + sex + ", birthday1=" + birthday1 + ", addr=" |
| | | + addr + ", constell=" + constell + ", animalSign=" |
| | | + animalSign + ", arrivalWay=" + arrivalWay + ", photo=" |
| | | + photo + ", pointAll=" + pointAll + ", commissionAll=" |
| | | + commissionAll + ", inDate=" + inDate + ", createTime=" |
| | | + createTime + ", remark=" + remark + ", staffId=" + staffId |
| | | + ", shopId=" + shopId + ", isDelete=" + isDelete + ", email=" |
| | | + email + ", blood=" + blood + ", sfCard=" + sfCard + ", link=" |
| | | + link + ", marry=" + marry + ", vocation=" + vocation |
| | | + ", levelId=" + levelId + ", uuid=" + uuid + ", balance=" |
| | | + balance + ", levelCard=" + levelCard + ", vipLevel=" |
| | | + vipLevel + ", staffName=" + staffName + ", inDateVo=" |
| | | + inDateVo + ", birthday1Vo=" + birthday1Vo + ", ranking=" |
| | | + ranking + ", startTime=" + startTime + ", endTime=" + endTime |
| | | + ", rankType=" + rankType + ", year=" + year + ", vipNum=" |
| | | + vipNum + ", timeStart=" + timeStart + ", timeEnd=" + timeEnd |
| | | + ", payTotal=" + payTotal + ", costTotal=" + costTotal |
| | | + ", costNum=" + costNum + ", openId=" + openId + ", statu=" |
| | | + statu + ", beauticains=" + beauticains + ", vipAnswers=" |
| | | + vipAnswers + ", cards=" + cards + ", qdSign=" + qdSign + "]"; |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | package com.matrix.system.hive.dao; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.matrix.core.pojo.PaginationVO; |
| | | import com.matrix.system.app.vo.OrderDetailAchieveItemVo; |
| | | import com.matrix.system.app.vo.RankingVo; |
| | | import com.matrix.system.app.vo.UserAchieveVo; |
| | | import com.matrix.system.hive.bean.AchieveNew; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | |
| | | List<AchieveNew> selectOrderItemAchieveByOrderId(Long orderId); |
| | | |
| | | List<RankingVo> selectStaffSaleAchieveRanking(@Param("record") AchieveNew achieveNew); |
| | | |
| | | int deleteByOrderId(@Param("orderId") Long orderId); |
| | | } |
| | |
| | | package com.matrix.system.hive.dao; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.matrix.core.pojo.PaginationVO; |
| | | import com.matrix.system.hive.bean.MoneyCardUseFlow; |
| | | import com.matrix.system.shopXcx.api.dto.MoneyCardUseFlowDto; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | public List<MoneyCardUseFlow> selectInPage(@Param("record") MoneyCardUseFlow moneyCardUseFlow, @Param("pageVo") PaginationVO pageVo); |
| | | |
| | | public List<MoneyCardUseFlow> selectForWxInPage(@Param("record")MoneyCardUseFlowDto moneyCardUseFlowDto); |
| | | |
| | | public List<MoneyCardUseFlow> selectByModel(@Param("record") MoneyCardUseFlow moneyCardUseFlow); |
| | | |
| | | public int selectTotalRecord(@Param("record") MoneyCardUseFlow moneyCardUseFlow); |
New file |
| | |
| | | package com.matrix.system.hive.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.matrix.system.hive.bean.MoneyCardUse; |
| | | |
| | | /** |
| | | * @description 订单表 |
| | | */ |
| | | public interface MoneyCardUseV2Dao extends BaseMapper<MoneyCardUse> { |
| | | |
| | | |
| | | } |
| | |
| | | List<ShoppingGoodsListVo> selectShoppingGoodsApiInPage(@Param("record") ShoppingGoodsListDto shoppingGoodsListDto, @Param("pageVo") PaginationVO pageVo); |
| | | |
| | | int selectShopppingGoodsAipTotal(@Param("record") ShoppingGoodsListDto shoppingGoodsListDto); |
| | | |
| | | public List<ShoppingGoods> selectByIds(@Param("ids")List<Integer> ids); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | int updateNoticeTimes(@Param("list")List<Long> noticedIds); |
| | | |
| | | List<SysProjServices> selectProjServicesByOrderItemId(@Param("itemId") Long itemId); |
| | | } |
| | |
| | | List<SysProjUseFlow> selectProjUseFlow(@Param("record") SysProjUseFlow projUseFlow, @Param("pageVo")PaginationVO pageVo); |
| | | |
| | | Integer selectProjUseFlowTotal(@Param("record") SysProjUseFlow projUseFlow); |
| | | |
| | | List<SysProjUse> selectTaoCanListWithProj(@Param("record") SysProjUse sysProjUse); |
| | | } |
| | |
| | | public int selectSecondTotalRecord(@Param("record") SysVipInfo sysVipInfo); |
| | | |
| | | |
| | | public SysVipInfo selectByPhone(String phone); |
| | | public SysVipInfo selectByPhone(@Param("phone") String phone,@Param("companyId") Long companyId); |
| | | |
| | | |
| | | |
| | |
| | | List<VipInfoListVo> selectVipAddressBookByList(@Param("record") VipInfoListDto vipInfoListDto); |
| | | |
| | | com.matrix.system.app.vo.VipInfoVo selectVipInfoById(@Param("id") Long id); |
| | | |
| | | public SysVipInfo findByOpenId(String openId); |
| | | |
| | | int unbundlingSaleMan(Long userId); |
| | | } |
New file |
| | |
| | | package com.matrix.system.hive.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotEmpty; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | @ApiModel(value = "ScoreChangeDto", description = "积分修改参数接收类") |
| | | public class ScoreChangeDto { |
| | | |
| | | @NotNull |
| | | @ApiModelProperty(value = "会员id", example = "1") |
| | | private Long vipId; |
| | | |
| | | @NotNull(message = "调整数量不能为空") |
| | | @ApiModelProperty(value = "调整数量", example = "1") |
| | | private Integer amount; |
| | | |
| | | @NotEmpty(message = "调整说明不能为空") |
| | | @ApiModelProperty(value = "调整说明", example = "线下兑换") |
| | | private String remarks; |
| | | |
| | | } |
| | |
| | | */ |
| | | public String getOrderCode(); |
| | | |
| | | String get32LenNumberCode(); |
| | | |
| | | public String getFlowCode(); |
| | | /** |
| | | * 生成一个加上typeName前缀的编号 |
| | | * typeName+时间戳+四位随机数 |
| | | * @param typeName |
| | | * @return |
| | | */ |
| | | public String getCodeByTyle(String typeName); |
| | | |
| | | /** |
| | | * 根据一定的规则返回一个随机编号。 |
| | |
| | | */ |
| | | public int modifyCancelProjServices(SysProjServices projServices); |
| | | |
| | | /** |
| | | * 删除服务单中明细, 即项目/套餐 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public int deleteProjServiceItemById(Long id); |
| | | |
| | | |
| | | /** |
| | | * 划扣 |
| | |
| | | |
| | | |
| | | public List<SysProjUse> selectTaocanProjUse(Long id, String status); |
| | | |
| | | public List<SysProjUse> findTaocaoProjUseWithProj(SysProjUse sysProjUse); |
| | | } |
| | |
| | | int apiModifyVip(ModifyVipDto modifyVipDto); |
| | | |
| | | VipInfoDetailVo findVipInfoDetail(Long id); |
| | | |
| | | |
| | | /** |
| | | * 设置为推广员 |
| | | * @param invitationId |
| | | */ |
| | | public int setToBeAnSalesman(Long userId,Long invitationId,long gradeId); |
| | | |
| | | SysVipInfo findByOpenId(String openId); |
| | | } |
| | |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.app.vo.UserAchieveVo; |
| | | import com.matrix.system.common.bean.BusParameterSettings; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.common.dao.SysUsersDao; |
| | | import com.matrix.system.constance.Dictionary; |
| | | import com.matrix.system.hive.bean.*; |
| | |
| | | achieveNew.setProjPercentage(Double.parseDouble(beauticianState.getExtract())); |
| | | } |
| | | if (isFirst && beauticianState.getEndTime() != null && beauticianState.getBeginTime() != null) { |
| | | long timeSpace = beauticianState.getEndTime().getTime() - beauticianState.getBeginTime().getTime(); |
| | | if (timeSpace > 0) { |
| | | achieveNew.setProjTime((int) (timeSpace / 1000 / 60)); |
| | | } else { |
| | | achieveNew.setProjTime(1); |
| | | } |
| | | // long timeSpace = beauticianState.getEndTime().getTime() - beauticianState.getBeginTime().getTime(); |
| | | // if (timeSpace > 0) { |
| | | // achieveNew.setProjTime((int) (timeSpace / 1000 / 60)); |
| | | // } else { |
| | | // achieveNew.setProjTime(1); |
| | | // } |
| | | achieveNew.setProjTime(beauticianState.getExcTime()); |
| | | isFirst = false; |
| | | } |
| | | achieveNewList.add(achieveNew); |
| | |
| | | if (CollectionUtils.isNotEmpty(pageOrder.getItems())) { |
| | | for (SysOrderItem orderItem : pageOrder.getItems()) { |
| | | |
| | | if (orderItem != null && CollectionUtils.isNotEmpty(orderItem.getAchaeveList())) { |
| | | if (orderItem != null && CollectionUtils.isNotEmpty(orderItem.getAchieveList())) { |
| | | |
| | | for (AchieveNew achieveNew : orderItem.getAchaeveList()) { |
| | | if (achieveNew !=null && achieveNew.getT1()!=null) { |
| | | for (AchieveNew achieveNew : orderItem.getAchieveList()) { |
| | | if (achieveNew !=null && achieveNew.getGoodsCash()!=null) { |
| | | buildAchieve(pageOrder, orderItem, achieveNew); |
| | | // 新增美疗师业绩 |
| | | achieveNewList.add(achieveNew); |
| | |
| | | |
| | | @Autowired |
| | | ShoppingGoodsDao shoppingGoodsDao; |
| | | @Autowired |
| | | BusParameterSettingsDao busParameterSettingsDao; |
| | | |
| | | private void buildAchieve(SysOrder pageOrder, SysOrderItem orderItem, AchieveNew achieveNew) { |
| | | BusParameterSettings shopManageJjcpasConsume =null; |
| | | if (Dictionary.ORDER_STATU_TK.equals(pageOrder.getStatu())) { |
| | | achieveNew.setId(null); |
| | | achieveNew.setProjPercentage(0 - achieveNew.getProjPercentage()); |
| | | achieveNew.setT1((0 - Double.parseDouble(achieveNew.getT1())) + ""); |
| | | achieveNew.setGoodsCash(0 - achieveNew.getGoodsCash()); |
| | | } |
| | | |
| | | achieveNew.setVipId(pageOrder.getVipId()); |
| | |
| | | } else { |
| | | achieveNew.setDatatime(new Date()); |
| | | } |
| | | if(Dictionary.SHOPPING_GOODS_TYPE_JJCP.equals(orderItem.getShoppingGoods().getGoodType())){ |
| | | if(shopManageJjcpasConsume==null){ |
| | | shopManageJjcpasConsume = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.SHOP_MANAGE_JJCPAS_CONSUME, pageOrder.getCompanyId()); |
| | | } |
| | | if(AppConstance.IS_Y.equals(shopManageJjcpasConsume.getParamValue())){ |
| | | achieveNew.setHisConsume(achieveNew.getGoodsCash()); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | achieveNew.setOrderType(Dictionary.ORDER_TYPE_SEAL); |
| | | achieveNew.setOrderId(pageOrder.getId()); |
| | | achieveNew.setOrderItemId(orderItem.getId()); |
| | |
| | | achieveNew.setShoppingGoodsId(orderItem.getGoodsId()); |
| | | // 是否赠送 |
| | | achieveNew.setT2(orderItem.getIsFree()); |
| | | // 根据商品类型设置业绩类型 |
| | | |
| | | if (Dictionary.ACHIEVE_TYPE_CASH.equals(achieveNew.getT3())){ |
| | | achieveNew.setCardCash(Double.parseDouble(achieveNew.getT1())); |
| | | } else { |
| | | // 设置划扣金额 |
| | | achieveNew.setConsume(Double.parseDouble(achieveNew.getT1())); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | |
| | | // 本日 |
| | | case 1 : |
| | | break; |
| | | // 昨日 |
| | | // 昨日 |
| | | case 2: |
| | | startTime = DateUtil.previousNDate(startTime, 1); |
| | | endTime = startTime; |
| | | break; |
| | | // 本月 |
| | | // 本月 |
| | | case 3: |
| | | calendar.set(Calendar.DAY_OF_MONTH, 1); |
| | | startTime = calendar.getTime(); |
| | | break; |
| | | // 上月 |
| | | // 上月 |
| | | case 4: |
| | | calendar.add(Calendar.MONTH, -1); |
| | | calendar.set(Calendar.DAY_OF_MONTH, 1); |
| | |
| | | import java.text.DateFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.Random; |
| | | |
| | | |
| | | |
| | | /** |
| | | * |
| | | * |
| | |
| | | } |
| | | |
| | | @Override |
| | | public String get32LenNumberCode(){ |
| | | DateFormat fmt = new SimpleDateFormat("yyyyMMddHHmmss"); |
| | | Date date=new Date(); |
| | | |
| | | String str = "0123456789"; |
| | | Random random = new Random(); |
| | | StringBuilder sb = new StringBuilder(); |
| | | for (int i = 0; i < 18; i++) { |
| | | int number = random.nextInt(str.length()); |
| | | sb.append(str.charAt(number)); |
| | | } |
| | | return fmt.format(date)+sb.toString(); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public String getFlowCode() { |
| | | return "F" + getNowTimeString(); |
| | | } |
| | | |
| | | @Override |
| | | public String getCodeByTyle(String typeName) { |
| | | return typeName+getNowTimeString()+ StringUtils.getRandomString(4); |
| | | } |
| | | } |
| | |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.pojo.PaginationVO; |
| | | import com.matrix.core.tools.DateUtil; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.app.dto.OrderListDto; |
| | |
| | | import com.matrix.system.app.vo.OrderDetailItemVo; |
| | | import com.matrix.system.app.vo.OrderDetailVo; |
| | | import com.matrix.system.app.vo.RankingVo; |
| | | import com.matrix.system.common.bean.BusParameterSettings; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.common.dao.SysUsersDao; |
| | | import com.matrix.system.constance.Dictionary; |
| | |
| | | import com.matrix.system.hive.pojo.ShoppingCarItem; |
| | | import com.matrix.system.hive.pojo.ShoppingCarItemsVo; |
| | | import com.matrix.system.hive.service.*; |
| | | import com.matrix.system.score.constant.ScoreSettingConstant; |
| | | import com.matrix.system.score.entity.ScoreVipDetail; |
| | | import com.matrix.system.score.service.ScoreVipDetailService; |
| | | import com.matrix.system.shopXcx.mqTask.MQTaskRouting; |
| | | import com.matrix.system.wechart.templateMsg.UniformMsgParam; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | |
| | | import javax.servlet.http.HttpSession; |
| | | import javax.validation.constraints.NotEmpty; |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | @Autowired |
| | | MoneyCardUseFlowDao moneyCardUseFlowDao; |
| | | |
| | | @Autowired |
| | | ScoreVipDetailService scoreVipDetailService; |
| | | |
| | | @Autowired |
| | | BusParameterSettingsDao busParameterSettingsDao; |
| | | @Autowired |
| | | SysVipLevelDao sysVipLevelDao; |
| | | |
| | |
| | | @Autowired |
| | | private SysInstoreInfoService sysInstoreInfoService; |
| | | |
| | | @Autowired |
| | | BusParameterSettingsDao parameterSettingsDao; |
| | | |
| | | @Value("${evn}") |
| | | private String evn; |
| | |
| | | |
| | | @Override |
| | | public SysOrder checkAndSaveOrder(SysOrder sysOrder) { |
| | | // 收款改变订单状态 |
| | | SysOrder source = null; |
| | | if (sysOrder.getId() != null) { |
| | | source = sysOrderDao.selectById(sysOrder.getId()); |
| | | } |
| | | |
| | | // 计算订单折扣金额,收款情况下 计算订单总额 |
| | | double zkTotal = 0.0; |
| | |
| | | SysUsers user = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); |
| | | sysOrder.setZkTotal(zkTotal); |
| | | sysOrder.setStatu(orderStatus); |
| | | SysOrder source = null; |
| | | if (sysOrder.getId() != null) { |
| | | source = sysOrderDao.selectById(sysOrder.getId()); |
| | | } |
| | | sysOrder.setStaffId(source != null ? source.getStaffId() : user.getSuId()); |
| | | sysOrder.setCompanyId(source != null ? source.getCompanyId() : user.getCompanyId()); |
| | | |
| | |
| | | |
| | | /** |
| | | * 取消订单 |
| | | * 本方法无法退回多次不同卡项收款的订单 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | throw new GlobleException("订单已取消"); |
| | | } |
| | | |
| | | List<SysOrderItem> sysOrderItems = orderItemDao.selectByOrderId(id); |
| | | List<SysOrderFlow> flows = sysOrderFlowDao.selectByOrderId(id); |
| | | // 非现金收款退回扣卡余额 |
| | | for (SysOrderFlow flow : flows) { |
| | | if (SysOrderFlow.PAY_METHOD_CARD.equals(flow.getPayMethod())) { |
| | | |
| | | for (SysOrderItem orderItem : sysOrderItems) { |
| | | |
| | | //非现金收款退回扣卡余额 |
| | | if (StringUtils.isNotBlank(orderItem.getPayMethodDetail())) { |
| | | |
| | | MoneyCardUse moneyCardUse = moneyCardUseDao.selectById(Long.parseLong(orderItem.getPayMethodDetail())); |
| | | MoneyCardUse moneyCardUse = moneyCardUseDao.selectById(flow.getCardId()); |
| | | MoneyCardUseFlow moneyCardUseFlow = new MoneyCardUseFlow(); |
| | | |
| | | if (moneyCardUse != null) { |
| | | |
| | | // 根据订单明细判断是赠送金额购买还是本金购买 |
| | | |
| | | moneyCardUseFlow.setTotal(orderItem.getCardPay()); |
| | | moneyCardUse.setRealMoney(MoneyUtil.add(moneyCardUse.getRealMoney(), orderItem.getCardPay())); |
| | | //TODO 目前无法退回到具体的赠送金额还是本金 |
| | | moneyCardUseFlow.setTotal(flow.getAmount().doubleValue()); |
| | | if (SysOrderFlow.IS_GIFT_Y.equals(flow.getIsGift())) { |
| | | moneyCardUse.setGiftMoney(MoneyUtil.add(moneyCardUse.getGiftMoney(), flow.getAmount().doubleValue())); |
| | | } else { |
| | | moneyCardUse.setRealMoney(MoneyUtil.add(moneyCardUse.getRealMoney(), flow.getAmount().doubleValue())); |
| | | } |
| | | |
| | | if (!moneyCardUse.getIsVipCar().equals(Dictionary.FLAG_YES_Y)) { |
| | | if (moneyCardUse.getLastCount() != null) { |
| | |
| | | moneyCardUseFlowDao.insert(moneyCardUseFlow); |
| | | } |
| | | } |
| | | } |
| | | |
| | | List<SysOrderItem> sysOrderItems = orderItemDao.selectByOrderId(id); |
| | | for (SysOrderItem orderItem : sysOrderItems) { |
| | | // 充值卡类型退款 |
| | | if (Dictionary.SHOPPING_GOODS_TYPE_CZK.equals(orderItem.getType())) { |
| | | |
| | | ShoppingGoods shoppingGoods = shoppingGoodsDao.selectById(orderItem.getGoodsId()); |
| | | |
| | | |
| | | //删除购买的充值卡 |
| | | moneyCardUseDao.deleteByOrderItemId(orderItem.getId()); |
| | | |
| | | } else if (Dictionary.SHOPPING_GOODS_TYPE_XM.equals(orderItem.getType()) |
| | | || Dictionary.SHOPPING_GOODS_TYPE_TC.equals(orderItem.getType())) { |
| | | // 项目套餐退款 |
| | | // 删除套餐项目使用情况 |
| | | sysProjUseDao.deleteByOrderItemId(orderItem.getId()); |
| | | |
| | | |
| | | } else if (Dictionary.SHOPPING_GOODS_TYPE_ZHK.equals(orderItem.getType())) { |
| | | // 综合卡 |
| | | // 删除套餐项目使用情况 |
| | | sysProjUseDao.deleteByOrderItemId(orderItem.getId()); |
| | | // 删除充值卡 |
| | | moneyCardUseDao.deleteByOrderItemId(orderItem.getId()); |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | // 删除收款记录 |
| | | sysOrderFlowDao.deleteByOrderId(id); |
| | | |
| | | //删除积分 |
| | | scoreVipDetailService.removeByBusinessId(order.getVipId(), order.getId()); |
| | | |
| | | // 取消订单 |
| | | order.setStatu(Dictionary.ORDER_STATU_YQX); |
| | | |
| | | |
| | | return sysOrderDao.update(order); |
| | | } |
| | | |
| | |
| | | if (!Dictionary.ORDER_STATU_DFK.equals(pageOrder.getStatu())) { |
| | | throw new GlobleException("该订单已经收过款,请刷新页面再试!"); |
| | | } |
| | | // 更新收款时间 |
| | | pageOrder.setPayTime(new Date()); |
| | | pageOrder.setStatu(Dictionary.ORDER_STATU_YFK); |
| | | sysOrderDao.update(pageOrder); |
| | | |
| | | // 获取用户信息 |
| | | SysVipInfo vipInfo = sysVipInfoDao.selectById(pageOrder.getVipId()); |
| | |
| | | sysVipInfoDao.update(vipInfo); |
| | | } |
| | | |
| | | //设置订单的成交状态 |
| | | changeOrderStatu(pageOrder); |
| | | //添加支付流水 |
| | | addOrderFlow(pageOrder); |
| | | |
| | | // 设置会员充值卡使用情况 |
| | | addMoneyCardUse(pageOrder); |
| | |
| | | |
| | | setShopSelCount(pageOrder); |
| | | |
| | | //设置会员积分 |
| | | addVipScore(pageOrder); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 收款改变订单状态,划扣金额 |
| | | * 设置会员消费积分 |
| | | * @param pageOrder |
| | | */ |
| | | private void addVipScore(SysOrder pageOrder) { |
| | | |
| | | SysVipInfo vipInfo=sysVipInfoDao.selectById(pageOrder.getVipId()); |
| | | |
| | | List<SysOrderFlow> flows = pageOrder.getFlows(); |
| | | int [] cashScore={0,0,0}; |
| | | //现金支付金额 |
| | | BigDecimal cashPayAmount=flows.stream() |
| | | .filter(item->(!item.getPayMethod().equals("储值卡"))&&(!item.getPayMethod().equals("欠款"))) |
| | | .map(SysOrderFlow::getAmount).reduce(BigDecimal.ZERO,BigDecimal::add); |
| | | BusParameterSettings cashConsumption = busParameterSettingsDao.selectCompanyParamByCode(ScoreSettingConstant.CASH_CONSUMPTION, vipInfo.getCompanyId()); |
| | | if(cashPayAmount!=null |
| | | &&cashPayAmount.compareTo(BigDecimal.ZERO)>0 |
| | | &&StringUtils.isNotBlank(cashConsumption.getParamValue())){ |
| | | |
| | | BigDecimal scoreSetting0 = new BigDecimal(cashConsumption.getParamValue()); |
| | | cashScore[0]= cashPayAmount.divide(scoreSetting0).intValue(); |
| | | |
| | | if(StringUtils.isNotBlank(cashConsumption.getParamValue1())){ |
| | | BigDecimal scoreSetting1 = new BigDecimal(cashConsumption.getParamValue1()); |
| | | cashScore[1]= cashPayAmount.divide(scoreSetting1).intValue(); |
| | | } |
| | | |
| | | if(StringUtils.isNotBlank(cashConsumption.getParamValue2())){ |
| | | BigDecimal scoreSetting2 = new BigDecimal(cashConsumption.getParamValue2()); |
| | | cashScore[2]= cashPayAmount.divide(scoreSetting2).intValue(); |
| | | } |
| | | } |
| | | |
| | | int [] cardScore={0,0,0}; |
| | | //储值卡本金支付金额 |
| | | BigDecimal cardPayAmount=flows.stream() |
| | | .filter(item->item.getPayMethod().equals("储值卡")&&item.getIsGift().equals("N")) |
| | | .map(SysOrderFlow::getAmount).reduce(BigDecimal.ZERO,BigDecimal::add); |
| | | |
| | | BusParameterSettings principalBalanceConsumption = busParameterSettingsDao.selectCompanyParamByCode(ScoreSettingConstant.PRINCIPAL_BALANCE_CONSUMPTION, vipInfo.getCompanyId()); |
| | | if(cardPayAmount!=null |
| | | &&cardPayAmount.compareTo(BigDecimal.ZERO)>0 |
| | | &&StringUtils.isNotBlank(principalBalanceConsumption.getParamValue())){ |
| | | |
| | | BigDecimal scoreSetting0 = new BigDecimal(principalBalanceConsumption.getParamValue()); |
| | | cardScore[0]= cardPayAmount.divide(scoreSetting0).intValue(); |
| | | |
| | | if(StringUtils.isNotBlank(principalBalanceConsumption.getParamValue1())){ |
| | | BigDecimal scoreSetting1 = new BigDecimal(principalBalanceConsumption.getParamValue1()); |
| | | cardScore[1]= cardPayAmount.divide(scoreSetting1).intValue(); |
| | | } |
| | | |
| | | if(StringUtils.isNotBlank(principalBalanceConsumption.getParamValue2())){ |
| | | BigDecimal scoreSetting2 = new BigDecimal(principalBalanceConsumption.getParamValue2()); |
| | | cardScore[2]= cardPayAmount.divide(scoreSetting2).intValue(); |
| | | } |
| | | } |
| | | |
| | | int [] giftScore={0,0,0}; |
| | | //储值卡本赠送付金额 |
| | | BigDecimal giftPayAmount=flows.stream() |
| | | .filter(item->item.getPayMethod().equals("储值卡")&&item.getIsGift().equals("Y")) |
| | | .map(SysOrderFlow::getAmount).reduce(BigDecimal.ZERO,BigDecimal::add); |
| | | BusParameterSettings bonusBalanceConsumption = busParameterSettingsDao.selectCompanyParamByCode(ScoreSettingConstant.BONUS_BALANCE_CONSUMPTION, vipInfo.getCompanyId()); |
| | | if(giftPayAmount!=null |
| | | &&giftPayAmount.compareTo(BigDecimal.ZERO)>0 |
| | | &&StringUtils.isNotBlank(bonusBalanceConsumption.getParamValue())){ |
| | | |
| | | BigDecimal scoreSetting0 = new BigDecimal(bonusBalanceConsumption.getParamValue()); |
| | | giftScore[0]= giftPayAmount.divide(scoreSetting0).intValue(); |
| | | |
| | | if(StringUtils.isNotBlank(bonusBalanceConsumption.getParamValue1())){ |
| | | BigDecimal scoreSetting1 = new BigDecimal(bonusBalanceConsumption.getParamValue1()); |
| | | giftScore[1]= giftPayAmount.divide(scoreSetting1).intValue(); |
| | | } |
| | | |
| | | if(StringUtils.isNotBlank(bonusBalanceConsumption.getParamValue2())){ |
| | | BigDecimal scoreSetting2 = new BigDecimal(bonusBalanceConsumption.getParamValue2()); |
| | | giftScore[2]= giftPayAmount.divide(scoreSetting2).intValue(); |
| | | } |
| | | } |
| | | |
| | | int selfScore=cashScore[0]+cardScore[0]+giftScore[0]; |
| | | int parentScore=cashScore[1]+cardScore[1]+giftScore[1]; |
| | | int topParentScore=cashScore[2]+cardScore[2]+giftScore[2]; |
| | | |
| | | |
| | | //添加自己的积分 |
| | | if(selfScore>0){ |
| | | scoreVipDetailService.addScore( |
| | | vipInfo.getId(), |
| | | pageOrder.getStaffId(), |
| | | pageOrder.getShopId(), |
| | | selfScore, |
| | | pageOrder.getId(), |
| | | ScoreVipDetail.SCORE_VIP_TYPE_CASH, |
| | | "消费奖励" |
| | | ); |
| | | } |
| | | |
| | | if(vipInfo.getRecommendId()!=null){ |
| | | //推荐注册老带新积分奖励 |
| | | SysVipInfo referrerVip = sysVipInfoDao.selectById(vipInfo.getRecommendId()); |
| | | if(parentScore>0){ |
| | | scoreVipDetailService.addScore( |
| | | referrerVip.getId(), |
| | | pageOrder.getStaffId(), |
| | | pageOrder.getShopId(), |
| | | parentScore, |
| | | pageOrder.getId(), |
| | | ScoreVipDetail.SCORE_VIP_TYPE_CASH, |
| | | "推荐消费奖励" |
| | | ); |
| | | } |
| | | //推荐注册二级带新积分奖励 |
| | | if(referrerVip.getRecommendId()!=null){ |
| | | SysVipInfo topVipInfo = sysVipInfoDao.selectById(referrerVip.getRecommendId()); |
| | | if(topParentScore>0){ |
| | | scoreVipDetailService.addScore( |
| | | topVipInfo.getId(), |
| | | pageOrder.getStaffId(), |
| | | pageOrder.getShopId(), |
| | | topParentScore, |
| | | pageOrder.getId(), |
| | | ScoreVipDetail.SCORE_VIP_TYPE_CASH, |
| | | "推荐消费奖励" |
| | | ); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 创建支付流水 |
| | | * |
| | | * @author:姜友瑶 |
| | | */ |
| | | private void changeOrderStatu(SysOrder sourceOrder) { |
| | | private void addOrderFlow(SysOrder sourceOrder) { |
| | | |
| | | String orderStatus = Dictionary.ORDER_STATU_YFK; |
| | | String flowType = SysOrderFlow.FLOW_TYPE_BUY; |
| | | double cashPayTotal = 0D; |
| | | double cardPayTotal = 0D; |
| | | |
| | | //处理支付流水 |
| | | int flowCount = 1; |
| | | for (SysOrderFlow flow : sourceOrder.getFlows()) { |
| | | |
| | | //支付内容摘要设置 |
| | | Long goodsId = sourceOrder.getItems().get(0).getGoodsId(); |
| | | ShoppingGoods goods = shoppingGoodsDao.selectById(goodsId); |
| | | flow.setFlowContent(goods.getName() + "等" + sourceOrder.getItems().size() + "件产品"); |
| | | |
| | | // 若是退款,则取负数 |
| | | if (Dictionary.ORDER_STATU_TK.equals(sourceOrder.getStatu())) { |
| | | flowType = SysOrderFlow.FLOW_TYPE_REFUND; |
| | | if (SysOrder.ORDER_TYPE_REFUND== sourceOrder.getOrderType()) { |
| | | flow.setFlowType(SysOrderFlow.FLOW_TYPE_REFUND); |
| | | flow.setAmount(flow.getAmount().negate()); |
| | | flow.setOrderId(sourceOrder.getOldOrderId()); |
| | | } else { |
| | | flow.setFlowType(SysOrderFlow.FLOW_TYPE_BUY); |
| | | flow.setOrderId(sourceOrder.getId()); |
| | | } |
| | | |
| | | //欠款处理 |
| | | if (SysOrderFlow.PAY_METHOD_ARREARS.equals(flow.getPayMethod())) { |
| | | orderStatus = Dictionary.ORDER_STATU_QK; |
| | | sourceOrder.setStatu(Dictionary.ORDER_STATU_QK); |
| | | sourceOrder.setArrears(flow.getAmount().doubleValue()); |
| | | sysOrderDao.update(sourceOrder); |
| | | } |
| | | |
| | | //统计储值卡支付 |
| | | if (SysOrderFlow.PAY_METHOD_CARD.equals(flow.getPayMethod())) { |
| | | if (flow.getCardId() != null) { |
| | | MoneyCardUse moneyCardUse = moneyCardUseDao.selectById(flow.getCardId()); |
| | | cardPayTotal += flow.getAmount().doubleValue(); |
| | | |
| | | //修改储值卡余额 |
| | | cardPaySk(moneyCardUse, sourceOrder, flow); |
| | | }else{ |
| | | throw new GlobleException("无效的储值卡支付方式"); |
| | | } |
| | | } |
| | | //统计现金支付 |
| | | if (!SysOrderFlow.PAY_METHOD_ARREARS.equals(flow.getPayMethod()) |
| | | && !SysOrderFlow.PAY_METHOD_CARD.equals(flow.getPayMethod())) { |
| | | cashPayTotal += flow.getAmount().doubleValue(); |
| | | } |
| | | |
| | | flow.setFlowNo(codeService.getFlowCode() + "-" + flowCount); |
| | | flow.setVipId(sourceOrder.getVipId()); |
| | | flow.setFlowType(flowType); |
| | | flow.setShopId(sourceOrder.getShopId()); |
| | | flow.setCompanyId(sourceOrder.getCompanyId()); |
| | | sysOrderFlowDao.insert(flow); |
| | | flowCount++; |
| | | } |
| | | |
| | | //修改订单信息 |
| | | if (Dictionary.ORDER_STATU_TK.equals(sourceOrder.getStatu())) { |
| | | orderStatus = Dictionary.ORDER_STATU_TK; |
| | | } |
| | | // 更新收款状态 |
| | | sourceOrder.setPayTime(new Date()); |
| | | sourceOrder.setStatu(orderStatus); |
| | | sourceOrder.setCardPay(cardPayTotal); |
| | | sourceOrder.setCashPay(cashPayTotal); |
| | | sysOrderDao.update(sourceOrder); |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | @Autowired |
| | | BusParameterSettingsDao parameterSettingsDao; |
| | | |
| | | /** |
| | | * @param order 新增出库单并更新本店库存 |
| | |
| | | @Override |
| | | public void addOutStore(SysOrder order) { |
| | | |
| | | List<SysOutStoreItem> storeItemList = new ArrayList<>(); |
| | | BusParameterSettings manageStockSetting = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WAREHOUSE_MANAGE_STOCK, order.getCompanyId()); |
| | | if(AppConstance.IS_Y.equals(manageStockSetting.getParamValue())){ |
| | | |
| | | for (SysOrderItem sysOrderItem : order.getItems()) { |
| | | List<SysOutStoreItem> storeItemList = new ArrayList<>(); |
| | | |
| | | if (ShoppingGoods.SHOPPING_GOODS_TYPE_JJCP.equals(sysOrderItem.getType())) { |
| | | for (SysOrderItem sysOrderItem : order.getItems()) { |
| | | |
| | | SysOutStoreItem storeItem = new SysOutStoreItem(); |
| | | storeItem.setSkuId(sysOrderItem.getGoodsId()); |
| | | storeItem.setAmount(Double.valueOf(sysOrderItem.getCount())); |
| | | storeItemList.add(storeItem); |
| | | if (ShoppingGoods.SHOPPING_GOODS_TYPE_JJCP.equals(sysOrderItem.getType())) { |
| | | |
| | | } else if (ShoppingGoods.SHOPPING_GOODS_TYPE_TC.equals(sysOrderItem.getType()) |
| | | SysOutStoreItem storeItem = new SysOutStoreItem(); |
| | | storeItem.setSkuId(sysOrderItem.getGoodsId()); |
| | | storeItem.setAmount(Double.valueOf(sysOrderItem.getCount())); |
| | | storeItemList.add(storeItem); |
| | | |
| | | || ShoppingGoods.SHOPPING_GOODS_TYPE_ZHK.equals(sysOrderItem.getType())) { |
| | | } else if (ShoppingGoods.SHOPPING_GOODS_TYPE_TC.equals(sysOrderItem.getType()) |
| | | |
| | | List<ShoppingGoodsAssemble> goodsList = new ArrayList<>(); |
| | | || ShoppingGoods.SHOPPING_GOODS_TYPE_ZHK.equals(sysOrderItem.getType())) { |
| | | |
| | | goodsList.addAll(shoppingGoodsAssembleDao.selectGoodsByShoppingGoodsIdAndType(sysOrderItem.getGoodsId(), ShoppingGoods.SHOPPING_GOODS_TYPE_JJCP)); |
| | | List<ShoppingGoodsAssemble> goodsList = new ArrayList<>(); |
| | | |
| | | if (ShoppingGoods.SHOPPING_GOODS_TYPE_ZHK.equals(sysOrderItem.getType())) { |
| | | //综合卡处理,中的套餐,中的家居产品 |
| | | List<ShoppingGoodsAssemble> zhkAssemble = shoppingGoodsAssembleDao.selectGoodsByShoppingGoodsIdAndType(sysOrderItem.getGoodsId(), ShoppingGoods.SHOPPING_GOODS_TYPE_TC); |
| | | zhkAssemble.forEach(item -> { |
| | | goodsList.addAll(shoppingGoodsAssembleDao.selectGoodsByShoppingGoodsIdAndType(item.getAssembleGoodId(), ShoppingGoods.SHOPPING_GOODS_TYPE_JJCP)); |
| | | goodsList.addAll(shoppingGoodsAssembleDao.selectGoodsByShoppingGoodsIdAndType(sysOrderItem.getGoodsId(), ShoppingGoods.SHOPPING_GOODS_TYPE_JJCP)); |
| | | |
| | | if (ShoppingGoods.SHOPPING_GOODS_TYPE_ZHK.equals(sysOrderItem.getType())) { |
| | | //综合卡处理,中的套餐,中的家居产品 |
| | | List<ShoppingGoodsAssemble> zhkAssemble = shoppingGoodsAssembleDao.selectGoodsByShoppingGoodsIdAndType(sysOrderItem.getGoodsId(), ShoppingGoods.SHOPPING_GOODS_TYPE_TC); |
| | | zhkAssemble.forEach(item -> { |
| | | goodsList.addAll(shoppingGoodsAssembleDao.selectGoodsByShoppingGoodsIdAndType(item.getAssembleGoodId(), ShoppingGoods.SHOPPING_GOODS_TYPE_JJCP)); |
| | | }); |
| | | } |
| | | |
| | | goodsList.forEach(item -> { |
| | | SysOutStoreItem storeItem = new SysOutStoreItem(); |
| | | storeItem.setSkuId(item.getAssembleGoodId()); |
| | | storeItem.setAmount(Double.valueOf(item.getTotal())); |
| | | storeItemList.add(storeItem); |
| | | }); |
| | | } |
| | | |
| | | goodsList.forEach(item -> { |
| | | SysOutStoreItem storeItem = new SysOutStoreItem(); |
| | | storeItem.setSkuId(item.getAssembleGoodId()); |
| | | storeItem.setAmount(Double.valueOf(item.getTotal())); |
| | | storeItemList.add(storeItem); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | if (CollectionUtils.isNotEmpty(storeItemList)) { |
| | | Long warehouseId = warehouseDao.findShopWarehouse(order.getShopId()).get(0).getId(); |
| | | SysOutStore outStore = new SysOutStore(); |
| | | outStore.setOutStoreNo(codeService.getOutStoreCode()); |
| | | outStore.setOrderId(order.getId()); |
| | | outStore.setShopId(order.getShopId()); |
| | | outStore.setShopId(order.getShopId()); |
| | | outStore.setStaffId(order.getStaffId()); |
| | | outStore.setType(Dictionary.OUT_STORE_JJCPCK); |
| | | outStore.setServiceNo(order.getOrderNo()); |
| | | outStore.setTime(new Date()); |
| | | outStore.setCheckStatus(Dictionary.CHECK_STATUS_DSH); |
| | | outStore.setCompanyId(order.getCompanyId()); |
| | | sysOutStoreDao.insert(outStore); |
| | | if (CollectionUtils.isNotEmpty(storeItemList)) { |
| | | Long warehouseId = warehouseDao.findShopWarehouse(order.getShopId()).get(0).getId(); |
| | | SysOutStore outStore = new SysOutStore(); |
| | | outStore.setOutStoreNo(codeService.getOutStoreCode()); |
| | | outStore.setOrderId(order.getId()); |
| | | outStore.setShopId(order.getShopId()); |
| | | outStore.setShopId(order.getShopId()); |
| | | outStore.setStaffId(order.getStaffId()); |
| | | outStore.setType(Dictionary.OUT_STORE_JJCPCK); |
| | | outStore.setServiceNo(order.getOrderNo()); |
| | | outStore.setTime(new Date()); |
| | | outStore.setCheckStatus(Dictionary.CHECK_STATUS_DSH); |
| | | outStore.setCompanyId(order.getCompanyId()); |
| | | sysOutStoreDao.insert(outStore); |
| | | |
| | | //出库明细,根据批次维度定义 |
| | | List<SysOutStoreItem> realOutStoreItemList = new ArrayList<>(); |
| | | //出库明细,根据批次维度定义 |
| | | List<SysOutStoreItem> realOutStoreItemList = new ArrayList<>(); |
| | | |
| | | storeItemList.forEach(outStoreItem -> { |
| | | storeItemList.forEach(outStoreItem -> { |
| | | |
| | | //设置出库主键 |
| | | outStoreItem.setOutStoreId(outStore.getId()); |
| | | //设置出库主键 |
| | | outStoreItem.setOutStoreId(outStore.getId()); |
| | | |
| | | //计算库存总数是否满足本次扣减的需求 |
| | | List<SysStoreInfo> stores = storeInfoDao.selectStoInfoBySku(outStoreItem.getSkuId(), warehouseId); |
| | | double sum = stores.stream().mapToDouble(item -> item.getStoreTotal()).sum(); |
| | | if (sum < outStoreItem.getAmount()) { |
| | | ShoppingGoods sysGoods = shoppingGoodsDao.selectById(outStoreItem.getSkuId()); |
| | | if (sysGoods != null) { |
| | | throw new GlobleException("出库失败:【" + sysGoods.getName() + "库存不足】"); |
| | | //计算库存总数是否满足本次扣减的需求 |
| | | List<SysStoreInfo> stores = storeInfoDao.selectStoInfoBySku(outStoreItem.getSkuId(), warehouseId); |
| | | double sum = stores.stream().mapToDouble(item -> item.getStoreTotal()).sum(); |
| | | if (sum < outStoreItem.getAmount()) { |
| | | ShoppingGoods sysGoods = shoppingGoodsDao.selectById(outStoreItem.getSkuId()); |
| | | if (sysGoods != null) { |
| | | throw new GlobleException("出库失败:【" + sysGoods.getName() + "库存不足】"); |
| | | |
| | | } else { |
| | | throw new GlobleException("出库失败没有找到出库产品"); |
| | | } else { |
| | | throw new GlobleException("出库失败没有找到出库产品"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | //循环获取所有批次产品,并扣减库存 |
| | | Double number = outStoreItem.getAmount(); |
| | | for (SysStoreInfo storeInfo : stores) { |
| | | Double oldStoreTotal = storeInfo.getStoreTotal(); |
| | | Double surplus = storeInfo.getStoreTotal() - number; |
| | | //更新库存 |
| | | storeInfo.setStoreTotal(surplus < 0 ? 0 : surplus); |
| | | //循环获取所有批次产品,并扣减库存 |
| | | Double number = outStoreItem.getAmount(); |
| | | for (SysStoreInfo storeInfo : stores) { |
| | | Double oldStoreTotal = storeInfo.getStoreTotal(); |
| | | Double surplus = storeInfo.getStoreTotal() - number; |
| | | //更新库存 |
| | | storeInfo.setStoreTotal(surplus < 0 ? 0 : surplus); |
| | | |
| | | //每次扣减库存都创建一个出库记录 |
| | | SysOutStoreItem sysOutStoreItem = new SysOutStoreItem(); |
| | | BeanUtils.copyProperties(outStoreItem, sysOutStoreItem); |
| | | sysOutStoreItem.setStoreId(storeInfo.getId()); |
| | | sysOutStoreItem.setAmount(oldStoreTotal - storeInfo.getStoreTotal()); |
| | | realOutStoreItemList.add(sysOutStoreItem); |
| | | //每次扣减库存都创建一个出库记录 |
| | | SysOutStoreItem sysOutStoreItem = new SysOutStoreItem(); |
| | | BeanUtils.copyProperties(outStoreItem, sysOutStoreItem); |
| | | sysOutStoreItem.setStoreId(storeInfo.getId()); |
| | | sysOutStoreItem.setAmount(oldStoreTotal - storeInfo.getStoreTotal()); |
| | | realOutStoreItemList.add(sysOutStoreItem); |
| | | |
| | | storeInfoDao.update(storeInfo); |
| | | //扣除后剩余库存大于0则跳出扣除,否则剩余数量的负数的绝对值就是再次扣减的数量 |
| | | if (surplus > 0) { |
| | | break; |
| | | } else { |
| | | number = Math.abs(surplus); |
| | | storeInfoDao.update(storeInfo); |
| | | //扣除后剩余库存大于0则跳出扣除,否则剩余数量的负数的绝对值就是再次扣减的数量 |
| | | if (surplus > 0) { |
| | | break; |
| | | } else { |
| | | number = Math.abs(surplus); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | sysOutStoreItemDao.batchInsert(realOutStoreItemList); |
| | | }); |
| | | sysOutStoreItemDao.batchInsert(realOutStoreItemList); |
| | | } |
| | | |
| | | }else{ |
| | | LogUtil.debug("不管理库存"); |
| | | } |
| | | |
| | | |
| | |
| | | order.setRemark(cardUser.getCardName()); |
| | | order.setStaffId(user.getSuId()); |
| | | order.setIsCross(2 + ""); |
| | | order.setOrderType(SysOrder.ORDER_TYPE_SEAL); |
| | | order.setStatu(Dictionary.ORDER_STATU_YFK); |
| | | order.setCompanyId(user.getCompanyId()); |
| | | sysOrderDao.insert(order); |
| | |
| | | orderItem.setIsFree(Dictionary.FLAG_NO); |
| | | orderItem.setPrice(czVo.getBjmoney()); |
| | | orderItem.setStatus(Dictionary.ORDER_STATU_YFK); |
| | | orderItem.setAchaeveList(czVo.getAchaeveList()); |
| | | orderItem.setAchieveList(czVo.getAchaeveList()); |
| | | orderItem.setShoppingGoods(shoppingGoods); |
| | | orderItemDao.insert(orderItem); |
| | | List<SysOrderItem> items = new ArrayList<>(); |
| | | items.add(orderItem); |
| | |
| | | moneyCardUseFlowDao.insert(moneyCardUseFlow); |
| | | |
| | | order.setFlows(czVo.getFlows()); |
| | | changeOrderStatu(order); |
| | | |
| | | addOrderFlow(order); |
| | | |
| | | // 添加员工业绩 |
| | | achieveNewService.addAchaeveByOrder(order); |
| | | |
| | | return order; |
| | | |
| | | } |
| | |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public void refundOrderMoney(SysOrder pageOrder) { |
| | | public void refundOrderMoney(SysOrder sysOrder) { |
| | | SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | |
| | | // 修改订单状态 |
| | | changeOrderStatu(pageOrder); |
| | | //原订单设置为退款状态 |
| | | SysOrder sourceOrder=new SysOrder(); |
| | | sourceOrder.setId(sysOrder.getOldOrderId()); |
| | | sourceOrder.setIsHasRefund(SysOrder.IS_HAS_REFUND_Y); |
| | | // sourceOrder.setStatu(Dictionary.ORDER_STATU_TK); |
| | | sysOrderDao.update(sourceOrder); |
| | | SysOrder oldOrder=sysOrderDao.selectById( sysOrder.getOldOrderId()); |
| | | |
| | | List<SysOrderItem> returnItems = new ArrayList<>(); |
| | | for (SysOrderItem item : pageOrder.getItems()) { |
| | | sysOrder.setId(null); |
| | | sysOrder.setStaffId(user.getSuId()); |
| | | sysOrder.setCompanyId(user.getCompanyId()); |
| | | sysOrder.setShopId(user.getShopId()); |
| | | sysOrder.setOrderType(SysOrder.ORDER_TYPE_REFUND); |
| | | sysOrder.setStatu(Dictionary.ORDER_STATU_YFK); |
| | | Date now = new Date(); |
| | | sysOrder.setOrderTime(now); |
| | | sysOrder.setPayTime(now); |
| | | sysOrder.setOrderNo(codeService.getRefundOrderNo()); |
| | | sysOrder.setZkTotal(-sysOrder.getZkTotal()); |
| | | //新增订单 |
| | | sysOrderDao.insert(sysOrder); |
| | | //插入明细 |
| | | for (SysOrderItem item : sysOrder.getItems()) { |
| | | |
| | | //更新原订单明细的可退数量 |
| | | SysOrderItem oldItem=new SysOrderItem(); |
| | | oldItem.setId(item.getId()); |
| | | oldItem.setRefundCount(item.getCount()); |
| | | orderItemDao.update(oldItem); |
| | | |
| | | //插入新的订单明细 |
| | | item.setId(null); |
| | | item.setCount(-item.getCount()); |
| | | item.setOrderId(sysOrder.getId()); |
| | | orderItemDao.insert(item); |
| | | } |
| | | |
| | | |
| | | // 添加订单收款流水 |
| | | addOrderFlow(sysOrder); |
| | | //退款退套餐退项目 |
| | | refundProjUse(sysOrder); |
| | | //删除积分 |
| | | scoreVipDetailService.removeByBusinessId(oldOrder.getVipId(), oldOrder.getId()); |
| | | |
| | | // 设置业绩 |
| | | achieveNewService.addAchaeveByOrder(sysOrder); |
| | | |
| | | } |
| | | |
| | | private void addRefundOrderFlow(SysOrder sourceOrder) { |
| | | //处理支付流水 |
| | | int flowCount = 1; |
| | | for (SysOrderFlow flow : sourceOrder.getFlows()) { |
| | | //支付内容摘要设置 |
| | | Long goodsId = sourceOrder.getItems().get(0).getGoodsId(); |
| | | ShoppingGoods goods = shoppingGoodsDao.selectById(goodsId); |
| | | flow.setFlowContent(goods.getName() + "等" + sourceOrder.getItems().size() + "件产品"); |
| | | // 退款,则取负数 |
| | | flow.setFlowType(SysOrderFlow.FLOW_TYPE_REFUND); |
| | | flow.setAmount(flow.getAmount().negate()); |
| | | flow.setOrderId(sourceOrder.getOldOrderId()); |
| | | |
| | | //统计储值卡支付 |
| | | if (SysOrderFlow.PAY_METHOD_CARD.equals(flow.getPayMethod())) { |
| | | if (flow.getCardId() != null) { |
| | | MoneyCardUse moneyCardUse = moneyCardUseDao.selectById(flow.getCardId()); |
| | | //修改储值卡余额 |
| | | cardPaySk(moneyCardUse, sourceOrder, flow); |
| | | }else{ |
| | | throw new GlobleException("无效的储值卡支付方式"); |
| | | } |
| | | } |
| | | |
| | | flow.setFlowNo(codeService.getFlowCode() + "-" + flowCount); |
| | | flow.setVipId(sourceOrder.getVipId()); |
| | | flow.setShopId(sourceOrder.getShopId()); |
| | | flow.setCompanyId(sourceOrder.getCompanyId()); |
| | | sysOrderFlowDao.insert(flow); |
| | | flowCount++; |
| | | } |
| | | } |
| | | |
| | | private void refundCard(MoneyCardUse moneyCardUse, SysOrder sourceOrder, SysOrderFlow flow) { |
| | | SysUsers user = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); |
| | | |
| | | MoneyCardUseFlow moneyCardUseFlow = new MoneyCardUseFlow(); |
| | | if (SysOrderFlow.IS_GIFT_Y.equals(flow.getIsGift())) { |
| | | if (moneyCardUse.getGiftMoney() >= flow.getAmount().doubleValue()) { |
| | | double surplus = MoneyUtil.sub(moneyCardUse.getGiftMoney(), flow.getAmount().doubleValue()); |
| | | moneyCardUse.setGiftMoney(surplus); |
| | | moneyCardUseFlow.setGiftMoney(0D - flow.getAmount().doubleValue()); |
| | | } else { |
| | | throw new GlobleException(moneyCardUse.getCardName() + "余额不足"); |
| | | } |
| | | } else { |
| | | if (moneyCardUse.getRealMoney() >= flow.getAmount().doubleValue()) { |
| | | double surplus = MoneyUtil.sub(moneyCardUse.getRealMoney(), flow.getAmount().doubleValue()); |
| | | moneyCardUse.setRealMoney(surplus); |
| | | moneyCardUseFlow.setTotal(0 - flow.getAmount().doubleValue()); |
| | | } else { |
| | | throw new GlobleException(moneyCardUse.getCardName() + "余额不足"); |
| | | } |
| | | } |
| | | |
| | | if (moneyCardUse.getIsVipCar().equals(Dictionary.FLAG_NO_N)) { |
| | | //余额为0时充值卡变为无效 |
| | | if (moneyCardUse.getRealMoney().equals(0D) && moneyCardUse.getGiftMoney().equals(0D)) { |
| | | moneyCardUse.setIsOver(Dictionary.FLAG_YES_Y); |
| | | moneyCardUse.setStatus(Dictionary.MONEYCARD_STATUS_WX); |
| | | } |
| | | } |
| | | |
| | | ShoppingGoods shoppingGoods = shoppingGoodsService.findById(moneyCardUse.getGoodsId()); |
| | | if (shoppingGoods != null) { |
| | | Date invalidTime = shoppingGoodsService.calInvalidTime(shoppingGoods, 2, moneyCardUse.getFailTime()); |
| | | moneyCardUse.setFailTime(invalidTime); |
| | | } |
| | | // 更新充值卡信息 |
| | | moneyCardUseDao.update(moneyCardUse); |
| | | //设置卡项使用流水 |
| | | moneyCardUseFlow.setCarUseId(moneyCardUse.getId()); |
| | | moneyCardUseFlow.setOrderNo(sourceOrder.getOrderNo()); |
| | | moneyCardUseFlow.setVipId(sourceOrder.getVipId()); |
| | | moneyCardUseFlow.setTimes(-1); |
| | | moneyCardUseFlow.setType(MoneyCardUseFlow.USE_TYPE_CONSUMER); |
| | | moneyCardUseFlow.setCreateTime(new Date()); |
| | | moneyCardUseFlow.setOperationId(user.getSuId()); |
| | | moneyCardUseFlow.setBalance(moneyCardUse.getGiftMoney() + moneyCardUse.getRealMoney()); |
| | | moneyCardUseFlowDao.insert(moneyCardUseFlow); |
| | | } |
| | | |
| | | /** |
| | | * 退款退项目,套餐,卡项 |
| | | * @param sysOrder |
| | | */ |
| | | private void refundProjUse(SysOrder sysOrder) { |
| | | SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | |
| | | //记录需要退库存的产品 |
| | | List<SysOrderItem> returnGoodsList = new ArrayList<>(); |
| | | |
| | | for (SysOrderItem item : sysOrder.getItems()) { |
| | | |
| | | SysProjUse queryProjUse = new SysProjUse(); |
| | | queryProjUse.setIsOver(Dictionary.FLAG_NO_N); |
| | | queryProjUse.setStatus(Dictionary.TAOCAN_STATUS_YX); |
| | | queryProjUse.setOrderItemId(item.getOldItemId()); |
| | | // 修改项目信息 |
| | | if (Dictionary.SHOPPING_GOODS_TYPE_XM.equals(item.getType()) || Dictionary.SHOPPING_GOODS_TYPE_JJCP.equals(item.getType())) { |
| | | |
| | | if (Dictionary.SHOPPING_GOODS_TYPE_JJCP.equals(item.getType())) { |
| | | if (Dictionary.FLAG_YES_Y.equals(item.getIsReturnStore())) { |
| | | returnItems.add(item); |
| | | returnGoodsList.add(item); |
| | | } |
| | | } else { |
| | | SysProjUse sysProjUse = sysProjUseDao.selectByModel(queryProjUse).get(0); |
| | | |
| | | int sub = sysProjUse.getSurplusCount() - item.getCount(); |
| | | sysProjUse.setSurplusCount(sub); |
| | | if (sub <= 0) { |
| | | if (sub < 0) { |
| | | throw new GlobleException("项目余次不足"); |
| | | }else if(sub==0){ |
| | | sysProjUse.setIsOver(Dictionary.FLAG_YES_Y); |
| | | sysProjUse.setStatus(Dictionary.TAOCAN_STATUS_WX); |
| | | } |
| | | sysProjUse.setSurplusCount(sub); |
| | | sysProjUseDao.update(sysProjUse); |
| | | |
| | | SysProjUseFlow sysProjUseFlow = SysProjUseMapper.INSTANCE.projUseToFlow(sysProjUse); |
| | | sysProjUseFlow.setOptionType("退款修改"); |
| | | sysProjUseFlow.setId(null); |
| | |
| | | if (Dictionary.SHOPPING_GOODS_TYPE_TC.equals(item.getType())) { |
| | | queryProjUse.setTaocanId(-1L); |
| | | List<SysProjUse> sysProjUses = sysProjUseDao.selectByModel(queryProjUse); |
| | | if (item.getCount() > sysProjUses.size()) { |
| | | throw new GlobleException("数据异常"); |
| | | } |
| | | |
| | | |
| | | for (int i = 0; i < item.getCount(); i++) { |
| | | |
| | | SysProjUse sysProjUse = sysProjUses.get(i); |
| | | sysProjUse.setIsOver(Dictionary.FLAG_YES_Y); |
| | | sysProjUse.setStatus(Dictionary.TAOCAN_STATUS_WX); |
| | | |
| | | sysProjUseDao.update(sysProjUse); |
| | | SysProjUseFlow sysProjUseFlow = SysProjUseMapper.INSTANCE.projUseToFlow(sysProjUse); |
| | | sysProjUseFlow.setOptionType("退款修改"); |
| | |
| | | shoppingGoodsDao.update(goods); |
| | | } |
| | | |
| | | // 家居产品退库存 |
| | | if (CollectionUtils.isNotEmpty(returnItems)) { |
| | | refundInstore(returnItems); |
| | | BusParameterSettings manageStockSetting = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WAREHOUSE_MANAGE_STOCK, sysOrder.getCompanyId()); |
| | | if(AppConstance.IS_Y.equals(manageStockSetting.getParamValue())){ |
| | | // 家居产品退库存 |
| | | if (CollectionUtils.isNotEmpty(returnGoodsList)) { |
| | | refundInstore(returnGoodsList); |
| | | } |
| | | } |
| | | |
| | | // 设置业绩 |
| | | achieveNewService.addAchaeveByOrder(pageOrder); |
| | | |
| | | } |
| | | |
| | |
| | | package com.matrix.system.hive.service.imp; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import com.matrix.component.rabbitmq.RabiitMqTemplate; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.exception.GlobleException; |
| | |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.app.dto.ServiceOrderListDto; |
| | | import com.matrix.system.app.vo.ServiceOrderListVo; |
| | | import com.matrix.system.common.bean.BusParameterSettings; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.common.dao.SysUsersDao; |
| | | import com.matrix.system.constance.Dictionary; |
| | | import com.matrix.system.hive.bean.*; |
| | | import com.matrix.system.hive.dao.*; |
| | | import com.matrix.system.hive.plugin.util.MoneyUtil; |
| | | import com.matrix.system.hive.service.*; |
| | | import com.matrix.system.score.constant.ScoreSettingConstant; |
| | | import com.matrix.system.score.entity.ScoreVipDetail; |
| | | import com.matrix.system.score.service.ScoreVipDetailService; |
| | | import com.matrix.system.shopXcx.mqTask.MQTaskRouting; |
| | | import com.matrix.system.wechart.templateMsg.UniformMsgParam; |
| | | import org.apache.commons.collections.CollectionUtils; |
| | |
| | | @Autowired |
| | | private RabiitMqTemplate rabiitMqTemplate; |
| | | |
| | | |
| | | @Autowired |
| | | BusParameterSettingsDao busParameterSettingsDao; |
| | | |
| | | @Autowired |
| | | ScoreVipDetailService scoreVipDetailService; |
| | | |
| | | @Autowired |
| | | SysVipInfoDao sysVipInfoDao; |
| | | |
| | | @Value("${evn}") |
| | | private String evn; |
| | | |
| | |
| | | public SysProjServices addSysProjServices(SysProjServices sysProjServices) throws GlobleException { |
| | | |
| | | //创建服务单 |
| | | if(WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY)!=null){ |
| | | if (WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY) != null) { |
| | | SysUsers user = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); |
| | | sysProjServices.setCreateStaffId(user.getSuId()); |
| | | sysProjServices.setShopId(user.getShopId()); |
| | |
| | | } |
| | | |
| | | |
| | | sysProjServices.setCreateTime(new Date()); |
| | | sysProjServices.setServiceNo(codeService.getServiceOrderCode()); |
| | | if (sysProjServices.getId() == null) { |
| | | sysProjServices.setCreateTime(new Date()); |
| | | sysProjServices.setServiceNo(codeService.getServiceOrderCode()); |
| | | int i = sysProjServicesDao.insert(sysProjServices); |
| | | } |
| | | |
| | | Double hkPrice = 0.0; |
| | | int i = sysProjServicesDao.insert(sysProjServices); |
| | | // 计算项目总时长 |
| | | int totalTime = 0; |
| | | //处理订单明细 |
| | |
| | | sysBeauticianState.setProjId(sysProjInfo.getId()); |
| | | sysBeauticianState.setServicesId(sysProjServices.getId()); |
| | | sysBeauticianState.setShopId(sysProjServices.getShopId()); |
| | | sysBeauticianState.setState(Dictionary.BEATUI_STATE_DYY); |
| | | sysBeauticianState.setState(sysProjServices.getState()); |
| | | beauticianStateDao.insert(sysBeauticianState); |
| | | } |
| | | // 设置项目总时长 |
| | |
| | | SysProjUse sysProjUse = projUseService.findById(sysBeauticianState.getPuseId()); |
| | | |
| | | ShoppingGoods shoppingGoods = shoppingGoodsDao.selectById(sysProjUse.getProjId()); |
| | | SysOrderItem orderItem = sysOrderItemService.findById(sysProjUse.getOrderItemId()); |
| | | SysOrderItem item = sysOrderItemService.findById(sysProjUse.getOrderItemId()); |
| | | SysOrder orderItem = sysOrderService.findById(item.getOrderId()); |
| | | if ("购买".equals(sysProjUse.getSource())) { |
| | | // 如果用户有欠款,服务单总价不能超过已付金额 |
| | | if (orderItem!=null && orderItem.getArrears() > 0) { |
| | |
| | | double money = MoneyUtil.sub((bj - orderItem.getArrears()), (yxfje + bcxfje)); |
| | | // 如果 已付金额 - (已消费金额+本次消费金额)<0 则不能再消费 |
| | | if (money < 0) { |
| | | return new VerifyResult(true, shoppingGoods.getName() + "存在欠款" + orderItem.getArrears() + "元 , 订单编号[ " + sysOrderService.findById(orderItem.getOrderId()).getOrderNo() + " ] "); |
| | | return new VerifyResult(true, shoppingGoods.getName() + "存在欠款" + orderItem.getArrears() + "元 , 订单编号[ " + orderItem.getOrderNo() + " ] "); |
| | | } |
| | | |
| | | |
| | |
| | | /** 验证数据是否正确 */ |
| | | SysProjServices checkProjServices = sysProjServicesDao.selectById(projServices.getId()); |
| | | // 验证服务单是否存在或者取消 |
| | | if (!checkProjServices.getState().equals(Dictionary.SERVICE_STATU_DYY) |
| | | && !checkProjServices.getState().equals(Dictionary.SERVICE_STATU_YYCG)) { |
| | | if (checkProjServices.getState().equals(Dictionary.SERVICE_STATU_YYQX) |
| | | || checkProjServices.getState().equals(Dictionary.SERVICE_STATU_FFJS)) { |
| | | throw new GlobleException("该服务单已被取消或者不存在!"); |
| | | } |
| | | // 验证是否选择床位 |
| | |
| | | } |
| | | |
| | | // 判断是否是编辑,还是新增,编辑则需要先释放资源 |
| | | if (checkProjServices.getState().equals(Dictionary.SERVICE_STATU_YYCG)) { |
| | | if (!checkProjServices.getState().equals(Dictionary.SERVICE_STATU_DYY)) { |
| | | // 释放床位资源 |
| | | bedStateDao.deleteByServiceId(checkProjServices.getId()); |
| | | } |
| | |
| | | if (beauticianStateDao.checkBeauticianClash(beauticianState) > 0) { |
| | | throw new GlobleException("该美疗师已被占用,请重新分配!"); |
| | | } |
| | | // beauticianState.setExcTime(beauticianState.getProjInfo().getTimeLength()); |
| | | beauticianState.setState(Dictionary.BEATUI_STATE_YYY); |
| | | beauticianStateDao.update(beauticianState); |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | // 设置成功状态 |
| | | projServices.setState(Dictionary.SERVICE_STATU_XPL); |
| | | if (Dictionary.SERVICE_STATU_DYY.equals(projServices.getState())) { |
| | | // 设置成功状态 |
| | | projServices.setState(Dictionary.SERVICE_STATU_XPL); |
| | | } |
| | | // 判断当前门店是否有历史美疗师 |
| | | LastestWorkBeatuistaff lastWorkStaff = new LastestWorkBeatuistaff(); |
| | | lastWorkStaff.setShopId(checkProjServices.getShopId()); |
| | |
| | | sysOutStoreDao.deleteById(sysOutStore.getId()); |
| | | sysOutStoreItemDao.deleteByOrderId(sysOutStore.getId()); |
| | | } |
| | | //删除积分 |
| | | scoreVipDetailService.removeByBusinessId(checkProjServices.getVipId(), checkProjServices.getId()); |
| | | |
| | | //更新服务单状态 |
| | | return sysProjServicesDao.update(checkProjServices); |
| | | } |
| | |
| | | private void backProjCount(SysProjServices projServices) { |
| | | List<SysBeauticianState> beauticianStateList = beauticianStateDao.selectBySerIds(projServices.getId()); |
| | | |
| | | Map<Long ,List<SysProjUse>> taocanMap = new HashMap<>(); |
| | | backProjCountItems(beauticianStateList, 1); |
| | | } |
| | | |
| | | private void backProjCountItems(List<SysBeauticianState> beauticianStateList, int type) { |
| | | Map<Long, List<SysProjUse>> taocanMap = new HashMap<>(); |
| | | // 回退项目余额 |
| | | for (SysBeauticianState beauticianState : beauticianStateList) { |
| | | // 该修改为 有效日期判断更新所有 |
| | | beauticianState.setState(Dictionary.BEATUI_STATE_YYQX); |
| | | beauticianStateDao.update(beauticianState); |
| | | if (type == 1) { |
| | | // 该修改为 有效日期判断更新所有 |
| | | beauticianState.setState(Dictionary.BEATUI_STATE_YYQX); |
| | | beauticianStateDao.update(beauticianState); |
| | | } else { |
| | | beauticianStateDao.deleteById(beauticianState.getId()); |
| | | } |
| | | |
| | | SysProjUse sysProjUse = sysProjUseDao.selectById(beauticianState.getPuseId()); |
| | | if (sysProjUse != null && sysProjUse.getId() != null) { |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public int deleteProjServiceItemById(Long id) { |
| | | SysBeauticianState sysBeauticianState = beauticianStateDao.selectById(id); |
| | | List<SysBeauticianState> list = new ArrayList<>(); |
| | | list.add(sysBeauticianState); |
| | | |
| | | backProjCountItems(list, 2); |
| | | return 1; |
| | | } |
| | | |
| | | // 划扣 jyy |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | |
| | | if (!projServices.getState().equals(Dictionary.SERVICE_STATU_FWWC)) { |
| | | throw new GlobleException("该服务单状态为" + projServices.getState() + ",不可以进行当前操作!"); |
| | | } else { |
| | | SysUsers users = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | if (skipServiceOrderStep(Dictionary.SERVICE_OVER_BEGIN_END)) { |
| | | SysBeauticianState checkBeauticianState = new SysBeauticianState(); |
| | | checkBeauticianState.setServicesId(projServices.getId()); |
| | | checkBeauticianState.setState(Dictionary.BEATUI_STATE_FWJS); |
| | | beauticianStateDao.chengItemState(checkBeauticianState); |
| | | |
| | | // 释放床位资源 |
| | | SysBedState checkBedState = sysBedStateDao.selectBySerIdAndBedId(projServices.getId(), projServices.getBedId()); |
| | | if (checkBedState != null) { |
| | | checkBedState.setBedState(Dictionary.BED_STATE_SYJS); |
| | | bedStateDao.update(checkBedState); |
| | | } |
| | | projServices.setEndTime(new Date()); |
| | | // 计算时差 |
| | | long minspace = DateUtil.getDifTimeMin(projServices.getStartTime(), projServices.getEndTime()) - projServices.getTotalTime(); |
| | | // 判断是服务超时还是服务提前结束,如果minspace大于0则是超时服务,小于0则是提前结束服务 |
| | | projServices.setIsOverTime(minspace + ""); |
| | | projServices.setState(Dictionary.SERVICE_STATU_FWWC); |
| | | sysProjServicesDao.update(projServices); |
| | | } |
| | | |
| | | projServices.setState(Dictionary.SERVICE_STATU_FFJS); |
| | | projServices.setConsumeTime(new Date()); |
| | | int result=sysProjServicesDao.update(projServices); |
| | | int result = sysProjServicesDao.update(projServices); |
| | | achieveNewService.addAchieveByServiceOrder(projServices); |
| | | |
| | | //设置会员积分 |
| | | addVipScore(projServices); |
| | | |
| | | //发送微信公众号提醒 |
| | | UniformMsgParam uniformMsgParam=new UniformMsgParam(projServices.getCompanyId(),UniformMsgParam.GZH_FWWC); |
| | | uniformMsgParam.put("serviceId",projServices.getId()); |
| | | rabiitMqTemplate.sendMsg(MQTaskRouting.SEND_UNIFORM_TEMPLATE_MSG+evn,uniformMsgParam.toJSONString()); |
| | | UniformMsgParam uniformMsgParam = new UniformMsgParam(projServices.getCompanyId(), UniformMsgParam.GZH_FWWC); |
| | | uniformMsgParam.put("serviceId", projServices.getId()); |
| | | rabiitMqTemplate.sendMsg(MQTaskRouting.SEND_UNIFORM_TEMPLATE_MSG + evn, uniformMsgParam.toJSONString()); |
| | | |
| | | |
| | | |
| | | |
| | | return result; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 设置会员消费积分 |
| | | */ |
| | | private void addVipScore(SysProjServices projServices) { |
| | | |
| | | SysVipInfo vipInfo =sysVipInfoDao.selectById(projServices.getVipId()); |
| | | |
| | | List<SysBeauticianState> sysBeauticianStates = beauticianStateDao.selectBySerIds(projServices.getId()); |
| | | |
| | | |
| | | double principalPrice = 0D; |
| | | double giftPrice = 0D; |
| | | for (SysBeauticianState sysBeauticianState : sysBeauticianStates) { |
| | | SysProjUse projUse = sysBeauticianState.getProjUse(); |
| | | if (projUse.getSource().equals(Dictionary.TAOCAN_SOURCE_ZS)) { |
| | | giftPrice += projUse.getPrice(); |
| | | } else { |
| | | principalPrice += projUse.getPrice(); |
| | | } |
| | | } |
| | | |
| | | int[] principalConsumScore = {0, 0, 0}; |
| | | BusParameterSettings principalConsumption = busParameterSettingsDao.selectCompanyParamByCode(ScoreSettingConstant.PRINCIPAL_CONSUMPTION, vipInfo.getCompanyId()); |
| | | //本金消耗 |
| | | if (principalPrice > 0 |
| | | && StringUtils.isNotBlank(principalConsumption.getParamValue())) { |
| | | |
| | | principalConsumScore[0] = (int) (principalPrice / Double.parseDouble(principalConsumption.getParamValue())); |
| | | |
| | | if (StringUtils.isNotBlank(principalConsumption.getParamValue1())) { |
| | | principalConsumScore[1] = (int) (principalPrice / Double.parseDouble(principalConsumption.getParamValue1())); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(principalConsumption.getParamValue2())) { |
| | | principalConsumScore[2] = (int) (principalPrice / Double.parseDouble(principalConsumption.getParamValue2())); |
| | | } |
| | | } |
| | | |
| | | int[] giveConsumScore = {0, 0, 0}; |
| | | BusParameterSettings giveConsumption = busParameterSettingsDao.selectCompanyParamByCode(ScoreSettingConstant.GIVE_CONSUMPTION, vipInfo.getCompanyId()); |
| | | //本金消耗 |
| | | if (giftPrice > 0 |
| | | && StringUtils.isNotBlank(giveConsumption.getParamValue())) { |
| | | |
| | | giveConsumScore[0] = (int) (giftPrice / Double.parseDouble(giveConsumption.getParamValue())); |
| | | |
| | | if (StringUtils.isNotBlank(giveConsumption.getParamValue1())) { |
| | | giveConsumScore[1] = (int) (giftPrice / Double.parseDouble(giveConsumption.getParamValue1())); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(giveConsumption.getParamValue2())) { |
| | | giveConsumScore[2] = (int) (giftPrice / Double.parseDouble(giveConsumption.getParamValue2())); |
| | | } |
| | | } |
| | | |
| | | int selfScore =principalConsumScore[0]+giveConsumScore[0]; |
| | | int parentScore =principalConsumScore[1]+giveConsumScore[1]; |
| | | int topParentScore =principalConsumScore[2]+giveConsumScore[2]; |
| | | |
| | | //添加自己的积分 |
| | | if (selfScore > 0) { |
| | | scoreVipDetailService.addScore( |
| | | vipInfo.getId(), |
| | | projServices.getCreateStaffId(), |
| | | projServices.getShopId(), |
| | | selfScore, |
| | | projServices.getId(), |
| | | ScoreVipDetail.SCORE_VIP_TYPE_CASH, |
| | | "消耗奖励" |
| | | ); |
| | | } |
| | | |
| | | if (vipInfo.getRecommendId() != null) { |
| | | //推荐注册老带新积分奖励 |
| | | SysVipInfo referrerVip = sysVipInfoDao.selectById(vipInfo.getRecommendId()); |
| | | if (parentScore > 0) { |
| | | scoreVipDetailService.addScore( |
| | | referrerVip.getId(), |
| | | projServices.getCreateStaffId(), |
| | | projServices.getShopId(), |
| | | parentScore, |
| | | projServices.getId(), |
| | | ScoreVipDetail.SCORE_VIP_TYPE_CASH, |
| | | "推荐消耗奖励" |
| | | ); |
| | | } |
| | | //推荐注册二级带新积分奖励 |
| | | if (referrerVip.getRecommendId() != null) { |
| | | SysVipInfo topVipInfo = sysVipInfoDao.selectById(referrerVip.getRecommendId()); |
| | | if (topParentScore > 0) { |
| | | scoreVipDetailService.addScore( |
| | | topVipInfo.getId(), |
| | | projServices.getCreateStaffId(), |
| | | projServices.getShopId(), |
| | | topParentScore, |
| | | projServices.getId(), |
| | | ScoreVipDetail.SCORE_VIP_TYPE_CASH, |
| | | "推荐消耗奖励" |
| | | ); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | // 派单 jyy |
| | |
| | | if (!projServices.getState().equals(Dictionary.SERVICE_STATU_XPL)) { |
| | | throw new GlobleException("该服务单状态为" + projServices.getState() + ",不可以进行当前操作!"); |
| | | } |
| | | projServicesVo.setCompanyId(projServices.getCompanyId()); |
| | | if (isNeedOutStore(projServicesVo)) { |
| | | |
| | | // 生成出库单 |
| | |
| | | |
| | | outStore.setOutStoreNo(codeService.getOutStoreCode()); |
| | | outStore.setShopId(projServices.getShopId()); |
| | | if(projServices.getDevisionId()!=null){ |
| | | if (projServices.getDevisionId() != null) { |
| | | outStore.setStaffId(projServices.getDevisionId()); |
| | | }else{ |
| | | } else { |
| | | |
| | | outStore.setStaffId(sysUsers.getSuId()); |
| | | } |
| | |
| | | double sum = stores.stream().mapToDouble(item2 -> item2.getStoreTotal()).sum(); |
| | | Double needAmount = MoneyUtil.div(item.getAmount(), Double.valueOf(shoppingGoods.getVolume())); |
| | | if (sum < needAmount) { |
| | | throw new GlobleException("出库失败:【" + shoppingGoods.getName()+"-"+shoppingGoods.getCode()+ "库存不足】"); |
| | | throw new GlobleException("出库失败:【" + shoppingGoods.getName() + "-" + shoppingGoods.getCode() + "库存不足】"); |
| | | } |
| | | //循环获取所有批次产品,并扣减库存 |
| | | for (SysStoreInfo storeInfo : stores) { |
| | |
| | | sysOutStoreItemDao.batchInsert(realOutStoreItemList); |
| | | } |
| | | // 设置服务单状态 |
| | | projServices.setState(Dictionary.SERVICE_STATU_PLWC); |
| | | if(projServices.getDevisionId()==null){ |
| | | // projServices.setState(Dictionary.SERVICE_STATU_PLWC); |
| | | |
| | | if (projServices.getDevisionId() == null) { |
| | | //如果没有设置配料师则默认为操作配料的人为配料师 |
| | | projServices.setDevisionId(sysUsers.getSuId()); |
| | | |
| | | } |
| | | |
| | | // 判断是否跳过开始/结束服务 |
| | | if (skipServiceOrderStep(Dictionary.SERVICE_OVER_BEGIN_END)) { |
| | | projServices.setStartTime(new Date()); |
| | | projServices.setState(Dictionary.SERVICE_STATU_FWWC); |
| | | } |
| | | // 释放床位资源 |
| | | // SysBedState checkBedState = sysBedStateDao.selectBySerIdAndBedId(projServices.getBedId(), projServices.getId()); |
| | | // if (checkBedState != null) { |
| | | // checkBedState.setBedState(Dictionary.BED_STATE_SYJS); |
| | | // bedStateDao.update(checkBedState); |
| | | // } |
| | | // projServices.setStartTime(new Date()); |
| | | // projServices.setEndTime(new Date()); |
| | | // // 计算时差 |
| | | // long minspace = DateUtil.getDifTimeMin(projServices.getStartTime(), projServices.getEndTime()) |
| | | // - projServices.getTotalTime(); |
| | | // // 判断是服务超时还是服务提前结束,如果minspace大于0则是超时服务,小于0则是提前结束服务 |
| | | // projServices.setIsOverTime(minspace + ""); |
| | | // projServices.setState(Dictionary.SERVICE_STATU_FWWC); |
| | | return sysProjServicesDao.update(projServices); |
| | | } |
| | | |
| | | /** |
| | | * 服务单收费需要生成出库记录 |
| | | * |
| | | * @param projServicesVo |
| | | * @return |
| | | */ |
| | | private boolean isNeedOutStore(SysProjServices projServicesVo) { |
| | | if(CollectionUtils.isNotEmpty(projServicesVo.getOutStoreItem())){ |
| | | for (SysOutStoreItem item : projServicesVo.getOutStoreItem()) { |
| | | if (item.getAmount() != null && item.getAmount() > 0) { |
| | | return true; |
| | | |
| | | if (CollectionUtils.isNotEmpty(projServicesVo.getOutStoreItem())) { |
| | | BusParameterSettings manageStockSetting = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WAREHOUSE_MANAGE_STOCK, projServicesVo.getCompanyId()); |
| | | if(AppConstance.IS_Y.equals(manageStockSetting.getParamValue())){ |
| | | for (SysOutStoreItem item : projServicesVo.getOutStoreItem()) { |
| | | if (item.getAmount() != null && item.getAmount() > 0) { |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | SysBeauticianState checkBeauticianState = new SysBeauticianState(); |
| | | checkBeauticianState.setServicesId(projServices.getId()); |
| | | checkBeauticianState.setState(Dictionary.BEATUI_STATE_FWJS); |
| | | checkBeauticianState.setStaffId(users.getSuId()); |
| | | int rerunlt = beauticianStateDao.chengItemState(checkBeauticianState); |
| | | |
| | | // 验证是否是最后一个美疗师结束服务 |
| | |
| | | } |
| | | |
| | | return rerunlt; |
| | | |
| | | } |
| | | |
| | | @Override |
| | |
| | | public int findApiServiceOrderListTotal(ServiceOrderListDto serviceOrderListDto) { |
| | | return sysProjServicesDao.selectApiServiceOrderListTotal(serviceOrderListDto); |
| | | } |
| | | |
| | | /** |
| | | * 跳过服务单某步骤 |
| | | */ |
| | | private boolean skipServiceOrderStep(String step) { |
| | | SysUsers users = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); |
| | | ParameterSettings ps = new ParameterSettings(); |
| | | ps.setCompanyId(users.getCompanyId()); |
| | | ps.setCategory("店务配置"); |
| | | List<ParameterSettings> settings = parameterSettingsDao.getByCategory(ps); |
| | | |
| | | boolean flag = false; |
| | | if (CollUtil.isNotEmpty(settings)) { |
| | | for (ParameterSettings setting : settings) { |
| | | if (step.equals(setting.getCode()) && Dictionary.FLAG_YES.equals(setting.getUserValue())) { |
| | | flag = true; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | return flag; |
| | | } |
| | | } |
| | |
| | | projUse.setStatus(status); |
| | | return sysProjUseDao.selectByModel(projUse); |
| | | } |
| | | |
| | | @Override |
| | | public List<SysProjUse> findTaocaoProjUseWithProj(SysProjUse sysProjUse) { |
| | | return sysProjUseDao.selectTaoCanListWithProj(sysProjUse); |
| | | } |
| | | } |
| | |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.pojo.PaginationVO; |
| | | import com.matrix.core.tools.*; |
| | | import com.matrix.core.tools.DateUtil; |
| | | import com.matrix.core.tools.EncrypUtil; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.core.tools.excl.ExcelSheetPO; |
| | | import com.matrix.core.tools.excl.ExcelUtil; |
| | | import com.matrix.system.app.dto.AddVipDto; |
| | |
| | | import com.matrix.system.app.dto.VipInfoListDto; |
| | | import com.matrix.system.app.vo.VipInfoDetailVo; |
| | | import com.matrix.system.app.vo.VipInfoListVo; |
| | | import com.matrix.system.common.bean.BusParameterSettings; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.common.tools.DataAuthUtil; |
| | | import com.matrix.system.common.tools.ServiceUtil; |
| | | import com.matrix.system.constance.Dictionary; |
| | |
| | | import com.matrix.system.hive.plugin.util.CollectionUtils; |
| | | import com.matrix.system.hive.pojo.VipInfoVo; |
| | | import com.matrix.system.hive.service.SysVipInfoService; |
| | | import com.matrix.system.score.constant.ScoreSettingConstant; |
| | | import com.matrix.system.score.entity.ScoreVipDetail; |
| | | import com.matrix.system.score.service.ScoreVipDetailService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | @Value("${default.vip.photo.man}") |
| | | String defaultMan; |
| | | @Autowired |
| | | BusParameterSettingsDao busParameterSettingsDao; |
| | | |
| | | @Autowired |
| | | ScoreVipDetailService scoreVipDetailService; |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | @Override |
| | | public int add(SysVipInfo sysVipInfo) { |
| | | SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | |
| | | |
| | | if (sysVipInfo.getVipNo() != null && (!sysVipInfo.getVipNo().equals(""))) { |
| | | if (serviceUtil.addCheckRepeatTowColumn(TableMapping.SYS_VIP_INFO, "VIP_NO", sysVipInfo.getVipNo(), |
| | | "company_id",user.getCompanyId())) { |
| | | "company_id",sysVipInfo.getCompanyId())) { |
| | | throw new GlobleException("编号已存在!"); |
| | | } |
| | | } |
| | |
| | | throw new GlobleException("请输入手机号!"); |
| | | } |
| | | if (serviceUtil.addCheckRepeatTowColumn(TableMapping.SYS_VIP_INFO, "PHONE", sysVipInfo.getPhone(), |
| | | "company_id",user.getCompanyId() )) { |
| | | throw new GlobleException("手机已被注册!"); |
| | | "company_id",sysVipInfo.getCompanyId() )) { |
| | | throw new GlobleException(sysVipInfo.getPhone()+"手机已被注册!"); |
| | | } |
| | | } |
| | | |
| | | |
| | | sysVipInfo.setShopId(user.getShopId()); |
| | | sysVipInfo.setCompanyId(user.getCompanyId()); |
| | | sysVipInfo.setCreateTime(new Date()); |
| | | sysVipInfo.setPointAll(0); |
| | | sysVipInfo.setIsDeal(SysVipInfo.UNDEAL_VIP); |
| | | sysVipInfo.setZjm(StringUtils.toHanyuPinyin(sysVipInfo.getVipName())+","+StringUtils.toHeadWordHanyuPinyin(sysVipInfo.getVipName())); |
| | | if(sysVipInfo.getSex().equals(Dictionary.SEX_MAN)){ |
| | | if(StringUtils.isNotBlank(sysVipInfo.getVipName())){ |
| | | sysVipInfo.setZjm(StringUtils.toHanyuPinyin(sysVipInfo.getVipName())+","+StringUtils.toHeadWordHanyuPinyin(sysVipInfo.getVipName())); |
| | | } |
| | | if(Dictionary.SEX_MAN.equals(sysVipInfo.getSex())){ |
| | | sysVipInfo.setPhoto(defaultMan); |
| | | }else{ |
| | | sysVipInfo.setPhoto(defaultWoman); |
| | | } |
| | | int i=sysVipInfoDao.insert(sysVipInfo); |
| | | modifyVipWithOtherInfo(sysVipInfo); |
| | | //创建用户默认储值卡 |
| | | addVipDefaultCard(sysVipInfo.getId()); |
| | | return i; |
| | |
| | | } |
| | | |
| | | |
| | | //如果会员id不为空则表示是修改,删除原有的绑定关系,建立新的关系 |
| | | if(vipInfo.getId()!=null && !vipInfo.getId().equals("")){ |
| | | MyBeatician query=new MyBeatician(); |
| | | query.setVipId(vipInfo.getId()); |
| | | List<MyBeatician> listDel= myBeaticianDao.selectByModel(query); |
| | | if(listDel!=null && listDel.size()>0){ |
| | | List<Long> delIds=new ArrayList<>(); |
| | | for (int i = 0; i < listDel.size(); i++) { |
| | | delIds.add(listDel.get(i).getId()); |
| | | } |
| | | myBeaticianDao.deleteByIds(delIds); |
| | | } |
| | | } |
| | | //添加客户的美疗师 |
| | | List<MyBeatician> list=vipInfo.getBeauticains(); |
| | | if(list!=null && list.size()>0){ |
| | | List<MyBeatician> saveList=new ArrayList<>(); |
| | | //此处由于前台传递过来list中的下标可能是不连续的。因此要过滤掉空的,即要过滤掉美疗师的id为空的数据 |
| | | for (MyBeatician temp:list) { |
| | | if(temp.getBeauticainId()!=null && !temp.getBeauticainId().equals("")){ |
| | | saveList.add(temp); |
| | | } |
| | | } |
| | | myBeaticianDao.insertAll(saveList,vipInfo.getId()); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | SysVipInfo vipInfo = new SysVipInfo(); |
| | | vipInfo.setVipNo(objects.get(0).toString()); |
| | | |
| | | SysVipInfo exist = sysVipInfoDao.selectByPhone(objects.get(3).toString()); |
| | | SysVipInfo exist = sysVipInfoDao.selectByPhone(objects.get(3).toString(),sysUsers.getCompanyId()); |
| | | if (exist != null) { |
| | | continue; |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public int apiAddVip(AddVipDto addVipDto) { |
| | | SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | |
| | |
| | | if (CollectionUtils.isNotEmpty(addVipDto.getLabels())) { |
| | | batchInsertLabel(addVipDto.getLabels(), vipInfo.getId()); |
| | | } |
| | | //添加推荐人积分 |
| | | addReferrerVipScore(vipInfo); |
| | | |
| | | //创建用户默认储值卡 |
| | | addVipDefaultCard(vipInfo.getId()); |
| | | return i; |
| | | } |
| | | |
| | | /** |
| | | * 添加推荐人积分 |
| | | * @param vipInfo |
| | | */ |
| | | public void addReferrerVipScore(SysVipInfo vipInfo) { |
| | | if(vipInfo.getRecommendId()!=null){ |
| | | SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | BusParameterSettings referrerScoreSetting = busParameterSettingsDao.selectCompanyParamByCode(ScoreSettingConstant.REFERRALS_CONSUMPTION, user.getCompanyId()); |
| | | //推荐注册老带新积分奖励 |
| | | SysVipInfo referrerVip = sysVipInfoDao.selectById(vipInfo.getRecommendId()); |
| | | |
| | | if(StringUtils.isNotBlank(referrerScoreSetting.getParamValue())){ |
| | | |
| | | scoreVipDetailService.addScore( |
| | | referrerVip.getId(), |
| | | user.getSuId(), |
| | | vipInfo.getShopId(), |
| | | Integer.parseInt(referrerScoreSetting.getParamValue()), |
| | | vipInfo.getId(), |
| | | ScoreVipDetail.SCORE_VIP_TYPE_REFERRER, |
| | | "推荐会员" |
| | | ); |
| | | } |
| | | |
| | | //推荐注册二级带新积分奖励 |
| | | |
| | | if(referrerVip.getRecommendId()!=null){ |
| | | |
| | | SysVipInfo topVipInfo = sysVipInfoDao.selectById(referrerVip.getRecommendId()); |
| | | |
| | | |
| | | if(StringUtils.isNotBlank(referrerScoreSetting.getParamValue1())){ |
| | | scoreVipDetailService.addScore( |
| | | topVipInfo.getId(), |
| | | user.getSuId(), |
| | | vipInfo.getShopId(), |
| | | Integer.parseInt(referrerScoreSetting.getParamValue1()), |
| | | vipInfo.getId(), |
| | | ScoreVipDetail.SCORE_VIP_TYPE_REFERRER, |
| | | "间接推荐会员" |
| | | ); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | |
| | | vipInfoDetailVo.setLabels(labels); |
| | | return vipInfoDetailVo; |
| | | } |
| | | |
| | | @Override |
| | | public SysVipInfo findByOpenId(String openId) { |
| | | return sysVipInfoDao.findByOpenId(openId); |
| | | } |
| | | |
| | | /** |
| | | * 设置成为推广员 |
| | | * @param invitationId |
| | | */ |
| | | @Override |
| | | public int setToBeAnSalesman(Long userId,Long invitationId,long gradeId) { |
| | | SysVipInfo sysVipInfo=sysVipInfoDao.selectById(userId); |
| | | sysVipInfo.setIsSales(SysVipInfo.IS_SALES); |
| | | sysVipInfo.setRecommendId(invitationId); |
| | | sysVipInfo.setBindingParentTime(new Date()); |
| | | sysVipInfo.setSalesmanGrade(gradeId); |
| | | return sysVipInfoDao.update(sysVipInfo); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | @Override |
| | | public boolean isInWorkTime(Long shopId, Date beginTime, Date endTime) { |
| | | Date minTime = findMinTime(shopId); |
| | | Date maxTime = findMaxTime(shopId); |
| | | minTime.setYear(beginTime.getYear()); |
| | | minTime.setMonth(beginTime.getMonth()); |
| | | minTime.setDate(beginTime.getDate()); |
| | | maxTime.setYear(beginTime.getYear()); |
| | | maxTime.setMonth(beginTime.getMonth()); |
| | | maxTime.setDate(beginTime.getDate()); |
| | | return ( |
| | | (DateUtil.isDuringDate(minTime, maxTime, beginTime) || minTime.getTime()==beginTime.getTime() ) |
| | | && DateUtil.isDuringDate(minTime, maxTime, endTime) || maxTime.getTime()==endTime.getTime() ); |
| | | if(beginTime!=null){ |
| | | Date minTime = findMinTime(shopId); |
| | | Date maxTime = findMaxTime(shopId); |
| | | minTime.setYear(beginTime.getYear()); |
| | | minTime.setMonth(beginTime.getMonth()); |
| | | minTime.setDate(beginTime.getDate()); |
| | | maxTime.setYear(beginTime.getYear()); |
| | | maxTime.setMonth(beginTime.getMonth()); |
| | | maxTime.setDate(beginTime.getDate()); |
| | | return ( |
| | | (DateUtil.isDuringDate(minTime, maxTime, beginTime) || minTime.getTime()==beginTime.getTime() ) |
| | | && DateUtil.isDuringDate(minTime, maxTime, endTime) || maxTime.getTime()==endTime.getTime() ); |
| | | }else{ |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.matrix.system.common.tools.ResponseHeadUtil; |
| | | import com.matrix.system.hive.action.util.QueryUtil; |
| | | import com.matrix.system.hive.bean.AchieveNew; |
| | | import com.matrix.system.hive.bean.SysOrder; |
| | | import com.matrix.system.hive.bean.SysOrderItem; |
| | | import com.matrix.system.hive.dao.AchieveNewDao; |
| | | import com.matrix.system.hive.plugin.util.CollectionUtils; |
| | | import com.matrix.system.hive.service.AchieveNewService; |
| | | import com.matrix.system.hive.service.SysOrderItemService; |
| | | import com.matrix.system.hive.service.SysOrderService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.ui.ModelMap; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | |
| | | @Autowired |
| | | private SysOrderItemService sysOrderItemService; |
| | | |
| | | @Autowired |
| | | private AchieveNewDao achieveNewDao; |
| | | |
| | | /** |
| | | * 门店每日单据明细表 |
| | |
| | | String title = "每日单据明细"; |
| | | orderSheet.setSheetName(title); |
| | | orderSheet.setTitle(title); |
| | | String[] header = {"年", "月", "日", "订单类型", "订单编号", "会员级别", "姓名", "项目名称", "总金额", "卡项", "现金单次", "现金产品", "划扣", "本金消耗", "赠消", "提成", "顾问", "美疗师", "人头", "项目个数", "项目时间", "门店"}; |
| | | String[] header = {"年", "月", "日", "订单编号", "订单类型", "会员姓名", "项目名称", "订单金额", "订单业绩", "收款方式", "业绩类型", "员工", "本金消耗", "赠消", "提成", "人头", "项目个数", "项目时间", "顾问", "门店"}; |
| | | orderSheet.setHeaders(header); |
| | | SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); |
| | | if(!AppConstance.ZONGDIAN.equals(sysUsers.getShopName())){ |
| | |
| | | temp.add(item.getYear()); |
| | | temp.add(item.getMonth()); |
| | | temp.add(item.getDay()); |
| | | temp.add(item.getOrderType()); |
| | | temp.add(item.getOrderNo()); |
| | | temp.add(item.getLevelName()); |
| | | temp.add(item.getOrderType()); |
| | | temp.add(item.getVipName()); |
| | | temp.add(item.getProName()); |
| | | temp.add(item.getZkTotal()); |
| | | temp.add(item.getCardCash()); |
| | | temp.add(item.getProjCash()); |
| | | temp.add(item.getGoodsCash()); |
| | | temp.add(item.getConsume()); |
| | | temp.add(item.getPayMethod()); |
| | | temp.add(item.getMeiliao()); |
| | | temp.add(item.getHisConsume()); |
| | | temp.add(item.getFreeConsume()); |
| | | temp.add(item.getProjPercentage()); |
| | | temp.add(item.getGuwen()); |
| | | temp.add(item.getMeiliao()); |
| | | temp.add(item.getNumberOfPeople()); |
| | | temp.add(item.getProjNum()); |
| | | temp.add(item.getProjTime()); |
| | | temp.add(item.getGuwen()); |
| | | temp.add(item.getShopName()); |
| | | list.add(temp); |
| | | } |
| | |
| | | |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | @Transactional |
| | | public AjaxResult add(@RequestBody List<AchieveNew> list) { |
| | | SysOrder order = sysOrderService.findById(list.get(0).getOrderId()); |
| | | List<SysOrderItem> orderItems = sysOrderItemService.findByOrderId(order.getId()); |
| | | orderItems.forEach(item -> { |
| | | List<AchieveNew> achieveNewList = new ArrayList<>(); |
| | | for(AchieveNew achieveNew : list) { |
| | | achieveNewService.removeById(achieveNew.getId()); |
| | | achieveNew.setId(null); |
| | | achieveNew.setConsume(null); |
| | | achieveNew.setCardCash(null); |
| | | |
| | | if (achieveNew.getOrderItemId().equals(item.getId())) { |
| | | achieveNewList.add(achieveNew); |
| | | } |
| | | |
| | | } |
| | | item.setAchaeveList(achieveNewList); |
| | | }); |
| | | order.setItems(orderItems); |
| | | achieveNewService.addAchaeveByOrder(order); |
| | | return AjaxResult.buildSuccessInstance("保存成功"); |
| | | if (CollectionUtils.isNotEmpty(list)) { |
| | | //删除原业绩 |
| | | achieveNewDao.deleteByOrderId(list.get(0).getOrderId()); |
| | | //插入新业绩 |
| | | achieveNewDao.batchInsert(list); |
| | | return AjaxResult.buildSuccessInstance("保存成功"); |
| | | } else { |
| | | return AjaxResult.buildFailInstance("未找到业绩数据"); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | import static com.matrix.system.hive.statistics.BusinessDataTypeEnum.*; |
| | | |
| | | /** |
| | | * 定时任务测试类 |
| | | * 业绩统计报表定时任务 |
| | | * |
| | | * @author zhangheng |
| | | * @email 512061637@qq.com |
| | | * @date 2019年1月15日 |
| | | * @author jyy |
| | | */ |
| | | @Component |
| | | public class StatisticsBusinessDataJob { |
| | |
| | | } |
| | | |
| | | |
| | | @Scheduled(cron = "0 0 0 1/1 * ?") |
| | | @Scheduled(cron = "1 0 0 1/1 * ?") |
| | | public boolean executeExt() { |
| | | |
| | | LogUtil.info("业绩统计定时任务开始运行*******************"); |
| | |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.constance.Dictionary; |
| | | import com.matrix.system.constance.SystemConstance; |
| | | import com.matrix.system.hive.action.BaseController; |
| | | import com.matrix.system.hive.action.util.QueryUtil; |
| | | import com.matrix.system.hive.bean.SysShopInfo; |
| | | import com.matrix.system.hive.service.SysShopInfoService; |
| | | import com.matrix.system.shopXcx.api.WeChatApiTools; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | |
| | | @Resource |
| | | private SysShopInfoService shopInfoService; // 店铺Service |
| | | |
| | | |
| | | @Autowired |
| | | WeChatApiTools weChatApiTools; |
| | | |
| | | @RequestMapping(value = "/showList") |
| | | @ResponseBody |
| | |
| | | AjaxResult creteSohopQrcode(@PathVariable("shopId") Long shopId) { |
| | | SysShopInfo shopInfo = shopInfoService.findById(shopId); |
| | | try { |
| | | String qrcodeSavePath = WxacodeUtil.getWxacode(shopId + "", "pages/index/index", MD5Util.strToMD5(shopId + "")); |
| | | String qrcodeSavePath = WxacodeUtil.getWxacode(shopId + "", "pages/index/index", MD5Util.strToMD5(shopId + "") |
| | | ,weChatApiTools.getAppid(shopInfo.getCompanyId()),weChatApiTools.getSecret(shopInfo.getCompanyId())); |
| | | LogUtil.debug("qrcodeSavePath={}", qrcodeSavePath); |
| | | // 图片保存目录路径 |
| | | String baseSavePath = PropertiesUtil.getString(AppConstance.FILES_TORAGE_PATH); |
| | |
| | | import com.matrix.core.tools.excl.ExcelSheetPO; |
| | | import com.matrix.core.tools.excl.ExcelUtil; |
| | | import com.matrix.core.tools.excl.ExcelVersion; |
| | | import com.matrix.system.common.bean.SystemDictionary; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.service.SystemDictionaryService; |
| | | import com.matrix.system.common.bean.SystemDictionary; |
| | | import com.matrix.system.common.service.SysUsersService; |
| | | import com.matrix.system.common.service.SystemDictionaryService; |
| | | import com.matrix.system.common.tools.ResponseHeadUtil; |
| | | import com.matrix.system.constance.Dictionary; |
| | | import com.matrix.system.constance.SystemConstance; |
| | | import com.matrix.system.hive.action.BaseController; |
| | | import com.matrix.system.hive.action.util.QueryUtil; |
| | | import com.matrix.system.hive.bean.*; |
| | | import com.matrix.system.hive.bean.Question; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.bean.SysVipLevel; |
| | | import com.matrix.system.hive.bean.VipAnswer; |
| | | import com.matrix.system.hive.dao.MoneyCardUseDao; |
| | | import com.matrix.system.hive.dao.VipAnswerDao; |
| | | import com.matrix.core.tools.DateUtil; |
| | | import com.matrix.system.hive.pojo.RegisterInfo; |
| | | import com.matrix.system.hive.service.*; |
| | | import com.matrix.system.hive.service.MoneyCardUseService; |
| | | import com.matrix.system.hive.service.QuestionSerivce; |
| | | import com.matrix.system.hive.service.SysVipInfoService; |
| | | import com.matrix.system.hive.service.SysVipLevelService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.ModelMap; |
| | |
| | | import java.net.URLDecoder; |
| | | import java.net.URLEncoder; |
| | | import java.security.NoSuchAlgorithmException; |
| | | import java.util.*; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Calendar; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | |
| | | @RequestMapping(value = "/showVipInfo") |
| | | public @ResponseBody |
| | | AjaxResult findByModel(String keyWord) { |
| | | LinkedList<SysVipInfo> userList = null; |
| | | // 获取最近查询客户 |
| | | if (WebUtil.getSession().getAttribute(SystemConstance.HISTORY_CUSTOMER) == null) { |
| | | userList = new LinkedList<SysVipInfo>(); |
| | | WebUtil.getSession().setAttribute(SystemConstance.HISTORY_CUSTOMER, userList); |
| | | } else { |
| | | userList = (LinkedList<SysVipInfo>) WebUtil.getSession().getAttribute(SystemConstance.HISTORY_CUSTOMER); |
| | | } |
| | | List<SysVipInfo> vips = vipInfoService.findByVipNoOrTel(keyWord); |
| | | if (vips.size() > 0) { |
| | | // 在session存放当前查询的客户 |
| | | MoneyCardUse cardUseInfo = cardUseService.findByVipId(vips.get(0).getId()); |
| | | if (cardUseInfo == null) { |
| | | cardUseInfo=vipInfoService.addVipDefaultCard(vips.get(0).getId()); |
| | | } |
| | | vips.get(0).setLevelCard(cardUseInfo); |
| | | WebUtil.getSession().setAttribute(SystemConstance.CURRENT_CUSTOMER, vips.get(0)); |
| | | // 满20后删除一个 |
| | | if (userList.size() == 20) { |
| | | userList.poll(); |
| | | } |
| | | // 去重标志 |
| | | boolean isNoRepeat = true; |
| | | for (SysVipInfo sysVipInfo : userList) { |
| | | if (vips.get(0).getPhone().equals(sysVipInfo.getPhone())) { |
| | | isNoRepeat = false; |
| | | } |
| | | } |
| | | if (isNoRepeat) { |
| | | userList.add(vips.get(0)); |
| | | } |
| | | } |
| | | |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, vips, 0); |
| | | } |
| | | |
| | |
| | | @RequestMapping(value = "/findUserByPhoneOrNo") |
| | | public @ResponseBody |
| | | AjaxResult findUserByPhoneOrNo(String keyWord) { |
| | | LinkedList<SysVipInfo> userList = null; |
| | | // 获取最近查询客户 |
| | | if (WebUtil.getSession().getAttribute(SystemConstance.HISTORY_CUSTOMER) == null) { |
| | | userList = new LinkedList<SysVipInfo>(); |
| | | WebUtil.getSession().setAttribute(SystemConstance.HISTORY_CUSTOMER, userList); |
| | | } else { |
| | | userList = (LinkedList<SysVipInfo>) WebUtil.getSession().getAttribute(SystemConstance.HISTORY_CUSTOMER); |
| | | } |
| | | List<SysVipInfo> vips = vipInfoService.findByVipNoOrTel(keyWord); |
| | | if (vips.size() > 0) { |
| | | // 在session存放当前查询的客户 |
| | | WebUtil.getSession().setAttribute(SystemConstance.CURRENT_CUSTOMER, vips.get(0)); |
| | | // 满20后删除一个 |
| | | if (userList.size() == 20) { |
| | | userList.poll(); |
| | | } |
| | | // 去重标志 |
| | | boolean isNoRepeat = true; |
| | | for (SysVipInfo sysVipInfo : userList) { |
| | | if (vips.get(0).getPhone().equals(sysVipInfo.getPhone())) { |
| | | isNoRepeat = false; |
| | | } |
| | | } |
| | | if (isNoRepeat) { |
| | | userList.add(vips.get(0)); |
| | | } |
| | | } |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, vips, 0); |
| | | |
| | | } |
| | | |
| | | @RequestMapping(value = "/getBirthday") |
| | |
| | | // 服务时长 |
| | | Map<String, BigDecimal> selectTimeLength(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("shopId") Long shopId, @Param("companyId") Long companyId); |
| | | |
| | | // 储值卡本金扣款 |
| | | Map<String, BigDecimal> selectCardAmount(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("shopId") Long shopId, @Param("companyId") Long companyId); |
| | | |
| | | // 储值卡赠金扣款 |
| | | Map<String, BigDecimal> selectFreeAmount(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("shopId") Long shopId, @Param("companyId") Long companyId); |
| | | |
| | | List<VipAchieveDataShowVo> selectVipAchieveInPage(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("userId") Long userId); |
| | | |
| | | // 订单业绩 |
| | |
| | | package com.matrix.system.job; |
| | | |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.system.constance.Dictionary; |
| | | import com.matrix.system.hive.bean.MoneyCardUse; |
| | | import com.matrix.system.hive.bean.SysProjUse; |
| | |
| | | |
| | | @Scheduled(cron = "0 0 0 * * ?") |
| | | public void setProjUseToInvalid() { |
| | | LogUtil.info("#项目,套餐失效任务处理#"); |
| | | List<SysProjUse> sysProjUses = sysProjUseDao.selectHasValidProjUse(); |
| | | |
| | | List<MoneyCardUse> moneyCardUses = moneyCardUseDao.selectHasValidMoneyCardUse(); |
| | |
| | | |
| | | import com.matrix.component.rabbitmq.RabiitMqTemplate; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.constance.Dictionary; |
| | | import com.matrix.system.hive.bean.MoneyCardUse; |
| | | import com.matrix.system.hive.bean.SysProjServices; |
| | | import com.matrix.system.hive.bean.SysProjUse; |
| | | import com.matrix.system.hive.dao.MoneyCardUseDao; |
| | | import com.matrix.system.hive.dao.SysProjServicesDao; |
| | | import com.matrix.system.hive.dao.SysProjUseDao; |
| | | import com.matrix.system.hive.plugin.util.CollectionUtils; |
| | | import com.matrix.system.shopXcx.mqTask.MQTaskRouting; |
| | | import com.matrix.system.wechart.templateMsg.UniformMsgParam; |
| | |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | /** |
| | | * 每分钟执行一次 |
| | | */ |
| | | @Scheduled(cron = "0 0/1 * * * ?") |
| | | @Scheduled(cron = "0/30 * * * * ?") |
| | | public void serviceOvertimeNotice() { |
| | | |
| | | List<SysProjServices> needNoticeService=projServicesDao.selectNeedNoticeService(); |
New file |
| | |
| | | package com.matrix.system.score.action; |
| | | |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.common.bean.BusParameterSettings; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.score.constant.ScoreSettingConstant; |
| | | import com.matrix.system.score.service.ScoreRuleSettingService; |
| | | import com.matrix.system.score.vo.ScoreRuleSettingsVo; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author wzy |
| | | * @date 2021-02-22 |
| | | **/ |
| | | @RestController |
| | | @RequestMapping(value = "/score/ruleSetting") |
| | | public class ScoreRuleSettingAction { |
| | | |
| | | @Autowired |
| | | private ScoreRuleSettingService scoreRuleSettingService; |
| | | @Autowired |
| | | private BusParameterSettingsDao busParameterSettingsDao; |
| | | |
| | | |
| | | /** |
| | | *查询积分规则配置 |
| | | */ |
| | | @RequestMapping(value = "/selectScoreRule") |
| | | public AjaxResult selectScoreRule() { |
| | | |
| | | AjaxResult result= AjaxResult.buildSuccessInstance("查询成功"); |
| | | SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | Long companyId = user.getCompanyId(); |
| | | |
| | | //积分有效期 |
| | | String[] jfyxqArrayCode={ScoreSettingConstant.VALID_PERIOD_POINTS}; |
| | | String[] jfyxqArrayName={"积分有效期:从获得开始 到"}; |
| | | List<ScoreRuleSettingsVo> jfyxqRuleSettingsVo = getRuleSettingsVo(jfyxqArrayCode,jfyxqArrayName,companyId); |
| | | result.putInMap("jfyxq", jfyxqRuleSettingsVo); |
| | | //积分抵扣现金 |
| | | String[] jfdxjArrayCode={ScoreSettingConstant.CREDIT_POINTS_CASH}; |
| | | String[] jfdxjArrayName={"积分抵扣现金"}; |
| | | List<BusParameterSettings> dataList = busParameterSettingsDao.selectByCodesAndCompanyId(Arrays.asList(jfdxjArrayCode), companyId); |
| | | List<ScoreRuleSettingsVo> jfdxjRuleSettingsVo=new ArrayList<ScoreRuleSettingsVo>(); |
| | | int index=0; |
| | | for (BusParameterSettings item:dataList){ |
| | | ScoreRuleSettingsVo paramVo=new ScoreRuleSettingsVo(); |
| | | BeanUtils.copyProperties(item,paramVo); |
| | | paramVo.setParamName(jfdxjArrayName[index]); |
| | | String paramValue = paramVo.getParamValue(); |
| | | if(StrUtil.isNotEmpty(paramValue)) { |
| | | paramVo.setParamSwitch(Boolean.TRUE); |
| | | }else { |
| | | paramVo.setParamSwitch(Boolean.FALSE); |
| | | } |
| | | jfdxjRuleSettingsVo.add(paramVo); |
| | | index++; |
| | | } |
| | | result.putInMap("jfdxj", jfdxjRuleSettingsVo); |
| | | //门店积分规则 |
| | | String[] mdjfArrayCode={ |
| | | ScoreSettingConstant.CASH_CONSUMPTION, |
| | | ScoreSettingConstant.PRINCIPAL_BALANCE_CONSUMPTION, |
| | | ScoreSettingConstant.BONUS_BALANCE_CONSUMPTION, |
| | | ScoreSettingConstant.PRINCIPAL_CONSUMPTION, |
| | | ScoreSettingConstant.GIVE_CONSUMPTION, |
| | | ScoreSettingConstant.REFERRALS_CONSUMPTION}; |
| | | String[] mdjfArrayName={ |
| | | "现金消费", |
| | | "本金余额消费", |
| | | "赠金余额消费", |
| | | "本金消耗", |
| | | "赠送消耗", |
| | | "转介客户"}; |
| | | List<ScoreRuleSettingsVo> mdjfRuleSettingsVo = getRuleSettingsVo(mdjfArrayCode,mdjfArrayName,companyId); |
| | | result.putInMap("mdjf", mdjfRuleSettingsVo); |
| | | //商城积分规则 |
| | | String[] scjfArrayCode={ |
| | | ScoreSettingConstant.CASH_CONSUMPTION_SHOP, |
| | | ScoreSettingConstant.RESERVATION_SERVICE_SHOP, |
| | | ScoreSettingConstant.EVALUATUIN_ORDER_SHOP}; |
| | | String[] scjfArrayName={ |
| | | "现金消费", |
| | | "预约服务", |
| | | "评价订单"}; |
| | | List<ScoreRuleSettingsVo> scjfRuleSettingsVo =getRuleSettingsVo(scjfArrayCode,scjfArrayName,companyId); |
| | | result.putInMap("scjf", scjfRuleSettingsVo); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | *获取对应的积分规则设置数据 |
| | | * @param ArrayCode |
| | | * @param ArrayName |
| | | * @param companyId |
| | | * @return |
| | | */ |
| | | private List<ScoreRuleSettingsVo> getRuleSettingsVo(String[] ArrayCode,String[] ArrayName,Long companyId){ |
| | | List<BusParameterSettings> dataList = busParameterSettingsDao.selectByCodesAndCompanyId(Arrays.asList(ArrayCode), companyId); |
| | | List<ScoreRuleSettingsVo> scoreRuleSettingsVos=new ArrayList<ScoreRuleSettingsVo>(); |
| | | int index=0; |
| | | for (BusParameterSettings item:dataList){ |
| | | ScoreRuleSettingsVo paramVo=new ScoreRuleSettingsVo(); |
| | | BeanUtils.copyProperties(item,paramVo); |
| | | paramVo.setParamName(ArrayName[index]); |
| | | scoreRuleSettingsVos.add(paramVo); |
| | | index++; |
| | | } |
| | | return scoreRuleSettingsVos; |
| | | } |
| | | |
| | | /** |
| | | * 修改公司维度的积分规则 |
| | | */ |
| | | @PostMapping(value = "/updateScoreRule") |
| | | public @ResponseBody |
| | | AjaxResult updateScoreRule(@RequestBody List<BusParameterSettings> busParameterSettings) { |
| | | return scoreRuleSettingService.updateScoreRuleByCompanyId(busParameterSettings); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.score.constant;
|
| | |
|
| | | public class ScoreSettingConstant {
|
| | |
|
| | | /**
|
| | | * 积分有效期
|
| | | */
|
| | | public final static String VALID_PERIOD_POINTS = "VALID_PERIOD_POINTS";
|
| | | public final static String VALID_PERIOD_POINTS_NAME = "积分有效期:从获得开始 到";
|
| | | /**
|
| | | * 积分抵扣现金
|
| | | */
|
| | | public final static String CREDIT_POINTS_CASH = "CREDIT_POINTS_CASH";
|
| | | public final static String CREDIT_POINTS_CASH_NAME = "积分抵扣现金";
|
| | |
|
| | | //门店设置
|
| | | /**
|
| | | * 现金消费
|
| | | */
|
| | | public final static String CASH_CONSUMPTION = "CASH_CONSUMPTION";
|
| | | public final static String CASH_CONSUMPTION_NAME = "现金消费";
|
| | | /**
|
| | | * 本金余额消费
|
| | | */
|
| | | public final static String PRINCIPAL_BALANCE_CONSUMPTION = "PRINCIPAL_BALANCE_CONSUMPTION";
|
| | | public final static String PRINCIPAL_BALANCE_CONSUMPTION_NAME = "本金余额消费";
|
| | | /**
|
| | | * 赠金余额消费
|
| | | */
|
| | | public final static String BONUS_BALANCE_CONSUMPTION = "BONUS_BALANCE_CONSUMPTION";
|
| | | public final static String BONUS_BALANCE_CONSUMPTION_NAME = "赠金余额消费";
|
| | | /**
|
| | | * 本金消耗
|
| | | */
|
| | | public final static String PRINCIPAL_CONSUMPTION = "PRINCIPAL_CONSUMPTION";
|
| | | public final static String PRINCIPAL_CONSUMPTION_NAME = "本金消耗";
|
| | | /**
|
| | | * 赠送消耗
|
| | | */
|
| | | public final static String GIVE_CONSUMPTION = "GIVE_CONSUMPTION";
|
| | | public final static String GIVE_CONSUMPTION_NAME = "赠送消耗";
|
| | | /**
|
| | | * 转介客户
|
| | | */
|
| | | public final static String REFERRALS_CONSUMPTION = "REFERRALS_CONSUMPTION";
|
| | | public final static String REFERRALS_CONSUMPTION_NAME = "转介客户";
|
| | |
|
| | |
|
| | | //商城设置
|
| | | /**
|
| | | * 现金消费
|
| | | */
|
| | | public final static String CASH_CONSUMPTION_SHOP = "CASH_CONSUMPTION_SHOP";
|
| | | public final static String CASH_CONSUMPTION_SHOP_NAME = "现金消费";
|
| | | /**
|
| | | * 预约服务
|
| | | */
|
| | | public final static String RESERVATION_SERVICE_SHOP = "RESERVATION_SERVICE_SHOP";
|
| | | public final static String RESERVATION_SERVICE_SHOP_NAME = "预约服务";
|
| | | /**
|
| | | * 评价订单
|
| | | */
|
| | | public final static String EVALUATUIN_ORDER_SHOP = "EVALUATUIN_ORDER_SHOP";
|
| | | public final static String EVALUATUIN_ORDER_SHOP_NAME = "评价订单";
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.matrix.system.score.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.matrix.system.score.entity.ScoreUseRecord; |
| | | import com.matrix.system.shopXcx.api.dto.ScoreFlowDto; |
| | | import com.matrix.system.shopXcx.api.vo.ScoreUseRecordVo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * @description 积分记录表 |
| | | * @author jyy |
| | | * @date 2021-02-26 15:26 |
| | | */ |
| | | public interface ScoreUseRecordDao extends BaseMapper<ScoreUseRecord> { |
| | | |
| | | /** |
| | | * 查询收支记录 |
| | | * @param page |
| | | * @param scoreFlowDto |
| | | * @return |
| | | */ |
| | | IPage<ScoreUseRecordVo> selectFlowList(Page<ScoreUseRecordVo> page, @Param("record")ScoreFlowDto scoreFlowDto); |
| | | } |
New file |
| | |
| | | package com.matrix.system.score.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.matrix.system.score.entity.ScoreVipDetail; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @description 客户积分余额 |
| | | * @author jyy |
| | | * @date 2021-02-26 15:26 |
| | | */ |
| | | public interface ScoreVipDetailDao extends BaseMapper<ScoreVipDetail> { |
| | | |
| | | /** |
| | | * 查询用户总积分 |
| | | * @param openId |
| | | * @param vipId |
| | | * @return |
| | | */ |
| | | int selectUserTotalScore(@Param("vipId")Long vipId); |
| | | |
| | | /** |
| | | * 查询用户有效的积分,按时间顺序排 |
| | | * @param |
| | | * @return |
| | | */ |
| | | List<ScoreVipDetail> selectEffectiveScore(@Param("vipId")Long vipId); |
| | | |
| | | List<ScoreVipDetail> selectInvalidaVipScore(); |
| | | |
| | | int invalidVipScore(); |
| | | } |
New file |
| | |
| | | package com.matrix.system.score.dto; |
| | | |
| | | /** |
| | | * @author wzy |
| | | * @date 2021-02-22 |
| | | **/ |
| | | public class ScoreRuleSettingDto { |
| | | } |
New file |
| | |
| | | package com.matrix.system.score.dto;
|
| | |
|
| | | public class SocreRuleDto {
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.matrix.system.score.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author wzy |
| | | * @date 2020-04-24 14:58 |
| | | **/ |
| | | public class BaseEntity implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id",type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | private String createBy; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createTime; |
| | | |
| | | private String updateBy; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date updateTime; |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getCreateBy() { |
| | | return createBy; |
| | | } |
| | | |
| | | public void setCreateBy(String createBy) { |
| | | this.createBy = createBy; |
| | | } |
| | | |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public String getUpdateBy() { |
| | | return updateBy; |
| | | } |
| | | |
| | | public void setUpdateBy(String updateBy) { |
| | | this.updateBy = updateBy; |
| | | } |
| | | |
| | | public Date getUpdateTime() { |
| | | return updateTime; |
| | | } |
| | | |
| | | public void setUpdateTime(Date updateTime) { |
| | | this.updateTime = updateTime; |
| | | } |
| | | } |
New file |
| | |
| | | package com.matrix.system.score.entity; |
| | | |
| | | import com.matrix.core.anotations.Extend; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @description 积分记录表 |
| | | * @author jyy |
| | | * @date 2021-02-26 15:26 |
| | | */ |
| | | @Data |
| | | @TableName("score_use_record") |
| | | public class ScoreUseRecord extends BaseEntity{ |
| | | @Extend |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 记录类型(1:现金消费2:员工划扣3赠送等) |
| | | */ |
| | | |
| | | |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 数量 |
| | | */ |
| | | |
| | | |
| | | private Integer recNum; |
| | | |
| | | /** |
| | | * 业务记录ID |
| | | */ |
| | | |
| | | |
| | | private Long businessId; |
| | | /** |
| | | * 操作人id |
| | | */ |
| | | Long oprationUserId; |
| | | /** |
| | | * 积分卡ID |
| | | */ |
| | | |
| | | |
| | | private Long scoreVipDetailId; |
| | | |
| | | /** |
| | | * 原积分 |
| | | */ |
| | | |
| | | |
| | | private Integer preScore; |
| | | |
| | | /** |
| | | * 现积分 |
| | | */ |
| | | |
| | | |
| | | private Integer nowScore; |
| | | |
| | | /** |
| | | * 操作人ID |
| | | */ |
| | | private Long vipId; |
| | | |
| | | private Long shopId; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | |
| | | |
| | | private String remarks; |
| | | |
| | | /** |
| | | * 所属公司_id |
| | | */ |
| | | |
| | | |
| | | private Long companyId; |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.score.entity; |
| | | |
| | | import com.matrix.core.anotations.Extend; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @description 客户积分余额 |
| | | * @author jyy |
| | | * @date 2021-02-26 15:26 |
| | | */ |
| | | @Data |
| | | @TableName("score_vip_detail") |
| | | public class ScoreVipDetail extends BaseEntity{ |
| | | @Extend |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 获取类型(1:现金消费) |
| | | */ |
| | | public static final int SCORE_VIP_TYPE_CASH=1; |
| | | |
| | | |
| | | /** |
| | | * 获取类型(2:赠送等) |
| | | */ |
| | | public static final int SCORE_VIP_TYPE_CONSUME=2; |
| | | /** |
| | | * 获取类型(3推荐客户) |
| | | */ |
| | | public static final int SCORE_VIP_TYPE_REFERRER=3; |
| | | /** |
| | | * 获取类型(4参加活动) |
| | | */ |
| | | public static final int SCORE_VIP_TYPE_JOIN_ACTIVE=4; |
| | | |
| | | |
| | | /** |
| | | * 获取类型(4人工调整) |
| | | */ |
| | | public static final int SCORE_VIP_TYPE_USERCHANGE=4; |
| | | /** |
| | | * 获取类型(5积分失效) |
| | | */ |
| | | public static final int SCORE_OVER_TIME=5; |
| | | |
| | | /** 有效*/ |
| | | public static final int SCORE_STATUS_YX=1; |
| | | /** 无效*/ |
| | | public static final int SCORE_STATUS_WX=2; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * erp用户Id |
| | | */ |
| | | private Long vipId; |
| | | |
| | | |
| | | /** |
| | | * 获取类型(1:现金消费2:赠送等) |
| | | */ |
| | | |
| | | |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 积分总数 |
| | | */ |
| | | |
| | | |
| | | private Integer allScore; |
| | | |
| | | /** |
| | | * 已使用积分 |
| | | */ |
| | | |
| | | |
| | | private Integer usedScore; |
| | | |
| | | /** |
| | | * 剩余积分 |
| | | */ |
| | | |
| | | |
| | | private Integer remainScore; |
| | | |
| | | /** |
| | | * 获取时间 |
| | | */ |
| | | |
| | | |
| | | private Date gainTime; |
| | | |
| | | /** |
| | | * 到期时间 |
| | | */ |
| | | |
| | | |
| | | private Date validiteTime; |
| | | |
| | | /** |
| | | * 有效状态(1:有效 2:无效) |
| | | */ |
| | | |
| | | |
| | | private Integer state; |
| | | |
| | | /** |
| | | * 原始单据ID |
| | | */ |
| | | |
| | | |
| | | private Long businessId; |
| | | |
| | | /** |
| | | * 所属公司_id |
| | | */ |
| | | |
| | | |
| | | private Long companyId; |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.score.mapper; |
| | | |
| | | /** |
| | | * @author wzy |
| | | * @date 2021-02-22 |
| | | **/ |
| | | public class ScoreRuleSettingMapper { |
| | | } |
New file |
| | |
| | | package com.matrix.system.score.scheduledJob; |
| | | |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.score.dao.ScoreUseRecordDao; |
| | | import com.matrix.system.score.dao.ScoreVipDetailDao; |
| | | import com.matrix.system.score.entity.ScoreUseRecord; |
| | | import com.matrix.system.score.entity.ScoreVipDetail; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 用户积分相关定时任务 |
| | | * |
| | | * @author jyy |
| | | */ |
| | | @Component |
| | | public class ScoreScheduledJob { |
| | | |
| | | |
| | | @Autowired |
| | | ScoreVipDetailDao scoreVipDetailDao; |
| | | |
| | | @Autowired |
| | | ScoreUseRecordDao scoreUseRecordDao; |
| | | |
| | | @Scheduled(cron = "1 0 0 1/1 * ?") |
| | | public boolean invalidVipScore() { |
| | | |
| | | LogUtil.info("计算无效积分定时任务开始运行****************"); |
| | | |
| | | //获取所有失效的积分,生成失效记录 |
| | | List<ScoreVipDetail> invalidavipScoreList = scoreVipDetailDao.selectInvalidaVipScore(); |
| | | |
| | | for (ScoreVipDetail scoreVipDetail : invalidavipScoreList) { |
| | | ScoreUseRecord scoreUseRecord=new ScoreUseRecord(); |
| | | scoreUseRecord.setCreateBy(AppConstance.SYSTEM_USER); |
| | | scoreUseRecord.setUpdateBy(AppConstance.SYSTEM_USER); |
| | | scoreUseRecord.setCreateTime(DateTime.now()); |
| | | scoreUseRecord.setUpdateTime(DateTime.now()); |
| | | scoreUseRecord.setNowScore(0); |
| | | scoreUseRecord.setCompanyId(scoreVipDetail.getCompanyId()); |
| | | scoreUseRecord.setScoreVipDetailId(scoreVipDetail.getId()); |
| | | scoreUseRecord.setBusinessId(0L); |
| | | scoreUseRecord.setRecNum(-scoreVipDetail.getRemainScore()); |
| | | scoreUseRecord.setType(ScoreVipDetail.SCORE_OVER_TIME); |
| | | scoreUseRecord.setVipId(scoreVipDetail.getVipId()); |
| | | scoreUseRecord.setPreScore(scoreVipDetail.getRemainScore()); |
| | | scoreUseRecord.setRemarks("积分失效"); |
| | | scoreUseRecordDao.insert(scoreUseRecord); |
| | | } |
| | | //更新失效积分记录状态 |
| | | scoreVipDetailDao.invalidVipScore(); |
| | | LogUtil.info("计算无效积分定时任务结束*******************"); |
| | | return true; |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.score.service; |
| | | |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.common.bean.BusParameterSettings; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author wzy |
| | | * @date 2021-02-22 |
| | | **/ |
| | | @Service |
| | | public class ScoreRuleSettingService{ |
| | | |
| | | @Autowired |
| | | private BusParameterSettingsDao busParameterSettingsDao; |
| | | @Autowired |
| | | private SysVipInfoDao sysVipInfoDao; |
| | | |
| | | public AjaxResult updateScoreRuleByCompanyId(List<BusParameterSettings> busParameterSettings) { |
| | | //获取当前登录人员信息 |
| | | SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | for (BusParameterSettings busParameterSetting:busParameterSettings ) { |
| | | String paramCode = busParameterSetting.getParamCode(); |
| | | if(StringUtils.isNotBlank(paramCode)){ |
| | | //删除原有code |
| | | BusParameterSettings delParanm=new BusParameterSettings(); |
| | | delParanm.setCompanyId(user.getCompanyId()); |
| | | delParanm.setParamCode(paramCode); |
| | | busParameterSettingsDao.deleteByModel(delParanm); |
| | | //添加新的code |
| | | BusParameterSettings newParam=new BusParameterSettings(); |
| | | newParam.setParamCode(paramCode); |
| | | newParam.setCompanyId(user.getCompanyId()); |
| | | newParam.setParamValue(busParameterSetting.getParamValue()); |
| | | newParam.setParamValue1(busParameterSetting.getParamValue1()); |
| | | newParam.setParamValue2(busParameterSetting.getParamValue2()); |
| | | busParameterSettingsDao.insert(newParam); |
| | | }else{ |
| | | return AjaxResult.buildFailInstance("code不能为空"); |
| | | } |
| | | } |
| | | AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, "更新成功"); |
| | | return result; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.score.service; |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.tools.DateUtil; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.system.common.bean.BusParameterSettings; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.common.dao.SysUsersDao; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import com.matrix.system.score.constant.ScoreSettingConstant; |
| | | import com.matrix.system.score.dao.ScoreUseRecordDao; |
| | | import com.matrix.system.score.dao.ScoreVipDetailDao; |
| | | import com.matrix.system.score.entity.ScoreUseRecord; |
| | | import com.matrix.system.score.entity.ScoreVipDetail; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author jyy |
| | | * @description 客户积分余额 |
| | | * @date 2021-02-26 15:26 |
| | | */ |
| | | @Service |
| | | public class ScoreVipDetailService extends ServiceImpl<ScoreVipDetailDao, ScoreVipDetail> { |
| | | |
| | | @Autowired |
| | | ScoreVipDetailDao scoreVipDetailDao; |
| | | |
| | | @Autowired |
| | | ScoreUseRecordDao scoreUseRecordDao; |
| | | |
| | | @Autowired |
| | | SysVipInfoDao sysVipInfoDao; |
| | | |
| | | @Autowired |
| | | SysVipInfoDao vipInfoDao; |
| | | |
| | | @Autowired |
| | | SysUsersDao sysUsersDao; |
| | | |
| | | @Autowired |
| | | BusParameterSettingsDao busParameterSettingsDao; |
| | | |
| | | /** |
| | | * 扣除用户积分 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void deductionScore(Long vipId, Long oprationUserId, Long shopId, Integer score, Long businessId, int type, String remark) { |
| | | Long companyId = vipInfoDao.selectById(vipId).getCompanyId(); |
| | | |
| | | String createBy = MatrixConstance.SYSTEM_USER; |
| | | if (oprationUserId != null) { |
| | | createBy = sysUsersDao.selectById(oprationUserId).getSuName(); |
| | | } |
| | | |
| | | List<ScoreVipDetail> effectiveScoreList = scoreVipDetailDao.selectEffectiveScore(vipId); |
| | | |
| | | for (ScoreVipDetail scoreVipDetail : effectiveScoreList) { |
| | | |
| | | ScoreUseRecord scoreUseRecord = new ScoreUseRecord(); |
| | | scoreUseRecord.setPreScore(scoreVipDetail.getRemainScore()); |
| | | |
| | | int surplus = scoreVipDetail.getRemainScore() - score; |
| | | int currentDedution = 0; |
| | | if (surplus > 0 || surplus == 0) { |
| | | //余额充足 |
| | | currentDedution = score; |
| | | scoreVipDetail.setRemainScore(surplus); |
| | | if (surplus == 0) { |
| | | scoreVipDetail.setState(ScoreVipDetail.SCORE_STATUS_WX); |
| | | } |
| | | scoreVipDetailDao.updateById(scoreVipDetail); |
| | | score = 0; |
| | | } else { |
| | | currentDedution = scoreVipDetail.getRemainScore(); |
| | | scoreVipDetail.setState(ScoreVipDetail.SCORE_STATUS_WX); |
| | | scoreVipDetail.setRemainScore(0); |
| | | scoreVipDetailDao.updateById(scoreVipDetail); |
| | | score = Math.abs(surplus); |
| | | } |
| | | |
| | | |
| | | //新增扣除记录 |
| | | scoreUseRecord.setCreateBy(createBy); |
| | | scoreUseRecord.setUpdateBy(createBy); |
| | | scoreUseRecord.setCreateTime(DateTime.now()); |
| | | scoreUseRecord.setUpdateTime(DateTime.now()); |
| | | scoreUseRecord.setNowScore(scoreVipDetail.getRemainScore()); |
| | | scoreUseRecord.setCompanyId(companyId); |
| | | scoreUseRecord.setScoreVipDetailId(scoreVipDetail.getId()); |
| | | scoreUseRecord.setBusinessId(businessId); |
| | | scoreUseRecord.setRecNum(-currentDedution); |
| | | scoreUseRecord.setType(type); |
| | | scoreUseRecord.setShopId(shopId); |
| | | scoreUseRecord.setVipId(vipId); |
| | | scoreUseRecord.setRemarks(remark); |
| | | scoreUseRecord.setOprationUserId(oprationUserId); |
| | | scoreUseRecordDao.insert(scoreUseRecord); |
| | | |
| | | if (surplus > 0 || surplus == 0) { |
| | | break; |
| | | } |
| | | } |
| | | if (score > 0) { |
| | | throw new GlobleException("积分不足"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 新增用户积分 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void addScore(Long vipId, Long oprationUserId, Long shopId, Integer score, Long businessId, int type, String remark) { |
| | | Long companyId = vipInfoDao.selectById(vipId).getCompanyId(); |
| | | |
| | | if (score < 0) { |
| | | throw new IllegalArgumentException("score必须有为大于零的数"); |
| | | } |
| | | |
| | | String createBy = MatrixConstance.SYSTEM_USER; |
| | | if (oprationUserId != null) { |
| | | createBy = sysUsersDao.selectById(oprationUserId).getSuName(); |
| | | } |
| | | |
| | | //计算过期时间 |
| | | BusParameterSettings yxqSetting = busParameterSettingsDao.selectCompanyParamByCode(ScoreSettingConstant.VALID_PERIOD_POINTS, companyId); |
| | | Calendar cal = Calendar.getInstance(); |
| | | int year = cal.get(Calendar.YEAR); |
| | | int sxYear = year + (Integer.parseInt(yxqSetting.getParamValue()) - 1); |
| | | Date sxys = DateUtil.stringToDate(sxYear + "-12-31 23:59", DateUtil.DATE_FORMAT_MM); |
| | | |
| | | ScoreVipDetail scoreVipDetail = new ScoreVipDetail(); |
| | | |
| | | scoreVipDetail.setCreateBy(createBy); |
| | | scoreVipDetail.setUpdateBy(createBy); |
| | | scoreVipDetail.setCreateTime(DateTime.now()); |
| | | scoreVipDetail.setUpdateTime(DateTime.now()); |
| | | scoreVipDetail.setState(ScoreVipDetail.SCORE_STATUS_YX); |
| | | scoreVipDetail.setRemainScore(score); |
| | | scoreVipDetail.setUsedScore(0); |
| | | scoreVipDetail.setBusinessId(businessId); |
| | | scoreVipDetail.setValiditeTime(sxys); |
| | | scoreVipDetail.setVipId(vipId); |
| | | scoreVipDetail.setGainTime(DateTime.now()); |
| | | scoreVipDetail.setAllScore(score); |
| | | scoreVipDetail.setType(type); |
| | | scoreVipDetail.setCompanyId(companyId); |
| | | scoreVipDetailDao.insert(scoreVipDetail); |
| | | |
| | | //新增添加记录 |
| | | ScoreUseRecord scoreUseRecord = new ScoreUseRecord(); |
| | | scoreUseRecord.setPreScore(score); |
| | | scoreUseRecord.setCreateBy(createBy); |
| | | scoreUseRecord.setUpdateBy(createBy); |
| | | scoreUseRecord.setCreateTime(DateTime.now()); |
| | | scoreUseRecord.setUpdateTime(DateTime.now()); |
| | | scoreUseRecord.setNowScore(score); |
| | | scoreUseRecord.setCompanyId(companyId); |
| | | scoreUseRecord.setScoreVipDetailId(scoreVipDetail.getId()); |
| | | scoreUseRecord.setBusinessId(businessId); |
| | | scoreUseRecord.setRecNum(score); |
| | | scoreUseRecord.setType(type); |
| | | scoreUseRecord.setVipId(vipId); |
| | | scoreUseRecord.setShopId(shopId); |
| | | scoreUseRecord.setOprationUserId(oprationUserId); |
| | | scoreUseRecord.setRemarks(remark); |
| | | scoreUseRecordDao.insert(scoreUseRecord); |
| | | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 根据固定等级规则新增用户积分 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void addScoreByParamSetting(Long vipId, Long oprationUserId, Long shopId, Long businessId, int type, String remark, BusParameterSettings parameterSetting) { |
| | | |
| | | if (parameterSetting != null) { |
| | | SysVipInfo vipInfo = sysVipInfoDao.selectById(vipId); |
| | | //添加自己的积分 |
| | | if (StringUtils.isNotBlank(parameterSetting.getParamValue())) { |
| | | Integer firstScore = new Integer(parameterSetting.getParamValue()); |
| | | if (firstScore > 0) { |
| | | addScore( |
| | | vipInfo.getId(), |
| | | oprationUserId, |
| | | shopId, |
| | | firstScore, |
| | | businessId, |
| | | type, |
| | | remark |
| | | ); |
| | | } |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(parameterSetting.getParamValue1()) |
| | | && vipInfo.getRecommendId() != null) { |
| | | //推荐注册老带新积分奖励 |
| | | SysVipInfo referrerVip = sysVipInfoDao.selectById(vipInfo.getRecommendId()); |
| | | Integer secondScore = new Integer(parameterSetting.getParamValue1()); |
| | | if (secondScore > 0) { |
| | | addScore( |
| | | referrerVip.getId(), |
| | | oprationUserId, |
| | | shopId, |
| | | secondScore, |
| | | businessId, |
| | | type, |
| | | remark |
| | | ); |
| | | } |
| | | //推荐注册二级带新积分奖励 |
| | | if (StringUtils.isNotBlank(parameterSetting.getParamValue2()) |
| | | && referrerVip.getRecommendId() != null) { |
| | | Integer threeScore = new Integer(parameterSetting.getParamValue2()); |
| | | if (threeScore > 0) { |
| | | addScore( |
| | | referrerVip.getRecommendId(), |
| | | oprationUserId, |
| | | shopId, |
| | | threeScore, |
| | | businessId, |
| | | type, |
| | | remark |
| | | ); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 退积分 |
| | | */ |
| | | public void refundScore(Long vipId, Integer score, Long oldBusinessId, int type) { |
| | | |
| | | Long companyId = vipInfoDao.selectById(vipId).getCompanyId(); |
| | | |
| | | if (score < 0) { |
| | | throw new IllegalArgumentException("score必须有为大于零的数"); |
| | | } |
| | | //查询原始使用记录 |
| | | QueryWrapper queryWrapper = new QueryWrapper(); |
| | | queryWrapper.eq("business_id", oldBusinessId); |
| | | queryWrapper.eq("company_id", companyId); |
| | | queryWrapper.eq("type", type); |
| | | List<ScoreUseRecord> scoreUseRecordList = scoreUseRecordDao.selectList(queryWrapper); |
| | | scoreUseRecordList.forEach(scoreUseRecord -> { |
| | | ScoreVipDetail scoreVipDetail = scoreVipDetailDao.selectById(scoreUseRecord.getScoreVipDetailId()); |
| | | if (scoreVipDetail != null) { |
| | | if (DateTime.now().isAfter(scoreVipDetail.getValiditeTime())) { |
| | | //积分还有效 |
| | | scoreVipDetail.setRemainScore(scoreVipDetail.getRemainScore() + score); |
| | | scoreVipDetail.setUsedScore(scoreVipDetail.getUsedScore() - score); |
| | | scoreVipDetail.setState(ScoreVipDetail.SCORE_STATUS_YX); |
| | | scoreVipDetailDao.updateById(scoreVipDetail); |
| | | scoreUseRecordDao.deleteById(scoreUseRecord.getId()); |
| | | } |
| | | } |
| | | |
| | | }); |
| | | } |
| | | |
| | | public void removeByBusinessId(Long vipId, Long oldBusinessId) { |
| | | Long companyId = vipInfoDao.selectById(vipId).getCompanyId(); |
| | | |
| | | if (oldBusinessId == null) { |
| | | throw new IllegalArgumentException("oldBusinessId必须有"); |
| | | } |
| | | QueryWrapper queryWrapper = new QueryWrapper(); |
| | | queryWrapper.eq("business_id", oldBusinessId); |
| | | queryWrapper.eq("company_id", companyId); |
| | | scoreVipDetailDao.delete(queryWrapper); |
| | | scoreUseRecordDao.delete(queryWrapper); |
| | | } |
| | | } |
New file |
| | |
| | | package com.matrix.system.score.vo;
|
| | |
|
| | | import com.matrix.core.anotations.Extend;
|
| | |
|
| | | public class ScoreRuleSettingsVo {
|
| | | @Extend
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | |
|
| | | private Long paramId;
|
| | | /**
|
| | | * 参数名称
|
| | | */
|
| | | private String paramName;
|
| | | /**
|
| | | * 参数编码
|
| | | */
|
| | | private String paramCode;
|
| | |
|
| | | /**
|
| | | * switch按钮
|
| | | */
|
| | | private Boolean paramSwitch;
|
| | |
|
| | |
|
| | | /**
|
| | | * 参数值
|
| | | */
|
| | | private String paramValue;
|
| | |
|
| | |
|
| | | /**
|
| | | * 值1
|
| | | */
|
| | | private String paramValue1;
|
| | |
|
| | |
|
| | | /**
|
| | | * 值2
|
| | | */
|
| | | private String paramValue2;
|
| | |
|
| | |
|
| | | /**
|
| | | * 值3
|
| | | */
|
| | | private String paramValue3;
|
| | |
|
| | | private Long companyId;
|
| | |
|
| | | private Long shopId;
|
| | |
|
| | |
|
| | | public Long getShopId() {
|
| | | return shopId;
|
| | | }
|
| | |
|
| | | public void setShopId(Long shopId) {
|
| | | this.shopId = shopId;
|
| | | }
|
| | |
|
| | | public Long getCompanyId() {
|
| | | return companyId;
|
| | | }
|
| | |
|
| | | public void setCompanyId(Long companyId) {
|
| | | this.companyId = companyId;
|
| | | }
|
| | |
|
| | | public Long getParamId() {
|
| | | return paramId;
|
| | | }
|
| | |
|
| | | public void setParamId(Long paramId) {
|
| | | this.paramId = paramId;
|
| | | }
|
| | |
|
| | |
|
| | | public String getParamCode() {
|
| | | return paramCode;
|
| | | }
|
| | |
|
| | | public void setParamCode(String paramCode) {
|
| | | this.paramCode = paramCode;
|
| | | }
|
| | |
|
| | |
|
| | | public String getParamValue() {
|
| | | return paramValue;
|
| | | }
|
| | |
|
| | | public void setParamValue(String paramValue) {
|
| | | this.paramValue = paramValue;
|
| | | }
|
| | |
|
| | |
|
| | | public String getParamValue1() {
|
| | | return paramValue1;
|
| | | }
|
| | |
|
| | | public void setParamValue1(String paramValue1) {
|
| | | this.paramValue1 = paramValue1;
|
| | | }
|
| | |
|
| | |
|
| | | public String getParamValue2() {
|
| | | return paramValue2;
|
| | | }
|
| | |
|
| | | public void setParamValue2(String paramValue2) {
|
| | | this.paramValue2 = paramValue2;
|
| | | }
|
| | |
|
| | |
|
| | | public String getParamValue3() {
|
| | | return paramValue3;
|
| | | }
|
| | |
|
| | | public void setParamValue3(String paramValue3) {
|
| | | this.paramValue3 = paramValue3;
|
| | | }
|
| | |
|
| | | public String getParamName() {
|
| | | return paramName;
|
| | | }
|
| | |
|
| | | public void setParamName(String paramName) {
|
| | | this.paramName = paramName;
|
| | | }
|
| | |
|
| | | public Boolean getParamSwitch() {
|
| | | return paramSwitch;
|
| | | }
|
| | |
|
| | | public void setParamSwitch(Boolean paramSwitch) {
|
| | | this.paramSwitch = paramSwitch;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | package com.matrix.system.shopXcx.action; |
| | | |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.constance.SystemMessageCode; |
| | | import com.matrix.core.pojo.PaginationVO; |
| | | import com.matrix.core.tools.*; |
| | | import com.matrix.core.web.BaseAction; |
| | | import com.matrix.core.constance.SystemErrorCode; |
| | | import com.matrix.core.anotations.RemoveRequestToken; |
| | | import com.matrix.core.anotations.SaveRequestToken; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.constance.SystemErrorCode; |
| | | import com.matrix.core.constance.SystemMessageCode; |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.pojo.PaginationVO; |
| | | import com.matrix.core.tools.DateUtil; |
| | | import com.matrix.core.tools.ModelUtils; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.hive.plugin.util.CollectionUtils; |
| | | import com.matrix.system.shopXcx.bean.*; |
| | | import com.matrix.system.shopXcx.dao.*; |
| | | import com.matrix.system.shopXcx.dto.SalonDTO; |
| | | import com.matrix.system.shopXcx.dto.SecKillDTO; |
| | | import org.springframework.stereotype.Controller; |
| | | import com.matrix.core.exception.GlobleException; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.matrix.core.anotations.SaveRequestToken; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Arrays; |
| | | import java.util.Comparator; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | |
| | | shopActivitiesDao.deleteById(actId); |
| | | shopActivitiesGroupInfoDao.deleteByActId(actId); |
| | | int i = shopActivitiesGroupPriceDao.deleteByActId(actId); |
| | | |
| | | if (i > 0) { |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, SystemMessageCode.DELETE_SUCCES, i); |
| | | } else { |
| | | throw new GlobleException(SystemErrorCode.DATA_DELETE_FAIL); |
| | | } |
| | | shopActivitiesGroupPriceDao.deleteByActId(actId); |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, SystemMessageCode.DELETE_SUCCES); |
| | | } |
| | | |
| | | @RequestMapping(value = "/closeAct") |
| | |
| | | package com.matrix.system.shopXcx.action; |
| | | |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.biz.service.BizUserService; |
| | | import com.matrix.core.anotations.RemoveRequestToken; |
| | | import com.matrix.core.anotations.SaveRequestToken; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.shopXcx.bean.ShopScoreExchange; |
| | | import com.matrix.system.hive.service.SysVipInfoService; |
| | | import com.matrix.system.shopXcx.dao.ShopScoreExchangeDao; |
| | | import com.matrix.system.shopXcx.pojo.ExchangeScorePOJO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | |
| | | public class ShopBizUserScoreAction { |
| | | |
| | | @Autowired |
| | | private BizUserService bizUserService; |
| | | private SysVipInfoService sysVipInfoService; |
| | | @Autowired |
| | | private ShopScoreExchangeDao shopScoreExchangeDao; |
| | | |
| | |
| | | * 记录编辑前的值Before_Edit_Value |
| | | */ |
| | | public static final String BEV = "ShopBizUserScore_BEV"; |
| | | |
| | | |
| | | /** |
| | | * 进入积分兑换界面 |
| | | */ |
| | | @SaveRequestToken |
| | | @RequestMapping(value = "/intoExchangePage") |
| | | public ModelAndView exchangeScore(String userId) { |
| | | BizUser bizUser = new BizUser(); |
| | | ModelAndView modelAndView = new ModelAndView("admin/shop/user-score-exchange"); |
| | | if (StringUtils.isNotBlank(userId)) { |
| | | bizUser = bizUserService.findById(userId); |
| | | if (bizUser.getCurrentScore() == null) { |
| | | bizUser.setCurrentScore(0); |
| | | } |
| | | } |
| | | modelAndView.addObject("obj", bizUser); |
| | | return modelAndView; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 兑换积分 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @RemoveRequestToken |
| | | @RequestMapping(value = "/exchangeScore") |
| | | public @ResponseBody |
| | | AjaxResult exchangeScore(ExchangeScorePOJO pojo) { |
| | | //校验参数中用户ID和用户兑换积分是否有效 |
| | | if (pojo == null || StringUtils.isBlank(pojo.getUserId()) |
| | | || pojo.getScore() == null || pojo.getScore() == 0) { |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "提交参数有误!"); |
| | | } |
| | | //兑换积分用户信息 |
| | | BizUser bizUser = bizUserService.findById(pojo.getUserId()); |
| | | if (bizUser == null) { |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "没有查询到相应用户!"); |
| | | } |
| | | if (bizUser.getCurrentScore() == null) { |
| | | bizUser.setCurrentScore(0); |
| | | } |
| | | //如果兑换积分大于用户当前积分 |
| | | if (pojo.getScore() > bizUser.getCurrentScore()) { |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "兑换积分大于用户当前积分!"); |
| | | } |
| | | //剩余积分 = 当前积分 - 兑换积分 |
| | | Integer remainScore = bizUser.getCurrentScore() - pojo.getScore(); |
| | | //当前操作用户信息 |
| | | SysUsers loginUser = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | //修改用户剩余积分 |
| | | BizUser updateModel = new BizUser(); |
| | | updateModel.setUserId(bizUser.getUserId()); |
| | | updateModel.setCurrentScore(remainScore); |
| | | updateModel.setUpdateBy(loginUser.getSuName()); |
| | | updateModel.setUpdateTime(new Date()); |
| | | bizUserService.modifyByModel(updateModel); |
| | | //添加积分兑换记录 |
| | | ShopScoreExchange insertExchange = new ShopScoreExchange(); |
| | | insertExchange.setCreateBy(loginUser.getSuName()); |
| | | insertExchange.setUpdateBy(loginUser.getSuName()); |
| | | insertExchange.setUserId(bizUser.getOpenId()); |
| | | insertExchange.setExchangeScore(pojo.getScore()); |
| | | insertExchange.setOperateId(loginUser.getSuId()); |
| | | insertExchange.setRemark(pojo.getRemarks()); |
| | | shopScoreExchangeDao.insert(insertExchange); |
| | | |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, "兑换成功!"); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import com.matrix.core.tools.ModelUtils; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.common.bean.CustomerDataDictionary; |
| | | import com.matrix.system.common.bean.SystemDictionary; |
| | | import com.matrix.system.common.dao.CustomerDataDictionaryDao; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.bean.SystemDictionary; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.common.dao.CustomerDataDictionaryDao; |
| | | import com.matrix.system.common.dao.SystemDictionaryDao; |
| | | import com.matrix.system.constance.Dictionary; |
| | | import com.matrix.system.hive.action.BaseController; |
| | | import com.matrix.system.shopXcx.api.tools.WxShopOrderUtil; |
| | | import com.matrix.system.shopXcx.bean.ShopDeliveryInfo; |
| | | import com.matrix.system.shopXcx.bean.ShopOrder; |
| | | import com.matrix.system.shopXcx.dao.ShopDeliveryInfoDao; |
| | | import com.matrix.system.shopXcx.dao.ShopLogisticsInfoDao; |
| | | import com.matrix.system.shopXcx.dao.ShopOrderDao; |
| | | import com.matrix.system.shopXcx.api.tools.WxShopOrderUtil; |
| | | import com.matrix.system.shopXcx.mqTask.MQTaskRouting; |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | pageVo.setSort("create_time"); |
| | | pageVo.setOrder("desc"); |
| | | shopDeliveryInfo.setCompanyId(sysUsers.getCompanyId()); |
| | | if (getMe().getShopRole().equals(Dictionary.FLAG_NO_N)) { |
| | | shopDeliveryInfo.setShopId(sysUsers.getShopId()); |
| | | } |
| | | |
| | | |
| | | List<ShopDeliveryInfo> dataList = shopDeliveryInfoDao.selectInPage(shopDeliveryInfo, pageVo); |
| | | AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, dataList, |
| | | shopDeliveryInfoDao.selectTotalRecord(shopDeliveryInfo)); |
| | |
| | | package com.matrix.system.shopXcx.action; |
| | | |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.google.gson.Gson; |
| | | import com.matrix.component.rabbitmq.RabiitMqTemplate; |
| | | import com.matrix.core.anotations.RemoveRequestToken; |
| | | import com.matrix.core.anotations.SaveRequestToken; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | |
| | | import com.matrix.core.tools.excl.ExcelVersion; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.constance.Dictionary; |
| | | import com.matrix.system.hive.action.BaseController; |
| | | import com.matrix.system.hive.action.util.QueryUtil; |
| | | import com.matrix.system.hive.bean.SysShopInfo; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.dao.SysShopInfoDao; |
| | | import com.matrix.system.hive.service.SysVipInfoService; |
| | | import com.matrix.system.shopXcx.bean.*; |
| | | import com.matrix.system.shopXcx.dao.*; |
| | | import com.matrix.system.shopXcx.dto.DiscountExplain; |
| | | import com.matrix.system.shopXcx.mqTask.MQTaskRouting; |
| | | import com.matrix.system.shopXcx.pojo.ShopOrderQueryPOJO; |
| | | import com.matrix.system.shopXcx.shopEnum.OrderStatusEnum; |
| | | import com.matrix.system.shopXcx.vo.LogisticsImportVo; |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.io.OutputStream; |
| | | import java.math.BigDecimal; |
| | |
| | | private WxApplyOrderRelateDao wxApplyOrderRelateDao; |
| | | @Autowired |
| | | private SysShopInfoDao sysShopInfoDao; |
| | | @Autowired |
| | | private SysVipInfoService vipInfoService; |
| | | @Autowired |
| | | private RabiitMqTemplate rabiitMqTemplate; |
| | | |
| | | //记录编辑前的值Before_Edit_Value |
| | | public static final String BEV = "ShopOrder_BEV"; |
| | | |
| | | public static final List<LogisticsImportVo> logisticsImportVoLists = new ArrayList<>(); |
| | | |
| | | @Value("${evn}") |
| | | private String evn; |
| | | |
| | | /** |
| | | * 导入快递单 |
| | | */ |
| | | @RequestMapping(value = "/logisticsImport") |
| | | @ResponseBody |
| | | public AjaxResult logisticsImport(HttpServletResponse response, HttpServletRequest request, |
| | | @RequestParam(value = "file", required = false) MultipartFile file) throws IOException { |
| | | |
| | | String fileName = file.getOriginalFilename(); |
| | | String dirPath = PropertiesUtil.getString(AppConstance.FILES_TORAGE_PATH); |
| | | // String dirPath = "E:/xcshop"; |
| | | File fileDir = new File(dirPath); |
| | | LogUtil.info("#----->{}#", fileDir.exists()); |
| | | if (!fileDir.exists()) { |
| | | fileDir.mkdirs(); |
| | | } |
| | | File saveFile = new File(dirPath + "/" + fileName); |
| | | file.transferTo(saveFile); |
| | | |
| | | String infoRemind = "提示:"; |
| | | AjaxResult ajaxResult = new AjaxResult(); |
| | | List<LogisticsImportVo> logisticsImportVos = logisticsImportFile(saveFile); |
| | | if(CollUtil.isNotEmpty(logisticsImportVos)){ |
| | | ajaxResult = AjaxResult.buildSuccessInstance("部分数据导入失败"); |
| | | ajaxResult.setStatus(AjaxResult.STATUS_FAIL); |
| | | }else{ |
| | | ajaxResult = AjaxResult.buildSuccessInstance("导入成功"); |
| | | ajaxResult.setStatus(AjaxResult.STATUS_SUCCESS); |
| | | } |
| | | return ajaxResult; |
| | | } |
| | | |
| | | @RequestMapping(value = "/exportLogisticsImportExcel") |
| | | public void exportLogisticsImportExcel(HttpServletResponse res) { |
| | | OutputStream os = null; |
| | | try { |
| | | res.setCharacterEncoding("UTF-8"); |
| | | res.setHeader("content-type", "application/octet-stream;charset=UTF-8"); |
| | | res.setContentType("application/octet-stream;charset=UTF-8"); |
| | | Date date = new Date(); |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日HH时mm分ss"); |
| | | res.setHeader("Content-Disposition", "attachment;filename=" + |
| | | java.net.URLEncoder.encode("快递单导入列表" + dateFormat.format(date) + ".xls".trim(), "UTF-8")); |
| | | |
| | | os = res.getOutputStream(); |
| | | ExcelUtil.createWorkbookAtOutStream(ExcelVersion.V2007, disPoseLogisticsImportExcel(logisticsImportVoLists), os, true); |
| | | logisticsImportVoLists.clear(); |
| | | } catch (Exception e) { |
| | | LogUtil.error("快递单导入异常", e); |
| | | } finally { |
| | | if (os != null) { |
| | | try { |
| | | os.close(); |
| | | } catch (IOException e) { |
| | | LogUtil.error("关闭资源异常", e); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | private List<ExcelSheetPO> disPoseLogisticsImportExcel(List<LogisticsImportVo> logisticsImportVos) { |
| | | List<ExcelSheetPO> res = new ArrayList<>(); |
| | | ExcelSheetPO orderSheet = new ExcelSheetPO(); |
| | | orderSheet.setSheetName("快递单导入"); |
| | | orderSheet.setTitle("快递单导入失败列表"); |
| | | String[] header = new String[]{"订单编号", "物流公司编码", "物流公司名称", "快递单号", "失败原因"}; |
| | | orderSheet.setHeaders(header); |
| | | List<List<Object>> body = new ArrayList<>(); |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss"); |
| | | if(CollUtil.isNotEmpty(logisticsImportVos)){ |
| | | for (LogisticsImportVo logisticsImportVo : logisticsImportVos) { |
| | | List<Object> bodyItem = new ArrayList<>(); |
| | | bodyItem.add(logisticsImportVo.getOrderNo()); |
| | | bodyItem.add(logisticsImportVo.getLogisticsCompanyCode()); |
| | | bodyItem.add(logisticsImportVo.getLogisticsCompany()); |
| | | bodyItem.add(logisticsImportVo.getWaybillNo()); |
| | | bodyItem.add(logisticsImportVo.getFailReason()); |
| | | body.add(bodyItem); |
| | | } |
| | | } |
| | | orderSheet.setDataList(body); |
| | | res.add(orderSheet); |
| | | return res; |
| | | } |
| | | |
| | | public List<LogisticsImportVo> logisticsImportFile(File file) throws IOException { |
| | | SysUsers sysUsers = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | List<ExcelSheetPO> excelList = ExcelUtil.readExcel(file, null,null); |
| | | ArrayList<LogisticsImportVo> logisticsImportVos = new ArrayList<>(); |
| | | for (int i = 0; i < excelList.size(); i++) { |
| | | List<List<Object>> dataList = excelList.get(i).getDataList(); |
| | | List<SysVipInfo> vipInfos = new ArrayList<>(); |
| | | if (CollectionUtils.isNotEmpty(dataList)) { |
| | | for (int j = 1; j < dataList.size(); j++) { |
| | | /** |
| | | * 订单处于【待付款】【待配送】【待收货】都可以导入 |
| | | * 其他状态生成一个提示 |
| | | */ |
| | | |
| | | LogisticsImportVo logisticsImportVo = new LogisticsImportVo(); |
| | | List<Object> objects = dataList.get(j); |
| | | //订单编号 |
| | | String orderNo = objects.get(0).toString(); |
| | | ShopOrder shopOrder = shopOrderDao.selectShopOrderByOrderNo(orderNo); |
| | | if(ObjectUtil.isNotEmpty(shopOrder) && |
| | | (shopOrder.getOrderStatus() == ShopOrder.ORDER_STATUS_WAIT_SEND || |
| | | shopOrder.getOrderStatus() == ShopOrder.ORDER_STATUS_WAIT_RECEIVE )){ |
| | | //物流公司编码 |
| | | String logisticsCompanyCode = objects.get(1).toString(); |
| | | //物流公司名称 |
| | | String logisticsCompany = objects.get(2).toString(); |
| | | //快递单号 |
| | | String waybillNo = objects.get(3).toString(); |
| | | |
| | | ShopDeliveryInfo shopDeliveryInfo = new ShopDeliveryInfo(); |
| | | shopDeliveryInfo.setOrderId(shopOrder.getId()); |
| | | List<ShopDeliveryInfo> infoList = shopDeliveryInfoDao.selectByModel(shopDeliveryInfo); |
| | | if (CollectionUtils.isEmpty(infoList)) { |
| | | logisticsImportVo.setOrderNo(objects.get(0).toString()); |
| | | logisticsImportVo.setLogisticsCompanyCode(objects.get(1).toString()); |
| | | logisticsImportVo.setLogisticsCompany(objects.get(2).toString()); |
| | | logisticsImportVo.setWaybillNo(objects.get(3).toString()); |
| | | logisticsImportVo.setFailReason("未找到发货信息"); |
| | | logisticsImportVos.add(logisticsImportVo); |
| | | logisticsImportVoLists.add(logisticsImportVo); |
| | | }else{ |
| | | shopDeliveryInfo = infoList.get(0); |
| | | shopDeliveryInfo.setOrderNo(orderNo); |
| | | shopDeliveryInfo.setLogisticsCompanyCode(logisticsCompanyCode); |
| | | shopDeliveryInfo.setLogisticsCompany(logisticsCompany); |
| | | shopDeliveryInfo.setWaybillNo(waybillNo); |
| | | shopDeliveryInfo.setUpdateBy(sysUsers.getSuName()); |
| | | shopDeliveryInfo.setLogisticsStatus(AppConstance.LOGISTICS_STATUS_OF_RECEIVE); |
| | | shopDeliveryInfo.setDeliveryTime(new Date()); |
| | | shopDeliveryInfoDao.updateByModel(shopDeliveryInfo); |
| | | |
| | | //构建需要修改订单信息Map |
| | | Map<String, Object> modifyMap = new HashMap<>(); |
| | | modifyMap.put("id", shopOrder.getId()); |
| | | modifyMap.put("orderStatus", ShopOrder.ORDER_STATUS_WAIT_RECEIVE); |
| | | shopOrderDao.updateByMap(modifyMap); |
| | | |
| | | //发送创建订单的消息 |
| | | rabiitMqTemplate.sendMsg(MQTaskRouting.ORDER_OUT_SOTORE+evn, orderNo); |
| | | } |
| | | }else{ |
| | | if(ObjectUtil.isEmpty(shopOrder)){ |
| | | logisticsImportVo.setOrderNo(objects.get(0).toString()); |
| | | logisticsImportVo.setLogisticsCompanyCode(objects.get(1).toString()); |
| | | logisticsImportVo.setLogisticsCompany(objects.get(2).toString()); |
| | | logisticsImportVo.setWaybillNo(objects.get(3).toString()); |
| | | logisticsImportVo.setFailReason("未找到订单信息"); |
| | | logisticsImportVos.add(logisticsImportVo); |
| | | logisticsImportVoLists.add(logisticsImportVo); |
| | | }else if(shopOrder.getOrderStatus() != ShopOrder.ORDER_STATUS_WAIT_SEND || |
| | | shopOrder.getOrderStatus() != ShopOrder.ORDER_STATUS_WAIT_RECEIVE ){ |
| | | logisticsImportVo.setOrderNo(objects.get(0).toString()); |
| | | logisticsImportVo.setLogisticsCompanyCode(objects.get(1).toString()); |
| | | logisticsImportVo.setLogisticsCompany(objects.get(2).toString()); |
| | | logisticsImportVo.setWaybillNo(objects.get(3).toString()); |
| | | logisticsImportVo.setFailReason("订单状态不允许发货"); |
| | | logisticsImportVos.add(logisticsImportVo); |
| | | logisticsImportVoLists.add(logisticsImportVo); |
| | | }else{ |
| | | logisticsImportVo.setOrderNo(objects.get(0).toString()); |
| | | logisticsImportVo.setLogisticsCompanyCode(objects.get(1).toString()); |
| | | logisticsImportVo.setLogisticsCompany(objects.get(2).toString()); |
| | | logisticsImportVo.setWaybillNo(objects.get(3).toString()); |
| | | logisticsImportVo.setFailReason("导入失败"); |
| | | logisticsImportVos.add(logisticsImportVo); |
| | | logisticsImportVoLists.add(logisticsImportVo); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return logisticsImportVos; |
| | | } |
| | | |
| | | /** |
| | | * 导出Excel |
| | |
| | | ExcelSheetPO orderSheet = new ExcelSheetPO(); |
| | | orderSheet.setSheetName("订单列表"); |
| | | orderSheet.setTitle("订单列表"); |
| | | String[] header = new String[]{"订单编号", "客户姓名", "客户电话", "收货地址", "下单时间", "订单金额", |
| | | "优惠总金额", "优惠说明", "订单状态", "配送方式", "门店名称", "商品名称", "规格", "生产企业", "单价", "购买数量"}; |
| | | String[] header = new String[]{"订单编号", "客户姓名", "客户电话", "收货地址", "店铺名称","订单状态","下单时间", "购买商品","订单金额", |
| | | "优惠总金额", "配送方式"}; |
| | | orderSheet.setHeaders(header); |
| | | List<List<Object>> body = new ArrayList<>(); |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss"); |
| | |
| | | } else { |
| | | bodyItem.add(""); |
| | | } |
| | | //下单时间 |
| | | bodyItem.add(dateFormat.format(shopOrder.getOrderTime())); |
| | | //购买数量 |
| | | // bodyItem.add(shopOrder.getPurchaseQuantity()); |
| | | //订单金额 |
| | | bodyItem.add(shopOrder.getOrderMoney()); |
| | | //优惠总金额 |
| | | bodyItem.add(shopOrder.getDiscountAmount()); |
| | | //优惠说明 |
| | | bodyItem.add(shopOrder.getDiscountExplain()); |
| | | //店铺名称 |
| | | bodyItem.add(shopOrder.getStoreName()); |
| | | //订单状态 |
| | | bodyItem.add(OrderStatusEnum.getNameByCode(shopOrder.getOrderStatus())); |
| | | //配送方式 门店 |
| | | bodyItem.add("物流"); |
| | | bodyItem.add(""); |
| | | |
| | | //商品名称 |
| | | //下单时间 |
| | | bodyItem.add(dateFormat.format(shopOrder.getOrderTime())); |
| | | //购买商品 |
| | | ShopSku shopSku = shopOrderDetails.getShopSku(); |
| | | ShopProduct shopProduct = shopOrderDetails.getShopProduct(); |
| | | if (shopProduct == null) { |
| | | bodyItem.add(""); |
| | | } else { |
| | | bodyItem.add(shopProduct.getTitle()); |
| | | bodyItem.add(shopProduct.getTitle()+ "(" +shopSku.getName()+ ")*" + shopOrderDetails.getCount()); |
| | | } |
| | | //规格名称、生产企业、单价 |
| | | ShopSku shopSku = shopOrderDetails.getShopSku(); |
| | | if (shopSku == null) { |
| | | bodyItem.add(""); |
| | | bodyItem.add(shopOrderDetails.getProductionEnterprise()); |
| | | bodyItem.add(""); |
| | | } else { |
| | | bodyItem.add(shopSku.getName()); |
| | | bodyItem.add(shopOrderDetails.getProductionEnterprise()); |
| | | bodyItem.add(shopSku.getPrice()); |
| | | } |
| | | //购买数量 |
| | | bodyItem.add(shopOrderDetails.getCount()); |
| | | //订单金额 |
| | | bodyItem.add(shopOrder.getOrderMoney()); |
| | | //优惠总金额 |
| | | bodyItem.add(shopOrder.getDiscountAmount()); |
| | | //配送方式 门店 |
| | | bodyItem.add("物流"); |
| | | body.add(bodyItem); |
| | | } |
| | | } |
| | |
| | | |
| | | /** |
| | | * @description 小程序页面 |
| | | * @author yourName |
| | | * @author jyy |
| | | * @date 2020-04-03 14:56 |
| | | */ |
| | | @Controller |
| | |
| | | package com.matrix.system.shopXcx.action; |
| | | |
| | | import com.matrix.component.wechat.externalInterface.common.WechatConfigure; |
| | | import com.matrix.component.rabbitmq.RabiitMqTemplate; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.component.wechat.externalInterface.weixinUtil.WeixinServiceUtil; |
| | | import com.matrix.core.anotations.RemoveRequestToken; |
| | | import com.matrix.core.anotations.SaveRequestToken; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.pojo.PaginationVO; |
| | | import com.matrix.core.tools.*; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.core.tools.ModelUtils; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | |
| | | import com.matrix.component.wechat.externalInterface.weixinUtil.WeixinServiceUtil; |
| | | import com.matrix.system.hive.action.util.QueryUtil; |
| | | import com.matrix.system.shopXcx.api.service.WXShopOrderService; |
| | | import com.matrix.system.shopXcx.api.service.WxShopRefundRecordService; |
| | | import com.matrix.system.shopXcx.bean.*; |
| | | import com.matrix.system.shopXcx.dao.ShopCouponRecordDao; |
| | | import com.matrix.system.shopXcx.dao.ShopDeliveryInfoDao; |
| | | import com.matrix.system.shopXcx.dao.ShopOrderDao; |
| | | import com.matrix.system.shopXcx.dao.ShopRefundRecordDao; |
| | | import com.matrix.component.tools.WxTempLateMsgUtil; |
| | | import com.matrix.system.shopXcx.api.service.WXShopOrderService; |
| | | import com.matrix.system.shopXcx.mqTask.MQTaskRouting; |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | |
| | | |
| | | @Value("${wx_pay_debug_onoff}") |
| | | private boolean isDebug; |
| | | @Value("${evn}") |
| | | private String evn; |
| | | |
| | | @Autowired |
| | | private RabiitMqTemplate rabiitMqTemplate; |
| | | |
| | | |
| | | /** |
| | | * 列表显示 |
| | |
| | | modifyMap.put("handingTime", new Date()); |
| | | int i = shopRefundRecordDao.updateByMap(modifyMap); |
| | | if (i > 0) { |
| | | //同意退款后发送微信提醒填写物流单号 |
| | | ShopRefundRecord fundRecord = shopRefundRecordDao.selectById(shopRefundRecord.getId()); |
| | | sendRefundLogisticsInfoToUser(fundRecord); |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, "操作成功", "退款记录表"); |
| | | } else { |
| | | throw new GlobleException("操作失败"); |
| | |
| | | modifyOrder.put("id", record.getOrderId()); |
| | | shopOrderDao.updateByMap(modifyOrder); |
| | | } |
| | | //退款拒绝后发送微信提醒 |
| | | sendFailedRefundInfoToUser(record); |
| | | if (i > 0) { |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, "操作成功", "退款记录表"); |
| | | } else { |
| | |
| | | if(flag){ |
| | | //退款成功后发送微信提醒 |
| | | ShopRefundRecord fundRecord = shopRefundRecordDao.selectById(oldShopRefundRecord.getId()); |
| | | sendRefundInfoToUser(fundRecord); |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | if(flag){ |
| | | //退款成功后发送微信提醒 |
| | | ShopRefundRecord fundRecord = shopRefundRecordDao.selectById(oldShopRefundRecord.getId()); |
| | | sendRefundInfoToUser(fundRecord); |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | if(flag){ |
| | | //退款成功后发送微信提醒 |
| | | ShopRefundRecord fundRecord = shopRefundRecordDao.selectById(Integer.valueOf(id)); |
| | | sendRefundInfoToUser(fundRecord); |
| | | |
| | | refundRecordService.updateGroupBuyStatus(Long.parseLong(id)); |
| | | } |
| | | } |
| | |
| | | if(flag){ |
| | | //退款成功后发送微信提醒 |
| | | ShopRefundRecord fundRecord = shopRefundRecordDao.selectById(Integer.valueOf(id)); |
| | | sendRefundInfoToUser(fundRecord); |
| | | |
| | | refundRecordService.updateGroupBuyStatus(Long.parseLong(id)); |
| | | } |
| | | } |
| | |
| | | //退款成功后同时把优惠券退回到用户的账号中 |
| | | if (shopOrder.getDiscountAmount() != null && shopOrder.getDiscountAmount().compareTo(BigDecimal.ZERO) == 0) { |
| | | ShopCouponRecord shopCouponRecord = new ShopCouponRecord(); |
| | | String userIds = shopRefundRecord.getUserId(); |
| | | shopCouponRecord.setUserId(userIds); |
| | | shopCouponRecord.setUserId(shopRefundRecord.getUserId()); |
| | | shopCouponRecord.setOrderId(shopOrder.getId()); |
| | | List<ShopCouponRecord> recordList = shopCouponRecordDao.selectByModel(shopCouponRecord); |
| | | if (CollectionUtils.isNotEmpty(recordList)) { |
| | |
| | | modifyMap.put("orderStatus", ShopOrder.ORDER_STATUS_MONEYBACK_SUCCESS); |
| | | modifyMap.put("refundCharge", shopRefundRecord.getRefundMoney()); |
| | | shopOrderDao.updateByMap(modifyMap); |
| | | |
| | | rabiitMqTemplate.sendMsg(MQTaskRouting.SHOP_ORDER_REFUND+evn,shopRefundRecord.getOrderId()+""); |
| | | |
| | | }catch (Exception e){ |
| | | LogUtil.debug("退款成功,修改退款表和订单表状态出错。。。", id); |
| | | e.printStackTrace(); |
| | |
| | | return flag; |
| | | } |
| | | |
| | | //退款成功后发送微信提醒 |
| | | private int sendRefundInfoToUser(ShopRefundRecord shopRefundRecord) { |
| | | ShopOrder order = shopOrderDao.selectById(shopRefundRecord.getOrderId()); |
| | | if (order == null) { |
| | | throw new GlobleException("没有找到需要退款的订单信息"); |
| | | } |
| | | List<String> msg = new ArrayList<>(); |
| | | //退款说明 |
| | | String refundExplain = "退款已经原路返回,具体到账时间可能会有1-3天延迟"; |
| | | msg.add(order.getOrderNo()); |
| | | msg.add(DateUtil.dateToString(shopRefundRecord.getRefundTime(),DateUtil.DATE_FORMAT_SS)); |
| | | msg.add(refundExplain); |
| | | msg.add("商品名称"); |
| | | String formId = null; |
| | | if(AppConstance.REFUND_GOODS.equals(shopRefundRecord.getRefundType()) && null != shopRefundRecord.getRefundTransactionNo()){ |
| | | formId = shopRefundRecord.getRefundTransactionNo(); |
| | | }else { |
| | | formId = order.getWxOrderNo().split("=")[1]; |
| | | } |
| | | String page = "pages/refunDetail/refunDetail?id=" + shopRefundRecord.getId() + "&&status=1" + "&&inform=1"; |
| | | int res = WxTempLateMsgUtil.sendWxTemplateMsg(msg, order.getUserId(), |
| | | page, WxTempLateMsgUtil.REFUND_SUCCESS, formId); |
| | | return res; |
| | | } |
| | | |
| | | //退款拒绝后发送微信提醒 |
| | | private int sendFailedRefundInfoToUser(ShopRefundRecord shopRefundRecord) { |
| | | ShopOrder order = shopOrderDao.selectById(shopRefundRecord.getOrderId()); |
| | | if (order == null) { |
| | | throw new GlobleException("没有找到拒绝退款的订单信息"); |
| | | } |
| | | List<String> msg = new ArrayList<>(); |
| | | //退款说明 |
| | | String remarks = "如有疑问请联系客服"; |
| | | msg.add(order.getOrderNo()); |
| | | msg.add("商品名称"); |
| | | msg.add(shopRefundRecord.getRefundRefuseReason()); |
| | | msg.add(shopRefundRecord.getRefundCause()); |
| | | String formId = null; |
| | | if(AppConstance.REFUND_GOODS .equals(shopRefundRecord.getRefundType()) && null != shopRefundRecord.getRefundTransactionNo()){ |
| | | formId = shopRefundRecord.getRefundTransactionNo(); |
| | | }else { |
| | | formId = order.getWxOrderNo().split("=")[1]; |
| | | } |
| | | String page = "pages/refunDetail/refunDetail?id=" + shopRefundRecord.getId() + "&&status=2" + "&&inform=1"; |
| | | int res = WxTempLateMsgUtil.sendWxTemplateMsg(msg, order.getUserId(), |
| | | page, WxTempLateMsgUtil.REFUND_FAILED, formId); |
| | | return res; |
| | | } |
| | | |
| | | //同意退款后发送微信提醒填写物流单号 |
| | | private int sendRefundLogisticsInfoToUser(ShopRefundRecord shopRefundRecord) { |
| | | ShopOrder order = shopOrderDao.selectById(shopRefundRecord.getOrderId()); |
| | | if (order == null) { |
| | | throw new GlobleException("没有找到发送微信提醒的订单信息"); |
| | | } |
| | | List<String> msg = new ArrayList<>(); |
| | | //退款说明 |
| | | String remarks = "申请退款已审核通过,请尽快填写退货物流信息"; |
| | | msg.add(order.getOrderNo()); |
| | | msg.add("商品名称"); |
| | | msg.add("待退回"); |
| | | msg.add(remarks); |
| | | String formId = order.getWxOrderNo().split("=")[1]; |
| | | String page = "pages/refunding/refunding?id=" + shopRefundRecord.getId() + "&&inform=1"; |
| | | int res = WxTempLateMsgUtil.sendWxTemplateMsg(msg, order.getUserId(), |
| | | page, WxTempLateMsgUtil.WRITE_LOGISTICS, formId); |
| | | return res; |
| | | } |
| | | } |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.component.rabbitmq.RabiitMqTemplate; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.component.tools.WxUtils; |
| | | import com.matrix.component.wechat.externalInterface.protocol.paramProtocol.BrandWCPayRequestData; |
| | | import com.matrix.component.wechat.externalInterface.weixinUtil.WeixinServiceUtil; |
| | | import com.matrix.config.RabbitMqConfig; |
| | | import com.matrix.core.constance.SystemErrorCode; |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.constance.Dictionary; |
| | | import com.matrix.system.hive.bean.ShoppingGoods; |
| | | import com.matrix.system.hive.bean.MoneyCardUse; |
| | | import com.matrix.system.hive.bean.MoneyCardUseFlow; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.dao.MoneyCardUseDao; |
| | | import com.matrix.system.hive.dao.MoneyCardUseFlowDao; |
| | | import com.matrix.system.hive.dao.ShoppingGoodsDao; |
| | | import com.matrix.system.shopXcx.api.pojo.AddShopOrderPOJO; |
| | | import com.matrix.system.shopXcx.api.pojo.CreateOrderDto; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import com.matrix.system.score.dao.ScoreVipDetailDao; |
| | | import com.matrix.system.shopXcx.api.pojo.OrderInfoQueryPOJO; |
| | | import com.matrix.system.shopXcx.api.pojo.ShopOrderDto; |
| | | import com.matrix.system.shopXcx.api.service.OrderCouponGroupService; |
| | | import com.matrix.system.shopXcx.api.service.ShoppingCartService; |
| | | import com.matrix.system.shopXcx.api.service.WXShopOrderService; |
| | | import com.matrix.system.shopXcx.api.service.WxShopCouponService; |
| | | import com.matrix.system.shopXcx.api.tools.WxShopCouponUtil; |
| | | import com.matrix.system.shopXcx.api.tools.WxShopOrderUtil; |
| | | import com.matrix.system.shopXcx.api.vo.CouponReceiveInfoVO; |
| | | import com.matrix.system.shopXcx.api.vo.ShopCartVo; |
| | | import com.matrix.system.shopXcx.bean.*; |
| | | import com.matrix.system.shopXcx.bean.ShopActivitiesGroupJoin; |
| | | import com.matrix.system.shopXcx.bean.ShopActivitiesGroupJoinUser; |
| | | import com.matrix.system.shopXcx.bean.ShopOrder; |
| | | import com.matrix.system.shopXcx.bean.ShopPayLog; |
| | | import com.matrix.system.shopXcx.dao.*; |
| | | import com.matrix.system.shopXcx.dto.DiscountExplain; |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | import com.matrix.system.shopXcx.mqTask.MQTaskRouting; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | |
| | | |
| | | /** |
| | |
| | | @Autowired |
| | | WxShopCouponService wxShopCouponService; |
| | | |
| | | @Autowired |
| | | private ShopReceiveAddressDao shopReceiveAddressDao; |
| | | |
| | | @Autowired |
| | | ShoppingCartService shoppingCartService; |
| | | |
| | | @Autowired |
| | | private ShopCouponDao shopCouponDao; |
| | | @Autowired |
| | | private WxShopCouponUtil wxShopCouponUtil; |
| | | |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | |
| | | |
| | | @Autowired |
| | | ShopProductDao shopProductDao; |
| | | @Autowired |
| | | private WxShopOrderUtil wxShopOrderUtil; |
| | | |
| | | @Autowired |
| | | private ShopOrderDetailsDao shopOrderDetailsDao; |
| | | OrderCouponGroupService orderCouponGroupService; |
| | | |
| | | @Autowired |
| | | private ShopPayLogDao shopPayLogDao; |
| | | |
| | | @Autowired |
| | | ShopOrderDao shopOrderDao; |
| | | |
| | | @Autowired |
| | | SysVipInfoDao sysVipInfoDao; |
| | | |
| | | @Autowired |
| | | private ShopActivitiesGroupJoinUserDao shopActivitiesGroupJoinUserDao; |
| | | |
| | | @Autowired |
| | | private ShopActivitiesGroupJoinDao shopActivitiesGroupJoinDao; |
| | | |
| | | @Autowired |
| | | private RabiitMqTemplate rabiitMqTemplate; |
| | | |
| | | @Autowired |
| | | ShoppingGoodsDao shoppingGoodsDao; |
| | | |
| | | @Autowired |
| | | MoneyCardUseFlowDao moneyCardUseFlowDao; |
| | | |
| | | @Autowired |
| | | MoneyCardUseDao moneyCardUseDao; |
| | | |
| | | @Value("${evn}") |
| | | private String evn; |
| | | |
| | | /** |
| | | * 计算购物车订单价格 |
| | | * |
| | | * @param addShopOrderPOJO |
| | | * @param shopOrderDto |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @PostMapping(value = "/calculationCartOrder") |
| | | public |
| | | @ResponseBody |
| | | AjaxResult calculationCartOrder(@RequestBody AddShopOrderPOJO addShopOrderPOJO) throws Exception { |
| | | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); //计算购物车中物品的优惠信息 |
| | | |
| | | List<ShopCartVo> cartList = shoppingCartService.findUserCartList(addShopOrderPOJO.getShopId()); |
| | | |
| | | |
| | | //取出购物车中选中的产品 |
| | | List<ShopShoppingCart> buyCart = new ArrayList<>(); |
| | | |
| | | //取出购物车中没有参加店铺活动的产品,和参加了店铺活动但是活动没有达到标准的产品,用来计算是否可以使用优惠券 |
| | | List<ShopShoppingCart> notCouponuyCart = new ArrayList<>(); |
| | | for (ShopCartVo shopCartVo : cartList) { |
| | | for (ShopShoppingCart shopShoppingCart : shopCartVo.getCartList()) { |
| | | if (shopShoppingCart.getIsSelected() == 1) { |
| | | buyCart.add(shopShoppingCart); |
| | | if (shopCartVo.getCoupon() == null || !shopCartVo.isSatisfactionCoupon()) { |
| | | notCouponuyCart.add(shopShoppingCart); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //获取当前购物车产品可用的优惠券 |
| | | List<CouponReceiveInfoVO> usefulCoupon = wxShopCouponService.getCartVoCouponList(bizUser.getCompanyId(),notCouponuyCart); |
| | | |
| | | //获取用户使用的优惠券 |
| | | CouponReceiveInfoVO shopCoupon = new CouponReceiveInfoVO(); |
| | | if (addShopOrderPOJO.getCouponReceiveId() == null) { |
| | | //如果用户没有选择优惠券则默认选优惠金额最高的 |
| | | //计算使用优惠券后的价格 |
| | | if (CollectionUtils.isNotEmpty(usefulCoupon)) { |
| | | //根据优惠券ID用户ID查询优惠券信息 |
| | | shopCoupon = usefulCoupon.get(0); |
| | | } |
| | | } else if (addShopOrderPOJO.getCouponReceiveId() != 1) { |
| | | //用户选择了优惠券 |
| | | shopCoupon = shopCouponRecordDao.selectMyCouponByReceiveId(addShopOrderPOJO.getCouponReceiveId()); |
| | | } else { |
| | | //用户不使用优惠券 |
| | | } |
| | | |
| | | |
| | | //计算收货地址: |
| | | |
| | | ShopReceiveAddress shopReceiveAddress = null; |
| | | if (addShopOrderPOJO.getReceiveAddrId() == null) { |
| | | //如果没有传收货地址则默认收货地址 |
| | | shopReceiveAddress = shopReceiveAddressDao.selectDefaultAddress(bizUser.getOpenId()); |
| | | if (shopReceiveAddress != null) { |
| | | addShopOrderPOJO.setReceiveAddrId(shopReceiveAddress.getAddrId()); |
| | | } |
| | | } else { |
| | | shopReceiveAddress = shopReceiveAddressDao.selectById(addShopOrderPOJO.getReceiveAddrId()); |
| | | addShopOrderPOJO.setReceiveAddrId(shopReceiveAddress.getAddrId()); |
| | | |
| | | } |
| | | |
| | | |
| | | //得到订单计价说明 |
| | | DiscountExplain discountExplain = shopOrderService.buildDiscountExplain(cartList, shopCoupon.getReceiveId(), bizUser.getCompanyId()); |
| | | |
| | | AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, buyCart, buyCart.size()); |
| | | //结算金额信息 |
| | | result.putInMap("discountExplain", discountExplain); |
| | | |
| | | |
| | | //用户优惠券 |
| | | result.putInMap("usefulCoupon", usefulCoupon); |
| | | //用户选中的优惠券 |
| | | result.putInMap("shopCoupon", shopCoupon); |
| | | |
| | | |
| | | //默认地址 |
| | | String deliverySelect = "立即配送"; |
| | | if (shopReceiveAddress != null) { |
| | | if (StringUtils.isNotBlank(shopReceiveAddress.getSchool())) { |
| | | deliverySelect = "立即配送"; |
| | | } else { |
| | | deliverySelect = "物流配送"; |
| | | } |
| | | } |
| | | result.putInMap("defaultAddress", shopReceiveAddress); |
| | | //配送方式 |
| | | result.putInMap("deliverySelect", deliverySelect); |
| | | |
| | | |
| | | result.setRows(buyCart); |
| | | return result; |
| | | AjaxResult calculationCartOrder(@RequestBody ShopOrderDto shopOrderDto) throws Exception { |
| | | return shopOrderService.buildDiscountExplain(shopOrderDto); |
| | | } |
| | | |
| | | |
| | | @Autowired |
| | | ShoppingGoodsDao shoppingGoodsDao; |
| | | private ScoreVipDetailDao scoreVipDetailDao; |
| | | |
| | | /** |
| | | * 新增订单 |
| | | * 新增微信支付订单 |
| | | * |
| | | * @param addShopOrderPOJO |
| | | * @param shopOrderDto |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/addShopOrder") |
| | | public |
| | | @ResponseBody |
| | | AjaxResult addShopOrder(@RequestBody AddShopOrderPOJO addShopOrderPOJO) throws Exception { |
| | | return shopOrderService.createShopOrder(addShopOrderPOJO); |
| | | } |
| | | AjaxResult addShopOrder(@RequestBody @Validated ShopOrderDto shopOrderDto) throws Exception { |
| | | |
| | | |
| | | /** |
| | | * 新增订单 |
| | | * 本方法抛弃,不再使用,本方法是单单个产品购买 |
| | | * 在多产品的时候不适合 |
| | | * @return |
| | | */ |
| | | @Deprecated |
| | | @PostMapping(value = "/addShopOrder2") |
| | | public |
| | | @ResponseBody |
| | | AjaxResult addShopOrder2(@RequestBody CreateOrderDto createOrderDto) throws Exception { |
| | | |
| | | |
| | | //校验收货地址 |
| | | ShopReceiveAddress shopReceiveAddress = shopReceiveAddressDao.selectById(createOrderDto.getReceiveAddrId()); |
| | | if (shopReceiveAddress == null) { |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "请选择正确的收获地址"); |
| | | } |
| | | |
| | | |
| | | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | ShopSku shopSku = shopSkuDao.selectById(createOrderDto.getSkuId()); |
| | | ShopProduct shopProduct = shopProductDao.selectById(createOrderDto.getProductId()); |
| | | String stokCode = shopSku.getStockCode(); |
| | | |
| | | ShopOrder shopOrder = new ShopOrder(); |
| | | //查询绑定的产品是否为家居产品 |
| | | if (StringUtils.isNotBlank(stokCode)) { |
| | | ShoppingGoods shoppingGoods = shoppingGoodsDao.selectById(Long.parseLong(stokCode)); |
| | | if (shoppingGoods != null) { |
| | | //根据购买的产品设置订单类型 |
| | | if (Dictionary.SHOPPING_GOODS_TYPE_JJCP.equals(shoppingGoods.getGoodType())) { |
| | | shopOrder.setOrderType(ShopOrder.ORDER_TYPE_GOODS); |
| | | } else { |
| | | shopOrder.setOrderType(ShopOrder.ORDER_TYPE_SERVICE); |
| | | } |
| | | } else { |
| | | shopOrder.setOrderType(ShopOrder.ORDER_TYPE_GOODS); |
| | | } |
| | | } |
| | | |
| | | List<ShopOrderDetails> details = new ArrayList<>(); |
| | | Integer cartCount = 0; |
| | | ShopOrderDetails shopOrderDetails = new ShopOrderDetails(); |
| | | shopOrderDetails.setCreateBy(AppConstance.SYSTEM_USER); |
| | | shopOrderDetails.setUpdateBy(AppConstance.SYSTEM_USER); |
| | | shopOrderDetails.setpId(createOrderDto.getProductId()); |
| | | shopOrderDetails.setsId(createOrderDto.getSkuId()); |
| | | shopOrderDetails.setPrice(shopSku.getPrice()); |
| | | shopOrderDetails.setCount(createOrderDto.getNumber()); |
| | | shopOrderDetails.setsTitle(shopProduct.getTitle() + shopSku.getName()); |
| | | shopOrderDetails.setDiscountAmount(BigDecimal.ZERO); |
| | | shopOrderDetails.setTotalPrice(shopOrderDetails.getPrice().multiply(BigDecimal.valueOf(shopOrderDetails.getCount()))); |
| | | details.add(shopOrderDetails); |
| | | cartCount += shopOrderDetails.getCount(); |
| | | |
| | | |
| | | //TODO 更新库存和销量[考虑和erp库存联动] |
| | | wxShopOrderUtil.updateProductAndSkuInfo(details); |
| | | |
| | | //用户openId |
| | | shopOrder.setUserId(bizUser.getOpenId()); |
| | | shopOrder.setCreateBy("微信小程序生成"); |
| | | shopOrder.setUpdateBy("微信小程序生成"); |
| | | shopOrder.setCommodityPrice(shopOrderDetails.getTotalPrice()); |
| | | shopOrder.setPurchaseQuantity(cartCount); |
| | | //购买方式 |
| | | shopOrder.setShippingMethod("物流配送"); |
| | | //生成订单号 |
| | | shopOrder.setOrderNo(WxUtils.getOrderNum()); |
| | | //设置支付状态 |
| | | shopOrder.setPayStatus(ShopOrder.ORDER_STATUS_WAIT_PAY); |
| | | //设置订单状态 |
| | | shopOrder.setOrderStatus(ShopOrder.ORDER_STATUS_WAIT_SEND); |
| | | |
| | | //设置退款费用(注:下次优化从数据字典表获取) |
| | | shopOrder.setRefundCharge(BigDecimal.ZERO); |
| | | //客户电话 |
| | | shopOrder.setUserTel(shopReceiveAddress.getAddrTelephone()); |
| | | //客户姓名 |
| | | shopOrder.setUserName(shopReceiveAddress.getAddrLiaisonman()); |
| | | //备注 |
| | | shopOrder.setRemarks(createOrderDto.getRemarks()); |
| | | //删除标识 |
| | | shopOrder.setDelFlag(AppConstance.DATA_USEABLE); |
| | | //微信订单号 |
| | | shopOrder.setWxOrderNo(""); |
| | | //微信支付结果 |
| | | shopOrder.setPayResult(ShopOrder.ORDER_WX_STATUS_WAIT_PAY); |
| | | //如果没有提交购买方式或配送方式不是物流 |
| | | //获取邮费 |
| | | shopOrder.setOrderMoney(shopOrderDetails.getTotalPrice()); |
| | | shopOrder.setStoreId(createOrderDto.getShopId()); |
| | | |
| | | shopOrderDao.insert(shopOrder); |
| | | |
| | | wxShopOrderUtil.insertSendPackageInfo(shopOrder, "物流配送", shopReceiveAddress); |
| | | |
| | | //给订单详情表添加订单ID |
| | | shopOrderDetails.setOrderId(shopOrder.getId()); |
| | | |
| | | shopOrderDetailsDao.insert(shopOrderDetails); |
| | | |
| | | |
| | | BrandWCPayRequestData payData = startPayment(shopOrder); |
| | | AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, Arrays.asList(payData)); |
| | | ShopOrder shopOrder = shopOrderService.createShopOrder(shopOrderDto); |
| | | AjaxResult result = AjaxResult.buildSuccessInstance("订单创建成功"); |
| | | result.putInMap("orderId", shopOrder.getId()); |
| | | |
| | | if (shopOrderDto.getPayMethod().equals(ShopOrder.SHOP_ORDER_PAY_METHOD_WX)) { |
| | | BrandWCPayRequestData payData = shopOrderService.startPayment(shopOrder); |
| | | result.setRows(Arrays.asList(payData)); |
| | | } |
| | | return result; |
| | | |
| | | |
| | | } |
| | | |
| | | @Value("${wx_pay_debug_onoff}") |
| | | private boolean isDebug; |
| | | @Autowired |
| | | private WeixinServiceUtil weixinServiceUtil; |
| | | |
| | | |
| | | /** |
| | | * 开始付款 |
| | | * 余额支付确认 |
| | | * |
| | | * @param shopOrder |
| | | * @param orderId |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public BrandWCPayRequestData startPayment(ShopOrder shopOrder) throws Exception { |
| | | BigDecimal unit = new BigDecimal("100"); |
| | | BigDecimal money = new BigDecimal(shopOrder.getOrderMoney().toString()); |
| | | BrandWCPayRequestData payData; |
| | | String productNames = wxShopOrderUtil.getProductNames(shopOrder.getUserId(), shopOrder.getId()); |
| | | if (isDebug) { |
| | | payData = weixinServiceUtil.createOrder("[测试]" + productNames, shopOrder.getOrderNo(), |
| | | 1, shopOrder.getUserId(), String.valueOf(shopOrder.getId())); |
| | | @GetMapping(value = "/moneyCardPay/{orderId}") |
| | | @ResponseBody |
| | | @Transactional |
| | | public AjaxResult moneyCardPay(@PathVariable Integer orderId) throws Exception { |
| | | |
| | | ShopOrder order = shopOrderDao.selectById(orderId); |
| | | if (order != null |
| | | && ShopOrder.SHOP_ORDER_PAY_METHOD_VIPCARD == order.getPayMethod() |
| | | && ShopOrder.ORDER_PAY_STATUS_WAIT == order.getPayStatus()) { |
| | | |
| | | MoneyCardUse moneyCardUse = moneyCardUseDao.selectVipCard(order.getUserId()); |
| | | Double balance=moneyCardUse.getGiftMoney() + moneyCardUse.getRealMoney(); |
| | | if(balance>=order.getOrderMoney().doubleValue()){ |
| | | //扣减会员卡余额 |
| | | if(moneyCardUse.getRealMoney()>=order.getOrderMoney().doubleValue()){ |
| | | moneyCardUse.setRealMoney(moneyCardUse.getRealMoney()-order.getOrderMoney().doubleValue()); |
| | | }else{ |
| | | moneyCardUse.setGiftMoney(moneyCardUse.getGiftMoney()-(order.getOrderMoney().doubleValue()- moneyCardUse.getRealMoney() )); |
| | | moneyCardUse.setRealMoney(0D); |
| | | } |
| | | moneyCardUseDao.update(moneyCardUse); |
| | | //插入扣减记录 |
| | | MoneyCardUseFlow moneyCardUseFlow=new MoneyCardUseFlow(); |
| | | moneyCardUseFlow.setTotal(order.getOrderMoney().doubleValue()); |
| | | moneyCardUseFlow.setCarUseId(moneyCardUse.getId()); |
| | | moneyCardUseFlow.setVipId(order.getUserId()); |
| | | moneyCardUseFlow.setType(MoneyCardUseFlow.USE_TYPE_CONSUMER); |
| | | moneyCardUseFlow.setOrderNo(order.getOrderNo()); |
| | | moneyCardUseFlow.setCreateTime(new Date()); |
| | | moneyCardUseFlow.setBalance(moneyCardUse.getGiftMoney()+moneyCardUse.getRealMoney()); |
| | | moneyCardUseFlow.setCardName(moneyCardUse.getCardName()); |
| | | moneyCardUseFlowDao.insert(moneyCardUseFlow); |
| | | |
| | | //构建需要修改订单信息Map |
| | | Map<String, Object> modifyMap = new HashMap<>(); |
| | | modifyMap.put("id", order.getId()); |
| | | //设置微信支付状态为已支付 |
| | | modifyMap.put("payResult", ShopOrder.ORDER_WX_STATUS_PAY_SUCCESS); |
| | | //设置支付状态为支付成功 |
| | | modifyMap.put("payStatus", ShopOrder.ORDER_PAY_STATUS_SUCCESS); |
| | | //如果是商品订单则进入待发货 |
| | | modifyMap.put("orderStatus", ShopOrder.ORDER_STATUS_WAIT_SEND); |
| | | shopOrderDao.updateByMap(modifyMap); |
| | | |
| | | // 判断该订单是否为拼团产生的订单 |
| | | ShopActivitiesGroupJoinUser joinUser = shopActivitiesGroupJoinUserDao.selectGroupJoinUserByOrderId(order.getId().longValue()); |
| | | if (joinUser != null) { |
| | | joinUser.setIsHasPay(ShopActivitiesGroupJoinUser.IS_HAS_PAY_Y); |
| | | shopActivitiesGroupJoinUserDao.updateByModel(joinUser); |
| | | |
| | | ShopActivitiesGroupJoin groupJoin = shopActivitiesGroupJoinDao.selectGroupAndPriceById(joinUser.getGjId()); |
| | | List<ShopActivitiesGroupJoinUser> joinUserList = shopActivitiesGroupJoinUserDao.selectGroupJoinUserListByGjId(joinUser.getGjId()); |
| | | LogUtil.info("#当前已支付完成:{}#", joinUserList.size()); |
| | | // 若拼团中已支付的数量等于几人团预设值,则更新拼团状态为拼团成功 |
| | | if (groupJoin.getGroupPrice().getGpCount() == joinUserList.size()) { |
| | | groupJoin.setGjStatus(ShopActivitiesGroupJoin.ACTIVITIES_JOIN_SUCCESS); |
| | | } else { |
| | | if (joinUser.getUserId().equals(groupJoin.getGjHeadId())) { |
| | | groupJoin.setGjStatus(ShopActivitiesGroupJoin.ACTIVITIES_JOIN_ING); |
| | | } |
| | | } |
| | | shopActivitiesGroupJoinDao.updateByModel(groupJoin); |
| | | |
| | | SysVipInfo sysVipInfo = sysVipInfoDao.selectByPhone(order.getUserTel(),order.getCompanyId()); |
| | | if (sysVipInfo != null) { |
| | | sysVipInfo.setIsDeal(SysVipInfo.DEAL_VIP); |
| | | sysVipInfoDao.update(sysVipInfo); |
| | | } |
| | | } |
| | | |
| | | // 根据订单类型创建不同的处理任务 |
| | | rabiitMqTemplate.sendTopicMsg(RabbitMqConfig.MQ_EXCHANGE_TOPIC + evn, MQTaskRouting.CREATE_ORDER + evn, orderId + ""); |
| | | //支付记录 |
| | | recordPayLog(Integer.valueOf(orderId), 1, order.getOrderNo(), order.getOrderMoney(), "会员卡余额支付成功", ShopOrder.ORDER_PAY_STATUS_SUCCESS); |
| | | |
| | | return AjaxResult.buildSuccessInstance("支付成功"); |
| | | |
| | | }else{ |
| | | return AjaxResult.buildFailInstance("会员卡余额不足"); |
| | | } |
| | | |
| | | } else { |
| | | payData = weixinServiceUtil.createOrder(productNames, shopOrder.getOrderNo(), |
| | | unit.multiply(money).intValue(), shopOrder.getUserId(), String.valueOf(shopOrder.getId())); |
| | | LogUtil.info("订单状态不为待付款,order status=", order.getOrderStatus()); |
| | | return AjaxResult.buildFailInstance("订单不支持本次结算"); |
| | | } |
| | | ShopOrder updateParam = new ShopOrder(); |
| | | updateParam.setId(shopOrder.getId()); |
| | | updateParam.setWxOrderNo(payData.getPrepay_id()); |
| | | shopOrderDao.updateByModel(updateParam); |
| | | return payData; |
| | | |
| | | } |
| | | |
| | | |
| | | private void recordPayLog(Integer orderId, Integer type, String orderNo, BigDecimal payMoney, String payRemark, int payStatus) { |
| | | //设置支付类型为收款 |
| | | ShopPayLog payLog = new ShopPayLog(); |
| | | payLog.setPayType(type); |
| | | payLog.setJoinId(orderId); |
| | | payLog.setPayMoney(payMoney); |
| | | payLog.setPayOrderNo(orderNo); |
| | | payLog.setPayRemark(payRemark); |
| | | payLog.setPayStatus(payStatus); |
| | | payLog.setCreateBy(AppConstance.SYSTEM_USER); |
| | | payLog.setUpdateBy(AppConstance.SYSTEM_USER); |
| | | shopPayLogDao.insert(payLog); |
| | | } |
| | | |
| | | |
| | |
| | | @GetMapping(value = "/getOrderStatusCount") |
| | | @ResponseBody |
| | | public AjaxResult getOrderStatusCount() { |
| | | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | AjaxResult result = AjaxResult.buildSuccessInstance( |
| | | shopOrderDao.selectOrderStatusCount(bizUser.getOpenId())); |
| | | shopOrderDao.selectOrderStatusCount(sysVipInfo.getId())); |
| | | return result; |
| | | } |
| | | |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.component.rabbitmq.RabiitMqTemplate; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.component.tools.AES; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.biz.dao.BizUserDao; |
| | | import com.matrix.component.tools.AES; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import com.matrix.system.shopXcx.api.pojo.BindingPhoneNumberPOJO; |
| | | import com.matrix.system.shopXcx.api.tools.SMSVerifiTools; |
| | | import com.matrix.system.shopXcx.api.vo.DataDecipheringVo; |
| | | import com.matrix.system.shopXcx.mqTask.MQTaskRouting; |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | import org.apache.commons.lang.RandomStringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author jiangyouyao |
| | |
| | | @Autowired |
| | | private SMSVerifiTools sMSVerifiTools; |
| | | @Autowired |
| | | private BizUserDao bizUserDao; |
| | | private SysVipInfoDao sysVipInfoDao; |
| | | |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | |
| | | if (StringUtils.isBlank(phoneNumber)) { |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "手机号码不能为空"); |
| | | } |
| | | BizUser bizUser = new BizUser(); |
| | | bizUser.setPhoneNumber(phoneNumber); |
| | | List<BizUser> bizUsers = bizUserDao.selectByModel(bizUser); |
| | | SysVipInfo sysVipInfo = new SysVipInfo(); |
| | | sysVipInfo.setPhone(phoneNumber); |
| | | List<SysVipInfo> bizUsers = sysVipInfoDao.selectByModel(sysVipInfo); |
| | | if (CollectionUtils.isNotEmpty(bizUsers) && bizUsers.size() > 0) { |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "该手机号已被绑定"); |
| | | } |
| | |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "手机号码不能为空"); |
| | | } |
| | | //验证通过将手机号加入相应的用户数据中 |
| | | BizUser bizUser = new BizUser(); |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | bizUser.setUserId(loginUser.getUserId()); |
| | | bizUser.setPhoneNumber(bindingPhoneNumber.getPhoneNumber()); |
| | | bizUserDao.updateByModel(bizUser); |
| | | |
| | | //绑定号码后同步到erp |
| | | mqTemplate.sendMsg(MQTaskRouting.CREATE_VIP + evn, loginUser.getOpenId()+","+bindingPhoneNumber.getShopId()); |
| | | |
| | | SysVipInfo sysVipInfo = new SysVipInfo(); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | sysVipInfo.setId(loginUser.getId()); |
| | | if(loginUser.getShopId()==null){ |
| | | sysVipInfo.setShopId(bindingPhoneNumber.getShopId()); |
| | | } |
| | | sysVipInfo.setPhone(bindingPhoneNumber.getPhoneNumber()); |
| | | sysVipInfoDao.update(sysVipInfo); |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, "绑定成功"); |
| | | } |
| | | |
| | |
| | | @RequestMapping(value = "/deciphering") |
| | | public @ResponseBody |
| | | AjaxResult deciphering(@RequestBody DataDecipheringVo dataDecipheringVo) { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | String session_key = loginUser.getSessionKey(); |
| | | LogUtil.debug(dataDecipheringVo.toString()); |
| | | String jsonResult = AES.wxDecrypt(dataDecipheringVo.getEncryptedData(), session_key, dataDecipheringVo.getIv()); |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.system.shopXcx.bean.ShopCollection; |
| | |
| | | @PostMapping(value = "/saveCollection") |
| | | public @ResponseBody |
| | | AjaxResult saveCollection(@RequestBody ShopCollection collection) { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | collection.setCreateBy(loginUser.getOpenId()); |
| | | collection.setUpdateBy(loginUser.getOpenId()); |
| | | collection.setCollUserid(loginUser.getOpenId()); |
| | |
| | | @ResponseBody |
| | | public AjaxResult deleteByProductId(@PathVariable("collProductid") Integer collProductid){ |
| | | Map<String, Object> deleteMap = new HashMap<>(); |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | String collUserid = loginUser.getOpenId(); |
| | | deleteMap.put("collProductid", collProductid); |
| | | deleteMap.put("collUserid", collUserid); |
| | |
| | | @PostMapping("/findCollection") |
| | | @ResponseBody |
| | | public AjaxResult getCollectionByUserId(@RequestBody ShopCollection collection) { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | String userId = loginUser.getOpenId(); |
| | | collection.setCollUserid(userId); |
| | | List<ShopCollection> list = collectionDao.selectByUserId(collection); |
| | |
| | | @PostMapping("/findByUserIdAndProid/{collProductid}") |
| | | @ResponseBody |
| | | public AjaxResult findByUserIdAndProid(@PathVariable("collProductid") Integer collProductid) { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | String userId = loginUser.getOpenId(); |
| | | List<ShopCollection> list = collectionDao.selectByUserIdAndProid(collProductid,userId); |
| | | AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, list, list.size()); |
| | |
| | | import com.matrix.component.wechat.externalInterface.common.Signature; |
| | | import com.matrix.component.wechat.externalInterface.common.Util; |
| | | import com.matrix.component.wechat.externalInterface.protocol.queryProtocol.NotifyData; |
| | | import com.matrix.config.RabbitMqConfig; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.system.common.bean.BusParameterSettings; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.common.interceptor.HostInterceptor; |
| | | import com.matrix.system.hive.bean.MoneyCardUse; |
| | | import com.matrix.system.hive.bean.MoneyCardUseFlow; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.dao.MoneyCardUseDao; |
| | | import com.matrix.system.hive.dao.MoneyCardUseFlowDao; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import com.matrix.system.score.service.ScoreVipDetailService; |
| | | import com.matrix.system.shopXcx.bean.ShopActivitiesGroupJoin; |
| | | import com.matrix.system.shopXcx.bean.ShopActivitiesGroupJoinUser; |
| | | import com.matrix.system.shopXcx.bean.ShopOrder; |
| | |
| | | @Autowired |
| | | BusParameterSettingsDao busParameterSettingsDao; |
| | | |
| | | @Autowired |
| | | ScoreVipDetailService scoreVipDetailService; |
| | | |
| | | |
| | | |
| | | @Value("${evn}") |
| | | private String evn; |
| | | /** |
| | | * 微信支付回调接口 |
| | | * |
| | | * @param response |
| | | * @param request |
| | | * @throws IOException |
| | | * @throws Exception |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @RequestMapping(value = "/wxapi/wxpayCallback") |
| | |
| | | } |
| | | shopActivitiesGroupJoinDao.updateByModel(groupJoin); |
| | | |
| | | SysVipInfo sysVipInfo = sysVipInfoDao.selectByPhone(order.getUserTel()); |
| | | SysVipInfo sysVipInfo = sysVipInfoDao.selectByPhone(order.getUserTel(), order.getCompanyId()); |
| | | if(sysVipInfo!=null){ |
| | | sysVipInfo.setIsDeal(SysVipInfo.DEAL_VIP); |
| | | sysVipInfoDao.update(sysVipInfo); |
| | |
| | | } |
| | | |
| | | // 根据订单类型创建不同的处理任务 |
| | | rabiitMqTemplate.sendMsg(MQTaskRouting.CREATE_ORDER+evn, orderId); |
| | | rabiitMqTemplate.sendTopicMsg(RabbitMqConfig.MQ_EXCHANGE_TOPIC +evn, MQTaskRouting.CREATE_ORDER+evn, orderId); |
| | | |
| | | |
| | | |
| | | threadResult.putInMap("status", "success"); |
| | | resXml = AppConstance.RESULT_XML_SUCCESS; |
| | | |
| | | //支付记录 |
| | | recordPayLog(Integer.valueOf(orderId), payMoney, order, payLog, "支付成功", ShopOrder.ORDER_PAY_STATUS_SUCCESS); |
| | | recordPayLog(Integer.valueOf(orderId), 1, order.getOrderNo(), payMoney, "支付成功", ShopOrder.ORDER_PAY_STATUS_SUCCESS); |
| | | |
| | | |
| | | } else { |
| | |
| | | |
| | | } |
| | | |
| | | private void recordPayLog(Integer orderId, BigDecimal payMoney, ShopOrder order, ShopPayLog payLog, String payRemark, int payStatus) { |
| | | |
| | | @Autowired |
| | | MoneyCardUseFlowDao moneyCardUseFlowDao; |
| | | |
| | | @Autowired |
| | | MoneyCardUseDao moneyCardUseDao; |
| | | |
| | | /** |
| | | * 微信充值回调 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @RequestMapping(value = "/wxapi/rechargeCallBack") |
| | | public void rechargeCallBack(HttpServletResponse response, HttpServletRequest request) throws IOException { |
| | | LogUtil.info("微信充值回调start...."); |
| | | |
| | | // 获取输入参数 |
| | | String inputLine; |
| | | StringBuffer notityXml = new StringBuffer(); |
| | | String resXml = ""; |
| | | String moneyCardUseFlowId = ""; |
| | | |
| | | AjaxResult threadResult = new AjaxResult(AjaxResult.STATUS_SUCCESS, ""); |
| | | try { |
| | | while ((inputLine = request.getReader().readLine()) != null) { |
| | | notityXml.append(inputLine); |
| | | } |
| | | request.getReader().close(); |
| | | LogUtil.info("notityXml ---- :{} ", notityXml); |
| | | |
| | | |
| | | // XMl转对象 |
| | | Object bb = Util.getObjectFromXML(notityXml.toString(), NotifyData.class); |
| | | NotifyData data = new NotifyData(); |
| | | BeanUtils.copyProperties(bb,data); |
| | | LogUtil.info("----return_code = {}", data.getReturn_code()); |
| | | |
| | | |
| | | // 返回状态码 SUCCESS/FAIL |
| | | if (AppConstance.CODE_SUCCESS.equals(data.getReturn_code())) { |
| | | |
| | | moneyCardUseFlowId = data.getAttach(); |
| | | // 检验订单状态 |
| | | MoneyCardUseFlow moneyCardUseFlow = moneyCardUseFlowDao.selectById(Long.valueOf(moneyCardUseFlowId)); |
| | | SysVipInfo user=sysVipInfoDao.selectById(moneyCardUseFlow.getVipId()); |
| | | |
| | | // 校验签名 |
| | | BusParameterSettings paySecret = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WECHARPAY_SECRET, user.getCompanyId()); |
| | | if (Signature.checkIsSignValidFromResponseString(notityXml.toString(),paySecret.getParamValue())) { |
| | | // 校验业务结果 |
| | | if (AppConstance.CODE_SUCCESS.equals(data.getResult_code())) { |
| | | // 返回SUCCESS报文 |
| | | resXml = AppConstance.RESULT_XML_SUCCESS; |
| | | // 支付费用 |
| | | Double total_fee = Double.parseDouble(data.getTotal_fee()); |
| | | // 商户订单号 |
| | | String payNum = data.getOut_trade_no(); |
| | | |
| | | LogUtil.info("支付回调关键信息---total_fee:{},payNum:{},moneyCardUseFlowId:{}", total_fee, payNum, moneyCardUseFlowId); |
| | | // 订单ID |
| | | Double payMoney = new BigDecimal(total_fee).divide(new BigDecimal(100), 2, |
| | | BigDecimal.ROUND_HALF_DOWN).doubleValue(); |
| | | |
| | | if (moneyCardUseFlow.getCarUseId()==null) { |
| | | |
| | | if(payMoney.equals(moneyCardUseFlow.getTotal())){ |
| | | threadResult.putInMap("status", "success"); |
| | | resXml = AppConstance.RESULT_XML_SUCCESS; |
| | | MoneyCardUse moneyCardUse = moneyCardUseDao.selectVipCard(user.getId()); |
| | | moneyCardUseFlow.setCarUseId(moneyCardUse.getId()); |
| | | moneyCardUseFlow.setCardName(moneyCardUse.getCardName()); |
| | | Double balance=moneyCardUse.getGiftMoney() + moneyCardUse.getRealMoney(); |
| | | moneyCardUseFlow.setBalance(balance==null?0:balance); |
| | | moneyCardUseFlowDao.update(moneyCardUseFlow); |
| | | |
| | | moneyCardUse.setRealMoney(moneyCardUse.getRealMoney()+payMoney.doubleValue()); |
| | | moneyCardUseDao.update(moneyCardUse); |
| | | |
| | | //充值记录 |
| | | recordPayLog(Integer.valueOf(moneyCardUseFlowId),2,moneyCardUseFlow.getPayNo(),new BigDecimal(payMoney), "充值成功", ShopOrder.ORDER_PAY_STATUS_SUCCESS); |
| | | }else{ |
| | | LogUtil.debug("支付金额不一致,检查支付金额payMoney={},order.getPayMoney()={}", payMoney, moneyCardUseFlow.getTotal()); |
| | | threadResult.putInMap("status", "err"); |
| | | threadResult.putInMap("msg", "支付金额不一致"); |
| | | resXml = AppConstance.RESULT_XML_FAIL.replace(ERRORMSG, "微信标识业务是失败"); |
| | | } |
| | | |
| | | } else { |
| | | LogUtil.info("充值已经确认"); |
| | | } |
| | | |
| | | } else { |
| | | LogUtil.info("微信标识业务是失败"); |
| | | threadResult.putInMap("status", "err"); |
| | | threadResult.putInMap("msg", "查询支付信息失败,请联系客服或者刷新支付信息(错误码:001)"); |
| | | resXml = AppConstance.RESULT_XML_FAIL.replace(ERRORMSG, "微信标识业务是失败"); |
| | | } |
| | | } else { |
| | | LogUtil.info("无效签名"); |
| | | threadResult.putInMap("status", "err"); |
| | | threadResult.putInMap("msg", "查询支付信息失败,请联系客服或者刷新支付信息(错误码:002)"); |
| | | resXml = AppConstance.RESULT_XML_FAIL.replace(ERRORMSG, "微信标识业务是失败"); |
| | | } |
| | | } else { |
| | | LogUtil.info("通信标识失败"); |
| | | threadResult.putInMap("status", "err"); |
| | | threadResult.putInMap("msg", "查询支付信息失败,请联系客服或者刷新支付信息(错误码:003)"); |
| | | resXml = AppConstance.RESULT_XML_FAIL.replace(ERRORMSG, "通信标识失败"); |
| | | } |
| | | } catch (Exception e) { |
| | | LogUtil.error("支付回调签名错误", e); |
| | | threadResult.putInMap("status", "err"); |
| | | threadResult.putInMap("msg", "查询支付信息失败,请联系客服或者刷新支付信息(错误码:004)"); |
| | | resXml = AppConstance.RESULT_XML_FAIL.replace(ERRORMSG, "支付回调签名错误"); |
| | | } finally { |
| | | // 通知线程消息 |
| | | PayThreadPool.notifyThread(Integer.valueOf(moneyCardUseFlowId), threadResult); |
| | | sendResultBack(response, resXml); |
| | | } |
| | | return; |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | private void recordPayLog(Integer orderId, Integer type,String orderNo, BigDecimal payMoney, String payRemark, int payStatus) { |
| | | //设置支付类型为收款 |
| | | payLog.setPayType(1); |
| | | ShopPayLog payLog=new ShopPayLog(); |
| | | payLog.setPayType(type); |
| | | payLog.setJoinId(orderId); |
| | | payLog.setPayMoney(payMoney); |
| | | payLog.setPayOrderNo(order.getOrderNo()); |
| | | payLog.setPayOrderNo(orderNo); |
| | | payLog.setPayRemark(payRemark); |
| | | payLog.setPayStatus(payStatus); |
| | | payLog.setCreateBy(AppConstance.SYSTEM_USER); |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.component.redis.RedisClient; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.core.tools.UUIDUtil; |
| | | import com.matrix.system.app.authority.AppAuthorityManager; |
| | | import com.matrix.system.app.dto.LoginDto; |
| | | import com.matrix.system.app.dto.PwdResetDto; |
| | | import com.matrix.system.app.dto.SmsCodeDto; |
| | | import com.matrix.system.app.dto.UploadPhotoDto; |
| | | import com.matrix.system.app.vo.UserInfoVo; |
| | | import com.matrix.system.common.authority.strategy.AccountPasswordLogin; |
| | | import com.matrix.system.common.authority.strategy.LoginStrategy; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.service.SysUsersService; |
| | | import com.matrix.system.common.tools.PasswordUtil; |
| | | import com.matrix.system.hive.bean.AppVersion; |
| | | import com.matrix.system.hive.bean.SysOrderFlow; |
| | | import com.matrix.system.hive.bean.SysShopInfo; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.dao.SysOrderDao; |
| | | import com.matrix.system.hive.dao.SysOrderFlowDao; |
| | | import com.matrix.system.hive.dao.SysOrderItemDao; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import com.matrix.system.hive.plugin.util.CollectionUtils; |
| | | import com.matrix.system.hive.plugin.util.ImageUtil; |
| | | import com.matrix.system.hive.service.SysShopInfoService; |
| | | import com.matrix.system.shopXcx.api.dto.ErpOrderListDto; |
| | | import com.matrix.system.shopXcx.api.vo.ErpOrderDetailFlowVo; |
| | | import com.matrix.system.shopXcx.api.vo.ErpOrderDetailItemVo; |
| | | import com.matrix.system.shopXcx.api.vo.ErpOrderDetailVo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.io.File; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.security.NoSuchAlgorithmException; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | |
| | | @Value("${static_resource_url}") |
| | | private String nginxUrl; |
| | | |
| | | @ApiOperation(value = "查询用户所有在ERP中产生的订单" ) |
| | | @ApiOperation(value = "查询用户所有在ERP中产生的订单") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "OK", response = ErpOrderListDto.class) |
| | | @ApiResponse(code = 200, message = "OK", response = ErpOrderListDto.class) |
| | | }) |
| | | @PostMapping(value = "/findUserOrderList") |
| | | public AjaxResult findUserOrderList(@RequestBody @Validated ErpOrderListDto erpOrderListDto) { |
| | | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo vipInfo = vipInfoDao.selectByPhone(bizUser.getPhoneNumber()); |
| | | if(vipInfo!=null){ |
| | | erpOrderListDto.setVipId(vipInfo.getId()); |
| | | List<ErpOrderDetailVo> rows=sysOrderDao.selectErpOrderList(erpOrderListDto); |
| | | rows.forEach(item->{ |
| | | item.setItems(orderItemDao.selectErpOrderItemByOrderId(item.getOrderId())); |
| | | }); |
| | | return AjaxResult.buildSuccessInstance(rows,"查询成功"); |
| | | }else{ |
| | | return AjaxResult.buildFailInstance("未查询到相关订单001"); |
| | | } |
| | | SysVipInfo vipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | |
| | | erpOrderListDto.setVipId(vipInfo.getId()); |
| | | List<ErpOrderDetailVo> rows = sysOrderDao.selectErpOrderList(erpOrderListDto); |
| | | rows.forEach(item -> { |
| | | item.setItems(orderItemDao.selectErpOrderItemByOrderId(item.getOrderId())); |
| | | }); |
| | | return AjaxResult.buildSuccessInstance(rows, "查询成功"); |
| | | |
| | | |
| | | } |
| | | |
| | | @ApiOperation(value = "查询用户在ERP中的订单详情" ) |
| | | @ApiOperation(value = "查询用户在ERP中的订单详情") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "OK", response = ErpOrderListDto.class) |
| | | @ApiResponse(code = 200, message = "OK", response = ErpOrderListDto.class) |
| | | }) |
| | | @GetMapping(value = "/findUserOrderById/{orderId}") |
| | | public AjaxResult findUserOrderList(@PathVariable Long orderId) { |
| | | ErpOrderDetailVo order=sysOrderDao.findUserOrderById(orderId); |
| | | ErpOrderDetailVo order = sysOrderDao.findUserOrderById(orderId); |
| | | order.setItems(orderItemDao.selectErpOrderItemByOrderId(order.getOrderId())); |
| | | List<SysOrderFlow> sysOrderFlows = orderFlowDao.selectPayMethodsAmountByOrderId(orderId); |
| | | List<ErpOrderDetailFlowVo> flowVos=new ArrayList<>(); |
| | | sysOrderFlows.forEach(item->{ |
| | | List<ErpOrderDetailFlowVo> flowVos = new ArrayList<>(); |
| | | sysOrderFlows.forEach(item -> { |
| | | ErpOrderDetailFlowVo erpOrderDetailFlowVo = new ErpOrderDetailFlowVo(); |
| | | BeanUtils.copyProperties(item,erpOrderDetailFlowVo); |
| | | BeanUtils.copyProperties(item, erpOrderDetailFlowVo); |
| | | flowVos.add(erpOrderDetailFlowVo); |
| | | }); |
| | | order.setFlow(flowVos); |
| | | AjaxResult result = AjaxResult.buildSuccessInstance("查询成功"); |
| | | result.putInMap("order",order); |
| | | return result; |
| | | result.putInMap("order", order); |
| | | return result; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.biz.bean.BizUser; |
| | | |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.system.shopXcx.bean.ShopWxAcode; |
| | | import com.matrix.component.tools.WxacodeUtil; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.system.shopXcx.api.WeChatApiTools; |
| | | import com.matrix.system.shopXcx.bean.ShopWxAcode; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | import java.util.Collections; |
| | | |
| | | /** |
| | | * @description 获取<link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}">接口 |
| | | * @description 获取 |
| | | * @author jiangyouyao |
| | | * @date 2019-07-03 15:15 |
| | | */ |
| | |
| | | public class WxGetAcodeAction { |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | @Autowired |
| | | WeChatApiTools weChatApiTools; |
| | | /** |
| | | * 获取微信二维码 |
| | | * @param |
| | |
| | | @PostMapping("/getWxAcode") |
| | | @ResponseBody |
| | | public AjaxResult getWxAcode(@RequestBody ShopWxAcode wxAcode) { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | String openId = loginUser.getOpenId(); |
| | | //String openId = "omfv64kVgvGpz6D8p4J3WZYuT6M4"; |
| | | try { |
| | | String wxacodeUrl = WxacodeUtil.getWxacode(wxAcode.getScene(), wxAcode.getPage(), wxAcode.getFileName()); |
| | | String wxacodeUrl = WxacodeUtil.getWxacode(wxAcode.getScene(), wxAcode.getPage(), wxAcode.getFileName(), |
| | | weChatApiTools.getAppid(loginUser.getCompanyId()),weChatApiTools.getSecret(loginUser.getCompanyId())); |
| | | String substring = wxacodeUrl.substring(0, 5); |
| | | if("error".equals(substring)){ |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, wxacodeUrl); |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.common.bean.CustomerDataDictionary; |
| | | import com.matrix.system.common.dao.CustomerDataDictionaryDao; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | |
| | | @PostMapping(value = "/saveInvoice") |
| | | public @ResponseBody |
| | | AjaxResult saveInvoice(@RequestBody ShopInvoice shopInvoice) { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | shopInvoice.setCreateBy(loginUser.getOpenId()); |
| | | shopInvoice.setUpdateBy(loginUser.getOpenId()); |
| | | shopInvoice.setUserId(loginUser.getOpenId()); |
| | |
| | | @PostMapping("/findProductComment") |
| | | @ResponseBody |
| | | public AjaxResult getProductCommentByUserId(@RequestBody ShopInvoice shopInvoice) { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | String userId = loginUser.getOpenId(); |
| | | shopInvoice.setUserId(userId); |
| | | List<ShopInvoice> list = invoiceDao.selectByUserId(shopInvoice); |
New file |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.component.wechat.externalInterface.protocol.paramProtocol.BrandWCPayRequestData; |
| | | import com.matrix.component.wechat.externalInterface.weixinUtil.WeixinServiceUtil; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.pojo.BasePageQueryDto; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.system.hive.bean.MoneyCardUse; |
| | | import com.matrix.system.hive.bean.MoneyCardUseFlow; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.dao.MoneyCardUseFlowDao; |
| | | import com.matrix.system.hive.dao.MoneyCardUseV2Dao; |
| | | import com.matrix.system.hive.service.CodeService; |
| | | import com.matrix.system.shopXcx.api.dto.MoneyCardUseFlowDto; |
| | | import com.matrix.system.shopXcx.api.vo.WxMoneyCardUseVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiResponse; |
| | | import io.swagger.annotations.ApiResponses; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author jyy |
| | | * @date 2021-04-09 |
| | | **/ |
| | | @Api(tags = "会员储值卡") |
| | | @RestController |
| | | @RequestMapping(value = "/wxapi/moneyCardUse") |
| | | public class WxMoneyCardUseAction { |
| | | |
| | | @Autowired |
| | | WeixinServiceUtil weixinServiceUtil; |
| | | |
| | | |
| | | @Autowired |
| | | private MoneyCardUseV2Dao moneyCardUseV2Dao; |
| | | |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | |
| | | @Autowired |
| | | MoneyCardUseFlowDao moneyCardUseFlowDao; |
| | | |
| | | @Autowired |
| | | CodeService codeService; |
| | | |
| | | |
| | | |
| | | |
| | | @ApiOperation(value = "查询会员主卡", notes = "") |
| | | @GetMapping(value = "/getUserVipCard") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "ok", response = WxMoneyCardUseVO.class) |
| | | }) |
| | | public AjaxResult getUserVipCard() { |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | QueryWrapper queryWrapper = new QueryWrapper(); |
| | | queryWrapper.eq("vip_id", sysVipInfo.getId()); |
| | | queryWrapper.eq("is_vip_car","Y"); |
| | | MoneyCardUse moneyCardUse = moneyCardUseV2Dao.selectOne(queryWrapper); |
| | | WxMoneyCardUseVO vo = new WxMoneyCardUseVO(); |
| | | BeanUtils.copyProperties(moneyCardUse, vo); |
| | | return AjaxResult.buildSuccessInstance(vo); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "查询会员储值卡", notes = "") |
| | | @PostMapping(value = "/getUserMoneyCardUseList") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "ok", response = WxMoneyCardUseVO.class) |
| | | }) |
| | | public AjaxResult getUserMoneyCardUseList(@RequestBody @Validated BasePageQueryDto pageDto) { |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | QueryWrapper queryWrapper = new QueryWrapper(); |
| | | queryWrapper.eq("vip_id", sysVipInfo.getId()); |
| | | IPage<MoneyCardUse> page = new Page<>(pageDto.getPageNum(), pageDto.getPageSize()); |
| | | IPage pageList = moneyCardUseV2Dao.selectPage(page, queryWrapper); |
| | | List<WxMoneyCardUseVO> rows = (List<WxMoneyCardUseVO>) pageList.getRecords().stream().map(item -> { |
| | | WxMoneyCardUseVO vo = new WxMoneyCardUseVO(); |
| | | BeanUtils.copyProperties(item, vo); |
| | | return vo; |
| | | }).collect(Collectors.toList()); |
| | | System.out.println(rows.get(0).getId()); |
| | | return AjaxResult.buildSuccessInstance(rows); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ApiOperation(value = "创建储值卡充值预付单", notes = "传入参数 {rechargeAmount:10} 最少充值1元,最多2位小数 ") |
| | | @PostMapping(value = "/createRechargeOrder") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "ok", response = AjaxResult.class) |
| | | }) |
| | | public AjaxResult createRechargeOrder(@RequestBody Map<String, String> param) throws Exception { |
| | | |
| | | String rechargeAmount = param.get("rechargeAmount"); |
| | | if (StringUtils.isBlank(rechargeAmount)) { |
| | | return AjaxResult.buildFailInstance("请输入充值金额"); |
| | | } |
| | | double total = new BigDecimal(rechargeAmount).setScale(2, BigDecimal.ROUND_HALF_DOWN).doubleValue(); |
| | | if (total < 0.02) { |
| | | return AjaxResult.buildFailInstance("充值金额最底1元"); |
| | | } |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | MoneyCardUseFlow moneyCardUseFlow = new MoneyCardUseFlow(); |
| | | moneyCardUseFlow.setVipId(sysVipInfo.getId()); |
| | | moneyCardUseFlow.setPayNo(codeService.get32LenNumberCode()); |
| | | moneyCardUseFlow.setTotal(total); |
| | | moneyCardUseFlow.setCreateTime(new Date()); |
| | | moneyCardUseFlow.setType(MoneyCardUseFlow.USE_TYPE_CZ); |
| | | moneyCardUseFlowDao.insert(moneyCardUseFlow); |
| | | moneyCardUseFlow.setContent("微信充值"); |
| | | BrandWCPayRequestData payData = weixinServiceUtil.createRechargeOrder("储值卡充值", moneyCardUseFlow.getPayNo(), |
| | | (int) (moneyCardUseFlow.getTotal() * 100), sysVipInfo.getOpenId(), String.valueOf(moneyCardUseFlow.getId())); |
| | | AjaxResult result = AjaxResult.buildSuccessInstance(payData); |
| | | result.putInMap("orderId", moneyCardUseFlow.getId()); |
| | | return result; |
| | | } |
| | | |
| | | @ApiOperation(value = "查询充值结果", notes = " ") |
| | | @GetMapping(value = "/getRechargePayStatus/{orderId}") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "ok", response = AjaxResult.class) |
| | | }) |
| | | public AjaxResult getRechargePayStatus(@PathVariable Long orderId) { |
| | | AjaxResult result =AjaxResult.buildSuccessInstance("查询成功"); |
| | | MoneyCardUseFlow moneyCardUseFlow = moneyCardUseFlowDao.selectById(orderId); |
| | | if (moneyCardUseFlow.getCarUseId() != null) { |
| | | result.putInMap("status", "success"); |
| | | result.putInMap("msg", "支付成功"); |
| | | } else { |
| | | LogUtil.debug("充值等待支付中={}。。。", orderId); |
| | | PayThreadPool.waitThread(orderId.intValue(), new Object()); |
| | | result = PayThreadPool.getThreadResult(orderId.intValue()); |
| | | LogUtil.debug("充值订单支付完成={}。。。", orderId); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation(value = "查询会员储值卡充值使用记录", notes = "keywords 传入会员卡ID") |
| | | @PostMapping(value = "/getRechargeList") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "ok", response = MoneyCardUseFlow.class) |
| | | }) |
| | | public AjaxResult getRechargeList(@RequestBody @Validated MoneyCardUseFlowDto pageDto) { |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | pageDto.setCompanyId(sysVipInfo.getCompanyId()); |
| | | List<MoneyCardUseFlow> dataList = moneyCardUseFlowDao.selectForWxInPage(pageDto); |
| | | return AjaxResult.buildSuccessInstance(dataList); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | @Autowired |
| | | private ShopProductAttributeDao shopProductAttributeDao; |
| | | |
| | | @RequestMapping("/getByCode/{shopId}/{attrCode}") |
| | | @RequestMapping("/getByCode/{attrCode}") |
| | | @ResponseBody |
| | | public AjaxResult getProductAttributeByCode(@PathVariable("shopId") Long shopId, @PathVariable("attrCode") String attrCode){ |
| | | public AjaxResult getProductAttributeByCode(@PathVariable("attrCode") String attrCode){ |
| | | |
| | | if(!StringUtils.isNotBlank(attrCode)){ |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL,"属性编码不能为空"); |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.system.common.bean.BusParameterSettings; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.score.constant.ScoreSettingConstant; |
| | | import com.matrix.system.score.entity.ScoreVipDetail; |
| | | import com.matrix.system.score.service.ScoreVipDetailService; |
| | | import com.matrix.system.shopXcx.bean.ShopOrder; |
| | | import com.matrix.system.shopXcx.bean.ShopProductComment; |
| | | import com.matrix.system.shopXcx.dao.ShopOrderDao; |
| | |
| | | @Autowired |
| | | private ShopOrderDao shopOrderDao; |
| | | |
| | | @Autowired |
| | | ScoreVipDetailService scoreVipDetailService; |
| | | |
| | | @Autowired |
| | | private BusParameterSettingsDao busParameterSettingsDao; |
| | | /** |
| | | * 根据ID逻辑删除产品评价 |
| | | * @param |
| | |
| | | @PostMapping(value = "/saveProductComment") |
| | | public @ResponseBody |
| | | AjaxResult saveProductComment(@RequestBody List<ShopProductComment> commentList) { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | int flag = 0; |
| | | if(CollectionUtils.isNotEmpty(commentList)){ |
| | | for(ShopProductComment productComment : commentList){ |
| | |
| | | modifyMap.put("id", orderId); |
| | | modifyMap.put("orderStatus", ShopOrder.ORDER_STATUS_ALREADY_REMARK); |
| | | shopOrderDao.updateByMap(modifyMap); |
| | | |
| | | //添加用户积分 |
| | | BusParameterSettings parameterSetting = busParameterSettingsDao.selectCompanyParamByCode(ScoreSettingConstant.EVALUATUIN_ORDER_SHOP_NAME, loginUser.getCompanyId()); |
| | | scoreVipDetailService.addScoreByParamSetting(loginUser.getId(), null,null, commentList.get(0).getComId(), |
| | | ScoreVipDetail.SCORE_VIP_TYPE_JOIN_ACTIVE,"评价送积分", parameterSetting); |
| | | |
| | | |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, "保存成功"); |
| | | } |
| | | |
| | |
| | | @PostMapping("/findProductComment") |
| | | @ResponseBody |
| | | public AjaxResult getProductCommentByUserId(@RequestBody ShopProductComment productComment) { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | String userId = loginUser.getOpenId(); |
| | | productComment.setUserId(userId); |
| | | List<ShopProductComment> list = productCommentDao.selectByUserId(productComment); |
| | |
| | | |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | |
| | |
| | | @PostMapping(value = "/saveReceiveAddress") |
| | | public @ResponseBody |
| | | AjaxResult saveReceiveAddress(@RequestBody ShopReceiveAddress receiveAddress) { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | receiveAddress.setCreateBy(loginUser.getOpenId()); |
| | | receiveAddress.setUpdateBy(loginUser.getOpenId()); |
| | | receiveAddress.setAddrUserid(loginUser.getOpenId()); |
| | |
| | | @PostMapping("/findReceiveAddress") |
| | | @ResponseBody |
| | | public AjaxResult getByAddrUserId(@RequestBody ShopReceiveAddress receiveAddress) { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | String userId = loginUser.getOpenId(); |
| | | receiveAddress.setAddrUserid(userId); |
| | | List<ShopReceiveAddress> list = shopReceiveAddressDao.selectByModel(receiveAddress); |
| | |
| | | @PostMapping("/findAddrByAddrId/{addrId}") |
| | | @ResponseBody |
| | | public AjaxResult getByAddrId(@PathVariable("addrId") Integer addrId) { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | String userId = loginUser.getOpenId(); |
| | | ShopReceiveAddress params = new ShopReceiveAddress(); |
| | | params.setAddrUserid(userId); |
| | |
| | | @PostMapping(value = "/updateReceiveAddress") |
| | | public @ResponseBody |
| | | AjaxResult updateReceiveAddress(@RequestBody ShopReceiveAddress receiveAddress) { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | receiveAddress.setCreateBy(loginUser.getOpenId()); |
| | | receiveAddress.setUpdateBy(loginUser.getOpenId()); |
| | | receiveAddress.setAddrUserid(loginUser.getOpenId()); |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.component.tools.WxUtils; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | |
| | | @PostMapping(value = "/saveRefundRecord") |
| | | public @ResponseBody |
| | | AjaxResult saveRefundRecord(@RequestBody ShopRefundRecord refundRecord) { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | refundRecord.setCreateBy(loginUser.getOpenId()); |
| | | refundRecord.setUpdateBy(loginUser.getOpenId()); |
| | | refundRecord.setUserId(loginUser.getOpenId()); |
| | | refundRecord.setUserId(loginUser.getId()); |
| | | refundRecord.setCompanyId(loginUser.getCompanyId()); |
| | | refundRecord.setAuditStatus(AppConstance.REFUND_NOT_AUDITED); |
| | | refundRecord.setRefundStatus(AppConstance.REFUND_PROCESSING); |
| | |
| | | refundRecord.setApplyTime(new Date()); |
| | | |
| | | ShopRefundRecord record = new ShopRefundRecord(); |
| | | record.setUserId(loginUser.getOpenId()); |
| | | record.setUserId(loginUser.getId()); |
| | | record.setOrderId(refundRecord.getOrderId()); |
| | | List<ShopRefundRecord> shopRefundRecords = refundRecordDao.selectByModel(record); |
| | | if(CollectionUtils.isNotEmpty(shopRefundRecords)){ |
| | |
| | | |
| | | if(flag){ |
| | | ShopRefundRecord fundRecord = refundRecordDao.selectById(shopRecord.getId()); |
| | | refundRecordService.sendRefundInfoToUser(fundRecord); |
| | | refundRecordService.updateGroupBuyStatus(orderId.longValue()); |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, "退款成功"); |
| | | } |
| | |
| | | @PostMapping("/findRefundRecord") |
| | | @ResponseBody |
| | | public AjaxResult getRefundRecordByUserId(@RequestBody ShopRefundRecord refundRecord) { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | String userId = loginUser.getOpenId(); |
| | | refundRecord.setUserId(userId); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | refundRecord.setUserId(loginUser.getId()); |
| | | List<ShopRefundRecord> list = refundRecordDao.selectByRefundUserId(refundRecord); |
| | | AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, list, list.size()); |
| | | return result; |
New file |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.fenxiao.dao.ShopSalesmanApplyDao; |
| | | import com.matrix.system.fenxiao.dao.ShopSalesmanOrderDao; |
| | | import com.matrix.system.fenxiao.service.ShopSalesmanApplyService; |
| | | import com.matrix.system.shopXcx.api.dto.SaleOrderDto; |
| | | import com.matrix.system.shopXcx.vo.SalesOrderVo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiResponse; |
| | | import io.swagger.annotations.ApiResponses; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | 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; |
| | | |
| | | /** |
| | | * @author jyy |
| | | * @date 2021-03-10 |
| | | **/ |
| | | @Api(tags = "分销订单接口类") |
| | | @RestController |
| | | @RequestMapping(value = "/wxapi/salesOrder") |
| | | public class WxSalesOrderAction { |
| | | |
| | | @Autowired |
| | | BusParameterSettingsDao busParameterSettingsDao; |
| | | |
| | | @Autowired |
| | | ShopSalesmanApplyDao salesmanApplyDao; |
| | | |
| | | |
| | | @Autowired |
| | | ShopSalesmanApplyService shopSalesmanApplyService; |
| | | |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | |
| | | @Autowired |
| | | private SysVipInfoDao sysVipInfoDao; |
| | | |
| | | @Autowired |
| | | private ShopSalesmanOrderDao shopSalesmanOrderDao; |
| | | |
| | | |
| | | @ApiOperation(value = "获取推广订单", notes = "") |
| | | @PostMapping(value = "/getOrderList") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "ok", response = SalesOrderVo.class) |
| | | }) |
| | | AjaxResult getInvitationuserList(@RequestBody @Validated SaleOrderDto saleOrderDto) { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | Page<SalesOrderVo> page=new Page<>(saleOrderDto.getPageNum(),saleOrderDto.getPageSize()); |
| | | if(StringUtils.isBlank(saleOrderDto.getSort())){ |
| | | saleOrderDto.setSort("create_time"); |
| | | saleOrderDto.setOrder("desc"); |
| | | } |
| | | saleOrderDto.setUserId(loginUser.getId()); |
| | | IPage<SalesOrderVo> shopSalesmanApplyIPage = shopSalesmanOrderDao.selectSalesManOrder(page, saleOrderDto); |
| | | AjaxResult result=AjaxResult.buildSuccessInstance(shopSalesmanApplyIPage.getRecords()); |
| | | return result; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.common.interceptor.HostInterceptor; |
| | | import com.matrix.system.shopXcx.api.dto.SaleProductDto; |
| | | import com.matrix.system.shopXcx.bean.ShopProduct; |
| | | import com.matrix.system.shopXcx.dao.ShopProductAttributeDao; |
| | | import com.matrix.system.shopXcx.dao.ShopProductDao; |
| | | import com.matrix.system.shopXcx.dao.ShopSkuDao; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiResponse; |
| | | import io.swagger.annotations.ApiResponses; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | 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.util.List; |
| | | |
| | | /** |
| | | * @author jyy |
| | | * @date 2021-03-10 |
| | | **/ |
| | | @Api(tags = "分销商品类") |
| | | @RestController |
| | | @RequestMapping(value = "/wxapi/salesProduct") |
| | | public class WxSalesProductAction { |
| | | |
| | | @Autowired |
| | | private ShopProductDao shopProductDao; |
| | | |
| | | @Autowired |
| | | private ShopProductAttributeDao shopProductAttributeDao; |
| | | |
| | | @Autowired |
| | | private ShopSkuDao shopSkuDao; |
| | | |
| | | @ApiOperation(value = "查询推广商品", notes = "") |
| | | @PostMapping(value = "/getSalesProductList") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "ok", response=SaleProductDto.class) |
| | | }) |
| | | public AjaxResult getShopProductShowList(@RequestBody @Validated SaleProductDto saleProductDto) { |
| | | ShopProduct shopProduct=new ShopProduct(); |
| | | shopProduct.setLimit(saleProductDto.getPageSize()); |
| | | shopProduct.setOffset((saleProductDto.getPageNum()-1)* saleProductDto.getPageSize()); |
| | | shopProduct.setCategoryId(saleProductDto.getCategoryId()); |
| | | shopProduct.setDelFlag(AppConstance.DATA_USEABLE); |
| | | shopProduct.setStatus(AppConstance.IS_PUTAWAY); |
| | | shopProduct.setAbleSales(ShopProduct.ABLE_SALES); |
| | | shopProduct.setCompanyId(HostInterceptor.getCompanyId()); |
| | | List<ShopProduct> shopProducts = shopProductDao.selectByModelWx(shopProduct); |
| | | shopProducts.forEach(item->item.setSkus(shopSkuDao.selectByPid(item.getId()))); |
| | | AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, shopProducts); |
| | | return result; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.component.wechat.externalInterface.weixinUtil.WeixinServiceUtil; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.pojo.BasePageQueryDto; |
| | | import com.matrix.system.fenxiao.dao.ShopRevenueFlowDao; |
| | | import com.matrix.system.fenxiao.entity.ShopRevenueFlow; |
| | | import com.matrix.system.hive.service.CodeService; |
| | | import com.matrix.system.shopXcx.api.dto.RevenueFlowDto; |
| | | import com.matrix.system.shopXcx.api.dto.WithdrawalCashDto; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiResponse; |
| | | import io.swagger.annotations.ApiResponses; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.validation.annotation.Validated; |
| | | 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.util.Date; |
| | | |
| | | /** |
| | | * @author jyy |
| | | * @date 2021-03-10 |
| | | **/ |
| | | @Api(tags = "提现接口类") |
| | | @RestController |
| | | @RequestMapping(value = "/wxapi/salesWithdrawal") |
| | | public class WxSalesWithdrawalAction { |
| | | |
| | | |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | |
| | | @Autowired |
| | | private SysVipInfoDao sysVipInfoDao; |
| | | |
| | | @Autowired |
| | | private ShopRevenueFlowDao revenueFlowDao; |
| | | |
| | | |
| | | @Autowired |
| | | private ShopRevenueFlowDao shopRevenueFlowDao; |
| | | @Autowired |
| | | WeixinServiceUtil weixinServiceUtil; |
| | | |
| | | @Autowired |
| | | CodeService codeService; |
| | | |
| | | @ApiOperation(value = "获取收支明细", notes = "") |
| | | @PostMapping(value = "/getRevenueFlow") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "ok", response = ShopRevenueFlow.class) |
| | | }) |
| | | AjaxResult getInvitationuserList(@RequestBody @Validated RevenueFlowDto revenueFlowDto) { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | Page<ShopRevenueFlow> page=new Page<>(revenueFlowDto.getPageNum(),revenueFlowDto.getPageSize()); |
| | | revenueFlowDto.setUserId(loginUser.getId()); |
| | | IPage<ShopRevenueFlow> shopSalesmanApplyIPage = revenueFlowDao.selectRevenuFlowList(page, revenueFlowDto); |
| | | AjaxResult result=AjaxResult.buildSuccessInstance(shopSalesmanApplyIPage.getRecords()); |
| | | return result; |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "提现", notes = "") |
| | | @PostMapping(value = "/withdrawalCash") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "ok", response = BasePageQueryDto.class) |
| | | }) |
| | | @Transactional |
| | | AjaxResult withdrawalCash(@RequestBody @Validated WithdrawalCashDto withdrawalCashDto) { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | loginUser=sysVipInfoDao.selectById(loginUser.getId()); |
| | | if(withdrawalCashDto.getAmount()<1){ |
| | | return AjaxResult.buildFailInstance("最小提现金额为1元"); |
| | | }else if(withdrawalCashDto.getAmount()>20000){ |
| | | return AjaxResult.buildFailInstance("最大提现金额为2万元"); |
| | | }else{ |
| | | if(loginUser.getWithdrawalCash()==null || loginUser.getWithdrawalCash()<withdrawalCashDto.getAmount()){ |
| | | return AjaxResult.buildFailInstance("余额不足"); |
| | | }else{ |
| | | |
| | | String txNo = codeService.get32LenNumberCode(); |
| | | |
| | | /*调试注释 |
| | | weixinServiceUtil.comPay("提现", txNo,Integer.parseInt((withdrawalCashDto.getAmount()*1000)+""), |
| | | loginUser.getOpenId(),loginUser.getCompanyId()); |
| | | */ |
| | | //记录收益流水 |
| | | ShopRevenueFlow invitationRevenueFlow=new ShopRevenueFlow(); |
| | | invitationRevenueFlow.setCompanyId(loginUser.getCompanyId()); |
| | | invitationRevenueFlow.setCreateBy(MatrixConstance.SYSTEM_USER); |
| | | invitationRevenueFlow.setUpdateBy(txNo); |
| | | invitationRevenueFlow.setCreateTime(new Date()); |
| | | invitationRevenueFlow.setUpdateTime(new Date()); |
| | | invitationRevenueFlow.setAmount(-withdrawalCashDto.getAmount()); |
| | | invitationRevenueFlow.setUserId(loginUser.getId()); |
| | | invitationRevenueFlow.setRevenueContent("提现"); |
| | | shopRevenueFlowDao.insert(invitationRevenueFlow); |
| | | //扣除用户剩余提现金额 |
| | | loginUser.setWithdrawalCash(loginUser.getWithdrawalCash()-withdrawalCashDto.getAmount()); |
| | | sysVipInfoDao.update(loginUser); |
| | | redisUserLoginUtils.updateUserInfo(loginUser); |
| | | |
| | | |
| | | return AjaxResult.buildSuccessInstance("提现成功"); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.component.tools.ImageUtil; |
| | | import com.matrix.component.tools.WxacodeUtil; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.pojo.BasePageQueryDto; |
| | | import com.matrix.core.pojo.VerificationResult; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.core.tools.MD5Util; |
| | | import com.matrix.core.tools.PropertiesUtil; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.system.common.bean.BusParameterSettings; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.common.interceptor.HostInterceptor; |
| | | import com.matrix.system.fenxiao.constant.FenxiaoSettingConstant; |
| | | import com.matrix.system.fenxiao.dao.ShopSalesmanApplyDao; |
| | | import com.matrix.system.fenxiao.entity.ShopSalesmanApply; |
| | | import com.matrix.system.fenxiao.service.ShopSalesmanApplyService; |
| | | import com.matrix.system.hive.plugin.util.CollectionUtils; |
| | | import com.matrix.system.shopXcx.api.WeChatApiTools; |
| | | import com.matrix.system.shopXcx.dao.ShopProductDao; |
| | | import com.matrix.system.shopXcx.vo.SalesmanApplyCondition; |
| | | import com.matrix.system.shopXcx.vo.SalesmanCenterInfo; |
| | | import com.matrix.system.shopXcx.vo.SalesmanVo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiResponse; |
| | | import io.swagger.annotations.ApiResponses; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.imageio.ImageIO; |
| | | import java.awt.*; |
| | | import java.awt.image.BufferedImage; |
| | | import java.io.File; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author wzy |
| | | * @date 2021-03-10 |
| | | **/ |
| | | @Api(tags = "推广员接口类") |
| | | @RestController |
| | | @RequestMapping(value = "/wxapi/salesman") |
| | | public class WxSalesmanAction { |
| | | |
| | | @Autowired |
| | | BusParameterSettingsDao busParameterSettingsDao; |
| | | |
| | | @Autowired |
| | | ShopSalesmanApplyDao salesmanApplyDao; |
| | | |
| | | |
| | | @Autowired |
| | | ShopSalesmanApplyService shopSalesmanApplyService; |
| | | |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | |
| | | @Autowired |
| | | private SysVipInfoDao sysVipInfoDao; |
| | | @Autowired |
| | | WeChatApiTools weChatApiTools; |
| | | |
| | | @Autowired |
| | | ShopProductDao shopProductDao; |
| | | |
| | | |
| | | @ApiOperation(value = "查询推广计划", notes = "") |
| | | @GetMapping(value = "/getTgPlan") |
| | | public AjaxResult getTgPlan() { |
| | | BusParameterSettings busParameterSettings = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_TG_PLAN, HostInterceptor.getCompanyId()); |
| | | AjaxResult ajaxResult = AjaxResult.buildSuccessInstance(""); |
| | | ajaxResult.setData(busParameterSettings.getParamValue3()); |
| | | return ajaxResult; |
| | | } |
| | | |
| | | @ApiOperation(value = "查询分销商城开关", notes = "1开启分销,2关闭分销") |
| | | @GetMapping(value = "/getSalesMallSetting") |
| | | public AjaxResult getSalesMallSwith() { |
| | | BusParameterSettings fxSwith = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_SWITCH, HostInterceptor.getCompanyId()); |
| | | BusParameterSettings fxModel = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_MODEL, HostInterceptor.getCompanyId()); |
| | | AjaxResult ajaxResult = AjaxResult.buildSuccessInstance("查询成功"); |
| | | ajaxResult.putInMap("fxSwith", fxSwith.getParamValue()); |
| | | ajaxResult.putInMap("fxModel", fxModel.getParamValue()); |
| | | return ajaxResult; |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "申请成为推广员", notes = "传入参数invitationId 邀请人openId ,非必填 例: {invitationId:openId}") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "ok", response = ShopSalesmanApply.class) |
| | | }) |
| | | @PostMapping(value = "/applyToBeAnSalesman") |
| | | @Transactional |
| | | public AjaxResult applyToBeAnSalesman(@RequestBody Map<String, String> param) { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | Long invitationId=null; |
| | | if(StringUtils.isNotBlank(param.get("invitationId"))){ |
| | | invitationId = Long.parseLong(param.get("invitationId")); |
| | | |
| | | SysVipInfo invitationUser = sysVipInfoDao.selectById(invitationId); |
| | | if (invitationUser != null && invitationUser.getId().equals(loginUser.getId())) { |
| | | return AjaxResult.buildFailInstance("不能邀请自己成为推广员"); |
| | | } |
| | | } |
| | | ShopSalesmanApply shopSalesmanApply = shopSalesmanApplyService.applyToBeAnSalesman(loginUser.getId(), null, invitationId, ShopSalesmanApply.APPLY_WAY_SELF); |
| | | loginUser = sysVipInfoDao.selectById(loginUser.getId()); |
| | | redisUserLoginUtils.updateUserInfo(loginUser); |
| | | return AjaxResult.buildSuccessInstance(shopSalesmanApply); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "查询审核进度", notes = "") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "ok", response = ShopSalesmanApply.class) |
| | | }) |
| | | @GetMapping(value = "/queryApplyProgress") |
| | | public AjaxResult queryApplyProgress() { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | QueryWrapper<ShopSalesmanApply> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("user_id", loginUser.getId()); |
| | | queryWrapper.eq("apply_status", ShopSalesmanApply.APPLY_STATUS_DSH); |
| | | ShopSalesmanApply shopSalesmanApply = salesmanApplyDao.selectOne(queryWrapper); |
| | | return AjaxResult.buildSuccessInstance(shopSalesmanApply); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "绑定下级客户,当客户点击分销员分销的产品时调用", notes = "传入参数invitationId 必须 分销员userId例: {invitationId:userId}") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "ok", response = Map.class) |
| | | }) |
| | | @PostMapping(value = "/bindingParentSalesman") |
| | | public AjaxResult bindingParentSalesman(@RequestBody Map<String, Long> param) { |
| | | Long invitationId = param.get("invitationId"); |
| | | |
| | | |
| | | |
| | | SysVipInfo invitationUser = sysVipInfoDao.selectById(invitationId); |
| | | if (invitationUser == null) { |
| | | return AjaxResult.buildFailInstance("请求参数错误"); |
| | | } |
| | | |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | if (invitationId.equals(loginUser.getId())) { |
| | | return AjaxResult.buildSuccessInstance("不能绑定自己"); |
| | | } |
| | | |
| | | loginUser = sysVipInfoDao.selectById(loginUser.getId()); |
| | | if (loginUser.getIsSales() == 1) { |
| | | return AjaxResult.buildSuccessInstance("只有非分销员才能被绑定成客户"); |
| | | } |
| | | if (loginUser.getRecommendId()!=null) { |
| | | return AjaxResult.buildSuccessInstance("已经被绑定"); |
| | | } else { |
| | | if (loginUser.getRecommendId()==null) { |
| | | Map<String, Object> updateParam = new HashMap<>(); |
| | | updateParam.put("id", loginUser.getId()); |
| | | loginUser.setRecommendId(invitationUser.getId()); |
| | | loginUser.setBindingParentTime(new Date()); |
| | | sysVipInfoDao.update(loginUser); |
| | | return AjaxResult.buildSuccessInstance("绑定成功"); |
| | | } else { |
| | | return AjaxResult.buildSuccessInstance("已经存在上级"); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "生成邀请下级海报", notes = "") |
| | | @PostMapping(value = "/getInvitationPoster") |
| | | AjaxResult getInvitationPoster() { |
| | | try { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | |
| | | String baseSavePath = PropertiesUtil.getString(AppConstance.FILES_TORAGE_PATH); |
| | | // 图片访问URL |
| | | String baseSaveUrl = PropertiesUtil.getString(AppConstance.NGINX_URL); |
| | | |
| | | //目标海报物理存储路径 |
| | | String targetImg = MD5Util.strToMD5(loginUser.getOpenId()) + "haibao.png"; |
| | | String targetImgPath = baseSavePath + "wxacode" + File.separatorChar + targetImg; |
| | | |
| | | String urlPath = baseSaveUrl + "/" + "wxacode" + "/" + targetImg; |
| | | |
| | | String qrcodeSavePath = WxacodeUtil.getWxacode(loginUser.getId() + "", "pages/distributorCenter/applyFor/applyFor", MD5Util.strToMD5(loginUser.getOpenId()) + "qrcode" |
| | | , weChatApiTools.getAppid(loginUser.getCompanyId()), weChatApiTools.getSecret(loginUser.getCompanyId())); |
| | | |
| | | BufferedImage qrcordImgBuf = ImageIO.read(new File(qrcodeSavePath)); |
| | | |
| | | //获取海报 |
| | | BusParameterSettings posterSetting = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_TG_POSTER, loginUser.getCompanyId()); |
| | | String posterPath = baseSavePath + "wxacode" + File.separatorChar + MD5Util.strToMD5(loginUser.getOpenId()) + "poster.png"; |
| | | ImageUtil.downloadPicture(posterSetting.getParamValue(), posterPath); |
| | | BufferedImage posterImgBuf = ImageIO.read(new File(posterPath)); |
| | | |
| | | //获取用户头像 |
| | | String userPhotoPath = baseSavePath + "wxacode" + File.separatorChar + MD5Util.strToMD5(loginUser.getOpenId()) + "userPhoto.png"; |
| | | ImageUtil.downloadPicture(loginUser.getAvatarUrl(), userPhotoPath); |
| | | BufferedImage userPhotoImgBuf = ImageIO.read(new File(userPhotoPath)); |
| | | |
| | | |
| | | BufferedImage backgroundImgBuf = new BufferedImage(700, 900, BufferedImage.TYPE_4BYTE_ABGR); |
| | | //绘制背景+产品 |
| | | Graphics2D g = backgroundImgBuf.createGraphics(); |
| | | g.setColor(Color.WHITE); |
| | | g.fillRect(0, 0, 700, 900); |
| | | g.drawImage(posterImgBuf, 0, 0, 700, 700, null); |
| | | |
| | | g.drawImage(userPhotoImgBuf, 20, 720, 80, 80, null); |
| | | |
| | | g.drawImage(qrcordImgBuf, 500, 720, 150, 150, null); |
| | | |
| | | g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB); |
| | | |
| | | g.setFont(new Font("WenQuanYi Micro Hei", Font.BOLD, 24)); |
| | | g.setColor(Color.BLACK); |
| | | g.drawString(loginUser.getNickName() + "邀请你一起推广赚佣金", 120, 750); |
| | | |
| | | g.dispose(); |
| | | ImageIO.write(backgroundImgBuf, "png", new File(targetImgPath)); |
| | | |
| | | return AjaxResult.buildSuccessInstance(urlPath); |
| | | } catch (Exception e) { |
| | | LogUtil.error("推广二维码生成错误:{}", e, ""); |
| | | return AjaxResult.buildFailInstance("二维码生成失败"); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "获取下级列表", notes = "keywords=1 表示下级,keywords=2表示顾客") |
| | | @PostMapping(value = "/getInvitationuserList") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "ok", response = SalesmanVo.class) |
| | | }) |
| | | AjaxResult getInvitationuserList(@RequestBody BasePageQueryDto pageDto) { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | Page<SalesmanVo> page = new Page<>(pageDto.getPageNum(), pageDto.getPageSize()); |
| | | IPage<SalesmanVo> shopSalesmanApplyIPage = salesmanApplyDao.selectInvitationuserInPage(page, loginUser.getId(), pageDto.getKeywords()); |
| | | AjaxResult result = AjaxResult.buildSuccessInstance(shopSalesmanApplyIPage.getRecords()); |
| | | return result; |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "查询分销员中心信息", notes = "") |
| | | @PostMapping(value = "/getSalesmanCenterInfo") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "ok", response = SalesmanCenterInfo.class) |
| | | }) |
| | | AjaxResult getSalesmanCenterInfo() { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SalesmanCenterInfo salesmanCenterInfo = salesmanApplyDao.selectSalesmanCenterInfo(loginUser.getId()); |
| | | return AjaxResult.buildSuccessInstance(salesmanCenterInfo); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询分销员申请条件", notes = "") |
| | | @PostMapping(value = "/getSalesmanApplyCondition") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "ok", response = SalesmanApplyCondition.class) |
| | | }) |
| | | AjaxResult getSalesmanApplyCondition() { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | VerificationResult ableToBeAnSalesman = shopSalesmanApplyService.isAbleToBeAnSalesman(loginUser.getId(), loginUser.getCompanyId()); |
| | | SalesmanApplyCondition applyConditionInfo = new SalesmanApplyCondition(); |
| | | applyConditionInfo.setIsAbleApply(ableToBeAnSalesman.isJudgeResult()); |
| | | applyConditionInfo.setMsg(ableToBeAnSalesman.getMsg()); |
| | | |
| | | //申请条件 |
| | | BusParameterSettings applyCondition = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_APPLY_CONDITION, loginUser.getCompanyId()); |
| | | switch (applyCondition.getParamValue()) { |
| | | case FenxiaoSettingConstant.FX_APPLY_CONDITION_WTJ: |
| | | applyConditionInfo.setCondition("您已满足申请条件"); |
| | | break; |
| | | case FenxiaoSettingConstant.FX_APPLY_CONDITION_XFZDCP: |
| | | applyConditionInfo.setCondition("消费指定产品并确认收货"); |
| | | List<String> strings = StringUtils.strToColl(applyCondition.getParamValue1(), ","); |
| | | List<Integer> ids = strings.stream().filter(i -> StringUtils.isNotBlank(i)).map(i -> Integer.parseInt(i + "")).distinct().collect(Collectors.toList()); |
| | | if (CollectionUtils.isNotEmpty(ids)) { |
| | | applyConditionInfo.setProductList(shopProductDao.selectByIds(ids)); |
| | | } else { |
| | | return AjaxResult.buildFailInstance("未配置消费产品,请联系管理员"); |
| | | } |
| | | |
| | | break; |
| | | case FenxiaoSettingConstant.FX_APPLY_CONDITION_XFRYCP: |
| | | //判断用户是否有确认收货的产品 |
| | | applyConditionInfo.setCondition("消费任意产品并确认收货"); |
| | | break; |
| | | case FenxiaoSettingConstant.FX_APPLY_CONDITION_XCZDJE: |
| | | Double zdje = Double.parseDouble(applyCondition.getParamValue2()); |
| | | applyConditionInfo.setCondition("消费满" + zdje + "元确认收货"); |
| | | applyConditionInfo.setMinAmount(zdje); |
| | | } |
| | | |
| | | return AjaxResult.buildSuccessInstance(applyConditionInfo); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.common.interceptor.HostInterceptor; |
| | | import com.matrix.system.shopXcx.api.dto.SaleProductDto; |
| | | import com.matrix.system.shopXcx.api.dto.ScoreProductDto; |
| | | import com.matrix.system.shopXcx.bean.ShopProduct; |
| | | import com.matrix.system.shopXcx.bean.ShopProductAttribute; |
| | | import com.matrix.system.shopXcx.dao.ShopProductAttributeDao; |
| | | import com.matrix.system.shopXcx.dao.ShopProductDao; |
| | | import com.matrix.system.shopXcx.dao.ShopSkuDao; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiResponse; |
| | | import io.swagger.annotations.ApiResponses; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | 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.util.List; |
| | | |
| | | /** |
| | | * @author jyy |
| | | * @date 2021-03-10 |
| | | **/ |
| | | @Api(tags = "积分商品类") |
| | | @RestController |
| | | @RequestMapping(value = "/wxapi/scoreProduct") |
| | | public class WxScoreProductAction { |
| | | |
| | | @Autowired |
| | | private ShopProductDao shopProductDao; |
| | | |
| | | @Autowired |
| | | private ShopSkuDao shopSkuDao; |
| | | |
| | | @Autowired |
| | | ShopProductAttributeDao shopProductAttributeDao; |
| | | |
| | | @ApiOperation(value = "查询积分商品", notes = "") |
| | | @PostMapping(value = "/getScoreProductList") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "ok", response=SaleProductDto.class) |
| | | }) |
| | | public AjaxResult getShopProductShowList(@RequestBody @Validated ScoreProductDto scoreProductDto) { |
| | | ShopProduct shopProduct=new ShopProduct(); |
| | | shopProduct.setLimit(scoreProductDto.getPageSize()); |
| | | shopProduct.setOffset((scoreProductDto.getPageNum()-1)* scoreProductDto.getPageSize()); |
| | | shopProduct.setScoreCategoryId(scoreProductDto.getScoreCategoryId()); |
| | | shopProduct.setDelFlag(AppConstance.DATA_USEABLE); |
| | | shopProduct.setStatus(AppConstance.IS_PUTAWAY); |
| | | shopProduct.setAbleScorePay(ShopProduct.PAYFOR_SCORE); |
| | | shopProduct.setCompanyId(HostInterceptor.getCompanyId()); |
| | | //根据属性查询 |
| | | if(StringUtils.isNotBlank(scoreProductDto.getAttrCode())){ |
| | | ShopProductAttribute jfscrmtj = shopProductAttributeDao.selectByCode("jfscrmtj", HostInterceptor.getCompanyId()); |
| | | if(jfscrmtj!=null){ |
| | | shopProduct.setAttrs(jfscrmtj.getAttrId()+""); |
| | | } |
| | | } |
| | | List<ShopProduct> shopProducts = shopProductDao.selectByModelWx(shopProduct); |
| | | shopProducts.forEach(item->item.setSkus(shopSkuDao.selectByPid(item.getId()))); |
| | | return AjaxResult.buildSuccessInstance(shopProducts); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.biz.dao.BizUserDao; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.component.tools.WxacodeUtil; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.core.tools.PropertiesUtil; |
| | | import com.matrix.core.tools.UUIDUtil; |
| | | import com.matrix.system.common.bean.BusParameterSettings; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.hive.dao.SysShopInfoDao; |
| | | import com.matrix.system.hive.plugin.util.CollectionUtils; |
| | | import com.matrix.system.shopXcx.api.WeChatApiTools; |
| | | import com.matrix.system.shopXcx.api.pojo.QrcodeImgParam; |
| | | import com.matrix.system.shopXcx.api.vo.QrcodeVo; |
| | | import com.matrix.system.shopXcx.api.vo.WxActivitiesGroupBuyVO; |
| | |
| | | @CrossOrigin(origins = "*", maxAge = 3600) |
| | | public class WxShareProductAction { |
| | | |
| | | |
| | | @Autowired |
| | | WeChatApiTools weChatApiTools; |
| | | @Autowired |
| | | private ShopProductDao shopProductDao; |
| | | |
| | |
| | | ShopActivitiesGroupInfoDao shopActivitiesGroupInfoDao; |
| | | |
| | | @Autowired |
| | | BizUserDao bizUserDao; |
| | | SysVipInfoDao sysVipInfoDao; |
| | | |
| | | |
| | | @Autowired |
| | |
| | | @RequestMapping(value = "/getProductShareQrcode") |
| | | public @ResponseBody |
| | | AjaxResult getwxacode1(@RequestBody QrcodeVo qrcodeVo) throws Exception { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | loginUser = bizUserDao.selectById(loginUser.getUserId()); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | loginUser = sysVipInfoDao.selectById(loginUser.getId()); |
| | | //活动类型 |
| | | ShopActivities activities=null; |
| | | //是否为拼团分享 |
| | |
| | | } |
| | | ShopShareQrcord queryOrcode = new ShopShareQrcord(); |
| | | queryOrcode.setProductId(qrcodeVo.getProductId()); |
| | | queryOrcode.setUserId(loginUser.getOpenId()); |
| | | queryOrcode.setUserId(loginUser.getId()); |
| | | |
| | | if (isGroupProduct ) { |
| | | queryOrcode.setProductId(Integer.parseInt(qrcodeVo.getActId() + "")); |
| | |
| | | //如果未查询到就先插入数据再更新数据 |
| | | shareQrcord.setCreateBy(loginUser.getOpenId()); |
| | | shareQrcord.setUpdateBy(loginUser.getOpenId()); |
| | | shareQrcord.setUserId(loginUser.getOpenId()); |
| | | shareQrcord.setUserId(loginUser.getId()); |
| | | shareQrcord.setShopId(qrcodeVo.getShopId()); |
| | | //拼团活动 |
| | | if (isGroupProduct ) { |
| | |
| | | * @param qrcodeVo |
| | | * @return |
| | | */ |
| | | private QrcodeImgParam getSeckillQrcodeImgParam(BizUser loginUser, QrcodeVo qrcodeVo) throws Exception { |
| | | private QrcodeImgParam getSeckillQrcodeImgParam(SysVipInfo loginUser, QrcodeVo qrcodeVo) throws Exception { |
| | | |
| | | ShopActivitiesSeckillInfo seckillInfo = shopActivitiesSeckillInfoDao.selectById(qrcodeVo.getSkillId()); |
| | | |
| | | ShopProduct shopProduct = shopProductDao.selectById(seckillInfo.getGoodsId().intValue()); |
| | | |
| | | String qrcodeSavePath = WxacodeUtil.getWxacode(qrcodeVo.getScene(), qrcodeVo.getPath(), UUIDUtil.getRandomID()); |
| | | String qrcodeSavePath = WxacodeUtil.getWxacode(qrcodeVo.getScene(), qrcodeVo.getPath(), UUIDUtil.getRandomID() |
| | | ,weChatApiTools.getAppid(loginUser.getCompanyId()),weChatApiTools.getSecret(loginUser.getCompanyId())); |
| | | |
| | | LogUtil.debug("qrcodeSavePath={}", qrcodeSavePath); |
| | | // 图片保存目录路径 |
| | |
| | | * @param qrcodeVo |
| | | * @return |
| | | */ |
| | | private QrcodeImgParam getGroupQrcodeImgParam(BizUser loginUser, QrcodeVo qrcodeVo) throws Exception { |
| | | private QrcodeImgParam getGroupQrcodeImgParam(SysVipInfo loginUser, QrcodeVo qrcodeVo) throws Exception { |
| | | |
| | | WxActivitiesGroupBuyVO groupBuyVO = shopActivitiesGroupInfoDao.selectGroupInfoWithPriceByActId(qrcodeVo.getActId()); |
| | | |
| | | ShopProduct shopProduct = shopProductDao.selectById(groupBuyVO.getGoodsId().intValue()); |
| | | |
| | | String qrcodeSavePath = WxacodeUtil.getWxacode(qrcodeVo.getScene(), qrcodeVo.getPath(), UUIDUtil.getRandomID()); |
| | | String qrcodeSavePath = WxacodeUtil.getWxacode(qrcodeVo.getScene(), qrcodeVo.getPath(), UUIDUtil.getRandomID() |
| | | ,weChatApiTools.getAppid(loginUser.getCompanyId()),weChatApiTools.getSecret(loginUser.getCompanyId())); |
| | | |
| | | LogUtil.debug("qrcodeSavePath={}", qrcodeSavePath); |
| | | // 图片保存目录路径 |
| | |
| | | } |
| | | |
| | | @NotNull |
| | | private QrcodeImgParam getQrcodeImgParam(BizUser loginUser, QrcodeVo qrcodeVo) throws Exception { |
| | | private QrcodeImgParam getQrcodeImgParam(SysVipInfo loginUser, QrcodeVo qrcodeVo) throws Exception { |
| | | |
| | | ShopProduct shopProduct = shopProductDao.selectById(qrcodeVo.getProductId()); |
| | | |
| | | |
| | | |
| | | String qrcodeSavePath = WxacodeUtil.getWxacode(qrcodeVo.getScene(), qrcodeVo.getPath(), UUIDUtil.getRandomID()); |
| | | String qrcodeSavePath = WxacodeUtil.getWxacode(qrcodeVo.getScene(), qrcodeVo.getPath(), UUIDUtil.getRandomID() |
| | | ,weChatApiTools.getAppid(loginUser.getCompanyId()),weChatApiTools.getSecret(loginUser.getCompanyId())); |
| | | |
| | | LogUtil.debug("qrcodeSavePath={}", qrcodeSavePath); |
| | | // 图片保存目录路径 |
| | |
| | | g = b2Img.createGraphics(); |
| | | g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_ATOP, 1)); |
| | | g.drawImage(qrcordImgBuf, 320, 550, 140, 140, null); |
| | | g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); |
| | | g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB); |
| | | //标题 |
| | | g.setColor(new Color(0xF10D0A0A, true)); |
| | | Font font = new Font("微软雅黑", Font.PLAIN, 24); |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.system.common.interceptor.HostInterceptor; |
| | |
| | | */ |
| | | @GetMapping(value = "/findOwnerGroupBuyInfo/{actId}") |
| | | public AjaxResult findOwnerGroupBuyInfo(@PathVariable("actId") Long actId) { |
| | | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | |
| | | // 1、判断该用户在该活动中有没有正在拼团 若有,则返回正在拼团的用户列表,若没有则返回gruoping=1且返回正在拼团的拼团列表, 若加入了团未完成付款,则需要再做设置 |
| | | ShopActivitiesGroupJoin isExsit = shopActivitiesGroupJoinDao.selectIsExistGroupInfoByUserId(actId, bizUser.getOpenId()); |
| | | ShopActivitiesGroupJoin isExsit = shopActivitiesGroupJoinDao.selectIsExistGroupInfoByUserId(actId, sysVipInfo.getOpenId()); |
| | | AjaxResult ajaxResult = new AjaxResult(AjaxResult.STATUS_SUCCESS, null); |
| | | if (isExsit == null) { |
| | | ajaxResult.putInMap("grouping", 2); |
| | |
| | | } else { |
| | | ajaxResult.putInMap("grouping", 1); |
| | | ShopActivitiesGroupJoin groupJoin = shopActivitiesGroupJoinDao.selectOwnerGroupJoinInfoWithNoPay(isExsit.getId()); |
| | | ShopActivitiesGroupJoinUser groupJoinUser = shopActivitiesGroupJoinUserDao.selectGroupJoinUserByUserIdAndGjId(bizUser.getOpenId(), groupJoin.getId()); |
| | | ShopActivitiesGroupJoinUser groupJoinUser = shopActivitiesGroupJoinUserDao.selectGroupJoinUserByUserIdAndGjId(sysVipInfo.getOpenId(), groupJoin.getId()); |
| | | ShopActivitiesGroupPrice price = shopActivitiesGroupPriceDao.selectById(groupJoin.getGpId()); |
| | | int theLast = price.getGpCount() - groupJoin.getJoinUserList().size(); |
| | | groupJoin.setTheLast(theLast); |
| | |
| | | */ |
| | | @GetMapping(value = "/findGroupJoinInfo/{gjId}") |
| | | public AjaxResult findGroupJoinInfo(@PathVariable Long gjId) { |
| | | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | ShopActivitiesGroupJoin groupJoin = shopActivitiesGroupJoinDao.selectOwnerGroupJoinInfo(gjId); |
| | | int isExist = 2; |
| | | |
| | | for (ShopActivitiesGroupJoinUser joinUser : groupJoin.getJoinUserList()) { |
| | | if (bizUser.getOpenId().equals(joinUser.getUserId())) { |
| | | if (sysVipInfo.getOpenId().equals(joinUser.getUserId())) { |
| | | isExist = 1; |
| | | } |
| | | } |
| | |
| | | |
| | | @PostMapping(value = "/calPrice") |
| | | public AjaxResult calPrice(@RequestBody CreateGroupBuyDTO createGroupBuyDTO) { |
| | | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | ShopActivitiesGroupPrice groupPrice = shopActivitiesGroupPriceDao.selectById(createGroupBuyDTO.getGpId()); |
| | | // 判断参数中gjId是否为空,若为空则为团长开团。再判断团长价是否为空,如果不为空则拥有团长价 |
| | | if (createGroupBuyDTO.getGjId() == null) { |
| | |
| | | } else { |
| | | createGroupBuyDTO.setPrice(groupPrice.getGpPrice()); |
| | | } |
| | | BigDecimal postage = wxShopOrderService.calculationPostage(createGroupBuyDTO.getPrice(),bizUser.getCompanyId()); |
| | | BigDecimal postage = wxShopOrderService.calculationPostage(createGroupBuyDTO.getPrice(),sysVipInfo.getCompanyId()); |
| | | BigDecimal payPrice = createGroupBuyDTO.getPrice().multiply(BigDecimal.valueOf(createGroupBuyDTO.getCount())).add(postage); |
| | | AjaxResult ajaxResult = new AjaxResult(AjaxResult.STATUS_SUCCESS, null); |
| | | ajaxResult.putInMap("billPrice", createGroupBuyDTO.getPrice().multiply(BigDecimal.valueOf(createGroupBuyDTO.getCount()))); |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.pojo.PaginationVO; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.system.common.interceptor.HostInterceptor; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.plugin.util.CollectionUtils; |
| | | import com.matrix.system.shopXcx.api.vo.SalonVO; |
| | | import com.matrix.system.shopXcx.bean.ShopActivities; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | */ |
| | | @GetMapping(value = "/findSalonInfoById/{id}") |
| | | public AjaxResult findSalonInfoById(@PathVariable("id") Long id) { |
| | | BizUser user = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo user = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | ShopActivities shopActivities = shopActivitiesDao.selectSalonActivityById(id); |
| | | ShopActivitiesSalonRecord salonRecord = shopActivitiesSalonRecordDao.selectSalonRecordByUserIdAndActId(user.getOpenId(), id); |
| | | AjaxResult ajaxResult = AjaxResult.buildSuccessInstance("获取成功"); |
| | |
| | | @PostMapping(value = "/joinSalonActivity") |
| | | @Transactional |
| | | public AjaxResult joinSalonActivity(@RequestBody CreateSalonDTO salonDTO) { |
| | | BizUser user = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo user = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | |
| | | ShopActivities shopActivities = shopActivitiesDao.selectById(salonDTO.getActId()); |
| | | if (shopActivities == null) { |
| | |
| | | |
| | | ShopActivitiesSalonRecord salonRecord = new ShopActivitiesSalonRecord(); |
| | | salonRecord.setActId(salonDTO.getActId()); |
| | | salonRecord.setUserId(user.getOpenId()); |
| | | salonRecord.setUserId(user.getId()); |
| | | salonRecord.setCreateBy(user.getNickName()); |
| | | salonRecord.setUpdateBy(user.getNickName()); |
| | | salonRecord.setStatus(ShopActivitiesSalonRecord.JOIN_STATUS_ING); |
| | |
| | | */ |
| | | @RequestMapping(value = "/findSalonListByUser") |
| | | public AjaxResult findSalonListByUser(@RequestBody SalonVO salonVO) { |
| | | BizUser user = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo user = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | salonVO.setUserId(user.getOpenId()); |
| | | List<ShopActivities> list = shopActivitiesDao.selectSalonActivityByUser(salonVO); |
| | | return AjaxResult.buildSuccessInstance(list); |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.system.shopXcx.api.service.WXShopOrderService; |
| | |
| | | */ |
| | | @PostMapping(value = "/calSecKillPrice") |
| | | public AjaxResult calSecKillPrice(@RequestBody SecKillVO secKillVO) { |
| | | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | ShopActivitiesSeckillInfo seckillInfo = shopActivitiesSeckillInfoDao.selectById(secKillVO.getId()); |
| | | if (seckillInfo == null) { |
| | | return AjaxResult.buildFailInstance("参数有误"); |
| | | } |
| | | |
| | | BigDecimal postage = wxShopOrderService.calculationPostage(seckillInfo.getSiPrice(),bizUser.getCompanyId()); |
| | | BigDecimal postage = wxShopOrderService.calculationPostage(seckillInfo.getSiPrice(),sysVipInfo.getCompanyId()); |
| | | BigDecimal payPrice = seckillInfo.getSiPrice().multiply(BigDecimal.valueOf(secKillVO.getCount())).add(postage); |
| | | AjaxResult ajaxResult = new AjaxResult(AjaxResult.STATUS_SUCCESS, null); |
| | | ajaxResult.putInMap("totalPrice", payPrice); |
New file |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.system.activity.dao.ActivitySignAwardSetDao; |
| | | import com.matrix.system.activity.dao.ActivitySignReceiveRecordDao; |
| | | import com.matrix.system.activity.dao.ActivitySignRecordDao; |
| | | import com.matrix.system.activity.dao.ActivitySignWriteoffDao; |
| | | import com.matrix.system.activity.entity.ActivitySignAwardSet; |
| | | import com.matrix.system.activity.entity.ActivitySignReceiveRecord; |
| | | import com.matrix.system.activity.entity.ActivitySignRecord; |
| | | import com.matrix.system.activity.entity.ActivitySignWriteoff; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.shopXcx.api.dto.ClickSignDTO; |
| | | import com.matrix.system.shopXcx.api.dto.SeeAwardTextDto; |
| | | import com.matrix.system.shopXcx.api.dto.SignAwardDto; |
| | | import com.matrix.system.shopXcx.api.vo.*; |
| | | import com.matrix.system.shopXcx.bean.ShopActivities; |
| | | import com.matrix.system.shopXcx.dao.ShopActivitiesDao; |
| | | import com.matrix.system.shopXcx.vo.SalesOrderVo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiResponse; |
| | | import io.swagger.annotations.ApiResponses; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Api(tags = "签到活动接口类") |
| | | @RestController |
| | | @RequestMapping(value = "/wxapi/sign") |
| | | public class WxShopActivitiesSignAction { |
| | | |
| | | @Autowired |
| | | private ShopActivitiesDao shopActivitiesDao; |
| | | |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | |
| | | @Autowired |
| | | private ActivitySignAwardSetDao activitySignAwardSetDao; |
| | | |
| | | @Autowired |
| | | private ActivitySignReceiveRecordDao activitySignReceiveRecordDao; |
| | | |
| | | @Autowired |
| | | private ActivitySignWriteoffDao activitySignWriteoffDao; |
| | | |
| | | @Autowired |
| | | private ActivitySignRecordDao activitySignRecordDao; |
| | | |
| | | @ApiOperation(value = "获取签到基本信息", notes = "") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "ok", response = SignBasicInfoVo.class) |
| | | }) |
| | | @GetMapping(value = "/getSignBasicInfo") |
| | | public AjaxResult getSignBasicInfo() { |
| | | //获取登录人信息 |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | Long companyId = loginUser.getCompanyId(); |
| | | Long userId = loginUser.getId(); |
| | | //获取签到活动的信息 |
| | | SignBasicInfoVo signBasicInfoVo = new SignBasicInfoVo(); |
| | | ShopActivities shopActivities = shopActivitiesDao.selectOneByCompanyIdAndActTypeAndActStatus(companyId,ShopActivities.ACTIVITIES_TYPE_SIGN,ShopActivities.ACTSTATUS_STATUS_ING); |
| | | Long actId = shopActivities.getId(); |
| | | signBasicInfoVo.setActName(shopActivities.getActName()); |
| | | signBasicInfoVo.setActCode(shopActivities.getActCode()); |
| | | signBasicInfoVo.setId(shopActivities.getId()); |
| | | String actContent = shopActivities.getActContent(); |
| | | SignBasicInfoJsonVo signBasicInfoJsonVo = JSON.parseObject(actContent, SignBasicInfoJsonVo.class); |
| | | signBasicInfoVo.setSignBasicInfoJsonVo(signBasicInfoJsonVo); |
| | | |
| | | List<ActivitySignAwardSetVo> activitySignAwardSetVos = activitySignAwardSetDao |
| | | .selectListByActIDAndCompanyId(actId,companyId,ActivitySignAwardSet.AWARDSTATE_WORK); |
| | | signBasicInfoVo.setActivitySignAwardSetVos(activitySignAwardSetVos); |
| | | |
| | | //今日是否已经参与 |
| | | ActivitySignRecord activitySignRecord = activitySignRecordDao.selectOneByActIdAndUserIdLikesignTime(actId,userId,new Date()); |
| | | if(ObjectUtil.isNotEmpty(activitySignRecord)) { |
| | | signBasicInfoVo.setJoinState(SignBasicInfoVo.JOINSTATE_SIGN); |
| | | }else { |
| | | signBasicInfoVo.setJoinState(SignBasicInfoVo.JOINSTATE_NOTSIGN); |
| | | } |
| | | AjaxResult ajaxResult = AjaxResult.buildSuccessInstance(""); |
| | | ajaxResult.setData(signBasicInfoVo); |
| | | return ajaxResult; |
| | | } |
| | | |
| | | /** |
| | | * 点击签到 |
| | | * |
| | | */ |
| | | @ApiOperation(value = "点击签到", notes = "") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "ok", response = SignSuccessVo.class) |
| | | }) |
| | | @PostMapping(value = "/clickSign") |
| | | @Transactional |
| | | public AjaxResult clickSign(@RequestBody ClickSignDTO clickSignDTO) { |
| | | SysVipInfo user = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | long actId = clickSignDTO.getActId(); |
| | | Long userId = user.getId(); |
| | | Long companyId = user.getCompanyId(); |
| | | /** |
| | | * 活动是否存在 |
| | | * 活动是否已经开始 |
| | | * 今日是否已经参与 |
| | | * 新增签到记录表 |
| | | * 判断累计连续签到天数是否+1 |
| | | * 是否已领取 |
| | | * 查询是否有签到奖品 |
| | | * 日常奖励和自定义奖品 |
| | | * 生成核销记录 |
| | | */ |
| | | //活动是否存在 |
| | | ShopActivities shopActivities = shopActivitiesDao.selectById(actId); |
| | | if (ObjectUtil.isEmpty(shopActivities)) { |
| | | return AjaxResult.buildFailInstance("活动不存在"); |
| | | } |
| | | //活动是否已经开始 |
| | | Integer actStatus = shopActivities.getActStatus(); |
| | | if(ShopActivities.ACTSTATUS_STATUS_ING != actStatus) { |
| | | return AjaxResult.buildFailInstance("活动未开始"); |
| | | } |
| | | //今日是否已经参与 |
| | | ActivitySignRecord activitySignRecord = activitySignRecordDao.selectOneByActIdAndUserIdLikesignTime(actId,userId,new Date()); |
| | | if (ObjectUtil.isNotEmpty(activitySignRecord)) { |
| | | return AjaxResult.buildFailInstance("今日用户已经签到成功"); |
| | | } |
| | | //前一天是否签到 |
| | | Date date = new Date(); |
| | | DateTime offsetDay = DateUtil.offsetDay(date, -1); |
| | | ActivitySignRecord activitySignRecordOld = activitySignRecordDao.selectOneByActIdAndUserIdLikesignTime(actId,userId,offsetDay); |
| | | ActivitySignRecord activitySignRecordAdd = new ActivitySignRecord(); |
| | | activitySignRecordAdd.setCompanyId(companyId); |
| | | activitySignRecordAdd.setCreateBy(user.getName()); |
| | | activitySignRecordAdd.setCreateTime(new Date()); |
| | | activitySignRecordAdd.setUpdateBy(user.getName()); |
| | | activitySignRecordAdd.setUpdateTime(new Date()); |
| | | activitySignRecordAdd.setActivityId(actId); |
| | | activitySignRecordAdd.setSignTime(date); |
| | | activitySignRecordAdd.setUserId(userId); |
| | | if(ObjectUtil.isEmpty(activitySignRecordOld)) { |
| | | //新增签到记录表,累计连续签到天数是1 |
| | | activitySignRecordAdd.setCumulativeDay(1); |
| | | }else { |
| | | Integer cumulativeDay = activitySignRecordOld.getCumulativeDay(); |
| | | //新增签到记录表,累计连续签到天数是否+1 |
| | | activitySignRecordAdd.setCumulativeDay(cumulativeDay+1); |
| | | } |
| | | activitySignRecordDao.insert(activitySignRecordAdd); |
| | | /** |
| | | * 查询是否有签到奖品 |
| | | * 日常奖励和自定义奖品 |
| | | */ |
| | | SignSuccessVo signSuccessVo = new SignSuccessVo(); |
| | | //日常奖励,新增奖品领取记录 |
| | | QueryWrapper<ActivitySignAwardSet> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("award_rule",ActivitySignAwardSet.AWARDRULE_NORMAL); |
| | | queryWrapper.eq("company_id",companyId); |
| | | queryWrapper.eq("activity_id",actId); |
| | | ActivitySignAwardSet activitySignAwardSetNormal = activitySignAwardSetDao.selectOne(queryWrapper); |
| | | if(ObjectUtil.isNotEmpty(activitySignAwardSetNormal)) { |
| | | ActivitySignReceiveRecord activitySignReceiveRecord = new ActivitySignReceiveRecord(); |
| | | activitySignReceiveRecord.setUserId(userId); |
| | | activitySignReceiveRecord.setReceiveTime(date); |
| | | activitySignReceiveRecord.setAwardId(activitySignAwardSetNormal.getId()); |
| | | activitySignReceiveRecord.setState(ActivitySignReceiveRecord.STATE_DONE); |
| | | activitySignReceiveRecord.setActivityId(actId); |
| | | activitySignReceiveRecord.setCompanyId(companyId); |
| | | activitySignReceiveRecord.setCreateBy(user.getName()); |
| | | activitySignReceiveRecord.setCreateTime(new Date()); |
| | | activitySignReceiveRecord.setUpdateBy(user.getName()); |
| | | activitySignReceiveRecord.setUpdateTime(new Date()); |
| | | activitySignReceiveRecordDao.insert(activitySignReceiveRecord); |
| | | |
| | | signSuccessVo.setNormalAwardName(activitySignAwardSetNormal.getAwardName()); |
| | | signSuccessVo.setNormalAwardImg(activitySignAwardSetNormal.getIntroduceImg()); |
| | | } |
| | | //获取当前累计天数 |
| | | int cumulativeDay = getCumulativeDay(actId, userId, date, 0); |
| | | //自定义奖励 |
| | | QueryWrapper<ActivitySignAwardSet> queryWrapperCumulativeDay = new QueryWrapper<>(); |
| | | queryWrapperCumulativeDay.eq("award_rule",ActivitySignAwardSet.AWARDRULE_CUMULATIVEDAY); |
| | | queryWrapperCumulativeDay.eq("cumulative_day",cumulativeDay); |
| | | queryWrapperCumulativeDay.eq("company_id",companyId); |
| | | queryWrapperCumulativeDay.eq("activity_id",actId); |
| | | ActivitySignAwardSet activitySignAwardSetCumulativeDay = activitySignAwardSetDao.selectOne(queryWrapperCumulativeDay); |
| | | if(ObjectUtil.isNotEmpty(activitySignAwardSetCumulativeDay)) { |
| | | //是否已领取 |
| | | Long id = activitySignAwardSetCumulativeDay.getId(); |
| | | QueryWrapper<ActivitySignReceiveRecord> queryWrapperActivitySignReceiveRecord = new QueryWrapper<>(); |
| | | queryWrapperActivitySignReceiveRecord.eq("award_id", id); |
| | | queryWrapperActivitySignReceiveRecord.eq("company_id", companyId); |
| | | queryWrapperActivitySignReceiveRecord.eq("activity_id", actId); |
| | | queryWrapperActivitySignReceiveRecord.eq("user_id", userId); |
| | | ActivitySignReceiveRecord activitySignReceiveRecordDone = activitySignReceiveRecordDao.selectOne(queryWrapperActivitySignReceiveRecord); |
| | | if (ObjectUtil.isNotEmpty(activitySignReceiveRecordDone)) { |
| | | String awardNameCumulativeDay = activitySignAwardSetCumulativeDay.getAwardName(); |
| | | AjaxResult ajaxResult = AjaxResult.buildSuccessInstance(awardNameCumulativeDay+"已经领取过了"); |
| | | ajaxResult.setData(signSuccessVo); |
| | | return ajaxResult; |
| | | } |
| | | //新增奖品领取记录 |
| | | ActivitySignReceiveRecord activitySignReceiveRecord = new ActivitySignReceiveRecord(); |
| | | activitySignReceiveRecord.setUserId(userId); |
| | | activitySignReceiveRecord.setReceiveTime(date); |
| | | activitySignReceiveRecord.setAwardId(activitySignAwardSetCumulativeDay.getId()); |
| | | activitySignReceiveRecord.setActivityId(actId); |
| | | activitySignReceiveRecord.setCompanyId(companyId); |
| | | activitySignReceiveRecord.setState(ActivitySignReceiveRecord.STATE_DONE); |
| | | activitySignReceiveRecord.setCreateBy(user.getName()); |
| | | activitySignReceiveRecord.setCreateTime(new Date()); |
| | | activitySignReceiveRecord.setUpdateBy(user.getName()); |
| | | activitySignReceiveRecord.setUpdateTime(new Date()); |
| | | /** |
| | | * 奖项类型(1:自定义产品2:积分3:优惠券4:店铺商品) |
| | | * |
| | | * todo:4:店铺商品 |
| | | */ |
| | | //1:自定义产品 |
| | | if(ActivitySignAwardSet.AWARDTYPE_CUSTOMIZE == activitySignAwardSetCumulativeDay.getAwardType()) { |
| | | activitySignReceiveRecord.setState(ActivitySignReceiveRecord.STATE_ING); |
| | | String randomString = StringUtils.getRandomString(8); |
| | | activitySignReceiveRecord.setWriteOffCode(randomString); |
| | | |
| | | /** |
| | | * 获取对应奖品的领取方式(兑奖方式(1:线下兑换2:物流配送3:客服兑换) |
| | | */ |
| | | signSuccessVo.setWriteOffCode(randomString); |
| | | signSuccessVo.setAwardType(activitySignAwardSetCumulativeDay.getAwardType()); |
| | | signSuccessVo.setAwardName(activitySignAwardSetCumulativeDay.getAwardName()); |
| | | signSuccessVo.setAwardImg(activitySignAwardSetCumulativeDay.getIntroduceImg()); |
| | | signSuccessVo.setAwardWay(activitySignAwardSetCumulativeDay.getAwardWay()); |
| | | signSuccessVo.setAwardState(activitySignAwardSetCumulativeDay.getAwardState()); |
| | | //2:物流配送 |
| | | signSuccessVo.setOperationTip(activitySignAwardSetCumulativeDay.getOperationTip()); |
| | | //1:线下兑换 |
| | | if(ActivitySignAwardSet.AWARDWAY_ONE == activitySignAwardSetCumulativeDay.getAwardWay()) { |
| | | signSuccessVo.setIntroduceTip(activitySignAwardSetCumulativeDay.getIntroduceTip()); |
| | | signSuccessVo.setPrizeAddress(activitySignAwardSetCumulativeDay.getPrizeAddress()); |
| | | signSuccessVo.setPrizeStartTime(activitySignAwardSetCumulativeDay.getPrizeStartTime()); |
| | | signSuccessVo.setPrizeEndTime(activitySignAwardSetCumulativeDay.getPrizeEndTime()); |
| | | } |
| | | //3:客服兑换 |
| | | if(ActivitySignAwardSet.AWARDWAY_THREE == activitySignAwardSetCumulativeDay.getAwardWay()) { |
| | | signSuccessVo.setWechatImg(activitySignAwardSetCumulativeDay.getWechatImg()); |
| | | signSuccessVo.setPrizeStartTime(activitySignAwardSetCumulativeDay.getPrizeStartTime()); |
| | | signSuccessVo.setPrizeEndTime(activitySignAwardSetCumulativeDay.getPrizeEndTime()); |
| | | } |
| | | } |
| | | //2:积分 |
| | | if(ActivitySignAwardSet.AWARDTYPE_SCORE == activitySignAwardSetCumulativeDay.getAwardType()) { |
| | | signSuccessVo.setScoreCnt(activitySignAwardSetCumulativeDay.getScoreCnt()); |
| | | } |
| | | //3:优惠券 |
| | | if(ActivitySignAwardSet.AWARDTYPE_COUPON == activitySignAwardSetCumulativeDay.getAwardType()) { |
| | | signSuccessVo.setCouponName(activitySignAwardSetCumulativeDay.getCouponName()); |
| | | } |
| | | activitySignReceiveRecordDao.insert(activitySignReceiveRecord); |
| | | //生成核销记录 |
| | | if(ActivitySignAwardSet.AWARDTYPE_CUSTOMIZE == activitySignAwardSetCumulativeDay.getAwardType()) { |
| | | ActivitySignWriteoff activitySignWriteoff = new ActivitySignWriteoff(); |
| | | //线下兑换和客服兑换 |
| | | if(ActivitySignAwardSet.AWARDWAY_ONE == activitySignAwardSetCumulativeDay.getAwardWay() |
| | | || ActivitySignAwardSet.AWARDWAY_THREE == activitySignAwardSetCumulativeDay.getAwardWay()) { |
| | | activitySignWriteoff.setWriteoffCode(activitySignReceiveRecord.getWriteOffCode()); |
| | | } |
| | | activitySignWriteoff.setActId(actId); |
| | | activitySignWriteoff.setAwardId(activitySignAwardSetCumulativeDay.getId()); |
| | | activitySignWriteoff.setWinTime(date); |
| | | if(ActivitySignAwardSet.AWARDWAY_TWO == activitySignAwardSetCumulativeDay.getAwardWay()) { |
| | | activitySignWriteoff.setState(ActivitySignWriteoff.STATE_TWO); |
| | | }else { |
| | | activitySignWriteoff.setState(ActivitySignWriteoff.STATE_ONE); |
| | | } |
| | | activitySignWriteoff.setUserId(userId); |
| | | activitySignWriteoff.setCompanyId(companyId); |
| | | activitySignWriteoff.setReceiveId(activitySignReceiveRecord.getId()); |
| | | activitySignWriteoff.setCreateBy(user.getName()); |
| | | activitySignWriteoff.setCreateTime(new Date()); |
| | | activitySignWriteoff.setUpdateBy(user.getName()); |
| | | activitySignWriteoff.setUpdateTime(new Date()); |
| | | activitySignWriteoffDao.insert(activitySignWriteoff); |
| | | } |
| | | } |
| | | |
| | | AjaxResult ajaxResult = AjaxResult.buildSuccessInstance("签到成功"); |
| | | ajaxResult.setData(signSuccessVo); |
| | | return ajaxResult; |
| | | } |
| | | /** |
| | | * 获取累计签到天数 |
| | | * @param actId |
| | | * @param userId |
| | | * @param date |
| | | * @return |
| | | */ |
| | | public int getCumulativeDay(long actId, long userId,Date date, int i) { |
| | | ActivitySignRecord activitySignRecordOld = activitySignRecordDao.selectOneByActIdAndUserIdLikesignTime(actId,userId,date); |
| | | if(ObjectUtil.isEmpty(activitySignRecordOld)) { |
| | | return i; |
| | | } |
| | | i++; |
| | | DateTime offsetDay = DateUtil.offsetDay(date, -i); |
| | | return getCumulativeDay(actId,userId,offsetDay,i); |
| | | } |
| | | |
| | | /** |
| | | * 获取累计的签到奖品 |
| | | * |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "获取累计的签到奖品", notes = "") |
| | | @PostMapping(value = "/getSignAwardList") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "ok", response = SignAwardListVo.class) |
| | | }) |
| | | public AjaxResult getSignAwardList(@RequestBody @Validated SignAwardDto signAwardDto) { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | Page<SalesOrderVo> page=new Page<>(signAwardDto.getPageNum(),signAwardDto.getPageSize()); |
| | | if(StringUtils.isBlank(signAwardDto.getSort())){ |
| | | signAwardDto.setSort("create_time"); |
| | | signAwardDto.setOrder("desc"); |
| | | } |
| | | signAwardDto.setUserId(loginUser.getId()); |
| | | signAwardDto.setCompanyId(loginUser.getCompanyId()); |
| | | IPage<SignAwardListVo> signAwardListVos = activitySignReceiveRecordDao.selectSignAwardList(page,signAwardDto); |
| | | AjaxResult result=AjaxResult.buildSuccessInstance(signAwardListVos.getRecords()); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 查看劵码 |
| | | * |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "查看劵码", notes = "") |
| | | @PostMapping(value = "/seeAwardText") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "ok", response = SeeAwardTextVo.class) |
| | | }) |
| | | public AjaxResult seeAwardText(@RequestBody @Validated SeeAwardTextDto seeAwardTextDto) { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | seeAwardTextDto.setUserId(loginUser.getId()); |
| | | seeAwardTextDto.setCompanyId(loginUser.getCompanyId()); |
| | | SeeAwardTextVo seeAwardTextVO = activitySignReceiveRecordDao.selectSeeAwardTextVOById(seeAwardTextDto); |
| | | AjaxResult result=AjaxResult.buildSuccessInstance(seeAwardTextVO); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 物流配送确认 |
| | | * |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "查看劵码", notes = "") |
| | | @PostMapping(value = "/logisticsInsure") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "ok", response = SeeAwardTextVo.class) |
| | | }) |
| | | public AjaxResult logisticsInsure(@RequestBody @Validated SeeAwardTextDto seeAwardTextDto) { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | seeAwardTextDto.setUserId(loginUser.getId()); |
| | | seeAwardTextDto.setCompanyId(loginUser.getCompanyId()); |
| | | SeeAwardTextVo seeAwardTextVO = activitySignReceiveRecordDao.selectSeeAwardTextVOById(seeAwardTextDto); |
| | | AjaxResult result=AjaxResult.buildSuccessInstance(seeAwardTextVO); |
| | | return result; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | } |
| | | logisticsInfo.put("isShipments",AppConstance.IS_SHIPMENTS); |
| | | logisticsInfo.put("logisticsStatus",shopDeliveryInfo.getLogisticsStatus()==null?"0":String.valueOf(shopDeliveryInfo.getLogisticsStatus())); |
| | | logisticsInfo.put("logisticsCompany", shopDeliveryInfo.getLogisticsCompany()); |
| | | logisticsInfo.put("waybillNo", shopDeliveryInfo.getWaybillNo()); |
| | | logisticsInfo.put("describe",describe); |
| | | result.setStatus(AjaxResult.STATUS_SUCCESS); |
| | | result.putInMap("logisticsInfo",logisticsInfo); |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.pojo.PaginationVO; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.system.common.bean.CustomerDataDictionary; |
| | | import com.matrix.system.common.dao.CustomerDataDictionaryDao; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | |
| | | import com.matrix.system.common.dao.CustomerDataDictionaryDao; |
| | | import com.matrix.system.common.interceptor.HostInterceptor; |
| | | import com.matrix.system.shopXcx.api.service.WxShopCouponService; |
| | | import com.matrix.system.shopXcx.bean.*; |
| | | import com.matrix.system.shopXcx.dao.*; |
| | | import com.matrix.system.shopXcx.api.service.WxShopCouponService; |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | |
| | | List<ShopProductAttrRef> shopProductAttrRefs = shopProductAttrRefDao.selectByPid(id); |
| | | List<ShopProductImg> shopProductImgs = shopProductImgDao.selectByPid(id); |
| | | List<ShopSku> shopSkus = shopSkuDao.selectByPid(id); |
| | | // List<ShopSku> shopSkus = shopSkuDao.selectByPidAndShopid(id, shopId); |
| | | List<ShopProductParamRef> shopProductParamRefs = shopProductParamRefDao.selectByPid(id); |
| | | shopProduct.setAttrRefs(shopProductAttrRefs); |
| | | shopProduct.setProductImgs(shopProductImgs); |
| | |
| | | //查询产品适配的优惠券 |
| | | result.putInMap("couponList", shopCouponService.getCouponListByProductId(id)); |
| | | //查询产品是否被用户收藏 |
| | | result.putInMap("checkCollect", CollectionUtils.isNotEmpty(collectionDao.selectByUserIdAndProid(id, redisUserLoginUtils.getLoginUser(BizUser.class).getOpenId()))); |
| | | result.putInMap("checkCollect", CollectionUtils.isNotEmpty(collectionDao.selectByUserIdAndProid(id, redisUserLoginUtils.getLoginUser(SysVipInfo.class).getOpenId()))); |
| | | } else { |
| | | result.putInMap("checkCollect", false); |
| | | } |
| | |
| | | @ResponseBody |
| | | public AjaxResult getShopProductShowList(@RequestBody ShopProduct shopProduct) { |
| | | List<ShopProduct> shopProducts = null; |
| | | |
| | | //查询是否匹配优惠条件 |
| | | ShopCoupon shopCoupon = shopCouponDao.getCouponByTitle(shopProduct.getTitle(),HostInterceptor.getCompanyId()); |
| | | if (shopCoupon != null && shopProduct.getOffset() < 1) { |
| | |
| | | * @param shopProduct |
| | | */ |
| | | private void saveSearchHistroy(@RequestBody ShopProduct shopProduct) { |
| | | BizUser bigUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo bigUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | ShopSearchRecord searchBean = new ShopSearchRecord(); |
| | | if (StringUtils.isNotBlank(shopProduct.getTitle())) { |
| | | searchBean.setSearchType(AppConstance.SEARCH_TYPE); |
| | | searchBean.setSearchContent(shopProduct.getTitle()); |
| | | } |
| | | searchBean.setUserId(bigUser.getOpenId()); |
| | | searchBean.setUserId(bigUser.getId()); |
| | | searchBean.setSearchPriceStart(shopProduct.getStartPrice()); |
| | | searchBean.setSearchPriceEnd(shopProduct.getEndPrice()); |
| | | searchBean.setSearchDel(AppConstance.DATA_USEABLE); |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.biz.service.BizUserService; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.pojo.PaginationVO; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.system.shopXcx.bean.ShopScoreExchange; |
| | | import com.matrix.system.shopXcx.bean.ShopScoreRecord; |
| | | import com.matrix.system.shopXcx.dao.ShopScoreExchangeDao; |
| | | import com.matrix.system.shopXcx.dao.ShopScoreRecordDao; |
| | | import com.matrix.system.score.dao.ScoreUseRecordDao; |
| | | import com.matrix.system.score.dao.ScoreVipDetailDao; |
| | | import com.matrix.system.shopXcx.api.dto.ScoreFlowDto; |
| | | import com.matrix.system.shopXcx.api.vo.ScoreUseRecordVo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiResponse; |
| | | import io.swagger.annotations.ApiResponses; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.CrossOrigin; |
| | | import org.springframework.validation.annotation.Validated; |
| | | 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.ResponseBody; |
| | | |
| | | import java.util.List; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * @description 用户积分控制器 |
| | | * @author jyy |
| | | * @date 2019-08-09 15:10 |
| | | * @date 2021-03-22 15:10 |
| | | */ |
| | | @Controller |
| | | @RequestMapping(value="/wxapi/shopScoreRecord") |
| | | @CrossOrigin(origins = "*", maxAge = 3600) |
| | | @Api(tags = "用户积分接口类") |
| | | @RestController |
| | | @RequestMapping(value = "/wxapi/score") |
| | | public class WxShopScoreAction { |
| | | |
| | | @Autowired |
| | | private ShopScoreRecordDao shopScoreRecordDao; |
| | | @Autowired |
| | | private ShopScoreExchangeDao shopScoreExchangeDao; |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | @Autowired |
| | | private BizUserService bizUserService; |
| | | @Autowired |
| | | RedisUserLoginUtils redisUserLoginUtils; |
| | | |
| | | @Autowired |
| | | ScoreUseRecordDao scoreUseRecordDao; |
| | | |
| | | @Autowired |
| | | ScoreVipDetailDao scoreVipDetailDao; |
| | | |
| | | @ApiOperation(value = "获取积分流水", notes = "") |
| | | @PostMapping(value = "/getFlowList") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "ok", response = ScoreUseRecordVo.class) |
| | | }) |
| | | AjaxResult getFlowList(@RequestBody @Validated ScoreFlowDto scoreFlowDto) { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | Page<ScoreUseRecordVo> page=new Page<>(scoreFlowDto.getPageNum(),scoreFlowDto.getPageSize()); |
| | | scoreFlowDto.setVipId(loginUser.getId()); |
| | | IPage<ScoreUseRecordVo> shopScoreRecord = scoreUseRecordDao.selectFlowList(page, scoreFlowDto); |
| | | AjaxResult result=AjaxResult.buildSuccessInstance(shopScoreRecord.getRecords()); |
| | | return result; |
| | | } |
| | | |
| | | @ApiOperation(value = "获取用户积分", notes = "") |
| | | @PostMapping(value = "/getUserScore") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "ok", response = AjaxResult.class) |
| | | }) |
| | | AjaxResult getUserScore() { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | AjaxResult result=AjaxResult.buildSuccessInstance(scoreVipDetailDao.selectUserTotalScore(loginUser.getId())); |
| | | return result; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询我的获得积分列表 |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/getRecordList") |
| | | @ResponseBody |
| | | public AjaxResult getRecordList(@RequestBody PaginationVO pageVo) { |
| | | |
| | | pageVo.setSort("create_time"); |
| | | pageVo.setOrder("desc"); |
| | | BizUser loginBizUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | ShopScoreRecord params = new ShopScoreRecord(); |
| | | params.setBeneficiaryId(loginBizUser.getOpenId()); |
| | | List<ShopScoreRecord> dataList = shopScoreRecordDao.selectInPage(params, pageVo); |
| | | int total = shopScoreRecordDao.selectTotalRecord(params); |
| | | AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, dataList, total); |
| | | //查询用户总积分 |
| | | BizUser user = bizUserService.findById(loginBizUser.getUserId()); |
| | | Integer totalScore = 0; |
| | | if (user != null && user.getTotalScore() != null) { |
| | | totalScore = user.getTotalScore(); |
| | | } |
| | | result.putInMap("totalScore", totalScore); |
| | | //查询下级总人数 |
| | | BizUser peopleSumParams = new BizUser(); |
| | | peopleSumParams.setParentOpenId(loginBizUser.getOpenId()); |
| | | int peopleSum = bizUserService.findTotal(peopleSumParams); |
| | | result.putInMap("peopleSum", peopleSum); |
| | | return result; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询我的积分兑换列表 |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/getChangeRecordList") |
| | | @ResponseBody |
| | | public AjaxResult getChangeRecordList(@RequestBody PaginationVO pageVo) { |
| | | |
| | | //不分页 |
| | | pageVo.setOffset(null); |
| | | pageVo.setLimit(null); |
| | | //按生成时间倒序排列 |
| | | pageVo.setSort("create_time"); |
| | | pageVo.setOrder("desc"); |
| | | BizUser loginBizUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | ShopScoreExchange params = new ShopScoreExchange(); |
| | | params.setUserId(loginBizUser.getOpenId()); |
| | | List<ShopScoreExchange> dataList = shopScoreExchangeDao.selectInPage(params, pageVo); |
| | | int total = shopScoreExchangeDao.selectTotalRecord(params); |
| | | AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, dataList, total); |
| | | //查询用户当前积分 |
| | | BizUser user = bizUserService.findById(loginBizUser.getUserId()); |
| | | Integer currentScore = 0; |
| | | if (user != null && user.getCurrentScore() != null) { |
| | | currentScore = user.getCurrentScore(); |
| | | } |
| | | result.putInMap("currentScore", currentScore); |
| | | return result; |
| | | } |
| | | |
| | | } |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.core.constance.SystemErrorCode; |
| | | import com.matrix.core.constance.SystemMessageCode; |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | |
| | | import com.matrix.system.shopXcx.bean.ShopShoppingCart; |
| | | import com.matrix.system.shopXcx.bean.ShopSku; |
| | | import com.matrix.system.shopXcx.dao.ShopShoppingCartDao; |
| | | import com.matrix.system.shopXcx.dao.ShopSkuDao; |
| | | import com.matrix.system.common.interceptor.HostInterceptor; |
| | | import com.matrix.system.shopXcx.api.service.OrderCouponGroupService; |
| | | import com.matrix.system.shopXcx.api.service.ShoppingCartService; |
| | | import com.matrix.system.shopXcx.api.service.WxShopCouponService; |
| | | import com.matrix.system.shopXcx.api.vo.ShopCartBillVo; |
| | | import com.matrix.system.shopXcx.api.vo.ShopCartVo; |
| | | import com.matrix.system.shopXcx.bean.ShopShoppingCart; |
| | | import com.matrix.system.shopXcx.bean.ShopSku; |
| | | import com.matrix.system.shopXcx.dao.ShopShoppingCartDao; |
| | | import com.matrix.system.shopXcx.dao.ShopSkuDao; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.HashMap; |
| | |
| | | * @date 2019-06-12 19:15 |
| | | */ |
| | | @CrossOrigin(origins = "*", maxAge = 3600) |
| | | @Controller |
| | | @Api(tags = "购物车类") |
| | | @RestController |
| | | @RequestMapping(value = "wxapi/ShoppingCart") |
| | | public class WxShoppingCartAction { |
| | | @Autowired |
| | |
| | | @Autowired |
| | | ShopSkuDao skuDao; |
| | | |
| | | @Autowired |
| | | OrderCouponGroupService orderCouponGroupService; |
| | | |
| | | /** |
| | | * 根据ID删除购物车 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "根据ID删除购物车", notes = "") |
| | | @PostMapping("/deleteByCartId/{cartId}") |
| | | @ResponseBody |
| | | public AjaxResult deleteByCartId(@PathVariable("cartId") Integer cartId) { |
| | |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, "删除成功"); |
| | | } |
| | | |
| | | /** |
| | | * 根据用户ID查询购物车 没有分页 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | | |
| | | @ApiOperation(value = "根据用户ID查询购物车 没有分页", notes = "") |
| | | @PostMapping("/findShoppingCart") |
| | | @ResponseBody |
| | | public AjaxResult getShoppingCartByUserId(@RequestBody ShopShoppingCart shoppingCart) { |
| | | List<ShopCartVo> cartList = shoppingCartService.findUserCartList(shoppingCart.getShopId()); |
| | | AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, cartList, cartList.size()); |
| | | ShopCartBillVo shopCartBill = shoppingCartService.buildShopCartBillVo(cartList); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | List<ShopShoppingCart> list = shoppingCartDao.selectByCartUserId(shoppingCart.getShopId(),loginUser.getId()); |
| | | List<ShopCartVo> shopCartVoList = shoppingCartService.buildShopCart(list); |
| | | AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, shopCartVoList, shopCartVoList.size()); |
| | | ShopCartBillVo shopCartBill = shoppingCartService.buildShopCartBillVo(shopCartVoList); |
| | | result.putInMap("billTotal", shopCartBill.getBillTotal().stripTrailingZeros().toPlainString()); |
| | | result.putInMap("selectCount", shopCartBill.getSelectCount()); |
| | | result.putInMap("cartCount", shopCartBill.getCartCount()); |
| | |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 批量删除 |
| | | */ |
| | | |
| | | @ApiOperation(value = "批量删除", notes = "") |
| | | @PostMapping(value = "/delShoppingCart/{keys}") |
| | | public |
| | | @ResponseBody |
| | |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "查询微商城购物车数量", notes = "") |
| | | @PostMapping(value = "/getUserCartCount/{shopId}") |
| | | public |
| | | @ResponseBody |
| | | AjaxResult getUserCartCount(@PathVariable("shopId") Long shopId) { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | Integer userCartCount = shoppingCartDao.selectUserCartCount(shopId, loginUser.getOpenId()); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | Integer userCartCount = shoppingCartDao.selectUserCartCount(shopId, loginUser.getId()); |
| | | if (userCartCount == null) { |
| | | userCartCount = 0; |
| | | } |
| | |
| | | AjaxResult saveShoppingCart(@RequestBody ShopShoppingCart shoppingCart) { |
| | | |
| | | //查询到sku设置对应的产品id |
| | | ShopSku sku= skuDao.selectById(shoppingCart.getCartSkuId()); |
| | | if(sku==null){ |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL,"无效的产品id"); |
| | | ShopSku sku = skuDao.selectById(shoppingCart.getCartSkuId()); |
| | | if (sku == null) { |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "无效的产品id"); |
| | | } |
| | | |
| | | shoppingCart.setCartProductId(sku.getpId()); |
| | | |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | shoppingCart.setCreateBy(loginUser.getOpenId()); |
| | | shoppingCart.setUpdateBy(loginUser.getOpenId()); |
| | | shoppingCart.setCartUserId(loginUser.getOpenId()); |
| | | shoppingCart.setCartUserId(loginUser.getId()); |
| | | shoppingCart.setCompanyId(HostInterceptor.getCompanyId()); |
| | | ShopShoppingCart shoppCartLimt = shoppingCartDao.selectBuyLimit(shoppingCart.getCartProductId(), |
| | | shoppingCart.getCartSkuId()); |
| | | // Integer buyLimitNum = 0; |
| | |
| | | ShopShoppingCart shopShoppingCart = new ShopShoppingCart(); |
| | | shopShoppingCart.setCartProductId(cartProductId); |
| | | shopShoppingCart.setCartSkuId(cartSkuId); |
| | | shopShoppingCart.setCartUserId(loginUser.getOpenId()); |
| | | shopShoppingCart.setCartUserId(loginUser.getId()); |
| | | shopShoppingCart.setShopId(shoppingCart.getShopId()); |
| | | List<ShopShoppingCart> shopShoppingCarts = shoppingCartDao.selectByModel(shopShoppingCart); |
| | | int i = 0; |
| | |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "保存失败"); |
| | | } |
| | | int userCartCount = shoppingCartDao.selectUserCartCount(shoppingCart.getShopId(), |
| | | loginUser.getOpenId()); |
| | | loginUser.getId()); |
| | | AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, "保存成功"); |
| | | result.putInMap("userCartCount", userCartCount); |
| | | return result; |
| | |
| | | * @param |
| | | * @return |
| | | */ |
| | | @RequestMapping("/updateCartSelected") |
| | | @PostMapping("/updateCartSelected") |
| | | @ResponseBody |
| | | public AjaxResult updateCartSelected(@RequestBody ShopShoppingCart shoppingCart) { |
| | | Map<String, Object> modifyMap = new HashMap<>(); |
| | |
| | | * @param |
| | | * @return |
| | | */ |
| | | @RequestMapping("/updateCartAllSelected/{shopId}/{isSelected}") |
| | | @PostMapping("/updateCartAllSelected/{shopId}/{isSelected}") |
| | | @ResponseBody |
| | | public AjaxResult updateCartAllSelected(@PathVariable("isSelected") Integer isSelected, |
| | | @PathVariable("shopId") Long shopId) { |
| | | Map<String, Object> modifyMap = new HashMap<>(); |
| | | BizUser user = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | shoppingCartDao.updateAllSelected(user.getOpenId(),shopId, isSelected); |
| | | SysVipInfo user = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | shoppingCartDao.updateAllSelected(user.getOpenId(), shopId, isSelected); |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, "修改成功"); |
| | | } |
| | | } |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.pojo.PaginationVO; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.system.common.interceptor.HostInterceptor; |
| | | import com.matrix.system.hive.bean.SysSkinCheckRecord; |
| | | import com.matrix.system.hive.bean.SysSkinDetail; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | |
| | | |
| | | @RequestMapping(value = "/showSkinList") |
| | | public @ResponseBody AjaxResult showSkinList(@RequestBody SkinCheckDTO skinCheckDTO) { |
| | | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | PaginationVO pageVo = new PaginationVO(); |
| | | pageVo.setLimit(skinCheckDTO.getLimit()); |
| | | pageVo.setOffset(skinCheckDTO.getOffset()); |
| | | SysSkinCheckRecord skinCheckRecord = new SysSkinCheckRecord(); |
| | | skinCheckRecord.setTelphone(bizUser.getPhoneNumber()); |
| | | skinCheckRecord.setTelphone(sysVipInfo.getPhone()); |
| | | List<SysSkinCheckRecord> dataList = sysSkinCheckRecordDao.selectInPage(skinCheckRecord, pageVo); |
| | | AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, dataList, |
| | | sysSkinCheckRecordDao.selectTotalRecord(skinCheckRecord)); |
| | |
| | | }); |
| | | |
| | | sysSkinCheckRecord.setSkinDetails(detailList); |
| | | SysVipInfo vipInfo = vipInfoDao.selectByPhone(sysSkinCheckRecord.getTelphone()); |
| | | SysVipInfo vipInfo = vipInfoDao.selectByPhone(sysSkinCheckRecord.getTelphone(), HostInterceptor.getCompanyId()); |
| | | AjaxResult result=AjaxResult.buildSuccessInstance(Arrays.asList(sysSkinCheckRecord)); |
| | | result.putInMap("vipInfo",vipInfo); |
| | | return result; |
New file |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.component.tools.HttpCurlUtil; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.core.web.BaseAction; |
| | | import com.matrix.system.activity.dao.ActivitySignReceiveRecordDao; |
| | | import com.matrix.system.common.bean.BusParameterSettings; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.common.interceptor.HostInterceptor; |
| | | import com.matrix.system.constance.Dictionary; |
| | | import com.matrix.system.fenxiao.constant.FenxiaoSettingConstant; |
| | | import com.matrix.system.fenxiao.dao.ShopSalesmanApplyDao; |
| | | import com.matrix.system.fenxiao.entity.ShopSalesmanApply; |
| | | import com.matrix.system.fenxiao.service.ShopSalesmanApplyService; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.dao.MoneyCardUseDao; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import com.matrix.system.hive.service.SysVipInfoService; |
| | | import com.matrix.system.score.dao.ScoreVipDetailDao; |
| | | import com.matrix.system.shopXcx.api.WeChatApiTools; |
| | | import com.matrix.system.shopXcx.api.dto.XcxUserSaveUserInfoDto; |
| | | import com.matrix.system.shopXcx.dao.ShopCouponRecordDao; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Collections; |
| | | |
| | | /** |
| | | * @author jyy |
| | | * @description (用户表) |
| | | * @date 2019-05-31 10:03 |
| | | */ |
| | | @Controller |
| | | @RequestMapping(value = "wxapi/user") |
| | | public class WxUserAction extends BaseAction { |
| | | |
| | | @Autowired |
| | | private SysVipInfoService sysVipInfoService; |
| | | |
| | | @Autowired |
| | | private SysVipInfoDao sysVipInfoDao; |
| | | |
| | | @Autowired |
| | | private ShopSalesmanApplyService shopSalesmanApplyService; |
| | | |
| | | @Autowired |
| | | BusParameterSettingsDao busParameterSettingsDao; |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | @Autowired |
| | | ShopSalesmanApplyDao salesmanApplyDao; |
| | | |
| | | @Autowired |
| | | WeChatApiTools weChatApiTools; |
| | | |
| | | @Autowired |
| | | private ScoreVipDetailDao scoreVipDetailDao; |
| | | |
| | | @Autowired |
| | | private MoneyCardUseDao moneyCardUseDao; |
| | | |
| | | @Autowired |
| | | ShopCouponRecordDao shopCouponRecordDao; |
| | | |
| | | @Autowired |
| | | ActivitySignReceiveRecordDao activitySignReceiveRecordDao; |
| | | @Value("${debug}") |
| | | private String isDebug; |
| | | |
| | | /** |
| | | * 小程序登录 |
| | | * |
| | | * @param code |
| | | * @return |
| | | * @throws Exception |
| | | * @author JIANGYOUYAO |
| | | * @email 935090232@qq.com |
| | | * @date 2018年5月23日 |
| | | */ |
| | | @RequestMapping(value = "/login/{keys}") |
| | | public @ResponseBody |
| | | AjaxResult wxLogin(@PathVariable("keys") String code) throws Exception { |
| | | AjaxResult res = new AjaxResult(); |
| | | LogUtil.info("code:{}" + code); |
| | | if (StringUtils.isNotBlank(code)) { |
| | | String requrl = weChatApiTools.getXcxLoginUrl(code, HostInterceptor.getCompanyId()); |
| | | String reslutData = HttpCurlUtil.sendGetHttp(requrl, null); |
| | | JSONObject json = JSONObject.fromObject(reslutData); |
| | | LogUtil.debug("微信登录获取到登录信息={}", json); |
| | | |
| | | if (json.containsKey("errcode")) { |
| | | res.setStatus(AjaxResult.STATUS_FAIL); |
| | | res.setInfo("自动登录失败"); |
| | | LogUtil.debug("微信登录获取到异常信息errcode"); |
| | | return res; |
| | | } |
| | | |
| | | String openId = json.getString("openid"); |
| | | String sessionKey = json.getString("session_key"); |
| | | LogUtil.debug("openId={},sessionKey={}", openId, sessionKey); |
| | | // 查询用户是否存在 |
| | | SysVipInfo sysVipInfo = null; |
| | | synchronized (this) { |
| | | sysVipInfo = sysVipInfoService.findByOpenId(openId); |
| | | if (sysVipInfo == null) { |
| | | // 新增用户 |
| | | sysVipInfo = new SysVipInfo(); |
| | | sysVipInfo.setIsSales(SysVipInfo.NOT_SALES); |
| | | sysVipInfo.setOpenId(openId); |
| | | sysVipInfo.setSessionKey(sessionKey); |
| | | sysVipInfo.setCompanyId(HostInterceptor.getCompanyId()); |
| | | sysVipInfo.setArrivalWay("微商城"); |
| | | sysVipInfo.setVipName("微信用户"); |
| | | sysVipInfo.setVipState(Dictionary.VIP_STATE_HY); |
| | | sysVipInfo.setVipType(Dictionary.VIP_TYPE_NOCARD); |
| | | sysVipInfo.setIsDeal(SysVipInfo.UNDEAL_VIP); |
| | | sysVipInfo.setVipNo(openId); |
| | | sysVipInfoService.add(sysVipInfo); |
| | | |
| | | }else{ |
| | | sysVipInfo.setSessionKey(sessionKey); |
| | | sysVipInfoDao.update(sysVipInfo); |
| | | } |
| | | } |
| | | // 存放redis |
| | | sysVipInfo.setLevelCard(null); |
| | | String token = redisUserLoginUtils.saveUserInfo(sysVipInfo); |
| | | LogUtil.info("用户token={}", token); |
| | | res.putInMap("token", token); |
| | | res.putInMap("userInfo", sysVipInfo); |
| | | res.setStatus(AjaxResult.STATUS_SUCCESS); |
| | | } else { |
| | | res.setStatus(AjaxResult.STATUS_FAIL); |
| | | res.setInfo("自动登录失败"); |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询用户信息 |
| | | */ |
| | | @RequestMapping(value = "/findUserInfo") |
| | | public @ResponseBody |
| | | AjaxResult findUserInfo() { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo sysVipInfo = sysVipInfoService.findById(loginUser.getId()); |
| | | sysVipInfo.setPointAll(scoreVipDetailDao.selectUserTotalScore(loginUser.getId())); |
| | | sysVipInfo.setBalance(moneyCardUseDao.selectVipCardTotalMoney(loginUser.getId())); |
| | | AjaxResult res = new AjaxResult(); |
| | | res.putInMap("couponCount", shopCouponRecordDao.countUnuseCouponRecord(loginUser.getId())); |
| | | res.putInMap("prizeCount",activitySignReceiveRecordDao.getSignAwardReceiveCount(loginUser.getId(),loginUser.getCompanyId())); |
| | | res.putInMap("userInfo", sysVipInfo); |
| | | res.setStatus(AjaxResult.STATUS_SUCCESS); |
| | | return res; |
| | | } |
| | | |
| | | /** |
| | | * 根据OpenID查询用户信息 |
| | | */ |
| | | @GetMapping(value = "/findUserInfo/{openId}") |
| | | public @ResponseBody |
| | | AjaxResult findUserInfo(@PathVariable String openId) { |
| | | SysVipInfo sysVipInfo = sysVipInfoService.findByOpenId(openId); |
| | | SysVipInfo bizUserQuery=new SysVipInfo(); |
| | | bizUserQuery.setNickName(sysVipInfo.getNickName()); |
| | | bizUserQuery.setAvatarUrl(sysVipInfo.getAvatarUrl()); |
| | | bizUserQuery.setOpenId(openId); |
| | | return AjaxResult.buildSuccessInstance(bizUserQuery); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 接收用户信息 |
| | | */ |
| | | @PostMapping(value = "/saveUserInfo") |
| | | public @ResponseBody |
| | | AjaxResult saveUserInfo(@RequestBody XcxUserSaveUserInfoDto xcxUserSaveUserInfoDto) { |
| | | |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo sysVipInfo=new SysVipInfo(); |
| | | sysVipInfo.setId(loginUser.getId()); |
| | | |
| | | BeanUtil.copyProperties(xcxUserSaveUserInfoDto,sysVipInfo); |
| | | sysVipInfo.setPhone(xcxUserSaveUserInfoDto.getPhoneNumber()); |
| | | if(StringUtils.isBlank(loginUser.getVipName())||loginUser.getVipName().equals("微信用户")){ |
| | | sysVipInfo.setVipName(xcxUserSaveUserInfoDto.getNickName()); |
| | | } |
| | | if(StringUtils.isBlank(loginUser.getSex())){ |
| | | sysVipInfo.setSex(xcxUserSaveUserInfoDto.getGender()==1?"男":"女"); |
| | | } |
| | | |
| | | int i = sysVipInfoDao.update(sysVipInfo); |
| | | |
| | | checkNeedToBeSalesman(sysVipInfo, loginUser); |
| | | if (i == 0) { |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "更新失败"); |
| | | } |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, Collections.singletonList(sysVipInfo)); |
| | | } |
| | | |
| | | |
| | | |
| | | void checkNeedToBeSalesman(SysVipInfo sysVipInfo, SysVipInfo loginUser) { |
| | | //查询是否需要自动成为分销员 |
| | | if ((loginUser.getIsSales() == null || loginUser.getIsSales() == 2) |
| | | && StringUtils.isNotBlank(sysVipInfo.getNickName())) {//目前还不是分销员 |
| | | BusParameterSettings fxSwith = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_SWITCH, HostInterceptor.getCompanyId()); |
| | | if (fxSwith.getParamValue().equals("1")) {//开启分销 |
| | | BusParameterSettings applyWay = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_APPLY_WAY, loginUser.getCompanyId()); |
| | | if (applyWay.getParamValue().equals(FenxiaoSettingConstant.FX_APPLY_WAY_AUTO)) {//自动成为分销员 |
| | | QueryWrapper<ShopSalesmanApply> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("user_id", loginUser.getId()); |
| | | queryWrapper.eq("apply_status", ShopSalesmanApply.APPLY_STATUS_DSH); |
| | | ShopSalesmanApply shopSalesmanApply = salesmanApplyDao.selectOne(queryWrapper); |
| | | if (shopSalesmanApply == null) {//没有待审核记录 |
| | | try { |
| | | shopSalesmanApplyService.applyToBeAnSalesman(loginUser.getId(), null, null, 2); |
| | | }catch (Exception e){ |
| | | LogUtil.debug(e.getMessage()); |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.system.shopXcx.dao.ShopSearchRecordDao; |
| | |
| | | @RequestMapping(value = "/getSearchRecordList") |
| | | @ResponseBody |
| | | public AjaxResult getSearchRecordList(){ |
| | | BizUser bigUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo bigUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | if(bigUser == null){ |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL,"用户未授权"); |
| | | } |
| | |
| | | @RequestMapping(value = "/deleteSearchRecord") |
| | | @ResponseBody |
| | | public AjaxResult deleteSearchRecord(){ |
| | | BizUser bigUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo bigUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | shopSearchRecordDao.deleteByUserId(bigUser.getOpenId()); |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS,"删除成功"); |
| | | } |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.biz.dao.BizUserDao; |
| | | import com.matrix.component.rabbitmq.RabiitMqTemplate; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.core.exception.GlobleException; |
| | |
| | | import com.matrix.core.tools.DateUtil; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.system.app.mapper.SysProjUseMapper; |
| | | import com.matrix.system.app.vo.*; |
| | | import com.matrix.system.app.vo.ServiceProductListVo; |
| | | import com.matrix.system.app.vo.ServiceProjVo; |
| | | import com.matrix.system.app.vo.ServiceTcVo; |
| | | import com.matrix.system.common.bean.BusParameterSettings; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.common.dao.SysUsersDao; |
| | | import com.matrix.system.common.interceptor.HostInterceptor; |
| | | import com.matrix.system.common.tools.LocationUtil; |
| | |
| | | import com.matrix.system.hive.dao.*; |
| | | import com.matrix.system.hive.plugin.util.CollectionUtils; |
| | | import com.matrix.system.hive.service.*; |
| | | import com.matrix.system.score.constant.ScoreSettingConstant; |
| | | import com.matrix.system.score.entity.ScoreVipDetail; |
| | | import com.matrix.system.score.service.ScoreVipDetailService; |
| | | import com.matrix.system.shopXcx.api.dto.ErpServiceCommentDto; |
| | | import com.matrix.system.shopXcx.api.dto.ErpServiceOrderListDto; |
| | | import com.matrix.system.shopXcx.api.vo.ErpServiceOrderListVo; |
| | |
| | | import com.matrix.system.shopXcx.dao.ShopSkuDao; |
| | | import com.matrix.system.shopXcx.dto.YYDayOfWeek; |
| | | import com.matrix.system.shopXcx.dto.YYmonth; |
| | | import io.swagger.annotations.*; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiResponse; |
| | | import io.swagger.annotations.ApiResponses; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Controller; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author jiangyouyao |
| | |
| | | SysUsersDao staffInfoDao; |
| | | |
| | | @Autowired |
| | | BizUserDao bizUserDao; |
| | | SysVipInfoDao sysVipInfoDao; |
| | | |
| | | @Autowired |
| | | RabiitMqTemplate rabiitMqTemplate; |
| | |
| | | |
| | | @Autowired |
| | | ShoppingGoodsDao shoppingGoodsDao; |
| | | @Autowired |
| | | ScoreVipDetailService scoreVipDetailService; |
| | | |
| | | @Autowired |
| | | private BusParameterSettingsDao busParameterSettingsDao; |
| | | |
| | | @Value("${evn}") |
| | | private String evn; |
| | |
| | | @ResponseBody |
| | | public |
| | | AjaxResult getUserPro(@PathVariable String phone) { |
| | | SysVipInfo vipInfo = vipInfoDao.selectByPhone(phone); |
| | | SysVipInfo vipInfo = vipInfoDao.selectByPhone(phone,HostInterceptor.getCompanyId()); |
| | | |
| | | if (vipInfo == null) { |
| | | throw new GlobleException("会员不存在"); |
| | |
| | | @RequestMapping(value = "/createServiceOrder") |
| | | public @ResponseBody |
| | | AjaxResult createServiceOrder(@RequestBody Onlinebooking onlinebooking) { |
| | | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo vipInfo = vipInfoDao.selectByPhone(bizUser.getPhoneNumber()); |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo vipInfo = vipInfoDao.selectByPhone(sysVipInfo.getPhone(),HostInterceptor.getCompanyId()); |
| | | SysProjUse sysProjUse = projUseDao.selectById(Long.parseLong(onlinebooking.getProductId() + "")); |
| | | Date yyTime = DateUtil.stringToDate(onlinebooking.getTimeStr(), DateUtil.DATE_FORMAT_MM); |
| | | SysProjServices sysProjServices = new SysProjServices(); |
| | |
| | | sysProjServices.setState(Dictionary.SERVICE_STATU_DQR); |
| | | SysProjServices newSysProjServices = projServicesService.addSysProjServices(sysProjServices); |
| | | if (newSysProjServices != null) { |
| | | |
| | | //添加用户积分 |
| | | BusParameterSettings parameterSetting = busParameterSettingsDao.selectCompanyParamByCode(ScoreSettingConstant.RESERVATION_SERVICE_SHOP, sysVipInfo.getCompanyId()); |
| | | scoreVipDetailService.addScoreByParamSetting(sysVipInfo.getId(), null,null, newSysProjServices.getId(), |
| | | ScoreVipDetail.SCORE_VIP_TYPE_JOIN_ACTIVE,"预约送积分", parameterSetting); |
| | | |
| | | |
| | | return AjaxResult.buildSuccessInstance("下单成功"); |
| | | } else { |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "下单失败!"); |
| | |
| | | @PostMapping(value = "/getServiceOrderList") |
| | | @ResponseBody |
| | | public AjaxResult findServiceOrderList(@RequestBody @Validated ErpServiceOrderListDto orderListDto) { |
| | | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo vipInfo= vipInfoDao.selectByPhone(bizUser.getPhoneNumber()); |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo vipInfo= vipInfoDao.selectByPhone(sysVipInfo.getPhone(),HostInterceptor.getCompanyId()); |
| | | orderListDto.setVipId(vipInfo.getId()); |
| | | List<ErpServiceOrderListVo> apiServiceOrderListInPage = projServicesDao.findWxServiceOrderList(orderListDto); |
| | | return AjaxResult.buildSuccessInstance(apiServiceOrderListInPage,"查询成功"); |
New file |
| | |
| | | package com.matrix.system.shopXcx.api.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | |
| | | @ApiModel(value = "AddVipDto", description = "添加会员接收参数类") |
| | | public class ApplyToBeAnSalesmanDto { |
| | | |
| | | @NotBlank(message = "性别不能为空") |
| | | @ApiModelProperty(value = "性别", example = "男/女") |
| | | private String sex; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.shopXcx.api.dto; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @ApiModel(value = "ClickSignDTO", description = "点击签到接收参数类") |
| | | @Data |
| | | public class ClickSignDTO { |
| | | |
| | | @NotBlank(message = "签到活动ID不能为空") |
| | | @ApiModelProperty(value = "签到活动ID", example = "1") |
| | | private long actId; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.shopXcx.api.dto; |
| | | |
| | | import com.matrix.core.pojo.BasePageQueryDto; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotEmpty; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | @ApiModel(value = "MoneyCardUseFlowDto", description = "储值卡流水查询参数接收类") |
| | | public class MoneyCardUseFlowDto extends BasePageQueryDto { |
| | | |
| | | |
| | | @NotEmpty(message = "请选择查询时间") |
| | | @ApiModelProperty(value = "查询月份",example = "2021-03") |
| | | private String queryTime; |
| | | |
| | | |
| | | @ApiModelProperty(value = "收支类型 不传全部,1,收入,2支出", example = "1") |
| | | private Integer revenueType; |
| | | |
| | | @NotNull(message = "请选择要查询的储值卡ID") |
| | | @ApiModelProperty(value = "储值卡id", example = "1") |
| | | private Long carUseId; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.shopXcx.api.dto; |
| | | |
| | | import com.matrix.core.pojo.BasePageQueryDto; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | @ApiModel(value = "RevenueFlowDto", description = "收益流水查询参数接收类") |
| | | public class RevenueFlowDto extends BasePageQueryDto { |
| | | |
| | | @NotNull(message = "查询月份不能为空") |
| | | @ApiModelProperty(value = "查询月份",example = "2021-03") |
| | | private String queryTime; |
| | | |
| | | |
| | | @ApiModelProperty(value = "收益类型 不传全部,1,收入,2支出", example = "1") |
| | | private Integer revenueType; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long userId; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.shopXcx.api.dto; |
| | | |
| | | import com.matrix.core.pojo.BasePageQueryDto; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | @ApiModel(value = "SaleOrderDto", description = "分销订单查询参数接收类") |
| | | public class SaleOrderDto extends BasePageQueryDto { |
| | | |
| | | @NotNull(message = "订单类型不能为空") |
| | | @ApiModelProperty(value = "订单类型1推广订单,2邀请订单", example = "1") |
| | | private Integer revenueType; |
| | | |
| | | |
| | | @ApiModelProperty(value = "结算状态1,待结算,2,已结算,3已退款", example = "1") |
| | | private Integer orderStatus; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long userId; |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.shopXcx.api.dto; |
| | | |
| | | import com.matrix.core.pojo.BasePageQueryDto; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "SaleProductDto", description = "分销产品查询参数接收类") |
| | | public class SaleProductDto extends BasePageQueryDto { |
| | | |
| | | @ApiModelProperty(value = "产品分类", example = "1") |
| | | private Integer categoryId; |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.shopXcx.api.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.matrix.core.pojo.BasePageQueryDto; |
| | | import com.matrix.core.tools.DateUtil; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @ApiModel(value = "ScoreFlowDto", description = "积分流水查询参数接收类") |
| | | public class ScoreFlowDto extends BasePageQueryDto { |
| | | |
| | | |
| | | @ApiModelProperty(value = "查询月份",example = "2021-03") |
| | | private String queryTime; |
| | | |
| | | @DateTimeFormat(pattern = DateUtil.DATE_FORMAT_DD) |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone="GMT+8") |
| | | private Date beginTime; |
| | | |
| | | @DateTimeFormat(pattern = DateUtil.DATE_FORMAT_DD) |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone="GMT+8") |
| | | private Date endTime; |
| | | |
| | | |
| | | @ApiModelProperty(value = "收支类型 不传全部,1,收入,2支出", example = "1") |
| | | private Integer revenueType; |
| | | |
| | | |
| | | @ApiModelProperty(value = "会员id", example = "1") |
| | | private Long vipId; |
| | | |
| | | @ApiModelProperty(value = "备注", example = "1") |
| | | private String remarks; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.shopXcx.api.dto; |
| | | |
| | | import com.matrix.core.pojo.BasePageQueryDto; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "ScoreProductDto", description = "积分产品查询参数接收类") |
| | | public class ScoreProductDto extends BasePageQueryDto { |
| | | |
| | | @ApiModelProperty(value = "产品分类", example = "1") |
| | | private Integer scoreCategoryId; |
| | | |
| | | |
| | | @ApiModelProperty(value = "属性编码", example = "jfscrmtj") |
| | | private String attrCode; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.shopXcx.api.dto; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "SeeAwardTextDto", description = "查询参数接收类") |
| | | public class SeeAwardTextDto { |
| | | |
| | | |
| | | @NotNull(message = "奖品ID不能为空") |
| | | @ApiModelProperty(value = "奖品ID", example = "1") |
| | | private Long awardId; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.shopXcx.api.dto; |
| | | |
| | | import com.matrix.core.pojo.BasePageQueryDto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | @Data |
| | | @ApiModel(value = "SignAwardDto", description = "查询参数接收类") |
| | | public class SignAwardDto extends BasePageQueryDto { |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.shopXcx.api.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | @ApiModel(value = "WithdrawalCashDto", description = "提现参数接收类") |
| | | public class WithdrawalCashDto { |
| | | |
| | | @NotNull(message = "提现金额不能为空") |
| | | @ApiModelProperty(value = "提现金额", example = "1") |
| | | private Double amount; |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.shopXcx.api.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "XcxUserSaveUserInfoDto", description = "小程序用户授权信息保存接收类") |
| | | public class XcxUserSaveUserInfoDto { |
| | | |
| | | @ApiModelProperty(value = "手机号码" ) |
| | | private String phoneNumber; |
| | | |
| | | @ApiModelProperty(value = "昵称" ) |
| | | private String nickName; |
| | | |
| | | |
| | | @ApiModelProperty(value = "头像" ) |
| | | private String avatarUrl; |
| | | |
| | | |
| | | @ApiModelProperty(value = "性别" ) |
| | | private Integer gender; |
| | | |
| | | |
| | | /** |
| | | * 用户所在国家 |
| | | */ |
| | | private String country; |
| | | |
| | | /** |
| | | * 省 |
| | | */ |
| | | private String province; |
| | | |
| | | /** |
| | | * 市 |
| | | */ |
| | | private String city; |
| | | |
| | | /** |
| | | * 区 |
| | | */ |
| | | private String area; |
| | | |
| | | } |
| | |
| | | /** |
| | | * 购买规格信息列表 |
| | | */ |
| | | private List<OrderProductSkuPOJO> skuList; |
| | | private List<OrderItemDto> skuList; |
| | | |
| | | |
| | | public Integer getAddrId() { |
| | |
| | | this.couponId = couponId; |
| | | } |
| | | |
| | | public List<OrderProductSkuPOJO> getSkuList() { |
| | | public List<OrderItemDto> getSkuList() { |
| | | return skuList; |
| | | } |
| | | |
| | | public void setSkuList(List<OrderProductSkuPOJO> skuList) { |
| | | public void setSkuList(List<OrderItemDto> skuList) { |
| | | this.skuList = skuList; |
| | | } |
| | | |
New file |
| | |
| | | package com.matrix.system.shopXcx.api.pojo; |
| | | |
| | | import com.matrix.system.shopXcx.api.vo.CouponReceiveInfoVO; |
| | | import com.matrix.system.shopXcx.bean.ShopCoupon; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 购物车前台展示对象 |
| | | */ |
| | | @Data |
| | | public class OrderCouponGroup { |
| | | |
| | | private ShopCoupon coupon; |
| | | |
| | | //是否满足优惠 |
| | | private boolean satisfactionCoupon; |
| | | |
| | | private List<OrderItemDto> orderItemDtos; |
| | | |
| | | //提示语 |
| | | private String msg=""; |
| | | |
| | | //优惠小计金额 |
| | | private BigDecimal subtotal=BigDecimal.ZERO; |
| | | |
| | | //原价 |
| | | private BigDecimal srcPrice=BigDecimal.ZERO; |
| | | |
| | | //优惠金额 |
| | | private BigDecimal couponPrice=BigDecimal.ZERO; |
| | | /** |
| | | * 抵用积分 |
| | | */ |
| | | private BigDecimal scorePay = BigDecimal.ZERO; |
| | | |
| | | private CouponReceiveInfoVO couponReceiveInfoVO; |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.shopXcx.api.pojo; |
| | | |
| | | import com.matrix.system.shopXcx.bean.ShopCoupon; |
| | | import com.matrix.system.shopXcx.bean.ShopProduct; |
| | | import com.matrix.system.shopXcx.bean.ShopSku; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author jyy |
| | | */ |
| | | @Data |
| | | public class OrderItemDto { |
| | | /** |
| | | * 产品ID |
| | | */ |
| | | private Integer productId; |
| | | /** |
| | | * 产品规格ID |
| | | */ |
| | | private Integer skuId; |
| | | |
| | | private ShopProduct shopProduct; |
| | | |
| | | private ShopSku shopSku; |
| | | |
| | | /** |
| | | * 购买数量 |
| | | */ |
| | | private Integer count; |
| | | |
| | | /** |
| | | * 支付方式1 直接购买 2,积分兑换 |
| | | */ |
| | | private Integer payType; |
| | | |
| | | /** |
| | | * 购物车id |
| | | */ |
| | | private Integer cartId; |
| | | |
| | | |
| | | private List<ShopCoupon> shopCoupons; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.shopXcx.api.pojo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author jyy |
| | | */ |
| | | @Data |
| | | public class ShopOrderDto { |
| | | |
| | | |
| | | public static final Integer JOIN_ACTIVE = 1; |
| | | /** |
| | | * 收货地址ID |
| | | */ |
| | | @NotNull(message = "请选择正确的收获地址") |
| | | private Integer receiveAddrId; |
| | | |
| | | /** |
| | | * 配送方式(1=物流,2=门店自取) |
| | | */ |
| | | private String deliverySelect; |
| | | |
| | | /** |
| | | * 配送门店ID |
| | | */ |
| | | private Long shopId; |
| | | |
| | | /** |
| | | * 优惠券记录id |
| | | */ |
| | | private Integer couponReceiveId; |
| | | |
| | | /** |
| | | * 参加店铺活动 1参加 2不参加 |
| | | */ |
| | | private Integer joinActive; |
| | | |
| | | /** |
| | | * 支付方式1微信,2 vipCard余额 |
| | | */ |
| | | @NotNull(message = "请选择支付方式") |
| | | private Integer payMethod; |
| | | |
| | | /** |
| | | * 订单备注 |
| | | */ |
| | | private String remarks; |
| | | |
| | | /** |
| | | * 购买商品规格列表详情 |
| | | */ |
| | | private List<OrderItemDto> orderItemList; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.shopXcx.api.service; |
| | | |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.shopXcx.api.pojo.OrderCouponGroup; |
| | | import com.matrix.system.shopXcx.api.pojo.OrderItemDto; |
| | | import com.matrix.system.shopXcx.bean.ShopCoupon; |
| | | import com.matrix.system.shopXcx.bean.ShopShoppingCart; |
| | | import com.matrix.system.shopXcx.dao.ShopProductDao; |
| | | import com.matrix.system.shopXcx.dao.ShopShoppingCartDao; |
| | | import com.matrix.system.shopXcx.dao.ShopSkuDao; |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 购物车前台展示对象 |
| | | */ |
| | | @Service |
| | | public class OrderCouponGroupService { |
| | | @Autowired |
| | | private ShopShoppingCartDao shoppingCartDao; |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | |
| | | @Autowired |
| | | WxShopCouponService shopCouponService; |
| | | |
| | | @Autowired |
| | | BusParameterSettingsDao busParameterSettingsDao; |
| | | |
| | | @Autowired |
| | | ShopProductDao shopProductDao; |
| | | |
| | | @Autowired |
| | | ShopSkuDao shopSkuDao; |
| | | |
| | | /** |
| | | * 初始化OrderCouponElement |
| | | * @param skuId |
| | | * @param count |
| | | * @param payType |
| | | * @return |
| | | */ |
| | | public OrderItemDto buildOrderCouponElement(OrderItemDto orderItemDto){ |
| | | orderItemDto.setShopSku(shopSkuDao.selectById(orderItemDto.getSkuId())); |
| | | orderItemDto.setShopProduct(shopProductDao.selectById(orderItemDto.getProductId())); |
| | | return orderItemDto; |
| | | } |
| | | |
| | | /** |
| | | * 计算用户的产品可以参与的店铺优惠活动分组 |
| | | */ |
| | | public List<OrderCouponGroup> buildOrderCouponGroupList(List<OrderItemDto> list) { |
| | | |
| | | //定义购物车优惠分组 |
| | | List<OrderCouponGroup> orderCouponGroupList = new ArrayList<>(); |
| | | // 1表示没有优惠的默认分组 |
| | | OrderCouponGroup def = new OrderCouponGroup(); |
| | | def.setSatisfactionCoupon(true); |
| | | def.setMsg("商城"); |
| | | def.setOrderItemDtos(new ArrayList<>()); |
| | | // 组合默认分组 |
| | | orderCouponGroupList.add(def); |
| | | |
| | | // 记录所有优惠券,一个优惠券(活动)表示一组 |
| | | Map<Integer, ShopCoupon> shopCouponMap = new HashMap<>(); |
| | | |
| | | //查询购物车中的产品匹配上的所有优惠活动 |
| | | for (OrderItemDto orderItemDto : list) { |
| | | |
| | | if(orderItemDto.getPayType()== ShopShoppingCart.CAR_TYPE_SCORE){ |
| | | // 积分兑换产品不参加优惠 |
| | | def.getOrderItemDtos().add(orderItemDto); |
| | | }else{ |
| | | List<ShopCoupon> shopCouponList = shopCouponService.getHdListByProductId(orderItemDto.getProductId()); |
| | | if (CollectionUtils.isNotEmpty(shopCouponList)) { |
| | | // 把所有的优惠券和购物车条目先关联一下,后续可以计算优惠升级的情况 |
| | | orderItemDto.setShopCoupons(shopCouponList); |
| | | for (ShopCoupon shopCoupon : shopCouponList) { |
| | | shopCouponMap.put(shopCoupon.getId(), shopCoupon); |
| | | } |
| | | } else { |
| | | // 该产品没有参加优惠券 |
| | | def.getOrderItemDtos().add(orderItemDto); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | //计算没有优惠组的价格 |
| | | countPrice(def); |
| | | |
| | | |
| | | /* |
| | | * 计算优惠券分组 1、获取到所有的优惠券,从最高满减开始,找寻合适的产品,找到后加入对应的购物车组 |
| | | * 2、计算组内价格 |
| | | */ |
| | | Set<Integer> keys = shopCouponMap.keySet(); |
| | | List<ShopCoupon> allShopCoupons = new ArrayList<>(); |
| | | for (Integer key : keys) { |
| | | allShopCoupons.add(shopCouponMap.get(key)); |
| | | } |
| | | |
| | | //根据优惠力度排序,优惠力度大的先参与计算 |
| | | Collections.sort(allShopCoupons, new Comparator() { |
| | | @Override |
| | | public int compare(Object o1, Object o2) { |
| | | ShopCoupon e1 = (ShopCoupon) o1; |
| | | ShopCoupon e2 = (ShopCoupon) o2; |
| | | return e2.getMinAmount().compareTo(e1.getMinAmount()); |
| | | } |
| | | }); |
| | | |
| | | |
| | | // 进行购物车和优惠券的匹配,匹配成功的加入到优惠组中, |
| | | for (int i = 0; i < allShopCoupons.size(); i++) { |
| | | ShopCoupon shopCoupon = allShopCoupons.get(i); |
| | | OrderCouponGroup shopCarVo = new OrderCouponGroup(); |
| | | shopCarVo.setCoupon(shopCoupon); |
| | | shopCarVo.setOrderItemDtos(new ArrayList<>()); |
| | | orderCouponGroupList.add(i, shopCarVo); |
| | | |
| | | // 获取所有购物车条目 |
| | | for (OrderItemDto orderItemDto : list) { |
| | | // 如果匹配到的产品已经出现在其他优惠组中,则需要判断是否移除之前的组 |
| | | boolean needRemove = false; |
| | | |
| | | // 判断当前购物车条目是否已经在合适的组里了 |
| | | if (isInGroupAndSatisfaction(orderItemDto, orderCouponGroupList)) { |
| | | continue; |
| | | |
| | | } else if (isInGroupNotSatisfaction(orderItemDto, orderCouponGroupList)) { |
| | | needRemove = true; |
| | | } |
| | | |
| | | List<ShopCoupon> cartCouons = orderItemDto.getShopCoupons(); |
| | | if (cartCouons != null) { |
| | | // 获取每个购物车条目满足的优惠 |
| | | for (ShopCoupon cartCouon : cartCouons) { |
| | | if (cartCouon.getId().equals(shopCoupon.getId())) { |
| | | //匹配成功,加入本组 |
| | | LogUtil.debug("购物车" + orderItemDto.getProductId() + "和优惠券" + cartCouon.getCName() + "匹配"); |
| | | if (needRemove) { |
| | | removeNotSatisfaction(orderItemDto, orderCouponGroupList); |
| | | } |
| | | shopCarVo.getOrderItemDtos().add(orderItemDto); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | // 计算本组优惠券是否已经满足优惠条件 |
| | | countPrice(shopCarVo); |
| | | } |
| | | |
| | | |
| | | // 因为有些优惠中可能没有产品,所以要去除cartList中没有产品的分组 |
| | | List<OrderCouponGroup> cartListCopy = new ArrayList<>(); |
| | | for (OrderCouponGroup orderCouponGroup : orderCouponGroupList) { |
| | | if (CollectionUtils.isNotEmpty(orderCouponGroup.getOrderItemDtos())) { |
| | | cartListCopy.add(orderCouponGroup); |
| | | } |
| | | } |
| | | return cartListCopy; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 购车条目在组中并且组是否已经满足优惠的 |
| | | * |
| | | * @param cartList |
| | | * @return |
| | | */ |
| | | private boolean isInGroupAndSatisfaction(OrderItemDto orderItemDto, List<OrderCouponGroup> cartList) { |
| | | boolean result = false; |
| | | for (OrderCouponGroup cartVo : cartList) { |
| | | if (cartVo.isSatisfactionCoupon() && cartVo.getOrderItemDtos().contains(orderItemDto)) { |
| | | result = true; |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 购物车条目在组中,但是组中产品没有达到优惠条件 |
| | | * @param cartList |
| | | * @return |
| | | */ |
| | | private boolean isInGroupNotSatisfaction(OrderItemDto orderItemDto, List<OrderCouponGroup> cartList) { |
| | | boolean result = false; |
| | | for (OrderCouponGroup cartVo : cartList) { |
| | | if (!cartVo.isSatisfactionCoupon() && cartVo.getOrderItemDtos().contains(orderItemDto)) { |
| | | result = true; |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 删除购物车条目所在分组中的引用 |
| | | * |
| | | * @param cartList |
| | | */ |
| | | private void removeNotSatisfaction(OrderItemDto orderItemDto, List<OrderCouponGroup> cartList) { |
| | | for (OrderCouponGroup cartVo : cartList) { |
| | | if (cartVo.getOrderItemDtos().remove(orderItemDto)) { |
| | | LogUtil.debug("删除购物车所在组" + cartVo.getCoupon().getCName() + "," + orderItemDto.getProductId()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 计算购物车价格和优惠信息 |
| | | * |
| | | * @author JIANGYOUYAO |
| | | * @email 935090232@qq.com |
| | | * @date 2019年8月27日 |
| | | */ |
| | | private void countPrice(OrderCouponGroup orderCouponGroup) { |
| | | List<OrderItemDto> orderItemDtoList = orderCouponGroup.getOrderItemDtos(); |
| | | // 计算总价 |
| | | BigDecimal sum = BigDecimal.ZERO; |
| | | //抵扣总积分 |
| | | BigDecimal scoreSum = BigDecimal.ZERO; |
| | | |
| | | for (OrderItemDto orderCouponElement : orderItemDtoList) { |
| | | if(ShopShoppingCart.CAR_TYPE_MICRO==orderCouponElement.getPayType()){ |
| | | //直接购买 |
| | | sum = sum.add(orderCouponElement.getShopSku().getPrice().multiply(BigDecimal.valueOf(orderCouponElement.getCount()))); |
| | | |
| | | }else if(ShopShoppingCart.CAR_TYPE_SCORE==orderCouponElement.getPayType()){ |
| | | //积分兑换 |
| | | sum = sum.add(orderCouponElement.getShopSku().getScorePrice().multiply(BigDecimal.valueOf(orderCouponElement.getCount()))); |
| | | scoreSum = scoreSum.add(new BigDecimal(orderCouponElement.getShopSku().getScoreCount() * orderCouponElement.getCount())); |
| | | }else{ |
| | | throw new GlobleException("参数错误"); |
| | | } |
| | | } |
| | | |
| | | if (orderCouponGroup.getCoupon() != null) { |
| | | // 存在优惠券 |
| | | if (sum.compareTo(orderCouponGroup.getCoupon().getMinAmount()) >= 0) { |
| | | //标记为合理分组 |
| | | orderCouponGroup.setSatisfactionCoupon(true); |
| | | if (sum.compareTo(orderCouponGroup.getCoupon().getMinAmount()) >= 0) { |
| | | orderCouponGroup.setSubtotal(sum.subtract(orderCouponGroup.getCoupon().getOffsetAmount())); |
| | | orderCouponGroup.setSrcPrice(sum); |
| | | orderCouponGroup.setCouponPrice(orderCouponGroup.getCoupon().getOffsetAmount()); |
| | | orderCouponGroup.setMsg(orderCouponGroup.getCoupon().getCName() + ",已优惠" |
| | | + orderCouponGroup.getCoupon().getOffsetAmount().stripTrailingZeros().toPlainString() + "元"); |
| | | } |
| | | } |
| | | if (sum.compareTo(orderCouponGroup.getCoupon().getMinAmount()) < 0) { |
| | | orderCouponGroup.setSatisfactionCoupon(false); |
| | | orderCouponGroup.setSubtotal(sum); |
| | | orderCouponGroup.setSrcPrice(sum); |
| | | orderCouponGroup.setMsg(orderCouponGroup.getCoupon().getCName()); |
| | | if (sum.doubleValue() > 0) { |
| | | orderCouponGroup.setMsg(orderCouponGroup.getCoupon().getCName() + ",再买" |
| | | + (orderCouponGroup.getCoupon().getMinAmount().subtract(sum)).stripTrailingZeros() |
| | | .toPlainString() |
| | | + "元立减" + orderCouponGroup.getCoupon().getOffsetAmount().stripTrailingZeros().toPlainString() |
| | | + "元"); |
| | | } |
| | | } |
| | | } else { |
| | | orderCouponGroup.setSubtotal(sum); |
| | | orderCouponGroup.setSrcPrice(sum); |
| | | orderCouponGroup.setSatisfactionCoupon(true); |
| | | } |
| | | orderCouponGroup.setScorePay(scoreSum); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.matrix.system.shopXcx.api.service; |
| | | |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | |
| | | @Autowired |
| | | BusParameterSettingsDao busParameterSettingsDao; |
| | | |
| | | |
| | | //计算购车选中项总价以及优惠金额 |
| | | public ShopCartBillVo buildShopCartBillVo(List<ShopCartVo> cartList) { |
| | | |
| | | ShopCartBillVo shopCartBillVo = new ShopCartBillVo(); |
| | | //计算购车选中项总价以及优惠金额 |
| | | BigDecimal billTotal = BigDecimal.ZERO; |
| | | BigDecimal billCouponTotal = BigDecimal.ZERO; |
| | | //未优惠之前的金额 |
| | | BigDecimal srcTotal = BigDecimal.ZERO; |
| | | |
| | | |
| | | //计算是否存在选中的产品 |
| | | Integer selectCount = 0; |
| | |
| | | shopCartBillVo.setBillCouponTotal(shopCartBillVo.getBillCouponTotal().add(shopCartVo.getCouponPrice())); |
| | | } |
| | | } |
| | | |
| | | |
| | | for (ShopShoppingCart shopCart : shopCartVo.getCartList()) { |
| | | if (shopCart.getIsSelected() == 1) { |
| | | selectCount += shopCart.getCartNumber(); |
| | |
| | | return shopCartBillVo; |
| | | } |
| | | |
| | | /** |
| | | * 计算用户的购物车产品优惠分组 |
| | | * |
| | | * @return |
| | | * @param shopId |
| | | */ |
| | | public List<ShopCartVo> findUserCartList(Long shopId) { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | String userId = loginUser.getOpenId(); |
| | | List<ShopShoppingCart> list = shoppingCartDao.selectByCartUserId(shopId,userId); |
| | | List<ShopCartVo> cartList = buildShopCart(list); |
| | | return cartList; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @SuppressWarnings("unchecked") |
| | | private List<ShopCartVo> buildShopCart(List<ShopShoppingCart> list) { |
| | | public List<ShopCartVo> buildShopCart(List<ShopShoppingCart> list) { |
| | | |
| | | |
| | | //定义购物车优惠分组 |
| | |
| | | for (ShopShoppingCart shopShoppingCart : cartList) { |
| | | sum = sum.add(shopShoppingCart.getPrice().multiply(BigDecimal.valueOf(shopShoppingCart.getCartNumber()))); |
| | | if (shopShoppingCart.getIsSelected() == 1) { |
| | | selectSum = selectSum |
| | | .add(shopShoppingCart.getPrice().multiply(BigDecimal.valueOf(shopShoppingCart.getCartNumber()))); |
| | | if(shopShoppingCart.getCartType()==ShopShoppingCart.CAR_TYPE_MICRO){ |
| | | selectSum = selectSum |
| | | .add(shopShoppingCart.getPrice().multiply(BigDecimal.valueOf(shopShoppingCart.getCartNumber()))); |
| | | }else { |
| | | selectSum = selectSum |
| | | .add(shopShoppingCart.getScorePrice().multiply(BigDecimal.valueOf(shopShoppingCart.getCartNumber()))); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | } else { |
| | | shopCartVo.setSubtotal(selectSum); |
| | | shopCartVo.setSrcPrice(selectSum); |
| | | shopCartVo.setSatisfactionCoupon(true); |
| | | shopCartVo.setSubtotal(selectSum); |
| | | shopCartVo.setSrcPrice(selectSum); |
| | | shopCartVo.setSatisfactionCoupon(true); |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.matrix.system.shopXcx.api.service; |
| | | |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.component.wechat.externalInterface.protocol.paramProtocol.BrandWCPayRequestData; |
| | | import com.matrix.system.shopXcx.bean.ShopOrder; |
| | | import com.matrix.system.shopXcx.dto.DiscountExplain; |
| | | import com.matrix.system.shopXcx.api.pojo.AddShopOrderPOJO; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.system.shopXcx.api.pojo.OrderInfoQueryPOJO; |
| | | import com.matrix.system.shopXcx.api.vo.ShopCartVo; |
| | | import com.matrix.system.shopXcx.api.pojo.ShopOrderDto; |
| | | import com.matrix.system.shopXcx.bean.ShopOrder; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author jyy |
| | |
| | | |
| | | /** |
| | | * 创建订单 |
| | | * @param addShopOrderPOJO |
| | | * @param shopOrderDto |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | AjaxResult createShopOrder(AddShopOrderPOJO addShopOrderPOJO) throws Exception; |
| | | ShopOrder createShopOrder(ShopOrderDto shopOrderDto) throws Exception; |
| | | |
| | | /** |
| | | * 订单结算 |
| | |
| | | */ |
| | | AjaxResult updateStockAndVolumeById(Integer orderId); |
| | | |
| | | DiscountExplain buildDiscountExplain(List<ShopCartVo> cartList, Integer id, Long companyId); |
| | | AjaxResult buildDiscountExplain(ShopOrderDto shopOrderDto); |
| | | } |
| | |
| | | |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.pojo.PaginationVO; |
| | | import com.matrix.system.shopXcx.bean.ShopCoupon; |
| | | import com.matrix.system.shopXcx.bean.ShopShoppingCart; |
| | | import com.matrix.system.shopXcx.api.pojo.OrderItemDto; |
| | | import com.matrix.system.shopXcx.api.vo.CouponReceiveInfoVO; |
| | | import com.matrix.system.shopXcx.bean.ShopCoupon; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * 根据购物车选中的产品 |
| | | * @return |
| | | */ |
| | | public List<CouponReceiveInfoVO> getCartVoCouponList(Long companyId,List<ShopShoppingCart> shopShoppingCarts); |
| | | public List<CouponReceiveInfoVO> getCartVoCouponList(Long companyId,List<OrderItemDto> OrderItemDtos); |
| | | |
| | | |
| | | /** |
| | |
| | | */ |
| | | Boolean refundToUser(String id, ShopRefundRecord shopRefundRecord); |
| | | |
| | | /** |
| | | * 退款成功后发送微信提醒 |
| | | * @param shopRefundRecord |
| | | * @return |
| | | */ |
| | | int sendRefundInfoToUser(ShopRefundRecord shopRefundRecord); |
| | | |
| | | void updateGroupBuyStatus(Long orderId); |
| | | |
| | |
| | | package com.matrix.system.shopXcx.api.service.impl; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.component.rabbitmq.RabiitMqTemplate; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.component.tools.WxUtils; |
| | |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.system.common.bean.BusParameterSettings; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.common.dao.CustomerDataDictionaryDao; |
| | | import com.matrix.system.common.interceptor.HostInterceptor; |
| | | import com.matrix.system.constance.Dictionary; |
| | | import com.matrix.system.hive.bean.ShoppingGoods; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.dao.ShoppingGoodsDao; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import com.matrix.system.score.dao.ScoreVipDetailDao; |
| | | import com.matrix.system.shopXcx.api.action.PayThreadPool; |
| | | import com.matrix.system.shopXcx.api.pojo.AddShopOrderPOJO; |
| | | import com.matrix.system.shopXcx.api.pojo.OrderCouponGroup; |
| | | import com.matrix.system.shopXcx.api.pojo.OrderInfoQueryPOJO; |
| | | import com.matrix.system.shopXcx.api.pojo.OrderItemDto; |
| | | import com.matrix.system.shopXcx.api.pojo.ShopOrderDto; |
| | | import com.matrix.system.shopXcx.api.service.OrderCouponGroupService; |
| | | import com.matrix.system.shopXcx.api.service.ShoppingCartService; |
| | | import com.matrix.system.shopXcx.api.service.WXShopOrderService; |
| | | import com.matrix.system.shopXcx.api.service.WxShopCouponService; |
| | | import com.matrix.system.shopXcx.api.tools.WxShopCouponUtil; |
| | | import com.matrix.system.shopXcx.api.tools.WxShopOrderUtil; |
| | | import com.matrix.system.shopXcx.api.vo.CouponReceiveInfoVO; |
| | | import com.matrix.system.shopXcx.api.vo.ShopCartBillVo; |
| | | import com.matrix.system.shopXcx.api.vo.ShopCartVo; |
| | | import com.matrix.system.shopXcx.bean.*; |
| | | import com.matrix.system.shopXcx.dao.*; |
| | | import com.matrix.system.shopXcx.dto.DiscountExplain; |
| | |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author jyy |
| | |
| | | public class WXShopOrderServiceImpl implements WXShopOrderService { |
| | | @Autowired |
| | | private WxShopOrderUtil wxShopOrderUtil; |
| | | @Autowired |
| | | private WxShopCouponUtil wxShopCouponUtil; |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | @Autowired |
| | |
| | | private ShopOrderDao shopOrderDao; |
| | | @Autowired |
| | | private ShopOrderDetailsDao shopOrderDetailsDao; |
| | | @Autowired |
| | | private ShopCouponDao shopCouponDao; |
| | | @Autowired |
| | | private ShopProductDao shopProductDao; |
| | | @Autowired |
| | |
| | | private ShopActivitiesGroupJoinUserDao shopActivitiesGroupJoinUserDao; |
| | | |
| | | @Autowired |
| | | OrderCouponGroupService orderCouponGroupService; |
| | | |
| | | @Autowired |
| | | CustomerDataDictionaryDao dataDictionaryDao; |
| | | @Value("${wx_pay_debug_onoff}") |
| | | private boolean isDebug; |
| | |
| | | @Autowired |
| | | private BusParameterSettingsDao busParameterSettingsDao; |
| | | |
| | | @Autowired |
| | | private ScoreVipDetailDao scoreVipDetailDao; |
| | | |
| | | |
| | | @Autowired |
| | | private SysVipInfoDao sysVipInfoDao; |
| | | @Override |
| | | public BigDecimal calculationPostage(BigDecimal payPrice,Long companyId) { |
| | | public BigDecimal calculationPostage(BigDecimal payPrice, Long companyId) { |
| | | BigDecimal postage = BigDecimal.ZERO; |
| | | BusParameterSettings yf = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.PACKAGE_PRICE, companyId); |
| | | BusParameterSettings myje = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.FREE_PACKAGE_PRICE, companyId); |
| | | if(yf!=null&&myje!=null){ |
| | | if (yf != null && myje != null) { |
| | | if (Double.parseDouble(myje.getParamValue()) > payPrice.doubleValue()) { |
| | | postage = new BigDecimal(yf.getParamValue()); |
| | | } |
| | | } |
| | | |
| | | return postage; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 创建订单 |
| | | * |
| | | * @param addShopOrderPOJO |
| | | * @param shopOrderDto |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public AjaxResult createShopOrder(AddShopOrderPOJO addShopOrderPOJO) throws Exception { |
| | | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | public ShopOrder createShopOrder(ShopOrderDto shopOrderDto) throws Exception { |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | |
| | | |
| | | //校验收货地址 |
| | | ShopReceiveAddress shopReceiveAddress = shopReceiveAddressDao.selectById(addShopOrderPOJO.getReceiveAddrId()); |
| | | if (shopReceiveAddress == null) { |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "请选择正确的收获地址"); |
| | | } |
| | | |
| | | ShopReceiveAddress shopReceiveAddress = shopReceiveAddressDao.selectById(shopOrderDto.getReceiveAddrId()); |
| | | |
| | | |
| | | List<ShopCartVo> cartList = shoppingCartService.findUserCartList(addShopOrderPOJO.getShopId()); |
| | | //购物车不能为空 |
| | | if (CollectionUtils.isEmpty(cartList)) { |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "请选择您需要购买的产品"); |
| | | } |
| | | |
| | | |
| | | //取出购物车中选中的产品 |
| | | List<ShopShoppingCart> buyCart = new ArrayList<>(); |
| | | //取出购物车中没有参加店铺活动的产品,和参加了店铺活动但是活动没有达到标准的产品,用来计算是否可以使用优惠券 |
| | | List<ShopShoppingCart> notCouponuyCart = new ArrayList<>(); |
| | | for (ShopCartVo shopCartVo : cartList) { |
| | | for (ShopShoppingCart shopShoppingCart : shopCartVo.getCartList()) { |
| | | if (shopShoppingCart.getIsSelected() == 1) { |
| | | buyCart.add(shopShoppingCart); |
| | | if (shopCartVo.getCoupon() == null || !shopCartVo.isSatisfactionCoupon()) { |
| | | notCouponuyCart.add(shopShoppingCart); |
| | | } |
| | | } |
| | | //计算订单优惠信息 |
| | | AjaxResult caculateResult= buildDiscountExplain(shopOrderDto); |
| | | DiscountExplain discountExplain= (DiscountExplain) caculateResult.getMapInfo().get("discountExplain"); |
| | | if(discountExplain.getScorePay()!=null){ |
| | | //校验用户积分是否够用 |
| | | int score=scoreVipDetailDao.selectUserTotalScore(sysVipInfo.getId()); |
| | | if(score<discountExplain.getScorePay()){ |
| | | throw new GlobleException("积分不足"); |
| | | } |
| | | } |
| | | |
| | | //计算订单优惠信息 |
| | | DiscountExplain discountExplain = buildDiscountExplain(cartList, addShopOrderPOJO.getCouponReceiveId(), bizUser.getCompanyId()); |
| | | |
| | | |
| | | ShopOrder shopOrder = new ShopOrder(); |
| | | shopOrder.setCompanyId(bizUser.getCompanyId()); |
| | | shopOrder.setStoreId(Integer.parseInt(addShopOrderPOJO.getShopId().toString())); |
| | | shopOrder.setCompanyId(sysVipInfo.getCompanyId()); |
| | | shopOrder.setStoreId(Integer.parseInt(shopOrderDto.getShopId().toString())); |
| | | //默认设置为产品类型 |
| | | shopOrder.setOrderType(ShopOrder.ORDER_TYPE_GOODS); |
| | | |
| | | List<ShopOrderDetails> details = new ArrayList<>(); |
| | | Integer cartCount = 0; |
| | | for (ShopShoppingCart shopShoppingCart : buyCart) { |
| | | Integer orderCount = 0; |
| | | for (OrderItemDto orderItemDto : shopOrderDto.getOrderItemList()) { |
| | | ShopOrderDetails shopOrderDetails = new ShopOrderDetails(); |
| | | shopOrderDetails.setCreateBy(AppConstance.SYSTEM_USER); |
| | | shopOrderDetails.setUpdateBy(AppConstance.SYSTEM_USER); |
| | | shopOrderDetails.setpId(shopShoppingCart.getCartProductId()); |
| | | shopOrderDetails.setsId(shopShoppingCart.getCartSkuId()); |
| | | shopOrderDetails.setPrice(shopShoppingCart.getPrice()); |
| | | shopOrderDetails.setCount(shopShoppingCart.getCartNumber()); |
| | | shopOrderDetails.setsTitle(shopShoppingCart.getTitle() + shopShoppingCart.getName()); |
| | | shopOrderDetails.setDiscountAmount(BigDecimal.ZERO); |
| | | shopOrderDetails.setTotalPrice(shopOrderDetails.getPrice().multiply(BigDecimal.valueOf(shopOrderDetails.getCount()))); |
| | | details.add(shopOrderDetails); |
| | | cartCount += shopOrderDetails.getCount(); |
| | | |
| | | //查询绑定的产品是否为家居产品,如果已经含家具产品则不再比较 |
| | | if (ShopOrder.ORDER_TYPE_GOODS != shopOrder.getOrderType()) { |
| | | ShopSku shopSku = shopSkuDao.selectById(shopShoppingCart.getCartSkuId()); |
| | | String stokCode = shopSku.getStockCode(); |
| | | if (StringUtils.isNotBlank(stokCode)) { |
| | | ShoppingGoods shoppingGoods = shoppingGoodsDao.selectById(Long.parseLong(stokCode)); |
| | | if (shoppingGoods != null) { |
| | | //根据购买的产品设置订单类型 |
| | | if (Dictionary.SHOPPING_GOODS_TYPE_JJCP.equals(shoppingGoods.getGoodType())) { |
| | | shopOrder.setOrderType(ShopOrder.ORDER_TYPE_GOODS); |
| | | } else { |
| | | |
| | | } |
| | | } else { |
| | | shopOrder.setOrderType(ShopOrder.ORDER_TYPE_GOODS); |
| | | } |
| | | } |
| | | shopOrderDetails.setpId(orderItemDto.getProductId()); |
| | | shopOrderDetails.setsId(orderItemDto.getSkuId()); |
| | | shopOrderDetails.setCount(orderItemDto.getCount()); |
| | | if(ShopOrderDetails.PAYTYPE_MICRO==orderItemDto.getPayType()){ |
| | | shopOrderDetails.setPrice(orderItemDto.getShopSku().getPrice()); |
| | | }else{ |
| | | shopOrderDetails.setPrice(orderItemDto.getShopSku().getScorePrice()); |
| | | shopOrderDetails.setScoreCount(BigDecimal.valueOf(orderItemDto.getShopSku().getScoreCount())); |
| | | shopOrderDetails.setTotalScoreCount(shopOrderDetails.getScoreCount().multiply(BigDecimal.valueOf(shopOrderDetails.getCount()))); |
| | | } |
| | | shopOrderDetails.setTotalPrice(shopOrderDetails.getPrice().multiply(BigDecimal.valueOf(shopOrderDetails.getCount()))); |
| | | |
| | | shopOrderDetails.setPayType(orderItemDto.getPayType()); |
| | | |
| | | shopOrderDetails.setsTitle(orderItemDto.getShopProduct().getTitle() + orderItemDto.getShopSku().getName()); |
| | | |
| | | shopOrderDetails.setDiscountAmount(BigDecimal.ZERO); |
| | | |
| | | details.add(shopOrderDetails); |
| | | orderCount += shopOrderDetails.getCount(); |
| | | if(orderItemDto.getCartId()!=null){ |
| | | //删除用户购物车选中的产品 |
| | | shoppingCartDao.deleteById(orderItemDto.getCartId()); |
| | | } |
| | | |
| | | } |
| | | |
| | | //校验商品是否限购 |
| | | wxShopOrderUtil.verifyProductLimitInfo(details, bizUser.getOpenId()); |
| | | wxShopOrderUtil.verifyProductLimitInfo(details, sysVipInfo.getOpenId()); |
| | | //TODO 更新库存和销量 更新库存和销量[考虑和erp库存联动] |
| | | wxShopOrderUtil.updateProductAndSkuInfo(details); |
| | | //用户openId |
| | | shopOrder.setUserId(bizUser.getOpenId()); |
| | | shopOrder.setUserId(sysVipInfo.getId()); |
| | | shopOrder.setCreateBy("微信小程序生成"); |
| | | shopOrder.setUpdateBy("微信小程序生成"); |
| | | shopOrder.setPayMethod(shopOrderDto.getPayMethod()); |
| | | shopOrder.setCommodityPrice(discountExplain.getBillPrice()); |
| | | shopOrder.setPurchaseQuantity(cartCount); |
| | | shopOrder.setPurchaseQuantity(orderCount); |
| | | shopOrder.setOrderType(ShopOrder.ORDER_TYPE_GOODS); |
| | | //购买方式 |
| | | shopOrder.setShippingMethod(addShopOrderPOJO.getDeliverySelect()); |
| | | shopOrder.setShippingMethod(shopOrderDto.getDeliverySelect()); |
| | | //生成订单号 |
| | | shopOrder.setOrderNo(WxUtils.getOrderNum()); |
| | | //设置支付状态 |
| | |
| | | //客户姓名 |
| | | shopOrder.setUserName(shopReceiveAddress.getAddrLiaisonman()); |
| | | //备注 |
| | | shopOrder.setRemarks(addShopOrderPOJO.getRemarks()); |
| | | shopOrder.setRemarks(shopOrderDto.getRemarks()); |
| | | //删除标识 |
| | | shopOrder.setDelFlag(AppConstance.DATA_USEABLE); |
| | | //微信订单号 |
| | |
| | | //获取邮费 |
| | | shopOrder.setPostage(discountExplain.getPostage()); |
| | | shopOrder.setOrderMoney(discountExplain.getPayPrice()); |
| | | shopOrder.setScorePay(discountExplain.getScorePay()); |
| | | Gson g = new GsonBuilder().create(); |
| | | shopOrder.setDiscountExplain(g.toJson(discountExplain)); |
| | | shopOrder.setDiscountAmount(discountExplain.getActivity().add(discountExplain.getCoupon())); |
| | | shopOrder.setDiscountAmount(discountExplain.getActivityPrice().add(discountExplain.getCouponPrice())); |
| | | shopOrder.setCompanyId(HostInterceptor.getCompanyId()); |
| | | shopOrderDao.insert(shopOrder); |
| | | |
| | | wxShopOrderUtil.insertSendPackageInfo(shopOrder, addShopOrderPOJO.getDeliverySelect(), shopReceiveAddress); |
| | | wxShopOrderUtil.insertSendPackageInfo(shopOrder, shopOrderDto.getDeliverySelect(), shopReceiveAddress); |
| | | //给订单详情表添加订单ID |
| | | for (ShopOrderDetails shopOrderDetails : details) { |
| | | shopOrderDetails.setOrderId(shopOrder.getId()); |
| | |
| | | shopOrderDetailsDao.batchInsert(details); |
| | | } |
| | | //更新使用的优惠券状态 |
| | | if (addShopOrderPOJO.getCouponReceiveId() != null) { |
| | | if (shopOrderDto.getCouponReceiveId() != null) { |
| | | ShopCouponRecord record = new ShopCouponRecord(); |
| | | record.setIsUsing(AppConstance.MY_COUPON_USE); |
| | | record.setOrderId(shopOrder.getId()); |
| | | record.setId(addShopOrderPOJO.getCouponReceiveId()); |
| | | record.setId(shopOrderDto.getCouponReceiveId()); |
| | | shopCouponRecordDao.updateByModel(record); |
| | | } |
| | | |
| | | //删除用户购物车选中的产品 |
| | | shoppingCartDao.deleteUserSelectCart(bizUser.getOpenId()); |
| | | |
| | | |
| | | BrandWCPayRequestData payData = startPayment(shopOrder); |
| | | AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, Arrays.asList(payData)); |
| | | result.putInMap("orderId", shopOrder.getId()); |
| | | |
| | | return result; |
| | | return shopOrder; |
| | | } |
| | | |
| | | @Override |
| | | public DiscountExplain buildDiscountExplain(List<ShopCartVo> cartList, Integer receiveId, Long companyId) { |
| | | ShopCartBillVo shopCartBill = shoppingCartService.buildShopCartBillVo(cartList); |
| | | DiscountExplain discountExplain = new DiscountExplain(); |
| | | discountExplain.setActivity(shopCartBill.getBillCouponTotal()); |
| | | discountExplain.setBillPrice(shopCartBill.getSrcTotal()); |
| | | discountExplain.setPayPrice(shopCartBill.getBillTotal()); |
| | | //计算优惠券 |
| | | if (receiveId != null) { |
| | | CouponReceiveInfoVO couponReceiveInfoVO = shopCouponRecordDao.selectMyCouponByReceiveId(receiveId); |
| | | if (couponReceiveInfoVO != null) { |
| | | BigDecimal payPrice = discountExplain.getPayPrice().subtract(couponReceiveInfoVO.getOffsetAmount()); |
| | | payPrice = payPrice.compareTo(BigDecimal.ZERO) < 0 ? BigDecimal.ZERO : payPrice; |
| | | discountExplain.setPayPrice(payPrice); |
| | | discountExplain.setCoupon(couponReceiveInfoVO.getOffsetAmount()); |
| | | } |
| | | public AjaxResult buildDiscountExplain(ShopOrderDto shopOrderDto) { |
| | | |
| | | if(CollUtil.isEmpty(shopOrderDto.getOrderItemList())){ |
| | | return AjaxResult.buildFailInstance("请选择购买的明细"); |
| | | } |
| | | |
| | | discountExplain.setPostage(calculationPostage(discountExplain.getPayPrice(),companyId)); |
| | | //订单计价说明 |
| | | DiscountExplain discountExplain = new DiscountExplain(); |
| | | //账单总金额 |
| | | BigDecimal billPrice = BigDecimal.ZERO; |
| | | //活动优惠金额 |
| | | BigDecimal activityTotal = BigDecimal.ZERO; |
| | | //优惠券惠金额 |
| | | BigDecimal couponPrice = BigDecimal.ZERO; |
| | | //支付总积分 |
| | | Integer scoreCount=0; |
| | | |
| | | //计算实际支付 |
| | | discountExplain.setPayPrice(discountExplain.getPayPrice().add(discountExplain.getPostage())); |
| | | return discountExplain; |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | |
| | | //计算购物车中物品的优惠信息 |
| | | List<OrderItemDto> orderItemDtos = shopOrderDto.getOrderItemList() |
| | | .stream().map(orderItemDto -> { |
| | | return orderCouponGroupService.buildOrderCouponElement(orderItemDto); |
| | | }) |
| | | .collect(Collectors.toList()); |
| | | //计算未优惠的总金额 |
| | | for (OrderItemDto orderItemDto :orderItemDtos ){ |
| | | if(orderItemDto.getPayType()==ShopShoppingCart.CAR_TYPE_MICRO){ |
| | | billPrice=billPrice.add(orderItemDto.getShopSku().getPrice().multiply(new BigDecimal(orderItemDto.getCount()))); |
| | | }else{ |
| | | billPrice=billPrice.add(orderItemDto.getShopSku().getScorePrice().multiply(new BigDecimal(orderItemDto.getCount()))); |
| | | scoreCount+=orderItemDto.getShopSku().getScoreCount()*orderItemDto.getCount(); |
| | | } |
| | | } |
| | | discountExplain.setScorePay(scoreCount); |
| | | |
| | | |
| | | //计算用户的产品可以参与的店铺优惠活动分组 |
| | | List<ShopCoupon> shopActiveList = new ArrayList<>();//记录用户可以参与的门店活动 |
| | | List<OrderCouponGroup> orderCouponGroupList = new ArrayList<>(); |
| | | int conditionsGroupCount = 0; |
| | | if (shopOrderDto.getJoinActive() == ShopOrderDto.JOIN_ACTIVE) {//用户参与优惠活动 |
| | | orderCouponGroupList = orderCouponGroupService.buildOrderCouponGroupList(orderItemDtos); |
| | | conditionsGroupCount = orderCouponGroupList.stream().map(orderCouponGroup -> { |
| | | if (orderCouponGroup.isSatisfactionCoupon()&&orderCouponGroup.getCoupon()!=null) { |
| | | shopActiveList.add(orderCouponGroup.getCoupon()); |
| | | return 1; |
| | | } else { |
| | | return 0; |
| | | } |
| | | }).mapToInt(Integer::intValue).sum(); |
| | | } |
| | | if(CollUtil.isNotEmpty(shopActiveList)){ |
| | | activityTotal=shopActiveList.stream().map(ShopCoupon:: getOffsetAmount).reduce(BigDecimal.ZERO,BigDecimal::add); |
| | | } |
| | | |
| | | //门店活动优惠金额 |
| | | discountExplain.setActivityPrice(activityTotal); |
| | | |
| | | |
| | | List<CouponReceiveInfoVO> usefulCoupon = new ArrayList<>(); |
| | | CouponReceiveInfoVO shopCoupon = new CouponReceiveInfoVO(); |
| | | //满足店铺活动的订单不能使用优惠券 |
| | | if (conditionsGroupCount > 0) { |
| | | //计算可用优惠券 |
| | | usefulCoupon = wxShopCouponService.getCartVoCouponList(sysVipInfo.getCompanyId(), orderItemDtos); |
| | | //获取用户使用的优惠券 |
| | | if (shopOrderDto.getCouponReceiveId() == null) { |
| | | //如果用户没有选择优惠券则默认选优惠金额最高的 |
| | | //计算使用优惠券后的价格 |
| | | if (CollectionUtils.isNotEmpty(usefulCoupon)) { |
| | | //根据优惠券ID用户ID查询优惠券信息 |
| | | shopCoupon = usefulCoupon.get(0); |
| | | } |
| | | } else if (shopOrderDto.getCouponReceiveId() != 1) { |
| | | //用户选择了优惠券 |
| | | shopCoupon = shopCouponRecordDao.selectMyCouponByReceiveId(shopOrderDto.getCouponReceiveId()); |
| | | } else { |
| | | //用户不使用优惠券 |
| | | } |
| | | //计算优惠券 |
| | | if (shopCoupon.getCouponId() != null) { |
| | | couponPrice=shopCoupon.getOffsetAmount(); |
| | | } |
| | | //优惠券金额 |
| | | discountExplain.setCouponPrice(couponPrice); |
| | | } |
| | | |
| | | |
| | | |
| | | //计算运费 |
| | | discountExplain.setPostage(calculationPostage(discountExplain.getPayPrice(), HostInterceptor.getCompanyId())); |
| | | |
| | | |
| | | |
| | | //账单总金额 |
| | | discountExplain.setBillPrice(billPrice.add(discountExplain.getPostage())); |
| | | |
| | | BigDecimal payPrice=discountExplain.getBillPrice().subtract(activityTotal).subtract(couponPrice); |
| | | //应付金额 |
| | | discountExplain.setPayPrice(payPrice.doubleValue()>0?payPrice:BigDecimal.ONE); |
| | | |
| | | AjaxResult result = AjaxResult.buildSuccessInstance(""); |
| | | //结算金额信息 |
| | | result.putInMap("discountExplain", discountExplain); |
| | | //用户优惠券 |
| | | result.putInMap("usefulCoupon", usefulCoupon); |
| | | //用户选中的优惠券 |
| | | result.putInMap("shopCoupon", shopCoupon); |
| | | |
| | | //店铺优惠活动 |
| | | result.putInMap("shopActiveList", shopActiveList); |
| | | |
| | | return result; |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | @Override |
| | | public AjaxResult orderSettlement(int orderId) throws Exception { |
| | | ShopOrder shopOrder = shopOrderDao.selectById(orderId); |
| | | |
| | | if (shopOrder == null) { |
| | | throw new GlobleException("订单不存在!"); |
| | | return AjaxResult.buildFailInstance("订单不存在!"); |
| | | } |
| | | if (ShopOrder.SHOP_ORDER_PAY_METHOD_WX != shopOrder.getPayMethod()) { |
| | | return AjaxResult.buildFailInstance("支付方式错误"); |
| | | } |
| | | if (!shopOrder.getPayResult().equals(ShopOrder.ORDER_PAY_STATUS_WAIT)) { |
| | | throw new GlobleException("该订单不是待支付状态!"); |
| | | return AjaxResult.buildFailInstance("该订单不是待支付状态!"); |
| | | } |
| | | |
| | | if(shopOrder.getScorePay()!=null){ |
| | | //校验用户积分是否够用 |
| | | int score=scoreVipDetailDao.selectUserTotalScore(shopOrder.getUserId()); |
| | | if(score<shopOrder.getScorePay()){ |
| | | return AjaxResult.buildFailInstance("积分不足"); |
| | | } |
| | | } |
| | | |
| | | BrandWCPayRequestData payData = startPayment(shopOrder); |
| | | AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, Arrays.asList(payData)); |
| | | result.putInMap("orderId", shopOrder.getId()); |
| | |
| | | BigDecimal money = new BigDecimal(shopOrder.getOrderMoney().toString()); |
| | | BrandWCPayRequestData payData; |
| | | String productNames = wxShopOrderUtil.getProductNames(shopOrder.getUserId(), shopOrder.getId()); |
| | | SysVipInfo vipInfo=sysVipInfoDao.selectById(shopOrder.getUserId()); |
| | | |
| | | LogUtil.debug(String.valueOf(isDebug)); |
| | | if (isDebug) { |
| | | payData = weixinServiceUtil.createOrder("[测试]" + productNames, shopOrder.getOrderNo(), |
| | | 1, shopOrder.getUserId(), String.valueOf(shopOrder.getId())); |
| | | 1, vipInfo.getOpenId(), String.valueOf(shopOrder.getId())); |
| | | } else { |
| | | payData = weixinServiceUtil.createOrder(productNames, shopOrder.getOrderNo(), |
| | | unit.multiply(money).intValue(), shopOrder.getUserId(), String.valueOf(shopOrder.getId())); |
| | | unit.multiply(money).intValue(),vipInfo.getOpenId(), String.valueOf(shopOrder.getId())); |
| | | } |
| | | ShopOrder updateParam = new ShopOrder(); |
| | | updateParam.setId(shopOrder.getId()); |
| | |
| | | */ |
| | | @Override |
| | | public AjaxResult getMyOrderInfo(OrderInfoQueryPOJO orderInfoQueryPOJO) { |
| | | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | orderInfoQueryPOJO.setSort("update_time"); |
| | | if (orderInfoQueryPOJO.getOffset() >= 1) { |
| | | orderInfoQueryPOJO.setOffset((orderInfoQueryPOJO.getOffset() - 1) * orderInfoQueryPOJO.getLimit()); |
| | | } |
| | | List<ShopOrder> result = shopOrderDao.selectMyOrderByStatus(bizUser.getOpenId(), orderInfoQueryPOJO); |
| | | List<ShopOrder> result = shopOrderDao.selectMyOrderByStatus(sysVipInfo.getId(), orderInfoQueryPOJO); |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, result); |
| | | } |
| | | |
| | |
| | | */ |
| | | @Override |
| | | public AjaxResult getOrderInfoById(Integer orderId) { |
| | | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | ShopOrder shopOrder = shopOrderDao.selectOrderInfoById(bizUser.getOpenId(), orderId); |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | ShopOrder shopOrder = shopOrderDao.selectOrderInfoById(sysVipInfo.getId(), orderId); |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, Arrays.asList(shopOrder)); |
| | | } |
| | | |
| | |
| | | } |
| | | if (shopOrder.getDiscountAmount() != null && shopOrder.getDiscountAmount().compareTo(BigDecimal.ZERO) > 0) { |
| | | ShopCouponRecord shopCouponRecord = new ShopCouponRecord(); |
| | | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | shopCouponRecord.setUserId(bizUser.getOpenId()); |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | shopCouponRecord.setUserId(sysVipInfo.getId()); |
| | | shopCouponRecord.setOrderId(orderId); |
| | | List<ShopCouponRecord> recordList = shopCouponRecordDao.selectByModel(shopCouponRecord); |
| | | if (CollectionUtils.isNotEmpty(recordList)) { |
zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopActivitiesGroupServiceImpl.java
zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopActivitiesSecKillServiceImpl.java
zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopCouponServiceImpl.java
zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopLogisticsQueryServiceImpl.java
zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopRefundRecordServiceImpl.java
zq-erp/src/main/java/com/matrix/system/shopXcx/api/tools/WxShopCouponUtil.java
zq-erp/src/main/java/com/matrix/system/shopXcx/api/tools/WxShopOrderUtil.java
zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ActivitySignAwardSetVo.java
zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ScoreUseRecordVo.java
zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/SeeAwardTextVo.java
zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ShopCartBillVo.java
zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ShopCartGroupVo.java
zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/ShopCartVo.java
zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/SignAwardListVo.java
zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/SignBasicInfoJsonVo.java
zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/SignBasicInfoVo.java
zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/SignSuccessVo.java
zq-erp/src/main/java/com/matrix/system/shopXcx/api/vo/WxMoneyCardUseVO.java
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivities.java
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivitiesGroupJoin.java
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivitiesGroupJoinUser.java
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivitiesSalonRecord.java
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivitiesSeckillRecord.java
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopAdvertis.java
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopCouponRecord.java
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopDeliveryDetail.java
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopDeliveryInfo.java
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopOrder.java
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopOrderDetails.java
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopPage.java
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopProduct.java
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopProductComment.java
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopRefundRecord.java
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopScoreRecord.java (deleted)
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopSearchRecord.java
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopShareQrcord.java
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopShoppingCart.java
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopSku.java
zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopActivitiesDao.java
zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopCouponDao.java
zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopCouponRecordDao.java
zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopDeliveryDetailDao.java
zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopOrderDao.java
zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopOrderV2Dao.java
zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopPageDao.java
zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopQrcordVisitorDao.java
zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopScoreRecordDao.java (deleted)
zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopShareQrcordDao.java
zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopShoppingCartDao.java
zq-erp/src/main/java/com/matrix/system/shopXcx/dto/CreateGroupBuyDTO.java
zq-erp/src/main/java/com/matrix/system/shopXcx/dto/DiscountExplain.java
zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/MQTaskRouting.java
zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/OrderTask.java
zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/SalesOrderRefundTask.java
zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/SalesOrderTask.java
zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/ScoreOrderTask.java
zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/VipCreateTask.java (deleted)
zq-erp/src/main/java/com/matrix/system/shopXcx/pojo/ShopOrderQueryPOJO.java
zq-erp/src/main/java/com/matrix/system/shopXcx/quartz/ShopActivityGroupJoinTimeOutQuartz.java
zq-erp/src/main/java/com/matrix/system/shopXcx/quartz/ShopActivityPayTimeOutQuartz.java
zq-erp/src/main/java/com/matrix/system/shopXcx/quartz/ShopActivityTimeOutQuartz.java
zq-erp/src/main/java/com/matrix/system/shopXcx/quartz/ShopAutomaticReceiveQuartz.java
zq-erp/src/main/java/com/matrix/system/shopXcx/quartz/ShopCouponQuartz.java
zq-erp/src/main/java/com/matrix/system/shopXcx/vo/LogisticsImportVo.java
zq-erp/src/main/java/com/matrix/system/shopXcx/vo/SalesOrderVo.java
zq-erp/src/main/java/com/matrix/system/shopXcx/vo/SalesmanApplyCondition.java
zq-erp/src/main/java/com/matrix/system/shopXcx/vo/SalesmanCenterInfo.java
zq-erp/src/main/java/com/matrix/system/shopXcx/vo/SalesmanVo.java
zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/UniformMsgSentTask.java
zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/messageBulderDemo/DefaultTemplateMessageBulder.java
zq-erp/src/main/resources/config/application.properties
zq-erp/src/main/resources/config/config.json
zq-erp/src/main/resources/config/db/increment/推广员.sql
zq-erp/src/main/resources/config/db/increment/签到活动.sql
zq-erp/src/main/resources/config/db/increment/美度业绩升级.sql
zq-erp/src/main/resources/config/system.properties
zq-erp/src/main/resources/config/test/application.properties
zq-erp/src/main/resources/config/test/config.json
zq-erp/src/main/resources/config/test/system.properties
zq-erp/src/main/resources/config/xcshop/application.properties
zq-erp/src/main/resources/config/xcshop/config.json
zq-erp/src/main/resources/config/xcshop/system.properties
zq-erp/src/main/resources/mybatis/mapper/activity/ActivitySignAwardSetDao.xml
zq-erp/src/main/resources/mybatis/mapper/activity/ActivitySignReceiveRecordDao.xml
zq-erp/src/main/resources/mybatis/mapper/activity/ActivitySignRecordDao.xml
zq-erp/src/main/resources/mybatis/mapper/activity/ActivitySignWriteoffDao.xml
zq-erp/src/main/resources/mybatis/mapper/common/BusParameterSettingsDao.xml
zq-erp/src/main/resources/mybatis/mapper/fenxiao/BizUserDao.xml
zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopRevenueFlowDao.xml
zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalemanSettlementDao.xml
zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanApplyDao.xml
zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanGradeDao.xml
zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanOrderDao.xml
zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanOrderItemDao.xml
zq-erp/src/main/resources/mybatis/mapper/hive/AchieveNewDao.xml
zq-erp/src/main/resources/mybatis/mapper/hive/MoneyCardUseDao.xml
zq-erp/src/main/resources/mybatis/mapper/hive/MoneyCardUseFlowDao.xml
zq-erp/src/main/resources/mybatis/mapper/hive/MoneyCardUseV2Dao.xml
zq-erp/src/main/resources/mybatis/mapper/hive/OnlinebookingDao.xml
zq-erp/src/main/resources/mybatis/mapper/hive/ShoppingGoodsDao.xml
zq-erp/src/main/resources/mybatis/mapper/hive/SysBeauticianStateDao.xml
zq-erp/src/main/resources/mybatis/mapper/hive/SysBusinessDataDao.xml
zq-erp/src/main/resources/mybatis/mapper/hive/SysOrderDao.xml
zq-erp/src/main/resources/mybatis/mapper/hive/SysOrderItemDao.xml
zq-erp/src/main/resources/mybatis/mapper/hive/SysProjServicesDao.xml
zq-erp/src/main/resources/mybatis/mapper/hive/SysProjUseDao.xml
zq-erp/src/main/resources/mybatis/mapper/hive/SysVipInfoDao.xml
zq-erp/src/main/resources/mybatis/mapper/hive/TjVipSumDao.xml
zq-erp/src/main/resources/mybatis/mapper/score/ScoreUseRecordDao.xml
zq-erp/src/main/resources/mybatis/mapper/score/ScoreVipDetailDao.xml
zq-erp/src/main/resources/mybatis/mapper/xcxShop/BizUserDao.xml (deleted)
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesDao.xml
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesGroupJoinDao.xml
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesGroupJoinUserDao.xml
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesSalonRecordDao.xml
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesSeckillRecordDao.xml
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopAdvertisDao.xml
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopCollectionDao.xml
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopCouponRecordDao.xml
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopDeliveryInfoDao.xml
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopInvoiceDao.xml
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopOrderDao.xml
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopOrderDetailsDao.xml
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopOrderSearchDao.xml
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopOrderV2Dao.xml
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopProductCommentDao.xml
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopProductDao.xml
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopRefundRecordDao.xml
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopShoppingCartDao.xml
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopSkuDao.xml
zq-erp/src/main/resources/readme-jyy
zq-erp/src/main/resources/static/demoPage/soketLoginTest.html
zq-erp/src/main/resources/static/demoPage/soketTest.html
zq-erp/src/main/resources/static/images/dui.png
zq-erp/src/main/resources/static/images/pc.png
zq-erp/src/main/resources/static/images/qrcode.png
zq-erp/src/main/resources/static/images/qrcodeBack.png
zq-erp/src/main/resources/static/js/function/vip.js
zq-erp/src/main/resources/static/js/plugin/qrcode.js
zq-erp/src/main/resources/static/js/systools/MBase.js
zq-erp/src/main/resources/static/templates/logisticsImport.xls
zq-erp/src/main/resources/static/templates/vipInfoImport.xls
zq-erp/src/main/resources/static/templates/vipProjUse.xls
zq-erp/src/main/resources/templates/views/admin/activity/activity-list.html
zq-erp/src/main/resources/templates/views/admin/activity/activity-market.html
zq-erp/src/main/resources/templates/views/admin/activity/activity-sign-logistics-info.html
zq-erp/src/main/resources/templates/views/admin/activity/activity-sign-receive.html
zq-erp/src/main/resources/templates/views/admin/activity/activity-sign-update.html
zq-erp/src/main/resources/templates/views/admin/activity/activity-sign-writeoff-info.html
zq-erp/src/main/resources/templates/views/admin/activity/activity-sign-writeoff.html
zq-erp/src/main/resources/templates/views/admin/activity/activity-sign.html
zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-apply.html
zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-order.html
zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-setting.html
zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-update.html
zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-user.html
zq-erp/src/main/resources/templates/views/admin/hive-erp/order/orderXq-form.html
zq-erp/src/main/resources/templates/views/admin/hive-erp/score/score-setting.html
zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/daily-list-new.html
zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/daily-sale-list.html
zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/cz-form.html
zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/order-form.html
zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/orderXq-form.html
zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/pbxq-form.html
zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/servicceAddForm.html
zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/service_all_list.html
zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/underlineOrder.html
zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/vip.html
zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/vip_bak.html
zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/yyServiceAddForm.html
zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/yypb-form-bak.html
zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/yypb-form.html
zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-account-card.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-account-choice.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-account-detail.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-account-follow-add.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-account-follow.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-account-mealuse.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-account-msg.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-account-my.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-account-potential.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-account-service.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-account-turn.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-account.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-card-user.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-search.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-vip.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-vipInfo-search.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-visit-info.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-visit-list.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM-visit.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/CRM.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/_foot.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/_pageNav.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/cwqk-list.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/mls-list.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/mobileLogin.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-car.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-history-msg.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-history.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-list.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-msg.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-msg2.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-msg3.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-msg4.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-msg5.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-search.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-service.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-use-completed.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-use-end-service.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-use-look-endService.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-use-new.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-use-start-service.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/order-use-time.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/order.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/personal-msg.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/personal-resetPassWord.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/personal-shop-list.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/personal-staff-list.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/personal-trainingMaterials-data.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/personal-trainingMaterials-info.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/personal-trainingMaterials1.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/personal-trainingMaterials2.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/personal.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/store-check-detail.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/store-check.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/mobile/vip-archives.html (deleted)
zq-erp/src/main/resources/templates/views/admin/hive/statistics/daily-list-new-bak.html
zq-erp/src/main/resources/templates/views/admin/hive/statistics/daily-list-new.html
zq-erp/src/main/resources/templates/views/admin/hive/statistics/daily-sale-list.html
zq-erp/src/main/resources/templates/views/admin/shop/logisticsImport-form.html
zq-erp/src/main/resources/templates/views/admin/shop/shopAdvertisType-list.html
zq-erp/src/main/resources/templates/views/admin/shop/shopOrder-list.html
zq-erp/src/main/resources/templates/views/admin/shop/shopProduct-form.html
zq-erp/src/main/resources/templates/views/admin/shop/shopProduct-list.html
zq-erp/src/main/resources/templates/views/admin/shop/shopProductComment-list.html
zq-erp/src/main/resources/templates/views/admin/shop/shopUser-list.html
zq-erp/src/main/resources/templates/views/admin/sys/customerDataDictionary-list.html
zq-erp/src/main/resources/templates/views/common/login.html
zq-erp/src/main/resources/templates/views/common/showprojException.html
zq-erp/src/test/java/com/matrix/BizUserToVipInfoTool.java
zq-erp/src/test/java/com/matrix/FenxiaoSoreInitTest.java
zq-erp/src/test/java/com/matrix/JyyTests.java
zq-erp/src/test/java/com/matrix/ParameterSettingsTool.java
zq-erp/src/test/java/com/matrix/SalesOrderTaskTest.java
zq-erp/src/test/java/com/matrix/SourceFlowTests.java
zq-erp/src/test/java/com/matrix/TcProjTest.java |