From f92d540d2b34067b475298f317efb4ba27a7e02d Mon Sep 17 00:00:00 2001 From: chenhao Date: Thu, 16 Oct 2025 17:32:19 +0800 Subject: [PATCH] =?UTF-8?q?feat(stock):=20=E6=96=B0=E5=A2=9E=E5=A4=87?= =?UTF-8?q?=E8=B4=A7=E7=AE=A1=E7=90=86=E5=8A=9F=E8=83=BD=E5=B9=B6=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E8=AE=A2=E5=8D=95=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增备货信息表(OmsStockInfo)及相关CRUD功能 - 实现库存执行页面权限控制 - 优化订单导出逻辑, 增加税率字段显示 - 移除前端调试代码及冗余排序功能 - 调整订单状态审批逻辑, 增加部门权限判断 - 完善订单列表页时间筛选与排序功能 -修复出库数量校验逻辑问题 --- .../templates/inventory/execution/edit.html | 2 +- .../templates/inventory/stock/index.html | 364 ++++++++++++++++++ .../templates/project/info/project.html | 28 +- .../templates/project/order/edit.html | 7 +- .../templates/project/order/order.html | 34 +- .../InventoryExecutionController.java | 1 + .../controller/OmsStockInfoController.java | 82 ++++ .../com/ruoyi/sip/domain/OmsStockInfo.java | 43 +++ .../sip/dto/OrderExcelNumStaticsDto.java | 1 + .../service/impl/TodoServiceImpl.java | 4 +- .../ruoyi/sip/mapper/OmsStockInfoMapper.java | 49 +++ .../sip/service/IOmsStockInfoService.java | 48 +++ .../impl/InventoryAuthServiceImpl.java | 8 +- .../service/impl/OmsStockInfoServiceImpl.java | 69 ++++ .../impl/ProjectOrderInfoServiceImpl.java | 76 +++- .../mapper/sip/OmsStockInfoMapper.xml | 150 ++++++++ 16 files changed, 888 insertions(+), 78 deletions(-) create mode 100644 ruoyi-admin/src/main/resources/templates/inventory/stock/index.html create mode 100644 ruoyi-sip/src/main/java/com/ruoyi/sip/controller/OmsStockInfoController.java create mode 100644 ruoyi-sip/src/main/java/com/ruoyi/sip/domain/OmsStockInfo.java create mode 100644 ruoyi-sip/src/main/java/com/ruoyi/sip/mapper/OmsStockInfoMapper.java create mode 100644 ruoyi-sip/src/main/java/com/ruoyi/sip/service/IOmsStockInfoService.java create mode 100644 ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/OmsStockInfoServiceImpl.java create mode 100644 ruoyi-sip/src/main/resources/mapper/sip/OmsStockInfoMapper.xml diff --git a/ruoyi-admin/src/main/resources/templates/inventory/execution/edit.html b/ruoyi-admin/src/main/resources/templates/inventory/execution/edit.html index 45a97637..b202dbe7 100644 --- a/ruoyi-admin/src/main/resources/templates/inventory/execution/edit.html +++ b/ruoyi-admin/src/main/resources/templates/inventory/execution/edit.html @@ -706,7 +706,7 @@ function initWarehouseTable(data) { $.modal.msgError("本次提交出库数量应大于0") return; } - debugger + let generateNumber = $('#out-generatedQuantity').text(); let allTotal = totalConfirmQuantity + Number(generateNumber) if (allTotal > Number($('#out-quantity').text())) { diff --git a/ruoyi-admin/src/main/resources/templates/inventory/stock/index.html b/ruoyi-admin/src/main/resources/templates/inventory/stock/index.html new file mode 100644 index 00000000..8c2476d4 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/inventory/stock/index.html @@ -0,0 +1,364 @@ + + + + + + + + +
+ +
+
+
+
+
+
    +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • + +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + + +
  • +
  • + + + + + + + + + +
    + + + + +
    +
  • + +
  • +  搜索 +  重置 +
  • +
+ + +
+
+
+ + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/project/info/project.html b/ruoyi-admin/src/main/resources/templates/project/info/project.html index 7cb16324..a53f8161 100644 --- a/ruoyi-admin/src/main/resources/templates/project/info/project.html +++ b/ruoyi-admin/src/main/resources/templates/project/info/project.html @@ -146,8 +146,6 @@ - - @@ -191,6 +189,7 @@ modalName: "项目管理", fixedColumns: true, fixedRightNumber:1, + sortable: true, columns: [{ checkbox: true }, @@ -289,6 +288,7 @@ { field: 'estimatedAmount', title: '预计金额(元)', + sortable: true, width: 140, formatter: function (value, row, index) { return value?formatAmountNumber(value):''; @@ -298,12 +298,14 @@ field: 'estimatedOrderTime', title: '预计下单时间', class: 'time1', + sortable: true, width: 140 }, { field: 'lastWorkUpdateTime', title: '更新时间', class: 'time3', + sortable: true, width: 160, formatter: function (value, row, index) { return value; @@ -327,7 +329,6 @@ } }; $.table.init(options); - initSrot() changeTimeType() layui.use('laydate', function () { var laydate = layui.laydate; @@ -382,29 +383,8 @@ $('span.highlight').parent().parent().addClass('highlightRow') } - function initSrot() { - let sort1 = $(`
`) - $('thead .time1 .th-inner').append(sort1) - let sort2 = $(`
`) - $('thead .time2 .th-inner').append(sort2) - let sort3 = $(`
`) - $('thead .time3 .th-inner').append(sort3) - - } - - - function changeSort(ele, index) { - - let arr = ['estimated_orderTime', 'estimated_deliverTime', 'last_work_update_time'] - $('.sortBox').find('.timeAction').removeClass('timeAction') - $(ele).addClass('timeAction') - $('input[name="orderByColumn"]').val(arr[index]) - $('input[name="isAsc"]').val($(ele).attr('sort')) - $.table.search() - } - function changeTimeType() { let timeType = $("[name='timeType']").val() if (timeType == 0) { diff --git a/ruoyi-admin/src/main/resources/templates/project/order/edit.html b/ruoyi-admin/src/main/resources/templates/project/order/edit.html index 63bd10a9..ec61221f 100644 --- a/ruoyi-admin/src/main/resources/templates/project/order/edit.html +++ b/ruoyi-admin/src/main/resources/templates/project/order/edit.html @@ -552,8 +552,9 @@

[[${log.approveOpinion}]]

-

接收人:[[${log.taskName == '公司领导'?log.applyUserName: - log.nextAllApproveUserName} ]]

+ +

接收人:[[${ log.nextAllApproveUserName} ]]

[[${#dates.format(log.approveTime,'yyyy-MM-dd HH:mm:ss')}]] 审批状态 : [ [[${log.approveStatus==3?'批准':log.approveStatus==2?'驳回':'提交审批'}]] ]

@@ -848,6 +849,8 @@ } $(function () { + + let shipmentAmount = [[${projectOrderInfo.shipmentAmount}]] || 0 if (shipmentAmount) { diff --git a/ruoyi-admin/src/main/resources/templates/project/order/order.html b/ruoyi-admin/src/main/resources/templates/project/order/order.html index 1e53ef38..6e3d4df6 100644 --- a/ruoyi-admin/src/main/resources/templates/project/order/order.html +++ b/ruoyi-admin/src/main/resources/templates/project/order/order.html @@ -110,8 +110,6 @@  重置 - - @@ -141,17 +139,7 @@ var editFlag = [[${@permission.hasPermi('project:order:edit')}]]; var removeFlag = [[${@permission.hasPermi('project:order:remove')}]]; var prefix = ctx + "project/order"; - function initSrot() { - let sort3 = $(`
`) - $('thead .time3 .th-inner').append(sort3) - let sort4 = $(`
`) - $('thead .time4 .th-inner').append(sort4) - let sort5 = $(`
`) - $('thead .time5 .th-inner').append(sort5) - bindSort([ sort3, sort4, sort5]) - - } function changeTimeType() { let timeType = $("[name='timeType']").val() if (timeType == 0) { @@ -165,22 +153,6 @@ $('#laydate-endTime').attr('name', 'orderEndTimeEnd') } } - function bindSort(list) { - list.forEach((ele, index) => { - $(ele).find('.sortBtn').on('click', function () { - changeSort(this, index) - }) - }) - - } - function changeSort(ele, index) { - let arr = ['deliveryTime','t2.estimatedOrderTime','orderEndTime'] - $('.sortBox').find('.timeAction').removeClass('timeAction') - $(ele).addClass('timeAction') - $('input[name="orderByColumn"]').val(arr[index]) - $('input[name="isAsc"]').val($(ele).attr('sort')) - $.table.search() - } function viewDetail(id){ $.modal.openFull("订单详情", ctx + "project/order/view/"+id) } @@ -209,6 +181,7 @@ exportUrl: prefix + "/export", modalName: "订单管理", fixedColumns:true, + sortable: true, fixedRightNumber:1, columns: [{ checkbox: true @@ -247,6 +220,7 @@ { field: 'shipmentAmount', title: '金额(¥)', + sortable: true, width:100, formatter: function (value, row, index) { return value?formatAmountNumber(value):''; @@ -283,18 +257,21 @@ { field: 'deliveryTime', title: '到货时间', + sortable: true, class: 'time3', width:200 }, { field: 'estimatedOrderTime', title: '下单时间', + sortable: true, class: 'time4', width:200 }, { field: 'orderEndTime', title: '执行单截止时间', + sortable: true, class: 'time5', width:200 }, @@ -317,7 +294,6 @@ }] }; $.table.init(options); - initSrot() layui.use('laydate', function () { var laydate = layui.laydate; var startDate = laydate.render({ diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/controller/InventoryExecutionController.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/controller/InventoryExecutionController.java index 8225ea94..55d657de 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/controller/InventoryExecutionController.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/controller/InventoryExecutionController.java @@ -53,6 +53,7 @@ public class InventoryExecutionController extends BaseController { @PostMapping("/list") @ResponseBody + @RequiresPermissions("inventory:execution:view") public TableDataInfo list(ProjectOrderInfo projectOrderInfo) { projectOrderInfo.setOrderStatus(ProjectOrderInfo.OrderStatus.APPROVE_COMPLETE.getCode()); diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/controller/OmsStockInfoController.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/controller/OmsStockInfoController.java new file mode 100644 index 00000000..a5e06f72 --- /dev/null +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/controller/OmsStockInfoController.java @@ -0,0 +1,82 @@ +package com.ruoyi.sip.controller; + +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.sip.domain.OmsStockInfo; +import com.ruoyi.sip.service.IOmsStockInfoService; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.List; + + + +/** + * @Author ch + * @Desc 备货信息(OmsStockInfo)表控制层 + * @Date 2025-10-16 09:43:37 + */ + +@Controller +@RequestMapping("/stock") +public class OmsStockInfoController extends BaseController { + private String prefix = "inventory/stock"; + @Autowired + private IOmsStockInfoService omsStockInfoService; + + + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(OmsStockInfo omsStockInfo) { + startPage(); + List list = omsStockInfoService.queryAll(omsStockInfo); + return getDataTable(list); + } + @RequiresPermissions("stock:index:view") + @GetMapping() + public String stock() + { + return prefix + "/index"; + } + + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Integer id) { + return AjaxResult.success(omsStockInfoService.queryById(id)); + } + + + + @PostMapping("/insert") + public AjaxResult add(@RequestBody OmsStockInfo omsStockInfo) { + return toAjax(omsStockInfoService.insert(omsStockInfo)); + } + + + + @PostMapping("/update") + @Log(title = "备货管理", businessType = BusinessType.UPDATE) + @ResponseBody + public AjaxResult edit(OmsStockInfo omsStockInfo) { + return toAjax(omsStockInfoService.update(omsStockInfo)); + } + + + + @Log(title = "备货管理", businessType = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + return toAjax(omsStockInfoService.batchRemove(ids.split(","))); + } + public AjaxResult remove(@PathVariable("id") Integer id) { + return toAjax(omsStockInfoService.deleteById(id)); + } + + +} diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/domain/OmsStockInfo.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/domain/OmsStockInfo.java new file mode 100644 index 00000000..05ee2992 --- /dev/null +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/domain/OmsStockInfo.java @@ -0,0 +1,43 @@ +package com.ruoyi.sip.domain; + +import lombok.Data; + +import java.util.Date; + + +/** + * 备货信息(OmsStockInfo)实体类 + * + * @author ch + * @since 2025-10-16 09:43:37 + */ +@Data +public class OmsStockInfo { + + private Integer id; + /** + * 订单编码 + */ + private String orderCode; + /** + * 备货状态 0:未备货 1:已备货 + */ + private String stockStatus; + /** + * 创建时间 + */ + private Date createTime; + + private Long allQuantity; + private Date deliveryTime; + private Date deliveryTimeStart; + private Date deliveryTimeEnd; + private String projectName; + private String projectCode; + private Long projectId; + private Long orderId; + +} + + + diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/dto/OrderExcelNumStaticsDto.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/dto/OrderExcelNumStaticsDto.java index 6d783b35..a4f1c3c8 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/dto/OrderExcelNumStaticsDto.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/dto/OrderExcelNumStaticsDto.java @@ -12,4 +12,5 @@ import java.math.BigDecimal; public class OrderExcelNumStaticsDto { private BigDecimal allPrice; private Long quantity; + private String taxRate; } diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/flowable/service/impl/TodoServiceImpl.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/flowable/service/impl/TodoServiceImpl.java index 501834d0..05511871 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/flowable/service/impl/TodoServiceImpl.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/flowable/service/impl/TodoServiceImpl.java @@ -153,8 +153,8 @@ public class TodoServiceImpl implements TodoService { }, (v1, v2) -> v1)); for (int i = 0; i < todoCompletedList.size(); i++) { Todo todoDto = todoCompletedList.get(i); - String nextApproveUserName=i==0? - todoList.stream().map(Todo::getApproveUserName).collect(Collectors.joining("、")) : todoCompletedList.get(i-1).getAllApproveUserName(); + String todoListApproveName = CollUtil.isEmpty(todoList) ? todoDto.getApplyUserName() : todoList.stream().map(Todo::getApproveUserName).collect(Collectors.joining("、")); + String nextApproveUserName = i == 0 ? todoListApproveName : todoCompletedList.get(i - 1).getAllApproveUserName(); todoDto.setNextAllApproveUserName(nextApproveUserName); todoDto.setRoleName(userRoleMap.get(Long.parseLong(todoDto.getApproveUser()))); } diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/mapper/OmsStockInfoMapper.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/mapper/OmsStockInfoMapper.java new file mode 100644 index 00000000..0d504492 --- /dev/null +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/mapper/OmsStockInfoMapper.java @@ -0,0 +1,49 @@ +package com.ruoyi.sip.mapper; + +import com.ruoyi.sip.domain.OmsStockInfo; + +import java.util.List; + +/** + * @Author ch + * @Desc 备货信息(OmsStockInfo)表数据库访问层 + * @Date 2025-10-16 09:43:37 + */ +public interface OmsStockInfoMapper { + + /** + * 通过实体作为筛选条件查询 + * + * @param omsStockInfo 实例对象 + * @return 对象列表 + */ + List queryAll(OmsStockInfo omsStockInfo); + + /** + * 根据ID查详情 + */ + OmsStockInfo queryById(Integer id); + + + /** + * 新增数据 + */ + int insert(OmsStockInfo omsStockInfo); + + + /** + * 修改数据 + */ + int update(OmsStockInfo omsStockInfo); + + /** + * 通过主键删除数据 + */ + int deleteById(Integer id); + + /** + * 通过id批量删除备货信息 + */ + int batchRemove(String[] ids); + +} diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/IOmsStockInfoService.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/IOmsStockInfoService.java new file mode 100644 index 00000000..2d98712e --- /dev/null +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/IOmsStockInfoService.java @@ -0,0 +1,48 @@ +package com.ruoyi.sip.service; + +import com.ruoyi.sip.domain.OmsStockInfo; + +import java.util.List; + +/** + * @Author ch + * @Desc 备货信息(OmsStockInfo)表服务接口 + * @Date 2025-10-16 09:43:37 + */ +public interface IOmsStockInfoService { + + /** + * 通过实体作为筛选条件查询 + */ + List queryAll(OmsStockInfo omsStockInfo); + + + /** + * 根据ID查详情 + */ + OmsStockInfo queryById(Integer id); + + /** + * 新增数据 + */ + int insert(OmsStockInfo omsStockInfo); + + /** + * 修改数据 + */ + int update(OmsStockInfo omsStockInfo); + + /** + * 通过主键删除数据 + */ + int deleteById(Integer id); + + /** + * 通过id批量删除备货信息 + */ + int batchRemove(String[] ids); + +} + + + diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/InventoryAuthServiceImpl.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/InventoryAuthServiceImpl.java index b2ebcbad..0a803f48 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/InventoryAuthServiceImpl.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/InventoryAuthServiceImpl.java @@ -2,6 +2,7 @@ package com.ruoyi.sip.service.impl; import cn.hutool.core.collection.CollUtil; +import com.ruoyi.common.core.domain.entity.SysDept; import com.ruoyi.common.core.domain.entity.SysRole; import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.exception.ServiceException; @@ -54,8 +55,11 @@ public class InventoryAuthServiceImpl implements IInventoryAuthService { @Override public boolean authAll() { SysUser sysUser = ShiroUtils.getSysUser(); - Set roleSet = Arrays.stream(allAuthRole.split(",")).filter(StringUtils::isNotEmpty).map(Long::parseLong).collect(Collectors.toSet()); - return sysUser.isAdmin() || sysUser.getRoles().stream().anyMatch(role -> roleSet.contains(role.getRoleId())); + SysDept dept = sysUser.getDept(); + if (dept == null) { + return false; + } + return sysUser.isAdmin() || dept.getAncestors().contains("0,100,") || sysUser.getDeptId() == 100; } diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/OmsStockInfoServiceImpl.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/OmsStockInfoServiceImpl.java new file mode 100644 index 00000000..dbb3fdbd --- /dev/null +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/OmsStockInfoServiceImpl.java @@ -0,0 +1,69 @@ +package com.ruoyi.sip.service.impl; + +import com.ruoyi.sip.domain.OmsStockInfo; +import com.ruoyi.sip.mapper.OmsStockInfoMapper; +import com.ruoyi.sip.service.IOmsStockInfoService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + +/** + * @Author ch + * @Desc 备货信息(OmsStockInfo)表服务实现类 + * @Date 2025-10-16 09:43:37 + */ + +@Service +public class OmsStockInfoServiceImpl implements IOmsStockInfoService { + + @Resource + private OmsStockInfoMapper omsStockInfoMapper; + + + /** + * 查询列表数据 + * @param omsStockInfo 实例对象 + * @return 对象列表 + */ + @Override + public List queryAll(OmsStockInfo omsStockInfo) { + List dataList = omsStockInfoMapper.queryAll(omsStockInfo); + return dataList; + } + + @Override + public OmsStockInfo queryById(Integer id) { + return omsStockInfoMapper.queryById(id); + } + + + @Override + public int insert(OmsStockInfo omsStockInfo) { + return omsStockInfoMapper.insert(omsStockInfo); + } + + + @Override + public int update(OmsStockInfo omsStockInfo) { + return omsStockInfoMapper.update(omsStockInfo); + } + + + @Override + public int deleteById(Integer id) { + return omsStockInfoMapper.deleteById(id); + } + + /** + * 通过id批量删除备货信息 + */ + @Override + public int batchRemove(String[] ids) { + return omsStockInfoMapper.batchRemove(ids); + } + +} + + + diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectOrderInfoServiceImpl.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectOrderInfoServiceImpl.java index 94202bc6..534e32b9 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectOrderInfoServiceImpl.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectOrderInfoServiceImpl.java @@ -41,6 +41,7 @@ import com.ruoyi.sip.dto.HomepageQueryDto; import com.ruoyi.sip.dto.OrderExcelNumStaticsDto; import com.ruoyi.sip.dto.StatisticsDetailDto; import com.ruoyi.sip.flowable.service.IBuApproveConfigService; +import com.ruoyi.sip.mapper.OmsStockInfoMapper; import com.ruoyi.sip.mapper.ProjectInfoMapper; import com.ruoyi.sip.service.*; import com.ruoyi.sip.flowable.service.DeleteFlowableProcessInstanceCmd; @@ -119,7 +120,7 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService, To private static final List CSS_EMAIL_LIST = Arrays.asList("wangxiaojun@pcitech.com", "huiwang@pcitech.com", "zhaoqian1@pcitech.com", "pci-ict@pcitech.com"); @Autowired - private IBuApproveConfigService approveConfigService; + private OmsStockInfoMapper omsStockInfoMapper; @Autowired private IProjectTaxRateTempService projectTaxRateTempService; @Value("${unis.order.endHour:96}") @@ -779,10 +780,13 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService, To // headerList.add(Collections.singletonList("订单状态")); headerList.add(Collections.singletonList("WS瘦授权软件数量-3130A6LC")); headerList.add(Collections.singletonList("WS瘦授权软件金额")); + headerList.add(Collections.singletonList("WS瘦授权软件税率")); headerList.add(Collections.singletonList("WS胖授权软件数量-3130A6LE")); headerList.add(Collections.singletonList("WS胖授权软件金额")); + headerList.add(Collections.singletonList("WS胖授权软件税率")); headerList.add(Collections.singletonList("LS软件数量-3130A6LD")); headerList.add(Collections.singletonList("LS软件金额")); + headerList.add(Collections.singletonList("LS软件税率")); addHeadList(maxOne, headerList, "ONEstor"); addHeadList(maxNvidia, headerList, "nVIDIA"); // headerList.add(Collections.singletonList("ONEstor数量")); @@ -829,6 +833,7 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService, To headerList.add(Collections.singletonList(prefix + "型号" + i)); headerList.add(Collections.singletonList(prefix + "数量" + i)); headerList.add(Collections.singletonList(prefix + "金额" + i)); + headerList.add(Collections.singletonList(prefix + "税率" + i)); } } @@ -850,11 +855,11 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService, To BigDecimal totalPrice = BigDecimal.ZERO; BigDecimal maintenancePrice = BigDecimal.ZERO; - OrderExcelNumStaticsDto wssDto = new OrderExcelNumStaticsDto(BigDecimal.ZERO, 0L); - OrderExcelNumStaticsDto wspDto = new OrderExcelNumStaticsDto(BigDecimal.ZERO, 0L); - OrderExcelNumStaticsDto lsDto = new OrderExcelNumStaticsDto(BigDecimal.ZERO, 0L); - OrderExcelNumStaticsDto oneStorDto = new OrderExcelNumStaticsDto(BigDecimal.ZERO, 0L); - OrderExcelNumStaticsDto nVIDIADto = new OrderExcelNumStaticsDto(BigDecimal.ZERO, 0L); + OrderExcelNumStaticsDto wssDto = new OrderExcelNumStaticsDto(BigDecimal.ZERO, 0L,""); + OrderExcelNumStaticsDto wspDto = new OrderExcelNumStaticsDto(BigDecimal.ZERO, 0L,""); + OrderExcelNumStaticsDto lsDto = new OrderExcelNumStaticsDto(BigDecimal.ZERO, 0L,""); + OrderExcelNumStaticsDto oneStorDto = new OrderExcelNumStaticsDto(BigDecimal.ZERO, 0L,""); + OrderExcelNumStaticsDto nVIDIADto = new OrderExcelNumStaticsDto(BigDecimal.ZERO, 0L,""); List maintenanceList = new ArrayList<>(); List deployList = new ArrayList<>(); List oneList = new ArrayList<>(); @@ -919,10 +924,13 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService, To int insertIndex=18; row.add(insertIndex++, wssDto.getQuantity().toString()); row.add(insertIndex++, wssDto.getAllPrice().toString()); + row.add(insertIndex++, wssDto.getTaxRate()); row.add(insertIndex++, wspDto.getQuantity().toString()); row.add(insertIndex++, wspDto.getAllPrice().toString()); + row.add(insertIndex++, wspDto.getTaxRate()); row.add(insertIndex++, lsDto.getQuantity().toString()); row.add(insertIndex++, lsDto.getAllPrice().toString()); + row.add(insertIndex++, lsDto.getTaxRate()); for (int i = 0; i < maxOne; i++) { ProjectProductInfo projectProductInfo = i < oneList.size() ? oneList.get(i) : null; insertIndex = addProductRowByIndex(projectProductInfo, row, insertIndex); @@ -1010,6 +1018,7 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService, To Long dtoQuantity = dto.getQuantity() == null ? 0L : dto.getQuantity(); dto.setAllPrice(allPrice.add(dtoAllPrice)); dto.setQuantity(quantity + dtoQuantity); + dto.setTaxRate(info.getTaxRate()==null?"":info.getTaxRate().toString()); } } @@ -1026,12 +1035,14 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService, To row.add(""); row.add(""); row.add(""); + row.add(""); return totalPrice; } row.add(productInfo.getProductBomCode()); row.add(productInfo.getModel()); row.add(productInfo.getQuantity() == null ? "" : productInfo.getQuantity().toString()); row.add(productInfo.getAllPrice() == null ? "" : productInfo.getAllPrice().toString()); + row.add(productInfo.getTaxRate() == null ? "" : productInfo.getTaxRate().toString()); if (productInfo.getAllPrice() != null) { totalPrice = totalPrice.add(productInfo.getAllPrice()); } @@ -1044,12 +1055,14 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService, To row.add(index++, ""); row.add(index++, ""); row.add(index++, ""); + row.add(index++, ""); return index; } row.add(index++, productInfo.getProductBomCode()); row.add(index++, productInfo.getModel()); row.add(index++, productInfo.getQuantity() == null ? "" : productInfo.getQuantity().toString()); row.add(index++, productInfo.getAllPrice() == null ? "" : productInfo.getAllPrice().toString()); + row.add(index++, productInfo.getTaxRate() == null ? "" : productInfo.getTaxRate().toString()); return index; } @@ -1106,26 +1119,50 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService, To // handleProductManagerApproval(businessKey); } else if (taskName.startsWith("商务")) { handleBusinessApproval(businessKey); + } else if ("省代".equals(taskName)) { + handlePartnerApproval(businessKey); + } else if ("公司领导".equals(taskName)) { + + //黄雪秋处理 流程状态更改 + if (ShiroUtils.getUserId().equals(118L)) { + handleCompanyLeaderApproval(businessKey); + } + } + + } return TodoCommonTemplate.super.todoApproveCallback(todo); } - @Override - public boolean multiInstanceApproveCallback(String activityName,ProcessInstance processInstance) { - String flowBusinessKey = processInstance.getBusinessKey(); - String[] split = flowBusinessKey.split("#"); - String businessKey = split.length > 1 ? split[1] : split[0]; - Map processVariables = processInstance.getProcessVariables(); - Integer approveBtn = (Integer) processVariables.get("approveBtn"); - if ("公司领导".equals(activityName) && approveBtn == 1) { - handleCompanyLeaderApproval(businessKey); - } + private void handlePartnerApproval(String businessKey) { +// ProjectOrderInfo dbProjectOrderInfo = projectOrderInfoMapper.selectProjectOrderInfoByCode(businessKey); + addStock(businessKey); - return TodoCommonTemplate.super.multiInstanceApproveCallback(activityName,processInstance); } + + private void addStock(String businessKey) { + OmsStockInfo omsStockInfo = new OmsStockInfo(); + omsStockInfo.setOrderCode(businessKey); + omsStockInfoMapper.insert(omsStockInfo); + } + +// @Override +// public boolean multiInstanceApproveCallback(String activityName,ProcessInstance processInstance) { +// String flowBusinessKey = processInstance.getBusinessKey(); +// String[] split = flowBusinessKey.split("#"); +// String businessKey = split.length > 1 ? split[1] : split[0]; +// Map processVariables = processInstance.getProcessVariables(); +// Integer approveBtn = (Integer) processVariables.get("approveBtn"); +// if ("公司领导".equals(activityName) && approveBtn == 1) { +// handleCompanyLeaderApproval(businessKey); +// } +// +// return TodoCommonTemplate.super.multiInstanceApproveCallback(activityName,processInstance); +// } + /** * 处理订单驳回 */ @@ -1136,6 +1173,7 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService, To if ("公司领导".equals(taskName)) { projectOrderInfo.setVersionCode("add"); + //todo 陈鹏驳回需要单独处理 现有流程为 陈鹏黄雪秋并行审批 但黄雪秋审批完成流程已经下行 陈鹏驳回时如黄雪秋已审批通过时需要特殊处理 } handleRejectOrder(businessKey); projectOrderInfoMapper.updateProjectOrderInfoByCode(projectOrderInfo); @@ -1163,7 +1201,9 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService, To private void handleBusinessApproval(String businessKey) { ProjectOrderInfo dbProjectOrderInfo = projectOrderInfoMapper.selectProjectOrderInfoByCode(businessKey); - + if (ProjectOrderInfo.ProcessTypeEnum.OFFLINE.getCode().equals(dbProjectOrderInfo.getProcessType())) { + addStock(businessKey); + } // 查询代理商邮箱 List emailList = new ArrayList<>(); diff --git a/ruoyi-sip/src/main/resources/mapper/sip/OmsStockInfoMapper.xml b/ruoyi-sip/src/main/resources/mapper/sip/OmsStockInfoMapper.xml new file mode 100644 index 00000000..cedc7ac1 --- /dev/null +++ b/ruoyi-sip/src/main/resources/mapper/sip/OmsStockInfoMapper.xml @@ -0,0 +1,150 @@ + + + + + + + + + + + + + + id, order_code, stock_status, create_time + + + + + + + + + + + + + INSERT INTO oms_stock_info + + + order_code, + + + stock_status, + + + create_time, + + + + + #{orderCode}, + + + #{stockStatus}, + + + #{createTime}, + + + + + + + UPDATE oms_stock_info + + + order_code = #{orderCode}, + + + stock_status = #{stockStatus}, + + + create_time = #{createTime}, + + + WHERE id = #{id} + + + + + DELETE + FROM oms_stock_info + WHERE id = #{id} + + + + + delete from oms_stock_info where id in + + #{id} + + + + + + +