Merge remote-tracking branch 'origin/dev_New' into dev_New
| | |
| | | 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;
|
| | |
| | | {
|
| | | return toAjax(noticeService.readAll());
|
| | | }
|
| | |
|
| | | @PostMapping("appReadNotice")
|
| | | @ApiOperation("移动端根据消息ID进行已读")
|
| | | public AjaxResult appReadNotice(@RequestParam("noticeId") Long noticeId) {
|
| | | boolean result = noticeService.appReadNotice(noticeId);
|
| | | return toAjax(result);
|
| | | }
|
| | | }
|
| | |
| | | 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;
|
| | |
| | | * @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;
|
| | |
|
| | | /** 公告标题 */
|
| | |
| | | */
|
| | | void simpleNoticeAll(final String title, final String message,final String jumpPath);
|
| | |
|
| | | /**
|
| | | * APP点击推送消息更改为已读状态
|
| | | *
|
| | | * @param noticeId 消息ID
|
| | | * @return 失败/成功
|
| | | */
|
| | | boolean appReadNotice(Long noticeId);
|
| | | }
|
| | |
| | | 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;
|
| | |
|
| | | /**
|
| | | * 公告 服务层实现
|
| | |
| | | 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;
|
| | | }
|
| | | }
|
| | |
| | | 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; |
| | |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | |
| | | // 推送 |
| | | sendRoutingPush( |
| | | sysNotice.getNoticeId(), |
| | | client.getCid(), |
| | | sysNotice.getNoticeTitle(), |
| | | sysNotice.getRemark() != null ? sysNotice.getRemark() : sysNotice.getNoticeContent(), |
| | |
| | | /** |
| | | * 发送单人路由推送 |
| | | */ |
| | | 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); |
| | | |
| | |
| | | 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); |
| | |
| | | } |
| | | |
| | | @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(); |
| | |
| | | * 查询产品信息列表 |
| | | */ |
| | | @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()); |
| | | 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()); |
| | |
| | | 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.sales_contract_no, |
| | |
| | | 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, |
| | |
| | | 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') |
| | | 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') |
| | | 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, |
| | |
| | | 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 |