rk
2025-12-15 12d724c247e4f7dcb77b3a94891ccf4d86b53cfa
经销商供货价信息
已添加6个文件
已修改3个文件
459 ■■■■■ 文件已修改
server/dmmall_admin/src/main/java/com/doumee/api/business/ShopGoodsRelationController.java 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmmall_service/db/business.shop_goods_relation.permissions.sql 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmmall_service/src/main/java/com/doumee/core/utils/Constants.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmmall_service/src/main/java/com/doumee/dao/business/ShopGoodsRelationMapper.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmmall_service/src/main/java/com/doumee/dao/business/model/ShopGoodsRelation.java 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmmall_service/src/main/java/com/doumee/service/business/ShopGoodsRelationService.java 97 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmmall_service/src/main/java/com/doumee/service/business/impl/GoodsorderServiceImpl.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmmall_service/src/main/java/com/doumee/service/business/impl/ShopGoodsRelationServiceImpl.java 139 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmmall_web/src/main/java/com/doumee/api/web/mall/PaymentCallback.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmmall_admin/src/main/java/com/doumee/api/business/ShopGoodsRelationController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,90 @@
package com.doumee.api.business;
import com.doumee.api.BaseController;
import com.doumee.core.annotation.excel.ExcelExporter;
import com.doumee.core.annotation.pr.PreventRepeat;
import com.doumee.core.model.ApiResponse;
import com.doumee.core.model.PageWrap;
import com.doumee.core.model.PageData;
import com.doumee.dao.business.model.ShopGoodsRelation;
import com.doumee.service.business.ShopGoodsRelationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
/**
 * @author æ±Ÿè¹„蹄
 * @date 2025/12/15 09:39
 */
@Api(tags = "经销商供货价信息")
@RestController
@RequestMapping("/business/shopGoodsRelation")
public class ShopGoodsRelationController extends BaseController {
    @Autowired
    private ShopGoodsRelationService shopGoodsRelationService;
    @PreventRepeat
    @ApiOperation("新建")
    @PostMapping("/create")
    @RequiresPermissions("business:shopgoodsrelation:create")
    public ApiResponse create(@RequestBody ShopGoodsRelation shopGoodsRelation) {
        return ApiResponse.success(shopGoodsRelationService.create(shopGoodsRelation));
    }
    @ApiOperation("根据ID删除")
    @GetMapping("/delete/{id}")
    @RequiresPermissions("business:shopgoodsrelation:delete")
    public ApiResponse deleteById(@PathVariable Integer id) {
        shopGoodsRelationService.deleteById(id);
        return ApiResponse.success(null);
    }
    @ApiOperation("批量删除")
    @GetMapping("/delete/batch")
    @RequiresPermissions("business:shopgoodsrelation:delete")
    public ApiResponse deleteByIdInBatch(@RequestParam String ids) {
        String [] idArray = ids.split(",");
        List<Integer> idList = new ArrayList<>();
        for (String id : idArray) {
            idList.add(Integer.valueOf(id));
        }
        shopGoodsRelationService.deleteByIdInBatch(idList);
        return ApiResponse.success(null);
    }
    @ApiOperation("根据ID修改")
    @PostMapping("/updateById")
    @RequiresPermissions("business:shopgoodsrelation:update")
    public ApiResponse updateById(@RequestBody ShopGoodsRelation shopGoodsRelation) {
        shopGoodsRelationService.updateById(shopGoodsRelation);
        return ApiResponse.success(null);
    }
    @ApiOperation("分页查询")
    @PostMapping("/page")
    @RequiresPermissions("business:shopgoodsrelation:query")
    public ApiResponse<PageData<ShopGoodsRelation>> findPage (@RequestBody PageWrap<ShopGoodsRelation> pageWrap) {
        return ApiResponse.success(shopGoodsRelationService.findPage(pageWrap));
    }
    @ApiOperation("导出Excel")
    @PostMapping("/exportExcel")
    @RequiresPermissions("business:shopgoodsrelation:exportExcel")
    public void exportExcel (@RequestBody PageWrap<ShopGoodsRelation> pageWrap, HttpServletResponse response) {
        ExcelExporter.build(ShopGoodsRelation.class).export(shopGoodsRelationService.findPage(pageWrap).getRecords(), "经销商供货价信息", response);
    }
    @ApiOperation("根据ID查询")
    @GetMapping("/{id}")
    @RequiresPermissions("business:shopgoodsrelation:query")
    public ApiResponse findById(@PathVariable Integer id) {
        return ApiResponse.success(shopGoodsRelationService.findById(id));
    }
}
server/dmmall_service/db/business.shop_goods_relation.permissions.sql
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,6 @@
INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:shopgoodsrelation:create', '新建经销商供货价信息', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:shopgoodsrelation:delete', '删除经销商供货价信息', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:shopgoodsrelation:update', '修改经销商供货价信息', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:shopgoodsrelation:query', '查询经销商供货价信息', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:shopgoodsrelation:exportExcel', '导出经销商供货价信息(Excel)', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
server/dmmall_service/src/main/java/com/doumee/core/utils/Constants.java
@@ -563,7 +563,7 @@
    public  enum OrderStatus{
        WAIT_PAY(0, "待支付", "待支付"),
        PAY_DONE(1, "待发货", "已支付待发货"),
        WAIT_RECEIVE(2, "待收货", "已发货待收货"),
        WAIT_RECEIVE(2, "待收货/待自提", "已发货待收货/待自提"),
        DONE(3, "交易完成", "交易完成"),
        CLOSE(4, "已关闭", "已关闭"),
        PART_DONE(5, "部分发货", "部分发货"),
server/dmmall_service/src/main/java/com/doumee/dao/business/ShopGoodsRelationMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,12 @@
package com.doumee.dao.business;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.doumee.dao.business.model.ShopGoodsRelation;
/**
 * @author æ±Ÿè¹„蹄
 * @date 2025/12/15 09:39
 */
public interface ShopGoodsRelationMapper extends BaseMapper<ShopGoodsRelation> {
}
server/dmmall_service/src/main/java/com/doumee/dao/business/model/ShopGoodsRelation.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,67 @@
package com.doumee.dao.business.model;
import com.doumee.core.annotation.excel.ExcelColumn;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import java.math.BigDecimal;
/**
 * ç»é”€å•†ä¾›è´§ä»·ä¿¡æ¯
 * @author æ±Ÿè¹„蹄
 * @date 2025/12/15 09:39
 */
@Data
@ApiModel("经销商供货价信息")
@TableName("`shop_goods_relation`")
public class ShopGoodsRelation {
    @TableId(type = IdType.AUTO)
    @ApiModelProperty(value = "主键", example = "1")
    @ExcelColumn(name="主键")
    private Integer id;
    @ApiModelProperty(value = "创建人编码", example = "1")
    @ExcelColumn(name="创建人编码")
    private Integer creator;
    @ApiModelProperty(value = "创建时间")
    @ExcelColumn(name="创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date createDate;
    @ApiModelProperty(value = "更新人编码", example = "1")
    @ExcelColumn(name="更新人编码")
    private Integer editor;
    @ApiModelProperty(value = "更新时间")
    @ExcelColumn(name="更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date editDate;
    @ApiModelProperty(value = "是否删除0否 1是", example = "1")
    @ExcelColumn(name="是否删除0否 1是")
    private Integer isdeleted;
    @ApiModelProperty(value = "备注")
    @ExcelColumn(name="备注")
    private String remark;
    @ApiModelProperty(value = "商户主键(shop主键)", example = "1")
    @ExcelColumn(name="商户主键(shop主键)")
    private Integer shopId;
    @ApiModelProperty(value = "商品SKU ID(goods_sku主键)", example = "1")
    @ExcelColumn(name="商品SKU ID(goods_sku主键)")
    private Integer goodsSkuId;
    @ApiModelProperty(value = "供货价", example = "1")
    @ExcelColumn(name="供货价")
    private BigDecimal price;
}
server/dmmall_service/src/main/java/com/doumee/service/business/ShopGoodsRelationService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,97 @@
package com.doumee.service.business;
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
import com.doumee.dao.business.model.ShopGoodsRelation;
import java.util.List;
/**
 * ç»é”€å•†ä¾›è´§ä»·ä¿¡æ¯Service定义
 * @author æ±Ÿè¹„蹄
 * @date 2025/12/15 09:39
 */
public interface ShopGoodsRelationService {
    /**
     * åˆ›å»º
     *
     * @param shopGoodsRelation å®žä½“对象
     * @return Integer
     */
    Integer create(ShopGoodsRelation shopGoodsRelation);
    /**
     * ä¸»é”®åˆ é™¤
     *
     * @param id ä¸»é”®
     */
    void deleteById(Integer id);
    /**
     * åˆ é™¤
     *
     * @param shopGoodsRelation å®žä½“对象
     */
    void delete(ShopGoodsRelation shopGoodsRelation);
    /**
     * æ‰¹é‡ä¸»é”®åˆ é™¤
     *
     * @param ids ä¸»é”®é›†
     */
    void deleteByIdInBatch(List<Integer> ids);
    /**
     * ä¸»é”®æ›´æ–°
     *
     * @param shopGoodsRelation å®žä½“对象
     */
    void updateById(ShopGoodsRelation shopGoodsRelation);
    /**
     * æ‰¹é‡ä¸»é”®æ›´æ–°
     *
     * @param shopGoodsRelations å®žä½“集
     */
    void updateByIdInBatch(List<ShopGoodsRelation> shopGoodsRelations);
    /**
     * ä¸»é”®æŸ¥è¯¢
     *
     * @param id ä¸»é”®
     * @return ShopGoodsRelation
     */
    ShopGoodsRelation findById(Integer id);
    /**
     * æ¡ä»¶æŸ¥è¯¢å•条记录
     *
     * @param shopGoodsRelation å®žä½“对象
     * @return ShopGoodsRelation
     */
    ShopGoodsRelation findOne(ShopGoodsRelation shopGoodsRelation);
    /**
     * æ¡ä»¶æŸ¥è¯¢
     *
     * @param shopGoodsRelation å®žä½“对象
     * @return List<ShopGoodsRelation>
     */
    List<ShopGoodsRelation> findList(ShopGoodsRelation shopGoodsRelation);
    /**
     * åˆ†é¡µæŸ¥è¯¢
     *
     * @param pageWrap åˆ†é¡µå¯¹è±¡
     * @return PageData<ShopGoodsRelation>
     */
    PageData<ShopGoodsRelation> findPage(PageWrap<ShopGoodsRelation> pageWrap);
    /**
     * æ¡ä»¶ç»Ÿè®¡
     *
     * @param shopGoodsRelation å®žä½“对象
     * @return long
     */
    long count(ShopGoodsRelation shopGoodsRelation);
}
server/dmmall_service/src/main/java/com/doumee/service/business/impl/GoodsorderServiceImpl.java
@@ -750,6 +750,17 @@
            if(Objects.isNull(shop)){
                throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"请选择正确的自提门店!");
            }
            //判断门店是否设置商品的价格信息
            //根据选择商户进行会员与商户信息绑定
            if(Objects.isNull(member.getBindShopId())){
                memberMapper.update(new UpdateWrapper<Member>().lambda()
                        .set(Member::getBindShopId,shop.getId())
                        .eq(Member::getId,member.getId())
                );
            }
            goodsorder.setPickUpShopId(shop.getId());
            goodsorder.setDistributionShopId(shop.getId());
            if(Objects.isNull(member.getBindShopId())){
@@ -885,7 +896,7 @@
            Object response = null;
            WxPayUnifiedOrderRequest request = new WxPayUnifiedOrderRequest();
            request.setBody("平台商城");
            request.setAttach("terraceMall");
            request.setAttach("shopGoods");
            request.setOutTradeNo(goodsorder.getCode().toString());
            request.setTotalFee(BaseWxPayRequest.yuanToFen(goodsorder.getPrice().toString()));
          //  request.setTotalFee(2);
server/dmmall_service/src/main/java/com/doumee/service/business/impl/ShopGoodsRelationServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,139 @@
package com.doumee.service.business.impl;
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
import com.doumee.core.utils.Utils;
import com.doumee.dao.business.ShopGoodsRelationMapper;
import com.doumee.dao.business.model.ShopGoodsRelation;
import com.doumee.service.business.ShopGoodsRelationService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.List;
/**
 * ç»é”€å•†ä¾›è´§ä»·ä¿¡æ¯Service实现
 * @author æ±Ÿè¹„蹄
 * @date 2025/12/15 09:39
 */
@Service
public class ShopGoodsRelationServiceImpl implements ShopGoodsRelationService {
    @Autowired
    private ShopGoodsRelationMapper shopGoodsRelationMapper;
    @Override
    public Integer create(ShopGoodsRelation shopGoodsRelation) {
        shopGoodsRelationMapper.insert(shopGoodsRelation);
        return shopGoodsRelation.getId();
    }
    @Override
    public void deleteById(Integer id) {
        shopGoodsRelationMapper.deleteById(id);
    }
    @Override
    public void delete(ShopGoodsRelation shopGoodsRelation) {
        UpdateWrapper<ShopGoodsRelation> deleteWrapper = new UpdateWrapper<>(shopGoodsRelation);
        shopGoodsRelationMapper.delete(deleteWrapper);
    }
    @Override
    public void deleteByIdInBatch(List<Integer> ids) {
        if (CollectionUtils.isEmpty(ids)) {
            return;
        }
        shopGoodsRelationMapper.deleteBatchIds(ids);
    }
    @Override
    public void updateById(ShopGoodsRelation shopGoodsRelation) {
        shopGoodsRelationMapper.updateById(shopGoodsRelation);
    }
    @Override
    public void updateByIdInBatch(List<ShopGoodsRelation> shopGoodsRelations) {
        if (CollectionUtils.isEmpty(shopGoodsRelations)) {
            return;
        }
        for (ShopGoodsRelation shopGoodsRelation: shopGoodsRelations) {
            this.updateById(shopGoodsRelation);
        }
    }
    @Override
    public ShopGoodsRelation findById(Integer id) {
        return shopGoodsRelationMapper.selectById(id);
    }
    @Override
    public ShopGoodsRelation findOne(ShopGoodsRelation shopGoodsRelation) {
        QueryWrapper<ShopGoodsRelation> wrapper = new QueryWrapper<>(shopGoodsRelation);
        return shopGoodsRelationMapper.selectOne(wrapper);
    }
    @Override
    public List<ShopGoodsRelation> findList(ShopGoodsRelation shopGoodsRelation) {
        QueryWrapper<ShopGoodsRelation> wrapper = new QueryWrapper<>(shopGoodsRelation);
        return shopGoodsRelationMapper.selectList(wrapper);
    }
    @Override
    public PageData<ShopGoodsRelation> findPage(PageWrap<ShopGoodsRelation> pageWrap) {
        IPage<ShopGoodsRelation> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity());
        QueryWrapper<ShopGoodsRelation> queryWrapper = new QueryWrapper<>();
        Utils.MP.blankToNull(pageWrap.getModel());
        if (pageWrap.getModel().getId() != null) {
            queryWrapper.lambda().eq(ShopGoodsRelation::getId, pageWrap.getModel().getId());
        }
        if (pageWrap.getModel().getCreator() != null) {
            queryWrapper.lambda().eq(ShopGoodsRelation::getCreator, pageWrap.getModel().getCreator());
        }
        if (pageWrap.getModel().getCreateDate() != null) {
            queryWrapper.lambda().ge(ShopGoodsRelation::getCreateDate, Utils.Date.getStart(pageWrap.getModel().getCreateDate()));
            queryWrapper.lambda().le(ShopGoodsRelation::getCreateDate, Utils.Date.getEnd(pageWrap.getModel().getCreateDate()));
        }
        if (pageWrap.getModel().getEditor() != null) {
            queryWrapper.lambda().eq(ShopGoodsRelation::getEditor, pageWrap.getModel().getEditor());
        }
        if (pageWrap.getModel().getEditDate() != null) {
            queryWrapper.lambda().ge(ShopGoodsRelation::getEditDate, Utils.Date.getStart(pageWrap.getModel().getEditDate()));
            queryWrapper.lambda().le(ShopGoodsRelation::getEditDate, Utils.Date.getEnd(pageWrap.getModel().getEditDate()));
        }
        if (pageWrap.getModel().getIsdeleted() != null) {
            queryWrapper.lambda().eq(ShopGoodsRelation::getIsdeleted, pageWrap.getModel().getIsdeleted());
        }
        if (pageWrap.getModel().getRemark() != null) {
            queryWrapper.lambda().eq(ShopGoodsRelation::getRemark, pageWrap.getModel().getRemark());
        }
        if (pageWrap.getModel().getShopId() != null) {
            queryWrapper.lambda().eq(ShopGoodsRelation::getShopId, pageWrap.getModel().getShopId());
        }
        if (pageWrap.getModel().getGoodsSkuId() != null) {
            queryWrapper.lambda().eq(ShopGoodsRelation::getGoodsSkuId, pageWrap.getModel().getGoodsSkuId());
        }
        if (pageWrap.getModel().getPrice() != null) {
            queryWrapper.lambda().eq(ShopGoodsRelation::getPrice, pageWrap.getModel().getPrice());
        }
        for(PageWrap.SortData sortData: pageWrap.getSorts()) {
            if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) {
                queryWrapper.orderByDesc(sortData.getProperty());
            } else {
                queryWrapper.orderByAsc(sortData.getProperty());
            }
        }
        return PageData.from(shopGoodsRelationMapper.selectPage(page, queryWrapper));
    }
    @Override
    public long count(ShopGoodsRelation shopGoodsRelation) {
        QueryWrapper<ShopGoodsRelation> wrapper = new QueryWrapper<>(shopGoodsRelation);
        return shopGoodsRelationMapper.selectCount(wrapper);
    }
}
server/dmmall_web/src/main/java/com/doumee/api/web/mall/PaymentCallback.java
@@ -100,6 +100,39 @@
                        fundService.create(fund);
                        break;
                    }
                    case "shopGoods": {
                        Goodsorder DBGoodsOrder = new Goodsorder();
                        DBGoodsOrder.setCode(Long.valueOf(outTradeNo));
                        Goodsorder goodsOrder = goodsorderService.findOne(DBGoodsOrder);
                        if(Objects.isNull(goodsOrder)){
                            return WxPayNotifyResponse.fail( "支付回调信息("+ wxId + ") = > æœªæŸ¥è¯¢åˆ°æ”¯ä»˜å¯¹è±¡ä¿¡æ¯!");
                        }
                        if(goodsOrder.getStatus().equals(Constants.ONE)){
                            return WxPayNotifyResponse.success("处理成功!");
                        }
                        goodsOrder.setPayStatus(Constants.ONE);
                        goodsOrder.setPayDate(new Date());
                        goodsOrder.setPayOrderId(paymentNo);
                        goodsOrder.setStatus(Constants.equalsInteger(goodsOrder.getReceiveType(),Constants.ZERO)?Constants.OrderStatus.PAY_DONE.getKey():Constants.OrderStatus.WAIT_RECEIVE.getKey());
                        goodsOrder.setPayMethod(Constants.ZERO);
                        goodsorderService.updateById(goodsOrder);
                        Fund fund = new Fund();
                        fund.setOrderCode(goodsOrder.getPayOrderId());
                        fund.setCreator(goodsOrder.getMemberId());
                        fund.setCreateDate(new Date());
                        fund.setIsdeleted(Constants.ZERO);
                        fund.setRemark(goodsOrder.getCode().toString());
                        fund.setMemberId(goodsOrder.getMemberId());
                        fund.setTitle("订单支付");
                        fund.setContent("订单支付");
                        fund.setObjId(goodsOrder.getId());
                        fund.setObjType(Constants.ONE);
                        fund.setType(Constants.ZERO);
                        fund.setNum(goodsOrder.getPrice());
                        fundService.create(fund);
                        break;
                    }
                }
                return WxPayNotifyResponse.success("处理成功!");
            }