Browse Source

[feat]

出货设备数据库表、实体类、mapper.xml层查找、插入和修改操作都加上 isConfirmReceivingFlag字段
销售出货通知前端页面新增 确认收货按钮和其接口方法
新增业务确认收货前端页面,实现如果有多个销售单号就显示多个,下面的物料分为成品和其他类型,成品的物料分开展示,设置本次出货数为1,每个设备只能签收一次,如果已经签收,则显示已出货,不可编辑;其他物料不必分开展示,但是也要实现如果已经签收,则显示已出货,不可编辑;
新增 客户确认收货物料详情Vo类继承销售出货通知详情表,加上shippingDeviceId和 snCode字段
销售出货通知Controller层新增 确认收货后端接口;新增 修改保存确认收货后端接口;
iml层新增 展示确认收货物料详情实现:把物料按照成品和其他类型进行展示,成品关联设备表,如果设备的IsConfirmReceivingFlag字段的值为0,就设置已出货数为1,否则设置为0;本次出货数和已出库数都要设置为1;并且最后得到的集合中,没有设备id的成品会被从列表中移除;其他类型的物料正常展示;
新增修改保存收货后端方法:实现,把从前端传入的数据,按照有设备id和没有设备id的数据进行分组,分别处理;没有设备id的,设置已收货前都要查询数据库中已有的数据,没有值,就为本次收货的数据,有值就进行合计,并且已收货数和本次收货数之和不能大于本次出货数;有设备id的,首先要过滤掉已收货数为1的数据,然后判断 本次收货数量只能为0或1。因为是同一个料号要累加本次收货数,最后统一更新已出货数
销售订单后端新增 通过销售订单号集合查询销售订单集合方法
dev
liuxiaoxu 2 weeks ago
parent
commit
bd61d23e79
  1. 14
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/AfterSalesShippingDevice.java
  2. 65
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesShippingInformController.java
  3. 19
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/ConfirmReceivingDetailVo.java
  4. 4
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSalesOrderMapper.java
  5. 5
      ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesOrderService.java
  6. 13
      ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesShippingInformService.java
  7. 10
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderServiceImpl.java
  8. 196
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformServiceImpl.java
  9. 6
      ruoyi-admin/src/main/resources/mapper/aftersales/AfterSalesShippingDeviceMapper.xml
  10. 7
      ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderMapper.xml
  11. 301
      ruoyi-admin/src/main/resources/templates/system/salesShippingInform/confirmReceiving.html
  12. 21
      ruoyi-admin/src/main/resources/templates/system/salesShippingInform/salesShippingInform.html

14
ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/AfterSalesShippingDevice.java

@ -166,6 +166,10 @@ public class AfterSalesShippingDevice extends BaseEntity
/** 是否添加出货设备(0代表是 1代表否) */
private String addShippingDeviceFlag;
/** 是否确认收货(0代表是 1代表否) 业务确认收货的时候使用 */
private String isConfirmReceivingFlag;
//生产开始时间
private Date startMakeTime;
@ -531,6 +535,15 @@ public class AfterSalesShippingDevice extends BaseEntity
this.outOrderCode = outOrderCode;
}
public String getIsConfirmReceivingFlag() {
return isConfirmReceivingFlag;
}
public void setIsConfirmReceivingFlag(String isConfirmReceivingFlag) {
this.isConfirmReceivingFlag = isConfirmReceivingFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@ -574,6 +587,7 @@ public class AfterSalesShippingDevice extends BaseEntity
.append("updateTime", getUpdateTime())
.append("addShippingDeviceFlag",getAddShippingDeviceFlag())
.append("outOrderCode",getOutOrderCode())
.append("isConfirmReceivingFlag",getIsConfirmReceivingFlag())
.toString();
}
}

65
ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesShippingInformController.java

@ -1,16 +1,18 @@
package com.ruoyi.system.controller;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
import com.ruoyi.aftersales.domain.vo.SelectShippingDeviceVO;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.erp.domain.ErpBom;
import com.ruoyi.erp.domain.ErpBomVo;
import com.ruoyi.purchase.domain.PurchaseOrder;
import com.ruoyi.system.domain.SysSalesOrder;
import com.ruoyi.system.domain.SysSalesOrderVo;
import com.ruoyi.system.domain.SysSalesShippingInformDetail;
import com.ruoyi.system.domain.Vo.ConfirmReceivingDetailVo;
import com.ruoyi.system.service.ISysSalesOrderService;
import com.ruoyi.system.service.ISysSalesShippingInformDetailService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
@ -47,6 +49,9 @@ public class SysSalesShippingInformController extends BaseController
@Autowired
private ISysSalesShippingInformDetailService shippingInformDetailService;
@Autowired
private ISysSalesOrderService sysSalesOrderService;
@RequiresPermissions("system:salesShippingInform:view")
@GetMapping()
public String salesShippingInform()
@ -334,6 +339,60 @@ public class SysSalesShippingInformController extends BaseController
return toAjax(sysSalesShippingInformService.updateCancelShipping(sysSalesShippingInform));
}
/**
* 确认收货
*/
@GetMapping("/confirmReceiving/{shippingInformId}")
public String confirmReceiving(@PathVariable("shippingInformId") Long shippingInformId, ModelMap mmap)
{
SysSalesShippingInform sysSalesShippingInform = sysSalesShippingInformService.selectSysSalesShippingInformById(shippingInformId);
List<SysSalesOrder> sysSalesOrders = new ArrayList<>();
String salesOrderCode = sysSalesShippingInform.getSalesOrderCode();
List<String> salesOrderCodes = new ArrayList<>();
if (StringUtils.isNotEmpty(salesOrderCode)){
String[] splitSalesOrderCode = salesOrderCode.split(",");
salesOrderCodes = Arrays.asList(splitSalesOrderCode);
}
sysSalesOrders = sysSalesOrderService.selectSysSalesOrderListByCodeList(salesOrderCodes);
mmap.put("sysSalesOrders", sysSalesOrders);
mmap.put("sysSalesShippingInform", sysSalesShippingInform);
return prefix + "/confirmReceiving";
}
/**
* 修改保存确认收货
*/
@RequiresPermissions("system:salesShippingInform:confirmReceiving")
@Log(title = "销售确认收货", businessType = BusinessType.UPDATE)
@PostMapping("/confirmReceiving")
@ResponseBody
public AjaxResult confirmReceivingSave(@RequestBody SysSalesShippingInform sysSalesShippingInform)
{
return toAjax(sysSalesShippingInformService.updateConfirmReceiving(sysSalesShippingInform));
}
/**
* 客户确认发货 物料信息详情
*/
@PostMapping("/confirmReceivingDetailList")
@ResponseBody
public TableDataInfo confirmReceivingDetailList(SysSalesShippingInform sysSalesShippingInform)
{
startPage();
List<ConfirmReceivingDetailVo> list = sysSalesShippingInformService.confirmReceivingDetailList(sysSalesShippingInform);
return getDataTable(list);
}
/**
* 客户验收
*/

19
ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/ConfirmReceivingDetailVo.java

@ -0,0 +1,19 @@
package com.ruoyi.system.domain.Vo;
import com.ruoyi.system.domain.SysSalesShippingInformDetail;
import lombok.Data;
/**
* 客户确认收货物料详情Vo类
* */
@Data
public class ConfirmReceivingDetailVo extends SysSalesShippingInformDetail {
/** 出货设备id */
private String shippingDeviceId;
/** SN号 */
private String snCode;
}

4
ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSalesOrderMapper.java

@ -92,4 +92,8 @@ public interface SysSalesOrderMapper
* */
List<SysSalesOrder> selectBatchSalesOrderById(List<Long> salesOrderIds);
/**
* 通过销售订单code批量查询销售订单
* */
List<SysSalesOrder> selectSysSalesOrderListByCodeList(List<String> salesOrderCodes);
}

5
ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesOrderService.java

@ -143,4 +143,9 @@ public interface ISysSalesOrderService
* 通过销售订单id批量查询销售订单
* */
List<SysSalesOrder> selectBatchSalesOrderById(List<Long> salesOrderIds);
/**
* 通过销售订单号集合查询销售订单集合
* */
List<SysSalesOrder> selectSysSalesOrderListByCodeList(List<String> salesOrderCodes);
}

13
ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesShippingInformService.java

@ -5,6 +5,7 @@ import java.util.List;
import com.ruoyi.system.domain.SysSalesOrder;
import com.ruoyi.system.domain.SysSalesShippingInform;
import com.ruoyi.system.domain.SysSalesShippingInformDetail;
import com.ruoyi.system.domain.Vo.ConfirmReceivingDetailVo;
import javax.servlet.http.HttpServletResponse;
@ -148,4 +149,16 @@ public interface ISysSalesShippingInformService
* 导出出货发票2模板
* */
void exportShippingInvoiceTwo(String outOrderCode, HttpServletResponse response);
/**
* 确认收货
* */
int updateConfirmReceiving(SysSalesShippingInform sysSalesShippingInform);
/**
* 展示确认收货物料详情
* */
List<ConfirmReceivingDetailVo> confirmReceivingDetailList(SysSalesShippingInform sysSalesShippingInform);
}

10
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderServiceImpl.java

@ -141,6 +141,16 @@ public class SysSalesOrderServiceImpl implements ISysSalesOrderService
return sysSalesOrders;
}
/**
* 通过销售订单号集合查询销售订单集合
* */
@Override
public List<SysSalesOrder> selectSysSalesOrderListByCodeList(List<String> salesOrderCodes) {
List<SysSalesOrder> sysSalesOrders = sysSalesOrderMapper.selectSysSalesOrderListByCodeList(salesOrderCodes);
return sysSalesOrders;
}
/**
* 查询销售订单列表
*

196
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformServiceImpl.java

@ -26,6 +26,7 @@ import com.ruoyi.common.utils.file.FileDownloadUtils;
import com.ruoyi.sales.domain.SalesShippingInformation;
import com.ruoyi.sales.mapper.SalesShippingInformationMapper;
import com.ruoyi.system.domain.*;
import com.ruoyi.system.domain.Vo.ConfirmReceivingDetailVo;
import com.ruoyi.system.dto.ExportShippingInformOrderDto;
import com.ruoyi.system.dto.ExportShippingInvoiceDto;
import com.ruoyi.system.dto.ExportShippingOrderDto;
@ -34,11 +35,13 @@ import com.ruoyi.system.mapper.*;
import com.ruoyi.warehouse.domain.WarehouseOutOrder;
import com.ruoyi.warehouse.mapper.WarehouseOutOrderMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.service.ISysSalesShippingInformService;
import com.ruoyi.common.core.text.Convert;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.servlet.http.HttpServletResponse;
@ -374,6 +377,198 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor
return 1;
}
/**
* 修改保存确认收货
*/
@Transactional(rollbackFor = Exception.class)
@Override
public int updateConfirmReceiving(SysSalesShippingInform sysSalesShippingInform) {
String loginName = ShiroUtils.getLoginName();
List<SysSalesShippingInformDetail> shippingInformDetailList = sysSalesShippingInform.getShippingInformDetailList();
boolean anyNullThisReceivingNum = shippingInformDetailList.stream().anyMatch(item -> item.getThisReceivingNum() == null);
if (anyNullThisReceivingNum){
throw new BusinessException("请填写每个本次收货数");
}
// 分组:有 shippingDeviceId 和没有 shippingDeviceId
Map<Boolean, List<SysSalesShippingInformDetail>> groupedDetails = shippingInformDetailList.stream()
.collect(Collectors.partitioningBy(detail -> detail.getShippingDeviceId() != null));
List<SysSalesShippingInformDetail> withShippingDeviceIdList = groupedDetails.getOrDefault(true, new ArrayList<>());
List<SysSalesShippingInformDetail> withoutShippingDeviceIdList = groupedDetails.getOrDefault(false, new ArrayList<>());
// 处理没有出货设备ID的数据
processWithoutShippingDeviceId(withoutShippingDeviceIdList);
// 处理有出货设备ID的数据
processWithShippingDeviceId(withShippingDeviceIdList);
//更新收货维护设备出库单数据
AftersalesOutOrder aftersalesOutOrder = new AftersalesOutOrder();
aftersalesOutOrder.setOutOrderCode(sysSalesShippingInform.getOutOrderCode());
//设置为待验收
aftersalesOutOrder.setWarehouseOutStatus("10");
aftersalesOutOrder.setUpdateBy(loginName);
aftersalesOutOrder.setUpdateTime(new Date());
int updateAftersalesOutOrderResult = aftersalesOutOrderMapper.updateAftersalesOutOrderByOutOrderCode(aftersalesOutOrder);
if (updateAftersalesOutOrderResult <= 0){
throw new BusinessException("更新售后出库单数据失败");
}
return updateAftersalesOutOrderResult;
}
private void processWithoutShippingDeviceId(List<SysSalesShippingInformDetail> withoutShippingDeviceIdList) {
for (SysSalesShippingInformDetail sysSalesShippingInformDetail : withoutShippingDeviceIdList) {
Long shippingInformDetailId = sysSalesShippingInformDetail.getShippingInformDetailId();
SysSalesShippingInformDetail tempShippingInformDetail = shippingInformDetailMapper.selectSysSalesShippingInformDetailById(shippingInformDetailId);
if (tempShippingInformDetail.getHasReceivingNum() == null || tempShippingInformDetail.getHasReceivingNum() == 0) {
sysSalesShippingInformDetail.setHasReceivingNum(sysSalesShippingInformDetail.getThisReceivingNum());
} else {
sysSalesShippingInformDetail.setHasReceivingNum(tempShippingInformDetail.getHasReceivingNum() + sysSalesShippingInformDetail.getThisReceivingNum());
}
if (sysSalesShippingInformDetail.getHasReceivingNum() > sysSalesShippingInformDetail.getThisShippingNum()) {
throw new BusinessException("已收货数和本次收货数之和不能大于本次出货数");
}
sysSalesShippingInformDetail.setThisReceivingNum(null);
int updateShippingInformDetailResult = shippingInformDetailMapper.updateSysSalesShippingInformDetail(sysSalesShippingInformDetail);
if (updateShippingInformDetailResult <= 0) {
throw new BusinessException("更新销售出货通知单详情数据失败");
}
}
}
private void processWithShippingDeviceId(List<SysSalesShippingInformDetail> withShippingDeviceIdList) {
String loginName = ShiroUtils.getLoginName();
List<SysSalesShippingInformDetail> filterShippingDeviceIdList = withShippingDeviceIdList.stream()
.filter(item -> item.getHasReceivingNum() != 1)
.collect(Collectors.toList());
// 判断是否有收货数量大于1,因为收货数量要么为0要么为1
boolean anyThisReceivingNum = filterShippingDeviceIdList.stream().anyMatch(item -> item.getThisReceivingNum() > 1);
if (anyThisReceivingNum){
throw new BusinessException("本次收货数量只能为0或1");
}
for (SysSalesShippingInformDetail sysSalesShippingInformDetail : filterShippingDeviceIdList) {
String shippingDeviceId = sysSalesShippingInformDetail.getShippingDeviceId();
AfterSalesShippingDevice afterSalesShippingDevice = salesShippingDeviceMapper.selectAfterSalesShippingDeviceByShippingDeviceId(shippingDeviceId);
if (sysSalesShippingInformDetail.getThisReceivingNum() == 1){
afterSalesShippingDevice.setIsConfirmReceivingFlag("0"); //设置已添加
}
afterSalesShippingDevice.setUpdateBy(loginName);
afterSalesShippingDevice.setUpdateTime(new Date());
int updateShippingDeviceResult = salesShippingDeviceMapper.updateAfterSalesShippingDevice(afterSalesShippingDevice);
if (updateShippingDeviceResult <= 0){
throw new BusinessException("更新出货设备数据失败");
}
}
Integer allReceivingNum = filterShippingDeviceIdList.stream()
.mapToInt(SysSalesShippingInformDetail::getThisReceivingNum)
.sum();
SysSalesShippingInformDetail sysSalesShippingInformDetail = filterShippingDeviceIdList.get(0);
Long shippingInformDetailId = sysSalesShippingInformDetail.getShippingInformDetailId();
SysSalesShippingInformDetail tempShippingInformDetail = shippingInformDetailMapper.selectSysSalesShippingInformDetailById(shippingInformDetailId);
if (tempShippingInformDetail.getHasReceivingNum() == null) {
tempShippingInformDetail.setHasReceivingNum(allReceivingNum);
} else {
tempShippingInformDetail.setHasReceivingNum(tempShippingInformDetail.getHasReceivingNum() + allReceivingNum);
}
int updateShippingInformDetailResult = shippingInformDetailMapper.updateSysSalesShippingInformDetail(tempShippingInformDetail);
if (updateShippingInformDetailResult <= 0) {
throw new BusinessException("更新销售出货通知单详情数据失败");
}
}
/**
* 展示确认收货物料详情
* */
@Override
public List<ConfirmReceivingDetailVo> confirmReceivingDetailList(SysSalesShippingInform sysSalesShippingInform) {
List<ConfirmReceivingDetailVo> confirmReceivingDetailVos = new ArrayList<>();
String outOrderCode = sysSalesShippingInform.getOutOrderCode();
List<SysSalesShippingInformDetail> sysSalesShippingInformDetails = shippingInformDetailMapper.selectSysSalesShippingInformDetailByCode(outOrderCode);
if (CollectionUtils.isEmpty(sysSalesShippingInformDetails)){
log.warn("确认收货物料详情为空,出库单号为:{}",outOrderCode);
}
for (SysSalesShippingInformDetail sysSalesShippingInformDetail : sysSalesShippingInformDetails) {
ConfirmReceivingDetailVo confirmReceivingDetailVo = new ConfirmReceivingDetailVo();
BeanUtils.copyProperties(sysSalesShippingInformDetail,confirmReceivingDetailVo);
confirmReceivingDetailVos.add(confirmReceivingDetailVo);
}
// 过滤 materialType 为 chcpsb 的设备
List<ConfirmReceivingDetailVo> chcpsbDevices = confirmReceivingDetailVos.stream()
.filter(item -> "chcpsb".equals(item.getMaterialType()))
.collect(Collectors.toList());
// 存储最终要保留的 chcpsb 设备
List<ConfirmReceivingDetailVo> validChcpsbDevices = new ArrayList<>();
for (ConfirmReceivingDetailVo chcpsbDevice : chcpsbDevices) {
String materialNo = chcpsbDevice.getMaterialNo();
AfterSalesShippingDevice afterSalesShippingDevice = new AfterSalesShippingDevice();
afterSalesShippingDevice.setMaterialNo(materialNo);
afterSalesShippingDevice.setOutOrderCode(outOrderCode);
List<AfterSalesShippingDevice> afterSalesShippingDevices = salesShippingDeviceMapper.selectHasAddShippingDevice(afterSalesShippingDevice);
if (!CollectionUtils.isEmpty(afterSalesShippingDevices)) {
for (AfterSalesShippingDevice device : afterSalesShippingDevices) {
ConfirmReceivingDetailVo detailVo = new ConfirmReceivingDetailVo();
BeanUtils.copyProperties(chcpsbDevice, detailVo);
detailVo.setShippingDeviceId(device.getShippingDeviceId());
detailVo.setSnCode(device.getSnCode());
detailVo.setThisShippingNum(1);
detailVo.setHasOutOrderNum(1);
if ("0".equals(device.getIsConfirmReceivingFlag())){
detailVo.setHasReceivingNum(1);
}else {
detailVo.setHasReceivingNum(0);
}
validChcpsbDevices.add(detailVo);
}
}
}
// 从 confirmReceivingDetailVos 中移除没有对应 AfterSalesShippingDevice 的 chcpsb 设备
confirmReceivingDetailVos = confirmReceivingDetailVos.stream()
.filter(item -> !"chcpsb".equals(item.getMaterialType()) || validChcpsbDevices.contains(item))
.collect(Collectors.toList());
// 添加有效的 chcpsb 设备
confirmReceivingDetailVos.addAll(validChcpsbDevices);
return confirmReceivingDetailVos;
}
/**
* 客户验收
*/
@ -959,6 +1154,7 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor
}
}
/**
* 导出出货通知单模板
* */

6
ruoyi-admin/src/main/resources/mapper/aftersales/AfterSalesShippingDeviceMapper.xml

@ -45,6 +45,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="addShippingDeviceFlag" column="add_shipping_device_flag" />
<result property="isConfirmReceivingFlag" column="is_confirm_receiving_flag" />
<result property="startMakeTime" column="start_make_time" />
<result property="endMakeTime" column="end_make_time" />
<result property="addProcessIssueRecordFlag" column="add_process_issue_record_flag" />
@ -56,7 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select shipping_device_code, shipping_device_id, make_no,sales_order_code, out_order_code, material_no, material_photoUrl, material_name, material_type, material_class, material_model_code, material_unit, material_brand, material_describe,
device_model_code, device_running_number, make_photoUrl, sn_code, aftersales_photoUrl, factory_date, guarantee_period, guarantee_period_flag, lock_date, lock_date_flag, wastage_expire_date, wastage_expire_flag,
component_guarantee_date, component_guarantee_flag, engineer_name, salesman_name, make_name,customer_id, customer_name, maintain_order_code, maintain_time, create_by, create_time, update_by, update_time,
add_shipping_device_flag, start_make_time, end_make_time, add_process_issue_record_flag,quality_status from aftersales_shipping_device
add_shipping_device_flag, is_confirm_receiving_flag, start_make_time, end_make_time, add_process_issue_record_flag,quality_status from aftersales_shipping_device
</sql>
<select id="selectAfterSalesShippingDeviceList" parameterType="AfterSalesShippingDevice" resultMap="AfterSalesShippingDeviceResult">
@ -220,6 +221,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="addShippingDeviceFlag != null">add_shipping_device_flag,</if>
<if test="isConfirmReceivingFlag != null"> is_confirm_receiving_flag,</if>
<if test="startMakeTime != null">start_make_time,</if>
<if test="endMakeTime != null">end_make_time,</if>
<if test="qualityStatus != null">quality_status,</if>
@ -264,6 +266,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="addShippingDeviceFlag != null">#{addShippingDeviceFlag}</if>
<if test="isConfirmReceivingFlag != null">#{isConfirmReceivingFlag}</if>
<if test="startMakeTime != null">#{startMakeTime}</if>
<if test="endMakeTime != null">#{endMakeTime}</if>
<if test="qualityStatus != null">#{qualityStatus}</if>
@ -312,6 +315,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="addShippingDeviceFlag != null">add_shipping_device_flag = #{addShippingDeviceFlag},</if>
<if test="isConfirmReceivingFlag != null">is_confirm_receiving_flag = #{isConfirmReceivingFlag},</if>
<if test="startMakeTime != null">start_make_time = #{startMakeTime},</if>
<if test="endMakeTime != null">end_make_time = #{endMakeTime},</if>
<if test="qualityStatus != null">quality_status = #{qualityStatus},</if>

7
ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderMapper.xml

@ -228,6 +228,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</select>
<select id="selectSysSalesOrderListByCodeList" parameterType="String" resultMap="SysSalesOrderResult">
select * from sys_sales_order where sales_order_code in
<foreach item="salesOrderCode" index="index" collection="list" open="(" separator="," close=")">
#{salesOrderCode}
</foreach>
</select>
<insert id="insertSysSalesOrder" parameterType="SysSalesOrder" useGeneratedKeys="true" keyProperty="salesOrderId">
insert into sys_sales_order
<trim prefix="(" suffix=")" suffixOverrides=",">

301
ruoyi-admin/src/main/resources/templates/system/salesShippingInform/confirmReceiving.html

@ -0,0 +1,301 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('确认收货')" />
<th:block th:include="include :: datetimepicker-css" />
<th:block th:include="include :: bootstrap-editable-css"/>
</head>
<style>
.
</style>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-confirmReceiving-edit" th:object="${sysSalesShippingInform}">
<div class="form-group">
<label class="col-sm-3 control-label">出库单号:</label>
<div class="col-sm-8">
<input name="outOrderCode" th:field="*{outOrderCode}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">出库类型:</label>
<div class="col-sm-8">
<select name="warehouseOutType" class="form-control m-b" th:with="type=${@dict.getType('warehouse_out_type')}" readonly>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{warehouseOutType}"></option>
</select>
</div>
</div>
<div th:each="order : ${sysSalesOrders}" class="col-sm-12" style="margin-left: -35px;">
<div class="col-sm-6">
<label class="col-sm-3 control-label">订单类型:</label>
<div class="col-sm-8">
<select name="salesOrderType" class="form-control m-b" readonly>
<option value="0" th:selected="${order.salesOrderType} == '0'">客户订单</option>
<option value="1" th:selected="${order.salesOrderType} == '1'">研发订单</option>
<option value="2" th:selected="${order.salesOrderType} == '2'">其他订单</option>
</select>
</div>
</div>
<div class="col-sm-6" >
<label class="col-sm-3 control-label">销售单号:</label>
<div class="col-sm-8">
<input name="salesOrderCode" th:value="${order.salesOrderCode}" class="form-control" type="text" readonly>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">客户ID:</label>
<div class="col-sm-8">
<input name="customerId" th:field="*{customerId}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">客户名称:</label>
<div class="col-sm-8">
<input name="customerName" th:field="*{customerName}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">收货联系人(Ship To):</label>
<div class="col-sm-8">
<input name="customerContact" th:field="*{customerContact}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">收货电话(Ship To):</label>
<div class="col-sm-8">
<input name="contactNumber" th:field="*{contactNumber}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">收货地址(Ship To):</label>
<div class="col-sm-8">
<input name="customerContactAddress" th:field="*{customerContactAddress}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">收货联系人(Bill To):</label>
<div class="col-sm-8">
<input name="customerContactBillto" th:field="*{customerContactBillto}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">收货电话(Bill To):</label>
<div class="col-sm-8">
<input name="contactNumberBillto" th:field="*{contactNumberBillto}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">收货地址(Bill To):</label>
<div class="col-sm-8">
<input name="contactAddressBillto" th:field="*{contactAddressBillto}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<input name="remark" th:field="*{remark}" class="form-control" type="text" readonly>
</div>
</div>
</form>
<!--物料信息-->
<div class="container">
<div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<!--用于可以修改列表字段的插件-->
<th:block th:include="include :: bootstrap-table-editable-js" />
<script th:inline="javascript">
var sysSalesShippingInform = [[${sysSalesShippingInform}]];
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]];
var prefix = ctx + "system/salesShippingInform";
$("#form-confirmReceiving-edit").validate({
focusCleanup: true
});
// 新增提交
function submitHandler() {
// 获取表单数据
const sysSalesShippingInformData = $("#form-confirmReceiving-edit").serializeArray().reduce((obj, item) => {
obj[item.name] = item.value;
return obj;
}, {});
// 获取bootstrap-table的数据,这里假设你使用bootstrap-table的API获取所有数据
var table = $('#bootstrap-table').bootstrapTable('getData');
// 将表数据转换成与complaintNoticeData格式一致的数组
var materialDataList = table.map(function(item) {
// 根据实际字段名调整
return {
"shippingInformDetailId": item.shippingInformDetailId,
"materialCode": item.materialCode,
"materialName": item.materialName,
"materialType": item.materialType,
"materialProcessMethod": item.materialProcessMethod,
"materialModel": item.materialModel,
"shippingDeviceId": item.shippingDeviceId,
"snCode": item.snCode,
"thisShippingNum": item.thisShippingNum,
"hasOutOrderNum": item.hasOutOrderNum,
"thisReceivingNum": item.thisReceivingNum,
"hasReceivingNum": item.hasReceivingNum,
// ...其他字段
};
});
const combinedData = Object.assign({}, sysSalesShippingInformData, {
shippingInformDetailList: materialDataList
});
// 合并表单数据和表格数据
console.log(combinedData)
// 使用 JSON.stringify() 序列化数据
const jsonData = JSON.stringify(combinedData);
// 发送 AJAX 请求到后端接口
$.operate.saveJson(prefix + "/confirmReceiving", jsonData);
}
//物料信息展示列表
$(function() {
var options = {
modalName: "选择物料",
url: prefix + "/confirmReceivingDetailList",
queryParams: queryParams,
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
pagination: false, // 设置不分页
columns: [{
checkbox: true
},
{
title: '销售出货通知单详情Id',
field: 'shippingInformDetailId',
visible: false
},
{
title: '料号',
field: 'materialNo',
},
{
title: '物料名称',
field: 'materialName',
},
{
title: '物料类型',
field: 'materialType',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{
title: '加工方式',
field: 'materialProcessMethod',
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
},
{
title: '型号',
field: 'materialModel',
},
{
title: '出货设备ID',
field: 'shippingDeviceId',
},
{
title: 'SN码',
field: 'snCode',
},
{
title: '本次出货数',
field: 'thisShippingNum',
},
{
title: '已出库数',
field: 'hasOutOrderNum',
},
{
title: '已收货数',
field: 'hasReceivingNum',
},
{
title: '本次收货数',
field: 'thisReceivingNum',
editable: {
//动态禁用行内编辑
noEditFormatter: function(value, row, index){
if (row.hasReceivingNum === row.thisShippingNum){
return "已出货";
}else{
return false;
}
},
validate: function(value) {
if ($.trim(value) === '') {
return '本次收货数不能为空';
}
if (isNaN(value)) {
return '请输入有效的数字';
}
if (value < 0) {
return '本次收货数不能小于0';
}
//不能为小数
if (value % 1 !== 0) {
return '本次收货数不能为小数';
}
},
},
formatter: function (value, row) {
// 检查 row 是否存在
if (!row) {
return "";
}
// 检查 thisReceivingNum 是否存在
if (row.thisReceivingNum === undefined || row.thisReceivingNum === null) {
return "";
}
// 根据 thisReceivingNum 的值决定返回值
if (row.thisReceivingNum) {
return row.thisReceivingNum;
} else {
return value;
}
}
},
]
};
$.table.init(options);
})
function queryParams(params) {
var curParams = {
// 传递参数查询参数
outOrderCode: sysSalesShippingInform.outOrderCode
};
return curParams;
}
</script>
</body>
</html>

21
ruoyi-admin/src/main/resources/templates/system/salesShippingInform/salesShippingInform.html

@ -95,11 +95,15 @@
var restoreFlag = [[${@permission.hasPermi('system:salesShippingInform:restore')}]];
var confirmShippingFlag = [[${@permission.hasPermi('system:salesShippingInform:confirmShipping')}]];
var cancelShippingFlag = [[${@permission.hasPermi('system:salesShippingInform:cancelShipping')}]];
var confirmReceivingFlag = [[${@permission.hasPermi('system:salesShippingInform:confirmReceiving')}]];
var customerCheckGoodsFlag = [[${@permission.hasPermi('system:salesShippingInform:customerCheckGoods')}]];
var customerCheckGoodsDetailFlag = [[${@permission.hasPermi('system:salesShippingInform:customerCheckGoodsDetail')}]];
var warehouseOutStatusDatas = [[${@dict.getType('warehouse_out_status')}]];
var warehouseOutTypeDatas = [[${@dict.getType('warehouse_out_type')}]];
var warehouseOrderTypeDatas = [[${@dict.getType('warehouse_order_type')}]];
@ -316,11 +320,14 @@
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + customerCheckGoodsDetailFlag + '" href="javascript:void(0)" onclick="customerCheckGoodsDetail(\'' + row.shippingInformId + '\')"><i class="fa fa-edit"></i>详情</a> ');
if(row.warehouseOutStatus == '2'){
actions.push('<a class="btn btn-success btn-xs ' + confirmShippingFlag + '" href="javascript:void(0)" onclick="confirmShipping(\'' + row.shippingInformId + '\')"><i class="fa fa-edit"></i>确认发货</a> ');
actions.push('<a class="btn btn-success btn-xs ' + cancelShippingFlag + '" href="javascript:void(0)" onclick="cancelShipping(\'' + row.shippingInformId + '\')"><i class="fa fa-edit"></i>取消发货</a> ');
actions.push('<a class=" ' + confirmShippingFlag + '" href="javascript:void(0)" onclick="confirmShipping(\'' + row.shippingInformId + '\')"><i class="fa fa-edit"></i>确认发货</a> ');
actions.push('<a class=" ' + cancelShippingFlag + '" href="javascript:void(0)" onclick="cancelShipping(\'' + row.shippingInformId + '\')"><i class="fa fa-edit"></i>取消发货</a> ');
}
if(row.warehouseOutStatus == '9'){
actions.push('<a class=" ' + confirmReceivingFlag + '" href="javascript:void(0)" onclick="confirmReceiving(\'' + row.shippingInformId + '\')"><i class="fa fa-edit"></i>确认收货</a> ');
}
if(row.warehouseOutStatus == '10' || row.warehouseOutStatus == '11'){
actions.push('<a class="btn btn-success btn-xs ' + customerCheckGoodsFlag + '" href="javascript:void(0)" onclick="customerCheckGoods(\'' + row.shippingInformId + '\')"><i class="fa fa-edit"></i>确认验收</a> ');
actions.push('<a class="' + customerCheckGoodsFlag + '" href="javascript:void(0)" onclick="customerCheckGoods(\'' + row.shippingInformId + '\')"><i class="fa fa-edit"></i>确认验收</a> ');
}
var actionLinks = actions.join('');
@ -347,6 +354,14 @@
$.modal.open("取消发货",url);
}
//确认收货
function confirmReceiving(shippingInformId){
var url = prefix +'/confirmReceiving/' + shippingInformId;
$.modal.open("确认收货",url);
}
//客户验收
function customerCheckGoods(shippingInformId){
var url = prefix +'/customerCheckGoods/' + shippingInformId;

Loading…
Cancel
Save