a9e1505680c7dd45840975b38451ef88d451e6d4..6cfc2e4258089c953b67054229170c1178585590
2026-03-23 rk
小程序 接口开发
6cfc2e 对比 | 目录
2026-03-23 rk
小程序 接口开发
bf7b97 对比 | 目录
已修改12个文件
200 ■■■■ 文件已修改
server/dmmall_admin/src/main/java/com/doumee/task/ScheduleTool.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmmall_admin/src/main/resources/application.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmmall_service/src/main/java/com/doumee/core/utils/GeneratePicUtil.java 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmmall_service/src/main/java/com/doumee/service/business/GoodsorderService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmmall_service/src/main/java/com/doumee/service/business/impl/CommentServiceImpl.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmmall_service/src/main/java/com/doumee/service/business/impl/GoodsorderServiceImpl.java 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmmall_service/src/main/java/com/doumee/service/system/impl/SystemLoginServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmmall_service/src/main/resources/application-dev.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmmall_service/src/main/resources/application-pro.yml 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmmall_service/src/main/resources/application-test.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmmall_web/src/main/java/com/doumee/api/common/PublicController.java 51 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmmall_web/src/main/java/com/doumee/api/web/UtilApi.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmmall_admin/src/main/java/com/doumee/task/ScheduleTool.java
@@ -131,6 +131,24 @@
    }
    /**
     * 定时自动完成 7 天未确认收货的物流发货订单
     * 每 10 分钟执行一次
     */
    @Scheduled(fixedDelay = 1000L * 60 * 10L )
    public void autoCompleteOrder(){
        if (timing) {
            System.out.println("开始执行订单自动完成任务--------Begin------");
            try {
                goodsorderService.autoCompleteOrder();
                System.out.println("订单自动完成任务执行成功--------End------");
            } catch (Exception e) {
                System.out.println("订单自动完成任务执行失败:" + e.getMessage());
            }
        }
    }
    /**
     * 定时完成售后单状态
     */
//    @Scheduled(fixedDelay = 1000L * 10L )
server/dmmall_admin/src/main/resources/application.yml
@@ -8,7 +8,7 @@
  #  application:
  #    name: doumeemes
  profiles:
    active: dev
    active: pro
  # JSON返回配置
  jackson:
server/dmmall_service/src/main/java/com/doumee/core/utils/GeneratePicUtil.java
@@ -24,7 +24,7 @@
@Slf4j
public class GeneratePicUtil {
    static String bg="https://shoeslxkj.oss-cn-beijing.aliyuncs.com/file/20230404/SysBaseBackGround/D56231512C0B4A4C9D06B02F9566B0B0.png";
    static String bg="https://dynometacn.oss-cn-shanghai.aliyuncs.com/goods/20260319/feccd954-32f7-47e2-96fb-be102b643f1f.png";
    static String headUrl = "https://shoeslxkj.oss-cn-beijing.aliyuncs.com/file/20230404/SysBaseBackGround/B802B64FE31447DCB030F13ECC7CA9F9.png";
@@ -339,22 +339,22 @@
        g2.fillRect(0, 0, width, height);
        //背景图片
//        BufferedImage titles = ImageIO.read(new URL(bg));
//        g2.drawImage(titles, 1, 1, 894, 1305, null);
//        g2.drawRect(0, 0, width - 1, height - 1);
        BufferedImage titles = ImageIO.read(new URL(bg));
        g2.drawImage(titles, 1, 1, 894, 1305, null);
        g2.drawRect(0, 0, width - 1, height - 1);
        //头部图片
        BufferedImage headBg = ImageIO.read(new URL(headImg));
//        BufferedImage headBg = getImgIO(imgurl);
        g2.drawImage(headBg, 1, 1, 894, 1080, null);
        g2.drawRect(0, 0, width - 1, height - 1);
        g2.setColor(Color.black);
        g2.setFont(new Font("黑体", Font.PLAIN, 40));
        g2.drawString("长按识别小程序", 46, 1180);
        g2.setColor(Color.gray);
        g2.setFont(new Font("黑体", Font.PLAIN, 32));
        g2.drawString("查看更多精彩内容", 48, 1230);
//        g2.setColor(Color.black);
//        g2.setFont(new Font("黑体", Font.PLAIN, 40));
//        g2.drawString("长按识别小程序", 46, 1180);
//
//        g2.setColor(Color.gray);
//        g2.setFont(new Font("黑体", Font.PLAIN, 32));
//        g2.drawString("查看更多精彩内容", 48, 1230);
        //设置二维码图片
//        BufferedImage barcodeCode = ImageIO.read(new URL(wxQrCodeImg));
server/dmmall_service/src/main/java/com/doumee/service/business/GoodsorderService.java
@@ -245,4 +245,6 @@
    void autoCancelOrder();
    void autoCompleteOrder();
}
server/dmmall_service/src/main/java/com/doumee/service/business/impl/CommentServiceImpl.java
@@ -1,5 +1,7 @@
package com.doumee.service.business.impl;
import cn.binarywang.wx.miniapp.bean.security.WxMaMsgSecCheckCheckRequest;
import cn.binarywang.wx.miniapp.bean.security.WxMaMsgSecCheckCheckResponse;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -12,6 +14,7 @@
import com.doumee.core.model.PageWrap;
import com.doumee.core.utils.Constants;
import com.doumee.core.utils.Utils;
import com.doumee.core.wx.WxMiniConfig;
import com.doumee.dao.business.*;
import com.doumee.dao.business.model.*;
import com.doumee.dao.web.dto.CommentDTO;
@@ -22,6 +25,7 @@
import com.doumee.service.business.CommentService;
import com.doumee.service.business.ZanService;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import me.chanjar.weixin.common.error.WxErrorException;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
@@ -67,6 +71,26 @@
    @Override
    public Comment apply(CommentApplyRequest comment, Integer memberId) {
        if (StringUtils.isNotBlank(comment.getContent())) {
            try {
                WxMaMsgSecCheckCheckRequest checkRequest = WxMaMsgSecCheckCheckRequest.builder()
                        .version("2")
                        .scene(3)
                        .openid(getMemberOpenId(memberId))
                        .content(comment.getContent())
                        .build();
                WxMaMsgSecCheckCheckResponse checkResponse = WxMiniConfig.wxMaService.getSecurityService().checkMessage(checkRequest);
                if (checkResponse.getResult() != null && checkResponse.getResult().getSuggest() != null) {
                    String suggest = checkResponse.getResult().getSuggest();
                    if ("risky".equalsIgnoreCase(suggest)) {
                        throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "评论内容包含违规信息,请修改后重新发布");
                    }
                }
            } catch (WxErrorException e) {
                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "内容安全检测失败,请稍后重试");
            }
        }
        Comment target = new Comment();
        target.setCreateDate(new Date());
        target.setEditDate(new Date());
@@ -408,4 +432,9 @@
        });
        return PageData.from(result);
    }
    private String getMemberOpenId(Integer memberId) {
        Member member = memberMapper.selectById(memberId);
        return member != null ? member.getOpenId() : null;
    }
}
server/dmmall_service/src/main/java/com/doumee/service/business/impl/GoodsorderServiceImpl.java
@@ -2378,9 +2378,60 @@
                this.cancel(goodsorder,null,"订单未支付超时自动取消");
            }
        }
    }
    /**
     * 自动完成 7 天未确认收货的物流发货订单
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void autoCompleteOrder(){
        //查询发货后 7 天未确认收货的订单数据(仅处理快递配送订单)
        List<Goodsorder> goodsOrderList = goodsorderMapper.selectList(
                new QueryWrapper<Goodsorder>()
                        .eq("STATUS", Constants.OrderStatus.WAIT_RECEIVE.getKey())
                        .eq("RECEIVE_TYPE", Constants.ZERO)  // 仅处理快递配送订单
                        .isNotNull("KD_CODE")  // 有物流单号
                        .ne("KD_CODE", "")  // 物流单号不为空
                        .apply(" KD_DATE IS NOT NULL ")  // 有发货时间
                        .apply(" NOW() >= DATE_SUB(KD_DATE, INTERVAL -7 DAY) ")  // 发货后 7 天
        );
        if (!goodsOrderList.isEmpty()) {
            for (Goodsorder order : goodsOrderList) {
                try {
                    Goodsorder updateOrder = new Goodsorder();
                    updateOrder.setId(order.getId());
                    updateOrder.setStatus(Constants.OrderStatus.DONE.getKey());
                    updateOrder.setDoneDate(new Date());
                    updateOrder.setDoneInfo("发货 7 天后系统自动确认收货");
                    goodsorderMapper.updateById(updateOrder);
                    //存在现金支付 赠送 积分
                    if(Constants.equalsInteger(updateOrder.getPayMethod(),Constants.ZERO)){
                        //赠送消费者积分
                        this.orderAddMemberIntegral(order);
                        //下单完成 根据信息确认是否需要赠送邀请者优惠券
                        this.orderDoneRewardInviteCoupon(order);
                        //经销商 添加赠送积分
                        this.orderAddShopIntegral(order);
                        //经销商 结算金额
                        this.orderAddShopCash(order);
                    }
                    System.out.println("订单自动完成:订单 ID=" + order.getId() + ", 订单编号=" + order.getCode());
                } catch (Exception e) {
                    System.out.println("订单自动完成失败:订单 ID=" + order.getId() + ", 错误:" + e.getMessage());
                }
            }
        }
    }
}
server/dmmall_service/src/main/java/com/doumee/service/system/impl/SystemLoginServiceImpl.java
@@ -47,7 +47,7 @@
        loginLog.setOsInfo(Utils.User_Client.getOS(request));
        loginLog.setServerIp(Utils.Server.getIP());
        // 校验验证码
    /*    try {
        try {
            captchaService.check(dto.getUuid(), dto.getCode());
        } catch (Exception e) {
            log.error(e.getMessage(), e);
@@ -55,7 +55,7 @@
            loginLog.setSuccess(Boolean.FALSE);
            systemLoginLogService.create(loginLog);
            throw e;
        }*/
        }
        // 校验用户名和密码
        Subject subject = SecurityUtils.getSubject();
        UsernamePasswordToken token = new UsernamePasswordToken(dto.getUsername(), dto.getPassword());
server/dmmall_service/src/main/resources/application-dev.yml
@@ -71,4 +71,4 @@
########################定时开启配置########################
timing: true
timing: false
server/dmmall_service/src/main/resources/application-pro.yml
@@ -50,11 +50,17 @@
wx:
  pay:
    appId: wx0115b948d647e9b2
    appSecret: 4b5b97d6770f1fc6b09a7019804739a7 #3462fa186da7cb06c544df8d8664b63a
    appSecret: 4b5b97d6770f1fc6b09a7019804739a7
    mchId: 1739990831
    mchKey: u4TSNtv0wFP7WRfnxBgijYOtRhS9FvlM
    notifyUrl: https://dynj.ahapp.net/dmmall_interface/web/api/wxPayNotify #mall.myshopify.com
    notifyUrl: https://mall.dynometacn.com/dmmall_web_api/web/api/wxPayNotify
    keyPath: /usr/local/jars/apiclient_cert.p12
#    appId: wxcd2b89fd2ff065f8
#    appSecret: 3462fa186da7cb06c544df8d8664b63a
#    mchId: 1229817002
#    mchKey: u4TSNtv0wFP7WRfnxBgijYOtRhS9FvlM
#    notifyUrl: https://mall.dynometacn.com/dmmall_web_api/web/api/wxPayNotify
#    keyPath: /usr/local/jars/dm_apiclient_cert.p12
tencent:
  map:
server/dmmall_service/src/main/resources/application-test.yml
@@ -63,4 +63,4 @@
########################定时开启配置########################
timing: true
timing: false
server/dmmall_web/src/main/java/com/doumee/api/common/PublicController.java
@@ -7,11 +7,13 @@
import com.doumee.core.utils.Constants;
import com.doumee.core.utils.DateUtil;
import com.doumee.core.utils.aliyun.ALiYunUtil;
import com.doumee.core.wx.WxMiniConfig;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.common.error.WxErrorException;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
@@ -23,6 +25,7 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashMap;
@@ -98,17 +101,14 @@
            MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
            Iterator<String> it = multipartRequest.getFileNames();
            while (it.hasNext()) {
                MultipartFile file = multipartRequest.getFile((String) it.next());// file
                // multipartRequest.getFile((String)
                // it.next());
                MultipartFile file = multipartRequest.getFile((String) it.next());
                if (file != null) {
                    // 1、上传到服务器临时文件夹
                    String uploadFileName = file.getOriginalFilename();
                    String originname = uploadFileName;
                    if (originname.lastIndexOf("/") >= 0) {
                        originname = originname.substring(originname.lastIndexOf("/") + 1);
                    }
                    String nfix = "";// 后缀名
                    String nfix = "";
                    if (StringUtils.isNotBlank(uploadFileName)) {
                        nfix = uploadFileName.substring(uploadFileName.lastIndexOf("."));
                    }
@@ -122,14 +122,36 @@
                        context.put("message", "对不起,文件格式\".dll\"上传有误!");
                        return;
                    }
                    String nowDate = DateUtil.getNowShortDate();// 当前时间(年月日)
                    if (isImageFile(nfix)) {
                        File tempFile = null;
                        try {
                            tempFile = File.createTempFile("wx_check_", nfix);
                            java.io.FileOutputStream fos = new java.io.FileOutputStream(tempFile);
                            fos.write(file.getBytes());
                            fos.close();
                            boolean isSafe = WxMiniConfig.wxMaService.getSecurityService().checkImage(tempFile);
                            if (!isSafe) {
                                context.put("code", 4001);
                                context.put("message", "图片内容不合规,请更换图片后重试");
                                writerJson(response, context);
                                return;
                            }
                        } catch (WxErrorException e) {
                            log.warn("微信图片安全检测失败: {}", e.getMessage());
                        } finally {
                            if (tempFile != null && tempFile.exists()) {
                                tempFile.delete();
                            }
                        }
                    }
                    String nowDate = DateUtil.getNowShortDate();
                    String fileName = UUID.randomUUID().toString() + nfix;
                    String tempFileName = nowDate + "/" + fileName;
                    String key = folder + tempFileName;// 文件名
                    String key = folder + tempFileName;
                    ALiYunUtil obs = new ALiYunUtil(endpoint,access_id, access_key);
                    if (obs.uploadOnlineObject(file.getInputStream(),bucketName, key,null)) {
                        // 移动成功,返回文件名
                        // sendSuccessMessage(response, resourcePath+key);
                        context.put("success", true);
                        context.put("code", 200);
                        context.put("errno",0);
@@ -143,7 +165,6 @@
                        writerJson(response, context);
                        return;
                    } else {
                        // 移动失败
                        context.put("code", 0);
                        context.put("message", "上传失败");
                        writerJson(response, context);
@@ -160,6 +181,16 @@
        return;
    }
    private boolean isImageFile(String suffix) {
        if (StringUtils.isBlank(suffix)) {
            return false;
        }
        String lowerSuffix = suffix.toLowerCase();
        return lowerSuffix.equals(".jpg") || lowerSuffix.equals(".jpeg")
            || lowerSuffix.equals(".png") || lowerSuffix.equals(".gif")
            || lowerSuffix.equals(".bmp") || lowerSuffix.equals(".webp");
    }
    public static void writerJson(HttpServletResponse response, Object object) {
        response.setContentType("application/json");
        writer(response, JSONObject.toJSONString(object));
server/dmmall_web/src/main/java/com/doumee/api/web/UtilApi.java
@@ -71,6 +71,7 @@
    public ApiResponse<List<Areas>> treeList (@RequestBody AreasDto pageWrap) {
        Areas a = new Areas();
        BeanUtils.copyProperties(pageWrap,a);
        areasService.cacheData();
        return ApiResponse.success(areasService.findList(a));
    }