From 4fc35bc07b14aa6fea89b9ba89141eb69e1caa43 Mon Sep 17 00:00:00 2001
From: maven <2163098428@qq.com>
Date: 星期四, 04 十二月 2025 15:08:41 +0800
Subject: [PATCH] yys1.协同办公:关闭签字功能,除报销管理外,关闭其余附件功能。 2.营销管理:关闭销售台账附件功能。 3.仓储物料:需增加成品入库 4.生产管控:生产派工需要新增派工产线及生产人 5.设备管理:设备台账关闭设备品牌和存放位置
---
src/main/java/com/ruoyi/production/mapper/ProductionLineMapper.java | 11
src/main/java/com/ruoyi/production/service/impl/SalesLedgerSchedulingServiceImpl.java | 95 ++++---
src/main/java/com/ruoyi/production/controller/ProductionLineController.java | 71 +++++
src/main/resources/application-trsw.yml | 219 ++++++++++++++++++
src/main/resources/mapper/production/SalesLedgerWorkMapper.xml | 4
src/main/resources/mapper/production/SalesLedgerProductionAccountingMapper.xml | 3
src/main/java/com/ruoyi/production/dto/SalesLedgerSchedulingDto.java | 4
src/main/java/com/ruoyi/production/pojo/SalesLedgerScheduling.java | 16 +
src/main/java/com/ruoyi/production/pojo/ProductionLine.java | 92 +++++++
src/main/java/com/ruoyi/production/dto/SalesLedgerSchedulingProcessDto.java | 25 ++
src/main/java/com/ruoyi/production/pojo/SalesLedgerWork.java | 12 +
src/main/java/com/ruoyi/production/service/impl/SalesLedgerProductionAccountingServiceImpl.java | 2
src/main/resources/mapper/production/SalesLedgerSchedulingMapper.xml | 13 +
src/main/java/com/ruoyi/production/dto/SalesLedgerWorkDto.java | 3
src/main/java/com/ruoyi/production/service/ProductionLineService.java | 28 ++
src/main/java/com/ruoyi/production/service/impl/ProductionLineServiceImpl.java | 99 ++++++++
src/main/resources/mapper/production/ProductionLineMapper.xml | 5
src/main/java/com/ruoyi/production/dto/ProductionDispatchAddDto.java | 12 +
src/main/java/com/ruoyi/production/service/impl/SalesLedgerWorkServiceImpl.java | 1
src/main/resources/application.yml | 2
20 files changed, 675 insertions(+), 42 deletions(-)
diff --git a/src/main/java/com/ruoyi/production/controller/ProductionLineController.java b/src/main/java/com/ruoyi/production/controller/ProductionLineController.java
new file mode 100644
index 0000000..060ca09
--- /dev/null
+++ b/src/main/java/com/ruoyi/production/controller/ProductionLineController.java
@@ -0,0 +1,71 @@
+package com.ruoyi.production.controller;
+
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.framework.aspectj.lang.annotation.Log;
+import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
+import com.ruoyi.framework.web.controller.BaseController;
+import com.ruoyi.framework.web.domain.AjaxResult;
+import com.ruoyi.production.pojo.ProductionLine;
+import com.ruoyi.production.service.ProductionLineService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * @author :yys
+ * @date : 2025/12/4 11:19
+ */
+@RestController
+@Api(tags = "浜х嚎绠$悊")
+@RequestMapping("/productionLine")
+public class ProductionLineController extends BaseController {
+
+ @Autowired
+ private ProductionLineService productionLineService;
+
+ /**
+ * 閫掑綊鏌ヨ浜х嚎鏍�
+ */
+ @GetMapping("/listTree")
+ @ApiOperation(value = "閫掑綊鏌ヨ浜х嚎鏍�")
+ public AjaxResult listTree() {
+ List<ProductionLine> productionLines = productionLineService.listTree();
+ return AjaxResult.success(productionLines);
+ }
+
+ /**
+ * 鍒嗛〉-鏍规嵁鐖惰妭鐐笽D鏌ヨ瀛愭爲锛堝鏌ヨID=1鐨勪骇绾夸笅鐨勬墍鏈夊伐搴忥級
+ */
+ @GetMapping("/pageList")
+ @ApiOperation(value = "鍒嗛〉-鏍规嵁鐖惰妭鐐笽D鏌ヨ瀛愭爲")
+ public AjaxResult getSubTree(Page page, ProductionLine productionLine) {
+ return AjaxResult.success(productionLineService.getSubTreeByParentId(page ,productionLine));
+ }
+
+ @PostMapping("/add")
+ @ApiOperation(value = "娣诲姞浜х嚎")
+ @Log(title = "浜х嚎绠$悊", businessType = BusinessType.INSERT)
+ public AjaxResult add(@RequestBody ProductionLine productionLine) {
+ return AjaxResult.success(productionLineService.save(productionLine));
+ }
+
+ @PostMapping("/update")
+ @ApiOperation(value = "淇敼浜х嚎")
+ @Log(title = "浜х嚎绠$悊", businessType = BusinessType.UPDATE)
+ public AjaxResult update(@RequestBody ProductionLine productionLine) {
+ return AjaxResult.success(productionLineService.updateById(productionLine));
+ }
+
+ @DeleteMapping("/delete")
+ @ApiOperation(value = "鍒犻櫎浜х嚎")
+ @Log(title = "浜х嚎绠$悊", businessType = BusinessType.DELETE)
+ public AjaxResult delete(@RequestBody List<Long> ids) {
+ if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("璇蜂紶鍏ヨ鍒犻櫎鐨処D");
+ return AjaxResult.success(productionLineService.removeBatchByIds(ids));
+ }
+
+}
diff --git a/src/main/java/com/ruoyi/production/dto/ProductionDispatchAddDto.java b/src/main/java/com/ruoyi/production/dto/ProductionDispatchAddDto.java
index 6385f0f..cbd6b54 100644
--- a/src/main/java/com/ruoyi/production/dto/ProductionDispatchAddDto.java
+++ b/src/main/java/com/ruoyi/production/dto/ProductionDispatchAddDto.java
@@ -34,6 +34,18 @@
private Long schedulingUserId;
/**
+ * 鐢熶骇浜�
+ */
+ @ApiModelProperty(value = "鐢熶骇浜�")
+ private Long productionUserId;
+
+ /**
+ * 浜х嚎id
+ */
+ @ApiModelProperty(value = "浜х嚎id")
+ private Long lineId;
+
+ /**
* 鎺掍骇鏃ユ湡
*/
@ApiModelProperty(value = "鎺掍骇鏃ユ湡")
diff --git a/src/main/java/com/ruoyi/production/dto/SalesLedgerSchedulingDto.java b/src/main/java/com/ruoyi/production/dto/SalesLedgerSchedulingDto.java
index d72bdc3..5055478 100644
--- a/src/main/java/com/ruoyi/production/dto/SalesLedgerSchedulingDto.java
+++ b/src/main/java/com/ruoyi/production/dto/SalesLedgerSchedulingDto.java
@@ -128,4 +128,8 @@
@ApiModelProperty(value = "绉熸埛ID")
private Long tenantId;
+ private Long productionUserId;
+
+ private String productionUserName;
+
}
diff --git a/src/main/java/com/ruoyi/production/dto/SalesLedgerSchedulingProcessDto.java b/src/main/java/com/ruoyi/production/dto/SalesLedgerSchedulingProcessDto.java
index 10d472a..251aa1a 100644
--- a/src/main/java/com/ruoyi/production/dto/SalesLedgerSchedulingProcessDto.java
+++ b/src/main/java/com/ruoyi/production/dto/SalesLedgerSchedulingProcessDto.java
@@ -125,6 +125,31 @@
private Long schedulingUserId;
+
+ /**
+ * 鐢熶骇浜篿d
+ */
+ @ApiModelProperty(value = "鐢熶骇浜篿d")
+ private Long productionUserId;
+
+ /**
+ * 鐢熶骇浜哄悕绉�
+ */
+ @Excel(name = "鐢熶骇浜哄悕绉�")
+ @ApiModelProperty(value = "鐢熶骇浜哄悕绉�")
+ private String productionUserName;
+
+ /**
+ * 鐢熶骇浜х嚎
+ */
+ @Excel(name = "鐢熶骇浜х嚎")
+ @ApiModelProperty(value = "鐢熶骇浜х嚎")
+ private String productionLineName;
+
+ @ApiModelProperty(value = "鐢熶骇浜х嚎id")
+ private Long productionLineId;
+
+
/**
* 鎺掍骇鏁伴噺
*/
diff --git a/src/main/java/com/ruoyi/production/dto/SalesLedgerWorkDto.java b/src/main/java/com/ruoyi/production/dto/SalesLedgerWorkDto.java
index 9a4a6a4..a92bff2 100644
--- a/src/main/java/com/ruoyi/production/dto/SalesLedgerWorkDto.java
+++ b/src/main/java/com/ruoyi/production/dto/SalesLedgerWorkDto.java
@@ -24,6 +24,9 @@
@ApiModelProperty(value = "鎺掍骇浜篿d")
private Long schedulingUserId;
+ @ApiModelProperty(value = "鐢熶骇浜篿d")
+ private Long productionUserId;
+
/**
* 鎺掍骇浜哄悕绉�
*/
diff --git a/src/main/java/com/ruoyi/production/mapper/ProductionLineMapper.java b/src/main/java/com/ruoyi/production/mapper/ProductionLineMapper.java
new file mode 100644
index 0000000..7fda4ef
--- /dev/null
+++ b/src/main/java/com/ruoyi/production/mapper/ProductionLineMapper.java
@@ -0,0 +1,11 @@
+package com.ruoyi.production.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ruoyi.production.pojo.ProductionLine;
+
+/**
+ * @author :yys
+ * @date : 2025/12/4 11:17
+ */
+public interface ProductionLineMapper extends BaseMapper<ProductionLine> {
+}
diff --git a/src/main/java/com/ruoyi/production/pojo/ProductionLine.java b/src/main/java/com/ruoyi/production/pojo/ProductionLine.java
new file mode 100644
index 0000000..232324b
--- /dev/null
+++ b/src/main/java/com/ruoyi/production/pojo/ProductionLine.java
@@ -0,0 +1,92 @@
+package com.ruoyi.production.pojo;
+
+import com.baomidou.mybatisplus.annotation.*;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.util.List;
+
+/**
+ * @author :yys
+ * @date : 2025/12/4 11:13
+ */
+@Data
+@TableName("production_line")
+public class ProductionLine {
+
+ private static final long serialVersionUID = 1L;
+
+ @TableId(value = "id", type = IdType.AUTO)
+ private Long id;
+
+ /**
+ * 鍚嶇О
+ */
+ @ApiModelProperty("鍚嶇О")
+ private String name;
+
+ /**
+ * 鐖剁骇id
+ */
+ @ApiModelProperty("鐖剁骇id")
+ private Integer parentId;
+
+ /**
+ * 绫诲瀷 1-浜х嚎 2-宸ュ簭
+ */
+ @ApiModelProperty("绫诲瀷 1-浜х嚎 2-宸ュ簭")
+ private Integer type;
+
+ /**
+ * 鎺掑簭
+ */
+ @ApiModelProperty("鎺掑簭")
+ private Integer sort;
+
+ /**
+ * 澶囨敞
+ */
+ @ApiModelProperty("澶囨敞")
+ private String remark;
+
+ /**
+ * 瀛愭暟鎹�
+ */
+ @TableField(exist = false)
+ @ApiModelProperty("瀛愭暟鎹�")
+ private List<ProductionLine> children;
+
+ /**
+ * 鍒涘缓鑰�
+ */
+ @TableField(fill = FieldFill.INSERT)
+ private Integer createUser;
+
+ /**
+ * 鍒涘缓鏃堕棿
+ */
+ @TableField(fill = FieldFill.INSERT)
+ private LocalDateTime createTime;
+
+ /**
+ * 淇敼鑰�
+ */
+ @TableField(fill = FieldFill.INSERT_UPDATE)
+ private Integer updateUser;
+
+ /**
+ * 淇敼鏃堕棿
+ */
+ @TableField(fill = FieldFill.INSERT_UPDATE)
+ private LocalDateTime updateTime;
+
+ /**
+ * 绉熸埛ID
+ */
+ @TableField(fill = FieldFill.INSERT)
+ private Long tenantId;
+
+}
diff --git a/src/main/java/com/ruoyi/production/pojo/SalesLedgerScheduling.java b/src/main/java/com/ruoyi/production/pojo/SalesLedgerScheduling.java
index e50d2d1..ff72294 100644
--- a/src/main/java/com/ruoyi/production/pojo/SalesLedgerScheduling.java
+++ b/src/main/java/com/ruoyi/production/pojo/SalesLedgerScheduling.java
@@ -39,6 +39,22 @@
private Long schedulingUserId;
/**
+ * 鐢熶骇浜х嚎id
+ */
+ private Long productionLineId;
+
+
+ /**
+ * 鐢熶骇浜篿d
+ */
+ private Long productionUserId;
+
+ /**
+ * 鐢熶骇浜哄悕绉�
+ */
+ private String productionUserName;
+
+ /**
* 鐢熶骇鐐掓満
*/
private String speculativeTradingName;
diff --git a/src/main/java/com/ruoyi/production/pojo/SalesLedgerWork.java b/src/main/java/com/ruoyi/production/pojo/SalesLedgerWork.java
index 50e9ca9..8f95ef4 100644
--- a/src/main/java/com/ruoyi/production/pojo/SalesLedgerWork.java
+++ b/src/main/java/com/ruoyi/production/pojo/SalesLedgerWork.java
@@ -48,6 +48,18 @@
private String schedulingUserName;
+
+ /**
+ * 鐢熶骇浜篿d
+ */
+ private Long productionUserId;
+
+ /**
+ * 鐢熶骇浜哄悕绉�
+ */
+ private String productionUserName;
+
+
/**
* 鎺掍骇鏁伴噺
*/
diff --git a/src/main/java/com/ruoyi/production/service/ProductionLineService.java b/src/main/java/com/ruoyi/production/service/ProductionLineService.java
new file mode 100644
index 0000000..df52f9f
--- /dev/null
+++ b/src/main/java/com/ruoyi/production/service/ProductionLineService.java
@@ -0,0 +1,28 @@
+package com.ruoyi.production.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ruoyi.production.pojo.ProductionLine;
+
+import java.util.List;
+
+/**
+ * @author :yys
+ * @date : 2025/12/4 11:18
+ */
+public interface ProductionLineService extends IService<ProductionLine> {
+
+ /**
+ * 閫掑綊鏌ヨ浜х嚎鏍�
+ * @return
+ */
+ List<ProductionLine> listTree();
+
+ /**
+ * 鏍规嵁鐖惰妭鐐笽D閫掑綊鏌ヨ瀛愭爲
+ * @param parentId 鐖惰妭鐐笽D
+ * @return 鍖呭惈瀛愯妭鐐圭殑鐖惰妭鐐瑰璞�
+ */
+ IPage<ProductionLine> getSubTreeByParentId(Page page, ProductionLine productionLine);
+}
diff --git a/src/main/java/com/ruoyi/production/service/impl/ProductionLineServiceImpl.java b/src/main/java/com/ruoyi/production/service/impl/ProductionLineServiceImpl.java
new file mode 100644
index 0000000..8ec5e56
--- /dev/null
+++ b/src/main/java/com/ruoyi/production/service/impl/ProductionLineServiceImpl.java
@@ -0,0 +1,99 @@
+package com.ruoyi.production.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.production.mapper.ProductionLineMapper;
+import com.ruoyi.production.pojo.ProductionLine;
+import com.ruoyi.production.service.ProductionLineService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author :yys
+ * @date : 2025/12/4 11:19
+ */
+@Service
+@Slf4j
+public class ProductionLineServiceImpl extends ServiceImpl<ProductionLineMapper, ProductionLine> implements ProductionLineService {
+
+ @Autowired
+ private ProductionLineMapper productionLineMapper;
+
+ /**
+ * 閫掑綊鏌ヨ浜х嚎鏍�
+ * @return
+ */
+ @Override
+ public List<ProductionLine> listTree() {
+ List<ProductionLine> productionLines = productionLineMapper.selectList(Wrappers.lambdaQuery(ProductionLine.class)
+ .eq(ProductionLine::getParentId, 0)
+ .eq(ProductionLine::getType, 1));
+ // 2. 閫掑綊涓烘瘡涓牴鑺傜偣鍔犺浇瀛愯妭鐐癸紙宸ュ簭/瀛愪骇绾匡級
+ for (ProductionLine rootLine : productionLines) {
+ loadChildren(rootLine,1);
+ }
+ return productionLines;
+ }
+
+ /**
+ * 閫掑綊鍔犺浇瀛愯妭鐐癸紙鏍稿績鏂规硶锛�
+ * @param parentNode 鐖惰妭鐐瑰璞�
+ */
+ private void loadChildren(ProductionLine parentNode,Integer type) {
+ // 1. 鏌ヨ褰撳墠鐖惰妭鐐圭殑鎵�鏈夊瓙鑺傜偣
+ List<ProductionLine> children = productionLineMapper.selectList(Wrappers.lambdaQuery(ProductionLine.class)
+ .eq(ProductionLine::getParentId, parentNode.getId())
+ .eq(ProductionLine::getType, type));
+
+ // 2. 鑻ユ湁瀛愯妭鐐癸紝缁х画閫掑綊鍔犺浇瀛愯妭鐐圭殑瀛愯妭鐐�
+ if (!children.isEmpty()) {
+ parentNode.setChildren(children); // 璁剧疆瀛愯妭鐐�
+ for (ProductionLine child : children) {
+ loadChildren(child,type); // 閫掑綊璋冪敤锛屽姞杞藉瓩瀛愯妭鐐�
+ }
+ }
+ }
+
+ /**
+ * 鎸夐渶鎻愪緵锛氭牴鎹埗鑺傜偣ID鏌ヨ鍗曚釜瀛愭爲锛堝鏌ヨ鏌愪釜浜х嚎涓嬬殑鎵�鏈夊伐搴忥級
+ */
+ @Override
+ public IPage<ProductionLine> getSubTreeByParentId(Page page, ProductionLine productionLine) {
+ // 1. 鏌ヨ鐖惰妭鐐规湰韬�
+ ProductionLine parentNode = productionLineMapper.selectById(productionLine.getId());
+ if (parentNode == null) {
+ return null;
+ }
+ // 2. 閫掑綊鍔犺浇瀛愯妭鐐�
+ loadChildren(productionLine,1);
+ List<Long> ids = new ArrayList<>();
+ ids.add(productionLine.getId());
+ if(CollectionUtils.isNotEmpty(productionLine.getChildren())){
+ // 閫掑綊鑾峰彇鎵�鏈夊瓙鑺傜偣鐨刬d
+ getAllChildIds(productionLine,ids);
+ }
+ return productionLineMapper.selectPage(page, Wrappers.lambdaQuery(ProductionLine.class)
+ .in(ProductionLine::getParentId, ids)
+ .eq(ProductionLine::getType, 2));
+ }
+
+ /**
+ * 閫掑綊鑾峰彇鎵�鏈夊瓙鑺傜偣鐨刬d
+ */
+ public List<Long> getAllChildIds(ProductionLine node,List<Long> ids) {
+ if (node.getChildren() != null) {
+ for (ProductionLine child : node.getChildren()) {
+ ids.add(child.getId());
+ ids.addAll(getAllChildIds(child,ids));
+ }
+ }
+ return ids;
+ }
+}
diff --git a/src/main/java/com/ruoyi/production/service/impl/SalesLedgerProductionAccountingServiceImpl.java b/src/main/java/com/ruoyi/production/service/impl/SalesLedgerProductionAccountingServiceImpl.java
index 3fcb8f2..fdb96a5 100644
--- a/src/main/java/com/ruoyi/production/service/impl/SalesLedgerProductionAccountingServiceImpl.java
+++ b/src/main/java/com/ruoyi/production/service/impl/SalesLedgerProductionAccountingServiceImpl.java
@@ -3,6 +3,7 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.production.dto.SalesLedgerProductionAccountingDto;
import com.ruoyi.production.mapper.SalesLedgerProductionAccountingMapper;
import com.ruoyi.production.pojo.SalesLedgerProductionAccounting;
@@ -26,6 +27,7 @@
@Override
public IPage<SalesLedgerProductionAccountingDto> listPage(Page page, SalesLedgerProductionAccountingDto salesLedgerProductionAccountingDto) {
+ salesLedgerProductionAccountingDto.setSchedulingUserId(SecurityUtils.getLoginUser().getUser().getUserId());
IPage<SalesLedgerProductionAccountingDto> list = salesLedgerProductionAccountingMapper.listPage(page, salesLedgerProductionAccountingDto);
list.getRecords().forEach(item -> {
String[] split = item.getSpecificationModel().split("\\*");
diff --git a/src/main/java/com/ruoyi/production/service/impl/SalesLedgerSchedulingServiceImpl.java b/src/main/java/com/ruoyi/production/service/impl/SalesLedgerSchedulingServiceImpl.java
index 5070319..cfd04c5 100644
--- a/src/main/java/com/ruoyi/production/service/impl/SalesLedgerSchedulingServiceImpl.java
+++ b/src/main/java/com/ruoyi/production/service/impl/SalesLedgerSchedulingServiceImpl.java
@@ -33,6 +33,7 @@
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.LocalDate;
+import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Arrays;
@@ -57,6 +58,8 @@
@Override
public IPage<SalesLedgerSchedulingDto> listPage(Page page, SalesLedgerSchedulingDto salesLedgerSchedulingDto) {
+ salesLedgerSchedulingDto.setProductionUserId(SecurityUtils.getLoginUser().getUser().getUserId());
+ salesLedgerSchedulingDto.setProductionUserName(SecurityUtils.getLoginUser().getUser().getNickName());
IPage<SalesLedgerSchedulingDto> list = salesLedgerSchedulingMapper.listPage(page, salesLedgerSchedulingDto);
if(list.getTotal() == 0){
return list;
@@ -145,52 +148,60 @@
i++;
continue;
}
- // 鑾峰彇绌轰綑鐐掓満
- String[] split = productionDispatchAddDto.getSpeculativeTradingName().split(",");
- if(split != null && split.length == 0){
+ SysUser sysUser1 = sysUserMapper.selectUserById(productionDispatchAddDto.getProductionUserId() == null ? loginUser.getUser().getUserId() : productionDispatchAddDto.getSchedulingUserId());
+ if(sysUser1 == null){
i++;
continue;
}
- List<SpeculativeTradingInfo> speculativeTradingInfos = speculativeTradingInfoMapper.selectList(new LambdaQueryWrapper<SpeculativeTradingInfo>()
- .in(SpeculativeTradingInfo::getName, Arrays.asList(split))
- .orderByAsc(SpeculativeTradingInfo::getSort));
- if(CollectionUtils.isEmpty(speculativeTradingInfos)){
- i++;
- continue;
- }
- AtomicReference<String> name = new AtomicReference<>(""); //闇�瑕佺粦瀹氱殑鐐掓満
- //閫氳繃瑙勬牸鍨嬪彿鍜屾帓浜ф暟閲忚绠楁湰娆$敓浜т骇閲�
- String[] split1 = productionDispatchAddDto.getSpecificationModel().split("\\*");
- if(split1.length != 2){
- i++;
- continue;
- }
- // 鏈鐢熶骇浜ч噺
- BigDecimal productionNum = new BigDecimal(split1[0])
- .multiply(new BigDecimal(split1[1]).multiply(productionDispatchAddDto.getSchedulingNum()));
- // 澶氫釜鐐掓満鎯呭喌
- if(speculativeTradingInfos.size() > 1){
- for (SpeculativeTradingInfo speculativeTradingInfo : speculativeTradingInfos) {
- // 鑾峰彇璇ョ倰鏈烘鍦ㄦ帓浜ч噺
- BigDecimal schedulingNumBySpeculativeTradingName = getSchedulingNumBySpeculativeTradingName(speculativeTradingInfo.getName());
- // 濡傛灉璇ョ倰鏈烘�婚噺(鍗曚綅kg闇�瑕佷箻1000) - 姝e湪鎺掍骇閲� >=鏈鐢熶骇浜ч噺灏卞垎閰嶆鐐掓満
- if(speculativeTradingInfo.getWorkLoad().multiply(new BigDecimal(1000)).subtract(schedulingNumBySpeculativeTradingName).compareTo(productionNum) >= 0){
- name.set(speculativeTradingInfo.getName());
- break;
- }
- }
- }else{
- // 鍗曚釜鐐掓満鎯呭喌
- name.set(speculativeTradingInfos.get(0).getName());
- }
- if(name.get().isEmpty()){
- i++;
- continue;
- }
+// // 鑾峰彇绌轰綑鐐掓満
+// String[] split = productionDispatchAddDto.getSpeculativeTradingName().split(",");
+// if(split != null && split.length == 0){
+// i++;
+// continue;
+// }
+// List<SpeculativeTradingInfo> speculativeTradingInfos = speculativeTradingInfoMapper.selectList(new LambdaQueryWrapper<SpeculativeTradingInfo>()
+// .in(SpeculativeTradingInfo::getName, Arrays.asList(split))
+// .orderByAsc(SpeculativeTradingInfo::getSort));
+// if(CollectionUtils.isEmpty(speculativeTradingInfos)){
+// i++;
+// continue;
+// }
+// AtomicReference<String> name = new AtomicReference<>(""); //闇�瑕佺粦瀹氱殑鐐掓満
+// //閫氳繃瑙勬牸鍨嬪彿鍜屾帓浜ф暟閲忚绠楁湰娆$敓浜т骇閲�
+// String[] split1 = productionDispatchAddDto.getSpecificationModel().split("\\*");
+// if(split1.length != 2){
+// i++;
+// continue;
+// }
+// // 鏈鐢熶骇浜ч噺
+// BigDecimal productionNum = new BigDecimal(split1[0])
+// .multiply(new BigDecimal(split1[1]).multiply(productionDispatchAddDto.getSchedulingNum()));
+// // 澶氫釜鐐掓満鎯呭喌
+// if(speculativeTradingInfos.size() > 1){
+// for (SpeculativeTradingInfo speculativeTradingInfo : speculativeTradingInfos) {
+// // 鑾峰彇璇ョ倰鏈烘鍦ㄦ帓浜ч噺
+// BigDecimal schedulingNumBySpeculativeTradingName = getSchedulingNumBySpeculativeTradingName(speculativeTradingInfo.getName());
+// // 濡傛灉璇ョ倰鏈烘�婚噺(鍗曚綅kg闇�瑕佷箻1000) - 姝e湪鎺掍骇閲� >=鏈鐢熶骇浜ч噺灏卞垎閰嶆鐐掓満
+// if(speculativeTradingInfo.getWorkLoad().multiply(new BigDecimal(1000)).subtract(schedulingNumBySpeculativeTradingName).compareTo(productionNum) >= 0){
+// name.set(speculativeTradingInfo.getName());
+// break;
+// }
+// }
+// }else{
+// // 鍗曚釜鐐掓満鎯呭喌
+// name.set(speculativeTradingInfos.get(0).getName());
+// }
+// if(name.get().isEmpty()){
+// i++;
+// continue;
+// }
SalesLedgerScheduling salesLedgerScheduling = SalesLedgerScheduling.builder()
.salesLedgerId(productionDispatchAddDto.getSalesLedgerId())
.salesLedgerProductId(productionDispatchAddDto.getSalesLedgerProductId())
- .speculativeTradingName(name.get())
+// .speculativeTradingName(name.get())
+ .productionUserId(sysUser1.getUserId())
+ .productionUserName(sysUser1.getNickName())
+ .productionLineId(productionDispatchAddDto.getLineId())
.schedulingUserId(sysUser.getUserId())
.schedulingUserName(sysUser.getNickName())
.schedulingNum(productionDispatchAddDto.getSchedulingNum())
@@ -281,6 +292,8 @@
@Override
public IPage<SalesLedgerSchedulingProcessDto> listPageProcess(Page page, SalesLedgerSchedulingProcessDto salesLedgerSchedulingDto) {
+ Long userId = SecurityUtils.getLoginUser().getUserId();
+ salesLedgerSchedulingDto.setProductionUserId(userId);
IPage<SalesLedgerSchedulingProcessDto> list = salesLedgerSchedulingMapper.listPageProcess(page, salesLedgerSchedulingDto);
// Set<Long> collect = list.getRecords().stream().map(SalesLedgerSchedulingProcessDto::getId).collect(Collectors.toSet());
// if(CollectionUtils.isEmpty(collect)) return list;
@@ -338,6 +351,8 @@
SalesLedgerWork.SalesLedgerWorkBuilder salesLedgerWorkBuilder = SalesLedgerWork.builder()
.salesLedgerSchedulingId(salesLedgerScheduling.getId())
.salesLedgerId(salesLedgerScheduling.getSalesLedgerId())
+ .productionUserId(salesLedgerScheduling.getProductionUserId())
+ .productionUserName(salesLedgerScheduling.getProductionUserName())
.remark(processSchedulingDto.getRemark())
.type(processSchedulingDto.getType())
.loss(processSchedulingDto.getLoss())
diff --git a/src/main/java/com/ruoyi/production/service/impl/SalesLedgerWorkServiceImpl.java b/src/main/java/com/ruoyi/production/service/impl/SalesLedgerWorkServiceImpl.java
index 51172a5..44e505f 100644
--- a/src/main/java/com/ruoyi/production/service/impl/SalesLedgerWorkServiceImpl.java
+++ b/src/main/java/com/ruoyi/production/service/impl/SalesLedgerWorkServiceImpl.java
@@ -57,6 +57,7 @@
@Override
public IPage<SalesLedgerWorkDto> listPage(Page page, SalesLedgerWorkDto salesLedgerWorkDto) {
+ salesLedgerWorkDto.setProductionUserId(SecurityUtils.getLoginUser().getUserId());
IPage<SalesLedgerWorkDto> iPage = salesLedgerWorkMapper.listPage(page, salesLedgerWorkDto);
List<Loss> losses = lossMapper.selectList(null);
if(!CollectionUtils.isEmpty(losses)){
diff --git a/src/main/resources/application-trsw.yml b/src/main/resources/application-trsw.yml
new file mode 100644
index 0000000..59b9f58
--- /dev/null
+++ b/src/main/resources/application-trsw.yml
@@ -0,0 +1,219 @@
+# 椤圭洰鐩稿叧閰嶇疆
+ruoyi:
+ # 鍚嶇О
+ name: RuoYi
+ # 鐗堟湰
+ version: 3.8.9
+ # 鐗堟潈骞翠唤
+ copyrightYear: 2025
+ # 鏂囦欢璺緞 绀轰緥锛� Windows閰嶇疆D:/ruoyi/uploadPath锛孡inux閰嶇疆 /home/ruoyi/uploadPath锛�
+ profile: /javaWork/product-inventory-management/file
+
+ # 鑾峰彇ip鍦板潃寮�鍏�
+ addressEnabled: false
+ # 楠岃瘉鐮佺被鍨� math 鏁板瓧璁$畻 char 瀛楃楠岃瘉
+ captchaType: math
+
+# 寮�鍙戠幆澧冮厤缃�
+server:
+ # 鏈嶅姟鍣ㄧ殑HTTP绔彛锛岄粯璁や负8080
+ port: 9129
+ servlet:
+ # 搴旂敤鐨勮闂矾寰�
+ context-path: /
+ tomcat:
+ # tomcat鐨刄RI缂栫爜
+ uri-encoding: UTF-8
+ # 杩炴帴鏁版弧鍚庣殑鎺掗槦鏁帮紝榛樿涓�100
+ accept-count: 1000
+ threads:
+ # tomcat鏈�澶х嚎绋嬫暟锛岄粯璁や负200
+ max: 800
+ # Tomcat鍚姩鍒濆鍖栫殑绾跨▼鏁帮紝榛樿鍊�10
+ min-spare: 100
+
+# 鏃ュ織閰嶇疆
+logging:
+ level:
+ com.ruoyi: warn
+ org.springframework: warn
+
+minio:
+ endpoint: http://114.132.189.42/
+ port: 7019
+ secure: false
+ accessKey: admin
+ secretKey: 12345678
+ preview-expiry: 24 # 棰勮鍦板潃榛樿24灏忔椂
+ default-bucket: demo-product
+# 鐢ㄦ埛閰嶇疆
+user:
+ password:
+ # 瀵嗙爜鏈�澶ч敊璇鏁�
+ maxRetryCount: 5
+ # 瀵嗙爜閿佸畾鏃堕棿锛堥粯璁�10鍒嗛挓锛�
+ lockTime: 10
+
+# Spring閰嶇疆
+spring:
+ datasource:
+ type: com.alibaba.druid.pool.DruidDataSource
+ driverClassName: com.mysql.cj.jdbc.Driver
+ druid:
+ # 涓诲簱鏁版嵁婧�
+ master:
+ url: jdbc:mysql://172.17.0.1:3306/product-inventory-management-trsw?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+ username: root
+ password: xd@123456..
+ # 浠庡簱鏁版嵁婧�
+ slave:
+ # 浠庢暟鎹簮寮�鍏�/榛樿鍏抽棴
+ enabled: false
+ url:
+ username:
+ password:
+ # 鍒濆杩炴帴鏁�
+ initialSize: 5
+ # 鏈�灏忚繛鎺ユ睜鏁伴噺
+ minIdle: 10
+ # 鏈�澶ц繛鎺ユ睜鏁伴噺
+ maxActive: 20
+ # 閰嶇疆鑾峰彇杩炴帴绛夊緟瓒呮椂鐨勬椂闂�
+ maxWait: 60000
+ # 閰嶇疆杩炴帴瓒呮椂鏃堕棿
+ connectTimeout: 30000
+ # 閰嶇疆缃戠粶瓒呮椂鏃堕棿
+ socketTimeout: 60000
+ # 閰嶇疆闂撮殧澶氫箙鎵嶈繘琛屼竴娆℃娴嬶紝妫�娴嬮渶瑕佸叧闂殑绌洪棽杩炴帴锛屽崟浣嶆槸姣
+ timeBetweenEvictionRunsMillis: 60000
+ # 閰嶇疆涓�涓繛鎺ュ湪姹犱腑鏈�灏忕敓瀛樼殑鏃堕棿锛屽崟浣嶆槸姣
+ minEvictableIdleTimeMillis: 300000
+ # 閰嶇疆涓�涓繛鎺ュ湪姹犱腑鏈�澶х敓瀛樼殑鏃堕棿锛屽崟浣嶆槸姣
+ maxEvictableIdleTimeMillis: 900000
+ # 閰嶇疆妫�娴嬭繛鎺ユ槸鍚︽湁鏁�
+ validationQuery: SELECT 1 FROM DUAL
+ testWhileIdle: true
+ testOnBorrow: false
+ testOnReturn: false
+ webStatFilter:
+ enabled: true
+ statViewServlet:
+ enabled: true
+ # 璁剧疆鐧藉悕鍗曪紝涓嶅~鍒欏厑璁告墍鏈夎闂�
+ allow:
+ url-pattern: /druid/*
+ # 鎺у埗鍙扮鐞嗙敤鎴峰悕鍜屽瘑鐮�
+ login-username: ruoyi
+ login-password: 123456
+ filter:
+ stat:
+ enabled: true
+ # 鎱QL璁板綍
+ log-slow-sql: true
+ slow-sql-millis: 1000
+ merge-sql: true
+ wall:
+ config:
+ multi-statement-allow: true
+ # 璧勬簮淇℃伅
+ messages:
+ # 鍥介檯鍖栬祫婧愭枃浠惰矾寰�
+ basename: i18n/messages
+ # 鏂囦欢涓婁紶
+ servlet:
+ multipart:
+ # 鍗曚釜鏂囦欢澶у皬
+ max-file-size: 1GB
+ # 璁剧疆鎬讳笂浼犵殑鏂囦欢澶у皬
+ max-request-size: 2GB
+ # 鏈嶅姟妯″潡
+ devtools:
+ restart:
+ # 鐑儴缃插紑鍏�
+ enabled: false
+ # redis 閰嶇疆
+ redis:
+ # 鍦板潃
+ # host: 127.0.0.1
+ host: 172.17.0.1
+ # 绔彛锛岄粯璁や负6379
+ port: 6380
+ # 鏁版嵁搴撶储寮�
+ database: 13
+ # 瀵嗙爜
+ # password: root2022!
+ password:
+
+ # 杩炴帴瓒呮椂鏃堕棿
+ timeout: 10s
+ lettuce:
+ pool:
+ # 杩炴帴姹犱腑鐨勬渶灏忕┖闂茶繛鎺�
+ min-idle: 0
+ # 杩炴帴姹犱腑鐨勬渶澶х┖闂茶繛鎺�
+ max-idle: 8
+ # 杩炴帴姹犵殑鏈�澶ф暟鎹簱杩炴帴鏁�
+ max-active: 8
+ # #杩炴帴姹犳渶澶ч樆濉炵瓑寰呮椂闂达紙浣跨敤璐熷�艰〃绀烘病鏈夐檺鍒讹級
+ max-wait: -1ms
+
+# token閰嶇疆
+token:
+ # 浠ょ墝鑷畾涔夋爣璇�
+ header: Authorization
+ # 浠ょ墝瀵嗛挜
+ secret: abcdefghijklmnopqrstuvwxyz
+ # 浠ょ墝鏈夋晥鏈燂紙榛樿30鍒嗛挓锛�
+ expireTime: 450
+
+# MyBatis Plus閰嶇疆
+mybatis-plus:
+ # 鎼滅储鎸囧畾鍖呭埆鍚� 鏍规嵁鑷繁鐨勯」鐩潵
+ typeAliasesPackage: com.ruoyi.**.pojo
+ # 閰嶇疆mapper鐨勬壂鎻忥紝鎵惧埌鎵�鏈夌殑mapper.xml鏄犲皠鏂囦欢
+ mapperLocations: classpath*:mapper/**/*Mapper.xml
+ # 鍔犺浇鍏ㄥ眬鐨勯厤缃枃浠�
+ configLocation: classpath:mybatis/mybatis-config.xml
+ global-config:
+ enable-sql-runner: true
+ db-config:
+ id-type: auto
+
+# PageHelper鍒嗛〉鎻掍欢
+pagehelper:
+ helperDialect: mysql
+ supportMethodsArguments: true
+ params: count=countSql
+
+# Swagger閰嶇疆
+swagger:
+ # 鏄惁寮�鍚痵wagger
+ enabled: true
+ # 璇锋眰鍓嶇紑
+ pathMapping: /dev-api
+
+# 闃叉XSS鏀诲嚮
+xss:
+ # 杩囨护寮�鍏�
+ enabled: true
+ # 鎺掗櫎閾炬帴锛堝涓敤閫楀彿鍒嗛殧锛�
+ excludes: /system/notice
+ # 鍖归厤閾炬帴
+ urlPatterns: /system/*,/monitor/*,/tool/*
+
+# 浠g爜鐢熸垚
+gen:
+ # 浣滆��
+ author: ruoyi
+ # 榛樿鐢熸垚鍖呰矾寰� system 闇�鏀规垚鑷繁鐨勬ā鍧楀悕绉� 濡� system monitor tool
+ packageName: com.ruoyi.project.system
+ # 鑷姩鍘婚櫎琛ㄥ墠缂�锛岄粯璁ゆ槸true
+ autoRemovePre: false
+ # 琛ㄥ墠缂�锛堢敓鎴愮被鍚嶄笉浼氬寘鍚〃鍓嶇紑锛屽涓敤閫楀彿鍒嗛殧锛�
+ tablePrefix: sys_
+ # 鏄惁鍏佽鐢熸垚鏂囦欢瑕嗙洊鍒版湰鍦帮紙鑷畾涔夎矾寰勶級锛岄粯璁や笉鍏佽
+ allowOverwrite: false
+
+file:
+ temp-dir: /javaWork/product-inventory-management/file/temp/uploads
+ upload-dir: /javaWork/product-inventory-management/file/prod/uploads
\ No newline at end of file
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index 9db8417..c79d967 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -1,4 +1,4 @@
# Spring閰嶇疆
spring:
profiles:
- active: hckxTest
+ active: dev
diff --git a/src/main/resources/mapper/production/ProductionLineMapper.xml b/src/main/resources/mapper/production/ProductionLineMapper.xml
new file mode 100644
index 0000000..da1c641
--- /dev/null
+++ b/src/main/resources/mapper/production/ProductionLineMapper.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.production.mapper.ProductionLineMapper">
+
+</mapper>
\ No newline at end of file
diff --git a/src/main/resources/mapper/production/SalesLedgerProductionAccountingMapper.xml b/src/main/resources/mapper/production/SalesLedgerProductionAccountingMapper.xml
index 29b88f2..d918cda 100644
--- a/src/main/resources/mapper/production/SalesLedgerProductionAccountingMapper.xml
+++ b/src/main/resources/mapper/production/SalesLedgerProductionAccountingMapper.xml
@@ -28,6 +28,9 @@
<if test="salesLedgerDto.schedulingUserName != null and salesLedgerDto.schedulingUserName != '' ">
AND t4.scheduling_user_name LIKE CONCAT('%',#{salesLedgerDto.schedulingUserName},'%')
</if>
+ <if test="salesLedgerDto.schedulingUserId != null and salesLedgerDto.schedulingUserId != '' ">
+ AND t4.scheduling_user_id LIKE CONCAT('%',#{salesLedgerDto.schedulingUserId},'%')
+ </if>
<if test="salesLedgerDto.customerName != null and salesLedgerDto.customerName != '' ">
AND T1.customer_name LIKE CONCAT('%',#{salesLedgerDto.customerName},'%')
</if>
diff --git a/src/main/resources/mapper/production/SalesLedgerSchedulingMapper.xml b/src/main/resources/mapper/production/SalesLedgerSchedulingMapper.xml
index 6009d15..1fb5907 100644
--- a/src/main/resources/mapper/production/SalesLedgerSchedulingMapper.xml
+++ b/src/main/resources/mapper/production/SalesLedgerSchedulingMapper.xml
@@ -41,6 +41,9 @@
<if test="salesLedgerDto.entryDateEnd != null and salesLedgerDto.entryDateEnd != '' ">
AND T1.entry_date <= DATE_FORMAT(#{salesLedgerDto.entryDateEnd},'%Y-%m-%d')
</if>
+ <if test="salesLedgerDto.productionUserId != null and salesLedgerDto.productionUserId != '' ">
+ AND T1.entry_person = #{salesLedgerDto.productionUserId}
+ </if>
</where>
GROUP BY T2.id
</select>
@@ -82,11 +85,16 @@
T1.customer_name,
t3.product_category,
t3.specification_model,
- t3.unit
+ t3.unit,
+ t4.name as productionLineName,
+ t4.id as productionLineId,
+ T2.production_user_name,
+ T2.production_user_id
FROM
sales_ledger_scheduling T2
LEFT JOIN sales_ledger T1 ON T1.id = T2.sales_ledger_id
left join sales_ledger_product t3 on T2.sales_ledger_product_id = t3.id
+ left join production_line t4 on t4.id = T2.production_line_id
<where>
t3.type = 1
<if test="salesLedgerDto.status != null and salesLedgerDto.status != '' ">
@@ -110,6 +118,9 @@
<if test="salesLedgerDto.entryDateEnd != null and salesLedgerDto.entryDateEnd != '' ">
AND T2.scheduling_date <= DATE_FORMAT(#{salesLedgerDto.entryDateEnd},'%Y-%m-%d')
</if>
+ <if test="salesLedgerDto.productionUserId != null and salesLedgerDto.productionUserId != '' ">
+ AND T2.production_user_id = #{salesLedgerDto.productionUserId}
+ </if>
</where>
order by T2.status asc
</select>
diff --git a/src/main/resources/mapper/production/SalesLedgerWorkMapper.xml b/src/main/resources/mapper/production/SalesLedgerWorkMapper.xml
index 3891b7d..892f4b8 100644
--- a/src/main/resources/mapper/production/SalesLedgerWorkMapper.xml
+++ b/src/main/resources/mapper/production/SalesLedgerWorkMapper.xml
@@ -8,6 +8,7 @@
t4.status,
t4.scheduling_user_id,
t4.scheduling_user_name,
+ t4.production_user_id,
t4.scheduling_date,
t4.scheduling_num,
t4.finished_num,
@@ -34,6 +35,9 @@
<if test="salesLedgerDto.status != null and salesLedgerDto.status != '' ">
AND t4.status = #{salesLedgerDto.status}
</if>
+ <if test="salesLedgerDto.productionUserId != null and salesLedgerDto.productionUserId != '' ">
+ AND t4.production_user_id = #{salesLedgerDto.productionUserId}
+ </if>
<if test="salesLedgerDto.customerName != null and salesLedgerDto.customerName != '' ">
AND T1.customer_name LIKE CONCAT('%',#{salesLedgerDto.customerName},'%')
</if>
--
Gitblit v1.9.3