liujie
11 小时以前 e1b1f32ad968da303fbd4827ace995704743cdda
拉卡拉支付
13个文件已修改
1个文件已添加
406 ■■■■■ 已修改文件
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TErpMaintenanceReminderController.java 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TSysOrderController.java 227 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/dto/TErpGoodsInfoSaveDto.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/dto/UpdateReminderDto.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/mapper/TErpMaintenanceReminderMapper.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/model/TCrmSupplier.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/model/TErpGoods.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/model/TErpMaintenanceReminder.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/model/TErpProcurement.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/model/TErpProcurementGoods.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/query/TErpGoodsQuery.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpMaintenanceReminderServiceImpl.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/vo/TErpMaintenanceReminderListVo.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/TErpMaintenanceReminderMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TErpMaintenanceReminderController.java
@@ -5,17 +5,24 @@
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.framework.web.service.TokenService;
import com.ruoyi.system.dto.UpdateReminderDto;
import com.ruoyi.system.model.TErpGoods;
import com.ruoyi.system.model.TErpMaintenanceReminder;
import com.ruoyi.system.model.TErpSupplierWarehousingBatch;
import com.ruoyi.system.query.TErpMaintenanceReminderQuery;
import com.ruoyi.system.query.TErpProcurementQuery;
import com.ruoyi.system.service.TErpMaintenanceReminderService;
import com.ruoyi.system.service.TErpProcurementService;
import com.ruoyi.system.service.*;
import com.ruoyi.system.vo.TErpMaintenanceReminderDetailVo;
import com.ruoyi.system.vo.TErpMaintenanceReminderListVo;
import com.ruoyi.system.vo.TErpProcurementVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.time.LocalDateTime;
/**
 * <p>
@@ -32,11 +39,19 @@
    private final TErpMaintenanceReminderService erpMaintenanceReminderService;
    private final TokenService tokenService;
    private final TErpSupplierWarehousingBatchService erpSupplierWarehousingBatchService;
    private final TErpSupplierWarehousingService erpSupplierWarehousingService;
    private final TErpGoodsService erpGoodsService;
    @Autowired
    public TErpMaintenanceReminderController(TErpMaintenanceReminderService erpMaintenanceReminderService, TokenService tokenService) {
    public TErpMaintenanceReminderController(TErpMaintenanceReminderService erpMaintenanceReminderService, TokenService tokenService,
                                             TErpSupplierWarehousingBatchService erpSupplierWarehousingBatchService,TErpSupplierWarehousingService erpSupplierWarehousingService,
                                             TErpGoodsService erpGoodsService) {
        this.erpMaintenanceReminderService = erpMaintenanceReminderService;
        this.tokenService = tokenService;
        this.erpSupplierWarehousingBatchService = erpSupplierWarehousingBatchService;
        this.erpSupplierWarehousingService = erpSupplierWarehousingService;
        this.erpGoodsService = erpGoodsService;
    }
@@ -61,5 +76,56 @@
        return R.ok(erpMaintenanceReminderService.detail(id,user));
    }
    /**
     * erp保养
     */
    @ApiOperation(value = "erp保养提醒操作维护")
    @PostMapping(value = "/updateReminder")
    public R<?> updateReminder(@RequestBody @Valid UpdateReminderDto dto) {
        TErpMaintenanceReminder reminder = erpMaintenanceReminderService.getById(dto.getId());
        reminder.setStatus(dto.getStatus());
        reminder.setMaintenanceRecord(dto.getHandlerContent());
        if(dto.getStatus()==2){
            SysUser user = tokenService.getLoginUser().getUser();
            reminder.setMaintenancePersonId(user.getUserId().intValue());
            reminder.setSuccessTime(LocalDateTime.now());
            erpMaintenanceReminderService.updateById( reminder);
            String warehousingBatchId = reminder.getWarehousingBatchId();
            TErpSupplierWarehousingBatch byId = erpSupplierWarehousingBatchService.getById(warehousingBatchId);
            String goodsId = erpSupplierWarehousingService.getById(byId.getWarehousingId()).getGoodsId();
            TErpMaintenanceReminder tErpMaintenanceReminder = new TErpMaintenanceReminder();
            TErpGoods byId1 = erpGoodsService.getById(goodsId);
            String maintenanceInterval = byId1.getMaintenanceInterval();
            String maintenanceIntervalUnit = byId1.getMaintenanceIntervalUnit();
            if(maintenanceIntervalUnit!=null && !"".equals(maintenanceIntervalUnit) && "天".equals(maintenanceIntervalUnit)){
                Integer day = Integer.valueOf(maintenanceInterval);
                // 当前时间+day天
                LocalDateTime time1 = LocalDateTime.now().plusDays(day);
                tErpMaintenanceReminder.setMaintenanceTime(time1);
            }else if(maintenanceIntervalUnit!=null && !"".equals(maintenanceIntervalUnit) && "月".equals(maintenanceIntervalUnit)){
                Integer day = Integer.valueOf(maintenanceInterval);
                // 当前时间+day月
                LocalDateTime time1 = LocalDateTime.now().plusMonths(day);
                tErpMaintenanceReminder.setMaintenanceTime(time1);
            }else if(maintenanceIntervalUnit!=null && !"".equals(maintenanceIntervalUnit) && "年".equals(maintenanceIntervalUnit)){
                Integer day = Integer.valueOf(maintenanceInterval);
                // 当前时间+day年
                LocalDateTime time1 = LocalDateTime.now().plusYears(day);
                tErpMaintenanceReminder.setMaintenanceTime(time1);
            }
            tErpMaintenanceReminder.setClinicSupplierId(reminder.getClinicSupplierId());
            tErpMaintenanceReminder.setMaintenanceType(reminder.getMaintenanceType());
            tErpMaintenanceReminder.setWarehousingBatchId(warehousingBatchId);
            erpMaintenanceReminderService.save(tErpMaintenanceReminder);
        }
        return R.ok();
    }
}
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TSysOrderController.java
@@ -1,11 +1,21 @@
package com.ruoyi.web.controller.api;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.lkl.laop.sdk.exception.SDKException;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ip.IpUtils;
import com.ruoyi.framework.web.service.TokenService;
import com.ruoyi.system.model.TCrmSupplier;
import com.ruoyi.system.model.TErpProcurement;
import com.ruoyi.system.model.TErpProcurementGoods;
import com.ruoyi.system.query.TErpGoodsWarehouseQuery;
import com.ruoyi.system.service.*;
import com.ruoyi.web.core.config.LakalaConfig;
@@ -22,11 +32,9 @@
import org.apache.http.conn.ssl.SSLSocketFactory;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
@@ -34,11 +42,20 @@
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import java.io.*;
import java.math.BigDecimal;
import java.nio.charset.StandardCharsets;
import java.security.*;
import java.security.cert.*;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.PKCS8EncodedKeySpec;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.stream.Collectors;
/**
 * <p>
@@ -54,12 +71,18 @@
public class TSysOrderController {
    private final TErpProcurementService erpProcurementService;
    private final TErpProcurementGoodsService erpProcurementGoodsService;
    private final TCrmSupplierService crmSupplierService;
    private final TokenService tokenService;
    @Autowired
    public TSysOrderController(TErpProcurementService erpProcurementService, TokenService tokenService) {
    public TSysOrderController(TErpProcurementService erpProcurementService, TokenService tokenService, TErpProcurementGoodsService erpProcurementGoodsService, TCrmSupplierService crmSupplierService) {
        this.erpProcurementService = erpProcurementService;
        this.tokenService = tokenService;
        this.erpProcurementGoodsService = erpProcurementGoodsService;
        this.crmSupplierService = crmSupplierService;
    }
    private static final String SYMBOLS = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
@@ -81,27 +104,41 @@
    @ApiOperation(value = "支付")
    @PostMapping(value = "/payOrder")
    @SneakyThrows
    public R<?> payOrder(@RequestBody @Valid TErpGoodsWarehouseQuery query, HttpServletRequest request) {
    public R<?> payOrder(@RequestParam String id, String type, HttpServletRequest request) {
        SysUser user = tokenService.getLoginUser().getUser();
        try {
            // 查出采购单 算出价格  下单  算出应该分佣金额 应该分给谁
            TErpProcurement erpProcurement = erpProcurementService.getById(id);
            String apiPath = "/api/v3/labs/trans/preorder";
            String ipAddr = IpUtils.getIpAddr(request);
            String time = DateUtils.dateTimeNow();
            // SYMBOLS 随机取4位数
            String nonce = "";
            for (int i = 0; i < 6; i++) {
                nonce += SYMBOLS.charAt(RANDOM.nextInt(SYMBOLS.length()));
            }
            String outTradeNo = time + nonce;
            String amount = String.valueOf(erpProcurement.getPayMoney().multiply(new BigDecimal("100")).intValue());
            String apiPath = "sit/api/v3/labs/trans/preorder";
            String body = "{\n" +
                    "\t\"req_time\": \"20250915115329\",\n" +
                    "\t\"req_time\": \"" + time + "\",\n" +
                    "\t\"version\": \"3.0\",\n" +
                    "\t\"req_data\": {\n" +
                    "\t\t\"out_trade_no\": \"c13c493182e1ee84\",\n" +
                    "\t\t\"out_trade_no\": \"" + outTradeNo + "\",\n" +
                    "\t\t\"merchant_no\": \"822290059430BFA\",\n" +
                    "\t\t\"term_no\": \"D9261078\",\n" +
                    "\t\t\"notify_url\": \"http://221.182.45.100:8089/t-sys-order/messageHandle\",\n" +
                    "\t\t\"location_info\": {\n" +
                    "\t\t\t\"request_ip\": \"180.157.249.160\"\n" +
                    "\t\t\t\"request_ip\": \"" + ipAddr + "\"\n" +
                    "\t\t},\n" +
                    "\t\t\"subject\": \"cc测试\",\n" +
                    "\t\t\"total_amount\": 1,\n" +
                    "\t\t\"account_type\": \"ALIPAY\",\n" +
                    "\t\t\"subject\": \"商品采购\",\n" +
                    "\t\t\"settle_type\": \"1\",\n" +
                    "\t\t\"total_amount\": " + amount + ",\n" +
                    "\t\t\"account_type\": \"" + type + "\",\n" +
                    "\t\t\"trans_type\": \"41\"\n" +
                    "\t}\n" +
                    "}";
@@ -112,6 +149,19 @@
                        + IOUtils.toString(response.getEntity().getContent(), ENCODING));
            }
            String responseStr = IOUtils.toString(response.getEntity().getContent(), ENCODING);
            erpProcurement.setPayNumber(outTradeNo);
            JSONObject jsonObject = JSONObject.parseObject(responseStr);
            JSONObject jsonObject1 = jsonObject.getJSONObject("resp_data");
            String code = jsonObject1.getString("log_no");
            erpProcurement.setPayTransactionId(code);
            erpProcurement.setStatus(2);
            erpProcurement.setTermNo("D9261078");
            erpProcurement.setAccountType(type);
            erpProcurement.setTransType("41");
            erpProcurementService.updateById(erpProcurement);
            return R.ok(responseStr);
        } catch (SDKException e) {
            e.printStackTrace();
@@ -120,6 +170,10 @@
    }
    public static void main(String[] args) {
        String a = "{\"code\":\"BBS00000\",\"msg\":\"成功\",\"resp_time\":\"20250916114506\",\"resp_data\":{\"merchant_no\":\"822290059430BFA\",\"out_trade_no\":\"202509161144582Kck\",\"trade_no\":\"2025091666200821320234\",\"log_no\":\"66200821320234\",\"settle_merchant_no\":\"\",\"settle_term_no\":\"\",\"trade_req_date\":\"20250916\",\"acc_resp_fields\":{\"code\":\"https://qr.alipay.com/bax01747cbtdjneesjaz0044\",\"code_image\":\"\",\"prepay_id\":\"\",\"app_id\":\"\",\"pay_sign\":\"\",\"time_stamp\":\"\",\"nonce_str\":\"\",\"package\":\"\",\"sign_type\":\"\",\"form_data\":\"\",\"redirect_url\":\"\",\"best_pay_info\":\"\",\"partner_id\":\"\",\"sub_mch_id\":\"2088240727800097\"}}}";
    }
    @RequestMapping("/messageHandle")
    @ApiOperation(value = "拉卡拉支付信息回调接口")
@@ -146,9 +200,151 @@
        X509Certificate lklCertificate = loadCertificate(new FileInputStream(new File(LakalaConfig.getLklNotifyCerStr())));
        String preSignData = timestamp + "\n" + nonce + "\n" + body + "\n";
        boolean verify = verify(lklCertificate, preSignData.getBytes(ENCODING), signature);
        if (verify) {
            // 先处理支付完成  修改状态 后处理分账  后走分账回调
        JSONObject jsonObject1 = JSONObject.parseObject(body);
        Object o = jsonObject1.get("out_trade_no");
        TErpProcurement erpProcurement = erpProcurementService.getOne(new LambdaQueryWrapper<TErpProcurement>().eq(TErpProcurement::getPayNumber, o));
        if (verify && erpProcurement.getStatus()==2) {
            erpProcurement.setPayTime(LocalDateTime.now());
            erpProcurement.setStatus(3);
            erpProcurementService.updateById(erpProcurement);
            List<TErpProcurementGoods> list = erpProcurementGoodsService.list(new LambdaQueryWrapper<TErpProcurementGoods>().eq(TErpProcurementGoods::getProcurementId, erpProcurement.getId()));
            // 操作分账
            HttpRequest post = HttpUtil.createPost(LakalaConfig.getServerUrl() + "sit/api/v3/sacs/separate");
            HashMap<String, Object> map = new HashMap<>();
            map.put("merchant_no", "822290059430BFA");
            map.put("log_no", erpProcurement.getPayTransactionId());
            map.put("log_date", DateUtils.dateTime());
            map.put("notify_url", "http://221.182.45.100:8089/t-sys-order/messageSeparateHandle");
            String time = DateUtils.dateTimeNow();
            // SYMBOLS 随机取4位数
            String str = "";
            for (int i = 0; i < 6; i++) {
                str += SYMBOLS.charAt(RANDOM.nextInt(SYMBOLS.length()));
            }
            String outTradeNo = time + str;
            map.put("out_separate_no", outTradeNo);
            map.put("total_amt", erpProcurement.getPayMoney().multiply(BigDecimal.valueOf(100)).intValue() + "");
            // 平台应得分账
            BigDecimal payMoney = erpProcurement.getPayMoney();
            ArrayList<HashMap<String, Object>> objects = new ArrayList<>();
            // 根据供应商id分组
            Map<String, List<TErpProcurementGoods>> collect = list.stream().collect(Collectors.groupingBy(TErpProcurementGoods::getSupplierId));
            for (Map.Entry<String, List<TErpProcurementGoods>> entry : collect.entrySet()) {
                HashMap<String, Object> map1 = new HashMap<>();
                String supplierId = entry.getKey();
                TCrmSupplier supplier = crmSupplierService.getById(supplierId);
                List<TErpProcurementGoods> value = entry.getValue();
                BigDecimal reduce = value.stream().map(TErpProcurementGoods::getSupplierMoney).reduce(BigDecimal.ZERO, BigDecimal::add);
                payMoney = payMoney.subtract(reduce);
                map1.put("recv_merchant_no", supplier.getRecvMerchantNo());
                map1.put("separate_value", reduce.multiply(BigDecimal.valueOf(100)).intValue() + "");
                objects.add(map1);
            }
            // 添加平台的
            map.put("recv_datas", objects);
            String jsonString = JSON.toJSONString(map);
            post.body(jsonString);
            HttpResponse response = post.execute();
            String responseStr = response.body();
            JSONObject jsonObject = JSONObject.parseObject(responseStr);
            if ("成功".equals(jsonObject.getString("msg"))) {
                Object o1 = jsonObject.get("resp_data");
                JSONObject jsonObject2 = JSONObject.parseObject(o1.toString());
                String separate_no = jsonObject2.getString("separate_no");
                erpProcurement.setSeparateNo(separate_no);
                erpProcurementService.updateById(erpProcurement);
            }
            // 响应success
            JSONObject responseJsonObject = new JSONObject();
            responseJsonObject.put("code", "SUCCESS");
            responseJsonObject.put("message", "执行成功");
            return responseJsonObject;
        }
        return null;
    }
    @RequestMapping("/messageSeparateHandle")
    @ApiOperation(value = "拉卡拉分账信息回调接口")
    public Object messageSeparateHandle(HttpServletRequest request) throws Exception {
        String body = this.getBody(request);
        String authorization = request.getHeader("Authorization");
        String timestamp = null;
        String nonce = null;
        String signature = null;
        authorization = authorization.replaceAll("LKLAPI-SHA256withRSA ", "");
        String[] split = authorization.split(",");
        for (String s : split) {
            if (s.startsWith("timestamp")) {
                timestamp = s.split("=")[1].replaceAll("\"", "");
            }
            if (s.startsWith("nonce")) {
                nonce = s.split("=")[1].replaceAll("\"", "");
            }
            if (s.startsWith("signature")) {
                // 取出签名
                signature = s.split("signature=")[1].replaceAll("\"", "");
            }
        }
        X509Certificate lklCertificate = loadCertificate(new FileInputStream(new File(LakalaConfig.getLklNotifyCerStr())));
        String preSignData = timestamp + "\n" + nonce + "\n" + body + "\n";
        boolean verify = verify(lklCertificate, preSignData.getBytes(ENCODING), signature);
        // 先处理支付完成  修改状态 后处理分账  后走分账回调
        JSONObject jsonObject1 = JSONObject.parseObject(body);
        Object o = jsonObject1.get("out_trade_no");
        TErpProcurement erpProcurement = erpProcurementService.getOne(new LambdaQueryWrapper<TErpProcurement>().eq(TErpProcurement::getPayNumber, o));
        if (verify && erpProcurement.getStatus()==2) {
            erpProcurement.setPayTime(LocalDateTime.now());
            erpProcurement.setStatus(3);
            erpProcurementService.updateById(erpProcurement);
            List<TErpProcurementGoods> list = erpProcurementGoodsService.list(new LambdaQueryWrapper<TErpProcurementGoods>().eq(TErpProcurementGoods::getProcurementId, erpProcurement.getId()));
            // 操作分账
            HttpRequest post = HttpUtil.createPost(LakalaConfig.getServerUrl() + "sit/api/v3/sacs/separate");
            HashMap<String, Object> map = new HashMap<>();
            map.put("merchant_no", "822290059430BFA");
            map.put("log_no", erpProcurement.getPayTransactionId());
            map.put("log_date", DateUtils.dateTime());
            map.put("notify_url", DateUtils.dateTime());
            String time = DateUtils.dateTimeNow();
            // SYMBOLS 随机取4位数
            String str = "";
            for (int i = 0; i < 6; i++) {
                str += SYMBOLS.charAt(RANDOM.nextInt(SYMBOLS.length()));
            }
            String outTradeNo = time + str;
            map.put("out_separate_no", outTradeNo);
            map.put("total_amt", erpProcurement.getPayMoney().multiply(BigDecimal.valueOf(100)).intValue() + "");
            // 平台应得分账
            BigDecimal payMoney = erpProcurement.getPayMoney();
            ArrayList<HashMap<String, Object>> objects = new ArrayList<>();
            // 根据供应商id分组
            Map<String, List<TErpProcurementGoods>> collect = list.stream().collect(Collectors.groupingBy(TErpProcurementGoods::getSupplierId));
            for (Map.Entry<String, List<TErpProcurementGoods>> entry : collect.entrySet()) {
                HashMap<String, Object> map1 = new HashMap<>();
                String supplierId = entry.getKey();
                TCrmSupplier supplier = crmSupplierService.getById(supplierId);
                List<TErpProcurementGoods> value = entry.getValue();
                BigDecimal reduce = value.stream().map(TErpProcurementGoods::getSupplierMoney).reduce(BigDecimal.ZERO, BigDecimal::add);
                payMoney = payMoney.subtract(reduce);
                map1.put("recv_merchant_no", supplier.getRecvMerchantNo());
                map1.put("separate_value", reduce.multiply(BigDecimal.valueOf(100)).intValue() + "");
                objects.add(map1);
            }
            // 添加平台的
            map.put("recv_datas", objects);
            String jsonString = JSON.toJSONString(map);
            post.body(jsonString);
            HttpResponse response = post.execute();
            String responseStr = response.body();
            // 响应success
            JSONObject jsonObject = new JSONObject();
@@ -256,7 +452,6 @@
            throw new RuntimeException("无效的私钥", e);
        }
    }
    public final String getBody(HttpServletRequest request) {
ruoyi-system/src/main/java/com/ruoyi/system/dto/TErpGoodsInfoSaveDto.java
@@ -25,6 +25,10 @@
    @ApiModelProperty(value = "保养周期")
    private String maintenanceInterval;
    @ApiModelProperty(value = "保养周期单位")
    private String maintenanceIntervalUnit;
    @ApiModelProperty(value = "最低采购数量")
    private Integer lowPurchaseQuantity;
ruoyi-system/src/main/java/com/ruoyi/system/dto/UpdateReminderDto.java
New file
@@ -0,0 +1,25 @@
package com.ruoyi.system.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
@Data
@ApiModel(value = "erp保养处理信息DTO")
public class UpdateReminderDto {
    @ApiModelProperty(value = "id")
    @NotBlank(message = "id不能为空")
    private String id;
    @ApiModelProperty(value = "处理内容")
    @NotBlank(message = "处理内容不能为空")
    private String handlerContent;
    @ApiModelProperty(value = "处理结果 1=未维护 2=已维护")
    @NotNull(message = "处理结果不能为空")
    private Integer status;
}
ruoyi-system/src/main/java/com/ruoyi/system/mapper/TErpMaintenanceReminderMapper.java
@@ -8,6 +8,7 @@
import com.ruoyi.system.vo.TErpMaintenanceReminderListVo;
import org.apache.ibatis.annotations.Param;
import java.time.LocalDateTime;
import java.util.List;
/**
@@ -20,5 +21,5 @@
 */
public interface TErpMaintenanceReminderMapper extends BaseMapper<TErpMaintenanceReminder> {
    List<TErpMaintenanceReminderListVo> pageList(@Param("page") PageInfo<TErpMaintenanceReminderListVo> page, @Param("query") TErpMaintenanceReminderQuery query, @Param("user") SysUser user, @Param("supplierClinicId") String supplierClinicId);
    List<TErpMaintenanceReminderListVo> pageList(@Param("page") PageInfo<TErpMaintenanceReminderListVo> page, @Param("query") TErpMaintenanceReminderQuery query, @Param("user") SysUser user, @Param("supplierClinicId") String supplierClinicId, @Param("tomorrow") LocalDateTime tomorrow );
}
ruoyi-system/src/main/java/com/ruoyi/system/model/TCrmSupplier.java
@@ -65,5 +65,9 @@
    @TableField("status")
    private Integer status;
    @ApiModelProperty(value = "收款商户号")
    @TableField("recv_merchant_no")
    private String recvMerchantNo;
}
ruoyi-system/src/main/java/com/ruoyi/system/model/TErpGoods.java
@@ -96,8 +96,13 @@
    private String goodsYards;
    @Excel(name = "保养周期(天)")
    @TableField("maintenance_interval")
    private String maintenanceInterval;
    @ApiModelProperty(value = "保养周期单位")
    @TableField("maintenance_interval_unit")
    private String maintenanceIntervalUnit;
    @ApiModelProperty(value = "最低采购数量")
    @TableField("low_purchase_quantity")
    @Excel(name = "最低采购数量")
ruoyi-system/src/main/java/com/ruoyi/system/model/TErpMaintenanceReminder.java
@@ -59,5 +59,10 @@
    @TableField("maintenance_record")
    private String maintenanceRecord;
    @ApiModelProperty(value = "维护完成时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField("success_time")
    private LocalDateTime successTime;
}
ruoyi-system/src/main/java/com/ruoyi/system/model/TErpProcurement.java
@@ -64,4 +64,36 @@
    @ApiModelProperty(value = "入库操作人")
    private String warehousingUserId;
    @ApiModelProperty(value = "支付时间")
    @TableField("pay_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime payTime;
    @ApiModelProperty(value = "退款编号")
    @TableField("refund_no")
    private String refundNo;
    @ApiModelProperty(value = "退款时间")
    @TableField("refund_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime refundTime;
    @ApiModelProperty(value = "退款流水号")
    @TableField("refund_log_no")
    private String refundLogNo;
    @ApiModelProperty(value = "终端号")
    @TableField("term_no")
    private String termNo;
    @ApiModelProperty(value = "钱包类型")
    @TableField("account_type")
    private String accountType;
    @ApiModelProperty(value = "接入方式")
    @TableField("trans_type")
    private String transType;
    @ApiModelProperty(value = "分账流水号")
    @TableField("separate_no")
    private String separateNo;
}
ruoyi-system/src/main/java/com/ruoyi/system/model/TErpProcurementGoods.java
@@ -74,4 +74,18 @@
    @TableField("supplier_id")
    private String supplierId;
    @ApiModelProperty(value = "状态0未分账 1已分账")
    @TableField("status")
    private Integer status;
    @ApiModelProperty(value = "供应商金额")
    @TableField("supplier_money")
    private BigDecimal supplierMoney;
    @ApiModelProperty(value = "收款商户号")
    @TableField("recv_merchant_no")
    private String recvMerchantNo;
}
ruoyi-system/src/main/java/com/ruoyi/system/query/TErpGoodsQuery.java
@@ -7,7 +7,7 @@
import lombok.Data;
@Data
@ApiModel(value = "erp商品信息查询参数query")
@ApiModel(value = "erp商品库存信息查询参数query")
public class TErpGoodsQuery extends BasePage {
    @ApiModelProperty(value = "商品名称")
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TErpMaintenanceReminderServiceImpl.java
@@ -14,6 +14,7 @@
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List;
import java.util.stream.Collectors;
@@ -74,7 +75,12 @@
            supplierClinicId =crmClinic.getId();
        }
        PageInfo<TErpMaintenanceReminderListVo> page = new PageInfo<>(query.getPageNum(), query.getPageSize());
        List<TErpMaintenanceReminderListVo> list = baseMapper.pageList(page, query, user,supplierClinicId);
        // 获取明天的时间
        LocalDateTime tomorrow = LocalDateTime.now().plusDays(1);
        List<TErpMaintenanceReminderListVo> list = baseMapper.pageList(page, query, user,supplierClinicId,tomorrow);
        if(list.isEmpty()){
            return page;
        }
ruoyi-system/src/main/java/com/ruoyi/system/vo/TErpMaintenanceReminderListVo.java
@@ -41,5 +41,8 @@
    private LocalDateTime maintenanceTime;
    @ApiModelProperty(value = "状态 1=未维护 2=已维护")
    private Integer status;
}
ruoyi-system/src/main/resources/mapper/system/TErpMaintenanceReminderMapper.xml
@@ -36,7 +36,7 @@
                 LEFT JOIN t_erp_supplier_warehousing_batch t2 on t1.warehousing_batch_id = t2.id
                 left join t_erp_supplier_warehousing t3 on t2.warehousing_id = t3.id
                 left join t_erp_goods t4 on t3.goods_id = t4.id
        where t1.disabled = 0
        where t1.disabled = 0 and #{tomorrow} >= t1.maintenance_time
          <if test="user.roleType !=null and user.roleType==4">
              and t1.clinic_supplier_id = #{user.supplierClinicId} and t1.maintenance_type=1
          </if>