From f2c7576cbd050824ec78233483e06fc375382bfb Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期四, 02 四月 2026 17:04:03 +0800
Subject: [PATCH] yys 1.客户档案导入-维护人,维护时间默认当前 2.销售报价审核非必填,产品选择方式也要改 3.销售产品增加物料号字段 4.产品维护增加录入时间,修改时间 6.发货审核不需要了 7.BI的生产核算分析不要了,增加生产订单当前工序 3.库存导入模板规格改成图纸编号,产品名称可以为空,加个库位 4.库存管理外购改为标准件 5.bom产品唯一 6.产品根据bom计算子项数量(只统计二级)
---
src/main/java/com/ruoyi/sales/controller/ShippingInfoController.java | 98 +++++++++++++++++++++++++++----------------------
1 files changed, 54 insertions(+), 44 deletions(-)
diff --git a/src/main/java/com/ruoyi/sales/controller/ShippingInfoController.java b/src/main/java/com/ruoyi/sales/controller/ShippingInfoController.java
index c498b93..7dc6004 100644
--- a/src/main/java/com/ruoyi/sales/controller/ShippingInfoController.java
+++ b/src/main/java/com/ruoyi/sales/controller/ShippingInfoController.java
@@ -3,11 +3,21 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.approve.mapper.ApproveProcessMapper;
+import com.ruoyi.approve.service.impl.ApproveProcessServiceImpl;
+import com.ruoyi.approve.vo.ApproveProcessVO;
+import com.ruoyi.common.enums.FileNameType;
+import com.ruoyi.common.utils.OrderUtils;
+import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
+import com.ruoyi.framework.security.LoginUser;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
+import com.ruoyi.other.service.impl.TempFileServiceImpl;
+import com.ruoyi.procurementrecord.utils.StockUtils;
+import com.ruoyi.sales.dto.ShippingInfoDto;
import com.ruoyi.sales.mapper.ShipmentApprovalMapper;
import com.ruoyi.sales.mapper.ShippingInfoMapper;
import com.ruoyi.sales.pojo.SalesLedger;
@@ -17,6 +27,7 @@
import com.ruoyi.sales.service.ISalesLedgerProductService;
import com.ruoyi.sales.service.ISalesLedgerService;
import com.ruoyi.sales.service.ShippingInfoService;
+import com.ruoyi.sales.service.impl.CommonFileServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.collections4.CollectionUtils;
@@ -25,6 +36,8 @@
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.time.LocalDate;
import java.util.List;
/**
@@ -38,61 +51,66 @@
@Autowired
private ShippingInfoService shippingInfoService;
+
@Autowired
- private ShipmentApprovalMapper shipmentApprovalMapper;
+ private CommonFileServiceImpl commonFileService;
+
@Autowired
- private ISalesLedgerProductService salesLedgerProductService;
+ private ApproveProcessServiceImpl approveProcessService;
+ @Autowired
+ private StockUtils stockUtils;
+
+ @GetMapping("/getByCustomerName")
+ @ApiOperation("閫氳繃瀹㈡埛鍚嶇О鏌ヨ")
+ public AjaxResult getByCustomerName(String customerName) {
+ return AjaxResult.success(shippingInfoService.getShippingInfoByCustomerName(customerName));
+ }
+
+ @ApiOperation("璇︽儏")
+ @GetMapping("/getById")
+ public AjaxResult getById(Long id) {
+ return AjaxResult.success(shippingInfoService.getDateil(id));
+ }
@GetMapping("/listPage")
@ApiOperation("鍙戣揣淇℃伅鍒楄〃")
public AjaxResult listPage(Page page, ShippingInfo req) {
- IPage<ShippingInfo> listPage = shippingInfoService.listPage(page,req);
+ IPage<ShippingInfoDto> listPage = shippingInfoService.listPage(page,req);
return AjaxResult.success(listPage);
}
@PostMapping("/add")
@ApiOperation("娣诲姞鍙戣揣淇℃伅")
@Transactional(rollbackFor = Exception.class)
- public AjaxResult add(@RequestBody ShippingInfo req) {
- LambdaQueryWrapper<ShippingInfo> wrapper = new LambdaQueryWrapper<>();
- wrapper.eq(ShippingInfo::getSalesLedgerId, req.getSalesLedgerId());
- wrapper.eq(ShippingInfo::getSalesLedgerProductId, req.getSalesLedgerProductId());
- List<ShippingInfo> list = shippingInfoService.list(wrapper);
- if(!CollectionUtils.isEmpty(list)){
- return AjaxResult.error("鍙戣揣淇℃伅宸插瓨鍦�");
- }
+ @Log(title = "鍙戣揣淇℃伅绠$悊", businessType = BusinessType.INSERT)
+ public AjaxResult add(@RequestBody ShippingInfoDto req) throws Exception {
+// LoginUser loginUser = SecurityUtils.getLoginUser();
+ String sh = OrderUtils.countTodayByCreateTime(shippingInfoMapper, "SH");
+ // 鍙戣揣瀹℃壒
+// ApproveProcessVO approveProcessVO = new ApproveProcessVO();
+// approveProcessVO.setApproveType(7);
+// approveProcessVO.setApproveDeptId(loginUser.getCurrentDeptId());
+// approveProcessVO.setApproveReason(req.getType() + ":" +sh);
+// approveProcessVO.setApproveUserIds(req.getApproveUserIds());
+// approveProcessVO.setApproveUser(loginUser.getUserId());
+// approveProcessVO.setApproveTime(LocalDate.now().toString());
+// approveProcessService.addApprove(approveProcessVO);
+ // 娣诲姞鍙戣揣娑堟伅
+ req.setShippingNo(sh);
+ req.setStatus("寰呭彂璐�");
boolean save = shippingInfoService.save(req);
- if(save){
- ShippingInfo shippingInfo = shippingInfoService.getOne(wrapper);
- ShipmentApproval shipmentApproval = new ShipmentApproval();
- shipmentApproval.setSalesLedgerId(req.getSalesLedgerId());
- shipmentApproval.setSalesLedgerProductId(req.getSalesLedgerProductId());
- shipmentApproval.setApproveUserId(req.getApproverId());
- shipmentApproval.setApproveStatus(2);
- shipmentApproval.setShippingInfoId(shippingInfo.getId());
- shipmentApprovalMapper.insert(shipmentApproval);
-
- SalesLedgerProduct salesLedgerProduct = salesLedgerProductService.getById(req.getSalesLedgerProductId());
- if(salesLedgerProduct != null){
- salesLedgerProduct.setApproveStatus(2);
- salesLedgerProductService.updateById(salesLedgerProduct);
- }
-
- }
return save ? AjaxResult.success() : AjaxResult.error();
}
@PostMapping("/update")
@ApiOperation("淇敼鍙戣揣淇℃伅")
+ @Transactional(rollbackFor = Exception.class)
+ @Log(title = "鍙戣揣淇℃伅绠$悊", businessType = BusinessType.UPDATE)
public AjaxResult update(@RequestBody ShippingInfo req) {
ShippingInfo byId = shippingInfoService.getById(req.getId());
if (byId == null) {
return AjaxResult.error("鍙戣揣淇℃伅涓嶅瓨鍦�");
- }
- Long userId = getLoginUser().getUserId();
- if(!userId.equals(Long.parseLong(byId.getCreateUser().toString()))){
- return AjaxResult.error("鎮ㄦ病鏈夋潈闄愪慨鏀规鍙戣揣淇℃伅");
}
boolean update = shippingInfoService.updateById(req);
return update ? AjaxResult.success() : AjaxResult.error();
@@ -100,19 +118,11 @@
@DeleteMapping("/delete")
@ApiOperation("鍒犻櫎鍙戣揣淇℃伅")
+ @Transactional(rollbackFor = Exception.class)
+ @Log(title = "鍙戣揣淇℃伅绠$悊", businessType = BusinessType.DELETE)
public AjaxResult delete(@RequestBody List<Long> ids) {
- Long userId = getLoginUser().getUserId();
- ids.forEach(id -> {
- ShippingInfo byId = shippingInfoService.getById(id);
- if (byId == null) {
- throw new RuntimeException("鍙戣揣淇℃伅涓嶅瓨鍦�");
- }
- if(!userId.equals(Long.parseLong(byId.getCreateUser().toString()))){
- throw new RuntimeException("鎮ㄦ病鏈夋潈闄愬垹闄ゆ鍙戣揣淇℃伅");
- }
- });
- boolean delete = shippingInfoService.removeBatchByIds(ids);
- return delete ? AjaxResult.success("鍒犻櫎鎴愬姛") : AjaxResult.error("鍒犻櫎澶辫触");
+
+ return shippingInfoService.delete(ids) ? AjaxResult.success("鍒犻櫎鎴愬姛") : AjaxResult.error("鍒犻櫎澶辫触");
}
@Autowired
--
Gitblit v1.9.3