From b9a985fea44086bb07069b1913835bbfaf0ed44a Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期三, 11 二月 2026 12:00:30 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_New' into dev_New
---
src/main/java/com/ruoyi/project/system/domain/SysNotice.java | 5 +
src/main/resources/mapper/sales/SalesLedgerProductMapper.xml | 8 +-
src/main/java/com/ruoyi/project/system/service/impl/SysNoticeServiceImpl.java | 17 +++++
src/main/java/com/ruoyi/project/system/service/impl/UnipushService.java | 24 +++++--
src/main/resources/mapper/purchase/PurchaseLedgerMapper.xml | 50 ++++++++--------
src/main/java/com/ruoyi/sales/controller/SalesLedgerProductController.java | 23 +++----
src/main/java/com/ruoyi/project/system/service/ISysNoticeService.java | 7 ++
src/main/java/com/ruoyi/project/system/controller/SysNoticeController.java | 17 +++--
8 files changed, 92 insertions(+), 59 deletions(-)
diff --git a/src/main/java/com/ruoyi/project/system/controller/SysNoticeController.java b/src/main/java/com/ruoyi/project/system/controller/SysNoticeController.java
index 75176f0..5f856f1 100644
--- a/src/main/java/com/ruoyi/project/system/controller/SysNoticeController.java
+++ b/src/main/java/com/ruoyi/project/system/controller/SysNoticeController.java
@@ -5,17 +5,11 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.framework.web.domain.R;
+import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-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 com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
@@ -99,4 +93,11 @@
{
return toAjax(noticeService.readAll());
}
+
+ @PostMapping("appReadNotice")
+ @ApiOperation("绉诲姩绔牴鎹秷鎭疘D杩涜宸茶")
+ public AjaxResult appReadNotice(@RequestParam("noticeId") Long noticeId) {
+ boolean result = noticeService.appReadNotice(noticeId);
+ return toAjax(result);
+ }
}
diff --git a/src/main/java/com/ruoyi/project/system/domain/SysNotice.java b/src/main/java/com/ruoyi/project/system/domain/SysNotice.java
index b199b72..b88a57c 100644
--- a/src/main/java/com/ruoyi/project/system/domain/SysNotice.java
+++ b/src/main/java/com/ruoyi/project/system/domain/SysNotice.java
@@ -3,8 +3,7 @@
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
-import com.baomidou.mybatisplus.annotation.FieldFill;
-import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
@@ -20,11 +19,13 @@
* @author ruoyi
*/
@Data
+@TableName("sys_notice")
public class SysNotice
{
private static final long serialVersionUID = 1L;
/** 鍏憡ID */
+ @TableId(value = "notice_id", type = IdType.AUTO)
private Long noticeId;
/** 鍏憡鏍囬 */
diff --git a/src/main/java/com/ruoyi/project/system/service/ISysNoticeService.java b/src/main/java/com/ruoyi/project/system/service/ISysNoticeService.java
index ab5d333..f371744 100644
--- a/src/main/java/com/ruoyi/project/system/service/ISysNoticeService.java
+++ b/src/main/java/com/ruoyi/project/system/service/ISysNoticeService.java
@@ -82,4 +82,11 @@
*/
void simpleNoticeAll(final String title, final String message,final String jumpPath);
+ /**
+ * APP鐐瑰嚮鎺ㄩ�佹秷鎭洿鏀逛负宸茶鐘舵��
+ *
+ * @param noticeId 娑堟伅ID
+ * @return 澶辫触/鎴愬姛
+ */
+ boolean appReadNotice(Long noticeId);
}
diff --git a/src/main/java/com/ruoyi/project/system/service/impl/SysNoticeServiceImpl.java b/src/main/java/com/ruoyi/project/system/service/impl/SysNoticeServiceImpl.java
index 2040850..28ec77c 100644
--- a/src/main/java/com/ruoyi/project/system/service/impl/SysNoticeServiceImpl.java
+++ b/src/main/java/com/ruoyi/project/system/service/impl/SysNoticeServiceImpl.java
@@ -28,6 +28,7 @@
import com.ruoyi.project.system.domain.SysNotice;
import com.ruoyi.project.system.mapper.SysNoticeMapper;
import com.ruoyi.project.system.service.ISysNoticeService;
+import org.springframework.transaction.annotation.Transactional;
/**
* 鍏憡 鏈嶅姟灞傚疄鐜�
@@ -230,4 +231,20 @@
return sysNotice;
}
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public boolean appReadNotice(Long noticeId) {
+ if (noticeId == null) {
+ return false;
+ }
+ SysNotice sysNotice = noticeMapper.selectNoticeById(noticeId);
+ if (sysNotice == null) {
+ return false;
+ }
+ sysNotice.setStatus("1");
+ return noticeMapper.update(null, Wrappers.<SysNotice>lambdaUpdate()
+ .eq(SysNotice::getNoticeId, noticeId)
+ .eq(SysNotice::getStatus, "0")
+ .set(SysNotice::getStatus, "1")) > 0;
+ }
}
diff --git a/src/main/java/com/ruoyi/project/system/service/impl/UnipushService.java b/src/main/java/com/ruoyi/project/system/service/impl/UnipushService.java
index b40cbee..3de2b9e 100644
--- a/src/main/java/com/ruoyi/project/system/service/impl/UnipushService.java
+++ b/src/main/java/com/ruoyi/project/system/service/impl/UnipushService.java
@@ -1,5 +1,6 @@
package com.ruoyi.project.system.service.impl;
+import com.alibaba.fastjson2.JSON;
import com.getui.push.v2.sdk.ApiHelper;
import com.getui.push.v2.sdk.GtApiConfiguration;
import com.getui.push.v2.sdk.api.PushApi;
@@ -25,6 +26,7 @@
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -84,6 +86,7 @@
// 鎺ㄩ��
sendRoutingPush(
+ sysNotice.getNoticeId(),
client.getCid(),
sysNotice.getNoticeTitle(),
sysNotice.getRemark() != null ? sysNotice.getRemark() : sysNotice.getNoticeContent(),
@@ -139,18 +142,23 @@
/**
* 鍙戦�佸崟浜鸿矾鐢辨帹閫�
*/
- private void sendRoutingPush(String cid, String title, String content, String targetPath) {
- log.info("鍑嗗鎺ㄩ�佹秷鎭�: CID={}, Title={}, TargetPath={}", cid, title, targetPath);
+ private void sendRoutingPush(Long noticeId, String cid, String title, String content, String targetPath) {
+ log.info("鍑嗗鎺ㄩ�佹秷鎭�:NoticeId={}, CID={}, Title={}, TargetPath={}", noticeId, cid, title, targetPath);
PushDTO<Audience> pushDTO = new PushDTO<>();
pushDTO.setRequestId("REQ_" + System.currentTimeMillis());
// 鍦ㄧ嚎閫忎紶鍐呭
PushMessage pushMessage = new PushMessage();
- String transmissionContent = String.format(
- "{\"title\":\"%s\",\"content\":\"%s\",\"payload\":\"%s\"}",
- title, content, targetPath
- );
+ Map<String, Object> pushMessageMap = new HashMap<>();
+ Map<String, Object> payloadMap = new HashMap<>();
+ pushMessageMap.put("title", title);
+ pushMessageMap.put("content", content);
+ payloadMap.put("url", targetPath);
+ payloadMap.put("noticeId", noticeId);
+ pushMessageMap.put("payload", JSON.toJSONString(payloadMap));
+
+ String transmissionContent = JSON.toJSONString(pushMessageMap);
pushMessage.setTransmission(transmissionContent);
pushDTO.setPushMessage(pushMessage);
@@ -160,7 +168,7 @@
pushDTO.setAudience(audience);
// 绂荤嚎鎺ㄩ�侀�氶亾
- pushDTO.setPushChannel(getPushChannel(title, content, targetPath));
+// pushDTO.setPushChannel(getPushChannel(noticeId, title, content, targetPath));
try {
ApiResult<Map<String, Map<String, String>>> result = pushApi.pushToSingleByCid(pushDTO);
@@ -175,7 +183,7 @@
}
@NotNull
- private PushChannel getPushChannel(String title, String content, String targetPath) {
+ private PushChannel getPushChannel(Long noticeId, String title, String content, String targetPath) {
PushChannel pushChannel = new PushChannel();
AndroidDTO androidDTO = new AndroidDTO();
Ups ups = new Ups();
diff --git a/src/main/java/com/ruoyi/sales/controller/SalesLedgerProductController.java b/src/main/java/com/ruoyi/sales/controller/SalesLedgerProductController.java
index 8632313..aed72ef 100644
--- a/src/main/java/com/ruoyi/sales/controller/SalesLedgerProductController.java
+++ b/src/main/java/com/ruoyi/sales/controller/SalesLedgerProductController.java
@@ -72,15 +72,14 @@
* 鏌ヨ浜у搧淇℃伅鍒楄〃
*/
@GetMapping("/list")
- public AjaxResult list(SalesLedgerProduct salesLedgerProduct)
- {
+ public AjaxResult list(SalesLedgerProduct salesLedgerProduct) {
List<SalesLedgerProduct> list = salesLedgerProductService.selectSalesLedgerProductList(salesLedgerProduct);
list.forEach(item -> {
- if (item.getFutureTickets().compareTo(BigDecimal.ZERO) == 0) {
- item.setFutureTickets(item.getQuantity());
- }
+ if (item.getFutureTickets().compareTo(BigDecimal.ZERO) == 0) {
+ item.setFutureTickets(BigDecimal.ZERO);
+ }
if (item.getFutureTicketsAmount().compareTo(BigDecimal.ZERO) == 0) {
- item.setFutureTicketsAmount(item.getTaxInclusiveTotalPrice());
+ item.setFutureTicketsAmount(BigDecimal.ZERO);
}
// ProcurementPageDto procurementDto = new ProcurementPageDto();
// procurementDto.setSalesLedgerProductId(item.getId());
@@ -89,13 +88,13 @@
// BigDecimal stockQuantity = stockUtils.getStockQuantity(item.getProductModelId()).get("stockQuantity");
// ProcurementPageDtoCopy procurementDtoCopy = result.getRecords().get(0);
- if (item.getApproveStatus() != 2) {
- if (item.getHasSufficientStock() == 0) {
- item.setApproveStatus(0);
- }else {
- item.setApproveStatus(1);
- }
+ if (item.getApproveStatus() != 2) {
+ if (item.getHasSufficientStock() == 0) {
+ item.setApproveStatus(0);
+ } else {
+ item.setApproveStatus(1);
}
+ }
});
return AjaxResult.success(list);
}
diff --git a/src/main/resources/mapper/purchase/PurchaseLedgerMapper.xml b/src/main/resources/mapper/purchase/PurchaseLedgerMapper.xml
index 98c2675..f501849 100644
--- a/src/main/resources/mapper/purchase/PurchaseLedgerMapper.xml
+++ b/src/main/resources/mapper/purchase/PurchaseLedgerMapper.xml
@@ -9,17 +9,18 @@
SET contract_amount = #{totalTaxInclusiveAmount}
WHERE id = #{id}
</update>
+
<select id="selectPurchaseLedgerListPage" resultType="com.ruoyi.purchase.dto.PurchaseLedgerDto">
- select
+ SELECT
pl.id,
- pl.purchase_contract_number ,
+ pl.purchase_contract_number,
pl.sales_contract_no,
pl.supplier_id,
pl.supplier_name,
pl.project_name,
pl.contract_amount,
- IFNULL(sum(tr.invoice_amount),0) as receipt_payment_amount,
- pl.contract_amount-IFNULL(sum(tr.invoice_amount),0) AS unReceipt_payment_amount,
+ IFNULL(tr_sum.total_invoice_amount, 0) AS receipt_payment_amount,
+ pl.contract_amount - IFNULL(tr_sum.total_invoice_amount, 0) AS unReceipt_payment_amount,
pl.entry_date,
pl.execution_date,
pl.recorder_id,
@@ -30,42 +31,41 @@
pl.approval_status,
pl.payment_method,
pl.remarks
- from purchase_ledger pl
- left join sales_ledger_product slp on slp.sales_ledger_id = pl.id and slp.type=2
- left join product_record pr on pl.id = pr.purchase_ledger_id
- left join ticket_registration tr on tr.id = pr.ticket_registration_id
- left join supplier_manage sm on pl.supplier_id = sm.id
+ FROM purchase_ledger pl
+ LEFT JOIN (
+ SELECT
+ purchase_ledger_id,
+ SUM(invoice_amount) AS total_invoice_amount
+ FROM ticket_registration
+ GROUP BY purchase_ledger_id
+ ) tr_sum ON pl.id = tr_sum.purchase_ledger_id
+ LEFT JOIN supplier_manage sm ON pl.supplier_id = sm.id
<where>
- 1 = 1
<if test="c.purchaseContractNumber != null and c.purchaseContractNumber != ''">
- and pl.purchase_contract_number like concat('%',#{c.purchaseContractNumber},'%')
+ AND pl.purchase_contract_number LIKE CONCAT('%', #{c.purchaseContractNumber}, '%')
</if>
<if test="c.approvalStatus != null and c.approvalStatus != ''">
- and pl.approval_status = #{c.approvalStatus}
+ AND pl.approval_status = #{c.approvalStatus}
</if>
<if test="c.supplierName != null and c.supplierName != ''">
- and pl.supplier_name like concat('%',#{c.supplierName},'%')
+ AND pl.supplier_name LIKE CONCAT('%', #{c.supplierName}, '%')
</if>
<if test="c.salesContractNo != null and c.salesContractNo != ''">
- and pl.sales_contract_no like concat('%',#{c.salesContractNo},'%')
+ AND pl.sales_contract_no LIKE CONCAT('%', #{c.salesContractNo}, '%')
</if>
<if test="c.projectName != null and c.projectName != ''">
- and pl.project_name like concat('%',#{c.projectName},'%')
+ AND pl.project_name LIKE CONCAT('%', #{c.projectName}, '%')
</if>
- <if test="c.entryDateStart != null and c.entryDateStart != '' ">
- AND pl.entry_date >= DATE_FORMAT(#{c.entryDateStart},'%Y-%m-%d')
+ <if test="c.entryDateStart != null and c.entryDateStart != ''">
+ AND pl.entry_date >= #{c.entryDateStart}
</if>
- <if test="c.entryDateEnd != null and c.entryDateEnd != '' ">
- AND pl.entry_date <= DATE_FORMAT(#{c.entryDateEnd},'%Y-%m-%d')
+ <if test="c.entryDateEnd != null and c.entryDateEnd != ''">
+ AND pl.entry_date <= #{c.entryDateEnd}
</if>
</where>
- group by pl.id, pl.purchase_contract_number, pl.sales_contract_no, pl.supplier_name,
- pl.project_name,pl.entry_date,
- pl.recorder_name,
- pl.contract_amount
- order by pl.entry_date desc
-
+ ORDER BY pl.entry_date DESC
</select>
+
<select id="getPaymentRegistrationDtoById" resultType="com.ruoyi.purchase.dto.PaymentRegistrationDto">
SELECT
T1.id,
diff --git a/src/main/resources/mapper/sales/SalesLedgerProductMapper.xml b/src/main/resources/mapper/sales/SalesLedgerProductMapper.xml
index d8655c9..4adf09e 100644
--- a/src/main/resources/mapper/sales/SalesLedgerProductMapper.xml
+++ b/src/main/resources/mapper/sales/SalesLedgerProductMapper.xml
@@ -8,23 +8,23 @@
SELECT
T1.*,
CASE
- WHEN t2.qualitity-t2.locked_quantity >= T1.quantity THEN 1
+ WHEN (IFNULL(t2.qualitity, 0) - IFNULL(t2.locked_quantity, 0)) >= IFNULL(T1.quantity, 0) THEN 1
ELSE 0
END as has_sufficient_stock
FROM
sales_ledger_product T1
LEFT JOIN stock_inventory t2 ON T1.product_model_id = t2.product_model_id
<where>
- 1=1
- <if test="salesLedgerProduct.salesLedgerId != null and salesLedgerProduct.salesLedgerId != '' ">
+ <if test="salesLedgerProduct.salesLedgerId != null">
AND T1.sales_ledger_id = #{salesLedgerProduct.salesLedgerId}
</if>
- <if test="salesLedgerProduct.type != null and salesLedgerProduct.type != '' ">
+ <if test="salesLedgerProduct.type != null">
AND T1.type = #{salesLedgerProduct.type}
</if>
</where>
ORDER BY T1.register_date DESC
</select>
+
<select id="selectSalesLedgerProductByMainId" resultType="com.ruoyi.sales.pojo.SalesLedgerProduct">
select slp.*
from quality_inspect qi
--
Gitblit v1.9.3