diff --git a/ruoyi-admin/src/main/resources/templates/inventory/delivery/delivery.html b/ruoyi-admin/src/main/resources/templates/inventory/delivery/delivery.html index 89c59390..a2b6b26f 100644 --- a/ruoyi-admin/src/main/resources/templates/inventory/delivery/delivery.html +++ b/ruoyi-admin/src/main/resources/templates/inventory/delivery/delivery.html @@ -137,7 +137,7 @@ align: 'center', formatter: function (value, row, index) { var actions = []; - actions.push('发货记录 '); + actions.push('发货记录 '); return actions.join(''); } 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 2b24e196..50be29d6 100644 --- a/ruoyi-admin/src/main/resources/templates/inventory/execution/edit.html +++ b/ruoyi-admin/src/main/resources/templates/inventory/execution/edit.html @@ -519,7 +519,7 @@ formatter: function (value, row, index) { var actions = []; let disabled = Number(row.quantity) <= Number(row.generatedQuantity) + Number(row.confirmQuantity) - actions.push(`出库`); return actions.join(''); } @@ -761,13 +761,13 @@ function initWarehouseTable(data) { formatter: function (value, row, index) { var actions = []; if (row.outerStatus === '1' || row.outerStatus === '4') { - actions.push(`撤销`); - actions.push(`确认出库`); + actions.push(`撤销`); + actions.push(`确认出库`); } else { // actions.push('查看详情'); - actions.push(`查看详情`); + actions.push(`查看详情`); } return actions.join(''); } diff --git a/ruoyi-admin/src/main/resources/templates/inventory/outer/edit.html b/ruoyi-admin/src/main/resources/templates/inventory/outer/edit.html index 7eb77645..bdf9ee95 100644 --- a/ruoyi-admin/src/main/resources/templates/inventory/outer/edit.html +++ b/ruoyi-admin/src/main/resources/templates/inventory/outer/edit.html @@ -112,8 +112,8 @@
- - + +
物流单号: 发货方式: + + + + +
+
+ +
+ +
-
@@ -111,6 +123,28 @@ $.operate.save(prefix + "/add", $('#form-partner-add').serialize()); } } + function selectPeople() { + var url = ctx + "sip/project/selectPeople"; + var options = { + title: '选择责任人', + width: "800", + height: '600', + url: url, + callBack: doSubmitPeople + }; + $.modal.openOptions(options); + } + function doSubmitPeople(index, layero) { + var rows = layero.find("iframe")[0].contentWindow.getSelections(); + if (rows.length == 0) { + $.modal.alertWarning("请选择一个用户"); + return; + } + $('[name="systemUserId"]').val(rows[0].userId); + $('[name="systemUserName"]').val(rows[0].userName); + + $.modal.close(index); + } \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/partner/edit.html b/ruoyi-admin/src/main/resources/templates/system/partner/edit.html index c2e49282..420b20b1 100644 --- a/ruoyi-admin/src/main/resources/templates/system/partner/edit.html +++ b/ruoyi-admin/src/main/resources/templates/system/partner/edit.html @@ -65,6 +65,15 @@
+
+
+ +
+ + +
+
+
@@ -110,6 +119,29 @@ selects: ['province', 'city'], nodata: 'none' }); + function selectPeople() { + var url = ctx + "sip/project/selectPeople"; + var options = { + title: '选择责任人', + width: "800", + height: '600', + url: url, + callBack: doSubmitPeople + }; + $.modal.openOptions(options); + } + function doSubmitPeople(index, layero) { + var rows = layero.find("iframe")[0].contentWindow.getSelections(); + if (rows.length == 0) { + $.modal.alertWarning("请选择一个用户"); + return; + } + $('[name="systemUserId"]').val(rows[0].userId); + $('[name="systemUserName"]').val(rows[0].userName); + + $.modal.close(index); + } + \ No newline at end of file diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/domain/PartnerInfo.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/domain/PartnerInfo.java index 54db2327..99c7c1f6 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/domain/PartnerInfo.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/domain/PartnerInfo.java @@ -43,6 +43,8 @@ public class PartnerInfo extends BaseEntity /** 联系人 */ @Excel(name = "联系人") private String contactPerson; + private String systemUserId; + private String systemUserName; /** 联系电话 */ @Excel(name = "联系电话") diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/domain/ProjectOrderInfo.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/domain/ProjectOrderInfo.java index c8a0fd36..ba7e83f5 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/domain/ProjectOrderInfo.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/domain/ProjectOrderInfo.java @@ -212,6 +212,8 @@ public class ProjectOrderInfo extends BaseEntity { private String partnerEmail; private String partnerUserName; private String partnerPhone; + private String systemUserId; + private String level; /** * 订单处理方式 0:电子订单 1:纸质订单 diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/mapper/PartnerInfoMapper.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/mapper/PartnerInfoMapper.java index a31a6725..542da8de 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/mapper/PartnerInfoMapper.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/mapper/PartnerInfoMapper.java @@ -18,6 +18,7 @@ public interface PartnerInfoMapper * @return 供应商管理 */ public PartnerInfo selectPartnerInfoById(Long id); + public List selectPartnerInfoByCode(List codeList); /** * 查询供应商管理列表 diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/IPartnerInfoService.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/IPartnerInfoService.java index 41f3fded..c40cac6b 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/IPartnerInfoService.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/IPartnerInfoService.java @@ -18,6 +18,7 @@ public interface IPartnerInfoService * @return 供应商管理 */ public PartnerInfo selectPartnerInfoById(Long id); + public List selectPartnerInfoByCode(List codeList); /** * 查询供应商管理列表 diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ExecutionTrackServiceImpl.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ExecutionTrackServiceImpl.java index 6a101d3b..cab94a73 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ExecutionTrackServiceImpl.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ExecutionTrackServiceImpl.java @@ -194,7 +194,7 @@ public class ExecutionTrackServiceImpl implements IExecutionTrackService { // 如果默认仓库不在现有列表中,创建一个新的条目 ProductWarehouseInfo defaultWarehouseInfo = new ProductWarehouseInfo(); defaultWarehouseInfo.setWarehouseId(defaultVendor.getWarehouseId()); - defaultWarehouseInfo.setWarehouseName(defaultVendor.getVendorName()); + defaultWarehouseInfo.setWarehouseName(defaultVendor.getWarehouseName()); // 这里假设默认仓库有足够库存,实际应用中可能需要查询具体库存 List productInfos = productInfoService.selectProductInfoByCodeList(Collections.singletonList(productCode)); defaultWarehouseInfo.setAvailableCount(productInfos.get(0).getAvailableCount() == null ? 0L : productInfos.get(0).getAvailableCount()); diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/InventoryOuterServiceImpl.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/InventoryOuterServiceImpl.java index 258b74e1..ff6bc038 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/InventoryOuterServiceImpl.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/InventoryOuterServiceImpl.java @@ -107,15 +107,21 @@ public class InventoryOuterServiceImpl implements IInventoryOuterService @Override public int insertInventoryOuter(InventoryOuter inventoryOuter) { + List detailList = inventoryOuter.getDetailList(); + if (CollUtil.isEmpty(detailList)) { + throw new ServiceException("出库单详情为空,保存失败"); + } + for (InventoryOuterDetail inventoryOuterDetail : detailList) { + if (inventoryOuterDetail.getWarehouseId()==null){ + throw new ServiceException("请选择仓库"); + } + } inventoryOuter.setOuterCode(generateOutCode()); inventoryOuter.setDeliveryStatus(InventoryOuter.DeliveryStatusEnum.WAIT_DELIVERY.getCode()); inventoryOuter.setOuterStatus(InventoryOuter.OuterStatusEnum.WAIT_CONFIRM.getCode()); inventoryOuter.setCreateBy(ShiroUtils.getUserId().toString()); inventoryOuter.setCreateTime(DateUtils.getNowDate()); - List detailList = inventoryOuter.getDetailList(); - if (CollUtil.isEmpty(detailList)) { - throw new ServiceException("出库单详情为空,保存失败"); - } + for (InventoryOuterDetail inventoryOuterDetail : detailList) { inventoryOuterDetail.setOuterCode(inventoryOuter.getOuterCode()); } @@ -201,12 +207,10 @@ public class InventoryOuterServiceImpl implements IInventoryOuterService List projectProductInfos = projectProductInfoService.listDeliveryProductByOrderCode(Collections.singletonList(inventoryOuter.getOrderCode())); //软硬件之和 long sum = projectProductInfos.stream().mapToLong(ProjectProductInfo::getQuantity).sum(); - - List list = inventoryOuterMapper.selectInventoryOuterList(queryDto); - long count = list.stream().filter(item -> + long count = list.stream().filter(item ->(item.getId().equals(inventoryOuter.getId()))|| //已确认和已接收数量 - InventoryOuter.OuterStatusEnum.WAIT_RECEIVE.getCode().equals(item.getOuterStatus()) || !InventoryOuter.OuterStatusEnum.RECEIVED.getCode().equals(item.getOuterStatus())) + InventoryOuter.OuterStatusEnum.WAIT_RECEIVE.getCode().equals(item.getOuterStatus()) || InventoryOuter.OuterStatusEnum.RECEIVED.getCode().equals(item.getOuterStatus())) .mapToLong(InventoryOuter::getQuantity).sum(); //部分接收 if (count == 0L) { diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/PartnerInfoServiceImpl.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/PartnerInfoServiceImpl.java index 9dce6f71..558b94d2 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/PartnerInfoServiceImpl.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/PartnerInfoServiceImpl.java @@ -3,6 +3,7 @@ package com.ruoyi.sip.service.impl; import java.util.Collections; import java.util.List; +import cn.hutool.core.collection.CollUtil; import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.utils.ShiroUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -36,6 +37,14 @@ public class PartnerInfoServiceImpl implements IPartnerInfoService return partnerInfoMapper.selectPartnerInfoById(id); } + @Override + public List selectPartnerInfoByCode(List codeList) { + if (CollUtil.isEmpty(codeList)){ + return Collections.emptyList(); + } + return partnerInfoMapper.selectPartnerInfoByCode(codeList); + } + /** * 查询供应商管理列表 * 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 0eccb130..0fe2ee46 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 @@ -10,6 +10,7 @@ import java.util.stream.Collectors; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.date.DateUtil; import cn.hutool.core.lang.Dict; +import cn.hutool.core.util.StrUtil; import com.alibaba.excel.EasyExcel; import com.alibaba.excel.metadata.CellData; import com.alibaba.excel.metadata.Head; @@ -345,6 +346,10 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService, To fileLogService.deleteProjectOrderFileLogByIds(deleteFileId); } if (ProjectOrderInfo.OrderStatus.WAIT_APPROVE.getCode().equals(projectOrderInfo.getOrderStatus())) { + List partnerInfos = partnerInfoService.selectPartnerInfoByCode(Collections.singletonList(projectOrderInfo.getPartnerCode())); + if (CollUtil.isEmpty(partnerInfos) || StringUtils.isEmpty(partnerInfos.get(0).getSystemUserId())) { + throw new ServiceException(StrUtil.format("代理商配置[{}]未指定系统用户,无法提交审批", existProjectOrderInfo.getPartnerName())); + } List processInstanceList = todoService.listProcessInstance(existProjectOrderInfo.getOrderCode()); if (CollUtil.isNotEmpty(processInstanceList)) { for (ProcessInstance processInstance : processInstanceList) { @@ -362,6 +367,7 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService, To put("processTemplate", projectOrderInfo.getProcessTemplate()); put("applyUserName", ShiroUtils.getSysUser().getUserName()); put("applyUser", ShiroUtils.getUserId()); + put("partnerUser", existProjectOrderInfo.getSystemUserId()); put("extendField1", projectOrderInfo.getVersionCode()); }}, orderFlowKey); complete(null, null, getFlowBusinessKey(existProjectOrderInfo.getOrderCode(), projectOrderInfo.getProcessType())); diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/utils/TemplateMailUtil.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/utils/TemplateMailUtil.java index 06af7e85..58cc6d34 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/utils/TemplateMailUtil.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/utils/TemplateMailUtil.java @@ -42,7 +42,7 @@ public class TemplateMailUtil { */ public static void sendTemplateMail(List toEmail, String title, MailTemplate path, Dict dict) { String enabled = SpringUtils.getProperty("unis.mail.enabled", "false"); - if (!Boolean.getBoolean(enabled)) { + if (!Boolean.parseBoolean(enabled)) { log.warn("邮件发送开关未开启"); return; } diff --git a/ruoyi-sip/src/main/resources/mapper/sip/ProjectOrderInfoMapper.xml b/ruoyi-sip/src/main/resources/mapper/sip/ProjectOrderInfoMapper.xml index b62c6ad1..8ff9f23b 100644 --- a/ruoyi-sip/src/main/resources/mapper/sip/ProjectOrderInfoMapper.xml +++ b/ruoyi-sip/src/main/resources/mapper/sip/ProjectOrderInfoMapper.xml @@ -54,7 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" t1.delivery_status,t1.sign_status,t1.outer_status,t1.approve_time ,t2.project_code,t2.project_name,t2.province,t2.customer_name,t2.customer_code,t2.industry_type,t2.bg_property,t2.agent_code,t2.estimated_order_time ,t2.customer_phone,t2.customer_user_name,t2.agent_code,t2.customer_code,t2.partner_name project_partner_name - ,t3.partner_name,t3.level + ,t3.partner_name,t3.level,t3.system_user_id ,t4.agent_name ,t5.user_name as duty_name from project_order_info t1 diff --git a/ruoyi-sip/src/main/resources/mapper/system/PartnerInfoMapper.xml b/ruoyi-sip/src/main/resources/mapper/system/PartnerInfoMapper.xml index d4c5f8d5..4420c131 100644 --- a/ruoyi-sip/src/main/resources/mapper/system/PartnerInfoMapper.xml +++ b/ruoyi-sip/src/main/resources/mapper/system/PartnerInfoMapper.xml @@ -21,23 +21,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select id, partner_code, partner_name, contact_email,province, city, address, contact_person, contact_phone, level, create_at, update_at, delete_at, status from partner_info + select t1.id, t1.partner_code, t1.partner_name, t1.contact_email,t1.province, t1.city, t1.address, t1.contact_person, t1.contact_phone + , t1.level, t1.create_at, t1.update_at, t1.delete_at, t1.status,t1.system_user_id,t2.user_name as system_user_name + from partner_info t1 left join sys_user t2 on t1.system_user_id=t2.user_id +