Browse Source

Merge remote-tracking branch 'origin/dev' into dev

dev
zhangsiqi 4 months ago
parent
commit
a3baca1ca2
  1. 63
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/controller/AftersalesWarehouseOutController.java
  2. 12
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/AfterSalesShippingDevice.java
  3. 2
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/vo/SelectShippingDeviceVO.java
  4. 17
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/mapper/AfterSalesShippingDeviceMapper.java
  5. 15
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAftersalesWarehouseOutService.java
  6. 106
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesWarehouseOutServiceImpl.java
  7. 1
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysMakeOrderController.java
  8. 43
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesOrderController.java
  9. 34
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSalesOrderChild.java
  10. 10
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSalesOrderChildMapper.java
  11. 10
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSalesShippingInformMapper.java
  12. 4
      ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesOrderChildService.java
  13. 5
      ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesOrderService.java
  14. 7
      ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesShippingInformService.java
  15. 9
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderChildServiceImpl.java
  16. 48
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderServiceImpl.java
  17. 51
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformServiceImpl.java
  18. 15
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/domain/WarehouseOutOrder.java
  19. 16
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/domain/WarehouseOutOrderDetail.java
  20. 5
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseOutOrderDetailService.java
  21. 6
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseOutOrderService.java
  22. 24
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseOutOrderDetailServiceImpl.java
  23. 105
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseOutOrderServiceImpl.java
  24. 19
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseStorageOrderServiceImpl.java
  25. 22
      ruoyi-admin/src/main/resources/mapper/aftersales/AfterSalesShippingDeviceMapper.xml
  26. 68
      ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderChildMapper.xml
  27. 36
      ruoyi-admin/src/main/resources/mapper/system/SysSalesShippingInformMapper.xml
  28. 186
      ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/addShippingDevices.html
  29. 308
      ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/addShippingDevicesOne.html
  30. 109
      ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/maintenanceEquipmentOne.html
  31. 3
      ruoyi-admin/src/main/resources/templates/system/makeorder/addEquipmentResume.html
  32. 231
      ruoyi-admin/src/main/resources/templates/system/salesOrder/salesDeliverGoods.html
  33. 12
      ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/prepareMaterial.html

63
ruoyi-admin/src/main/java/com/ruoyi/aftersales/controller/AftersalesWarehouseOutController.java

@ -11,11 +11,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.aftersales.service.IAftersalesWarehouseOutService;
@ -245,9 +241,9 @@ public class AftersalesWarehouseOutController extends BaseController
@Log(title = "售后维护设备出库", businessType = BusinessType.UPDATE)
@PostMapping("/maintenanceEquipmentOne")
@ResponseBody
public AjaxResult maintenanceEquipmentOneSave(WarehouseOutOrder warehouseOutOrder)
public AjaxResult maintenanceEquipmentOneSave(@RequestBody WarehouseOutOrder warehouseOutOrder)
{
return toAjax(warehouseOutOrderService.updateWarehouseOutOrder(warehouseOutOrder));
return toAjax(warehouseOutOrderService.updateMaintenanceEquipmentOne(warehouseOutOrder));
}
@ -263,19 +259,64 @@ public class AftersalesWarehouseOutController extends BaseController
List<WarehouseOutOrderDetail> list = warehouseOutOrderService.selectOutOrderDetailListByCode(warehouseOutOrder);
return getDataTable(list);
}
/**
* 展示售后第一次维护设备料号已选择添加出货设备的相关出货设备信息
*/
@PostMapping("/showAftersalesShippingDeviceList")
@ResponseBody
public TableDataInfo showAftersalesShippingDeviceList(@RequestParam("materialNo") String materialNo)
{
startPage();
List<SelectShippingDeviceVO> list = warehouseOutOrderService.showAftersalesShippingDeviceList(materialNo);
return getDataTable(list);
}
/**
* 售后第一次维护设备 添加出货设备信息
*/
@GetMapping("/addShippingDevicesOne/{outOrderDetailId}")
public String addShippingDevicesOne(@PathVariable("outOrderDetailId") Long outOrderDetailId, ModelMap mmap)
{
WarehouseOutOrderDetail warehouseOutOrderDetail = outOrderDetailService.selectWarehouseOutOrderDetailById(outOrderDetailId);
mmap.put("warehouseOutOrderDetail", warehouseOutOrderDetail);
return prefix + "/addShippingDevicesOne";
}
/**
* 修改保存售后第一次维护设备 添加出货设备信息
*/
@ResponseBody
@PostMapping("/addShippingDevicesOne")
public AjaxResult addShippingDevicesOne(@RequestBody WarehouseOutOrderDetail warehouseOutOrderDetail)
{
return toAjax(outOrderDetailService.addShippingDevicesOne(warehouseOutOrderDetail));
}
/**
* 展示售后第一次维护设备料号相关出货设备信息
* 展示售后第一次维护设备添加出货设备料号相关出货设备信息
*/
@PostMapping("/showAftersalesShippingDevicelist")
@PostMapping("/getEquipMaterialDetailByMaterialNo")
@ResponseBody
public TableDataInfo showAftersalesShippingDevicelist(WarehouseOutOrder warehouseOutOrder)
public TableDataInfo showAftersalesShippingDevicelist(WarehouseOutOrderDetail warehouseOutOrderDetail)
{
startPage();
List<SelectShippingDeviceVO> list = warehouseOutOrderService.selectAftersalesShippingDevicelistByCodeAndNo(warehouseOutOrder);
List<SelectShippingDeviceVO> list = warehouseOutOrderService.selectAftersalesShippingDeviceListByMaterialNo(warehouseOutOrderDetail);
return getDataTable(list);
}
/**
* 第一次维护设备删除物料信息出货设备信息
*/

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

@ -158,7 +158,8 @@ public class AfterSalesShippingDevice extends BaseEntity
@Excel(name = "维修时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date maintainTime;
/** 是否添加出货设备(0代表是 1代表否) */
private String addShippingDeviceFlag;
public void setShippingDeviceCode(Long shippingDeviceCode)
{
this.shippingDeviceCode = shippingDeviceCode;
@ -464,6 +465,14 @@ public class AfterSalesShippingDevice extends BaseEntity
this.maintainTime = maintainTime;
}
public String getAddShippingDeviceFlag() {
return addShippingDeviceFlag;
}
public void setAddShippingDeviceFlag(String addShippingDeviceFlag) {
this.addShippingDeviceFlag = addShippingDeviceFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@ -505,6 +514,7 @@ public class AfterSalesShippingDevice extends BaseEntity
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("addShippingDeviceFlag",getAddShippingDeviceFlag())
.toString();
}
}

2
ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/vo/SelectShippingDeviceVO.java

@ -18,5 +18,7 @@ public class SelectShippingDeviceVO {
private String makePhotoUrl;
private String snCode;
}

17
ruoyi-admin/src/main/java/com/ruoyi/aftersales/mapper/AfterSalesShippingDeviceMapper.java

@ -14,12 +14,20 @@ public interface AfterSalesShippingDeviceMapper
/**
* 查询出货设备
*
* @param shippingDeviceCode 出货设备ID
* @param shippingDeviceCode 出货设备Code
* @return 出货设备
*/
public AfterSalesShippingDevice selectAfterSalesShippingDeviceById(Long shippingDeviceCode);
/**
* 查询出货设备
*
* @param shippingDeviceId 出货设备ID
* @return 出货设备
*/
public AfterSalesShippingDevice selectAfterSalesShippingDeviceByShippingDeviceId(String shippingDeviceId);
/**
* 查询选择设备
*
@ -64,7 +72,7 @@ public interface AfterSalesShippingDeviceMapper
/**
* 删除出货设备
*
* @param shippingDeviceCode 出货设备ID
* @param shippingDeviceId 出货设备ID
* @return 结果
*/
public int deleteAfterSalesShippingDeviceById(String shippingDeviceId);
@ -102,4 +110,9 @@ public interface AfterSalesShippingDeviceMapper
* 根据生产单号和关联销售单号查询出货设备履历信息
* */
List<AfterSalesShippingDevice> selectAfterSalesShippingDeviceByNoAndCode(AfterSalesShippingDevice afterSalesShippingDevice);
/*
* 根据物料号查询出货设备信息列表
* */
List<AfterSalesShippingDevice> selectShippingDeviceListByMaterialNo(AfterSalesShippingDevice afterSalesShippingDevice);
}

15
ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAftersalesWarehouseOutService.java

@ -114,4 +114,19 @@ public interface IAftersalesWarehouseOutService
* 展示售后第一次维护设备物料相关信息
* */
List<WarehouseOutOrderDetail> selectOutOrderDetailListByCode(WarehouseOutOrder warehouseOutOrder);
/**
* 展示售后第一次维护设备 添加出货设备 料号相关出货设备信息
* */
List<SelectShippingDeviceVO> selectAftersalesShippingDeviceListByMaterialNo(WarehouseOutOrderDetail warehouseOutOrderDetail);
/**
* 展示售后第一次维护设备料号已选择添加出货设备的相关出货设备信息
* */
List<SelectShippingDeviceVO> showAftersalesShippingDeviceList(String materialNo);
/**
* 修改保存售后第一次维护设备
*/
int updateMaintenanceEquipmentOne(WarehouseOutOrder warehouseOutOrder);
}

106
ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesWarehouseOutServiceImpl.java

@ -1,7 +1,9 @@
package com.ruoyi.aftersales.service.impl;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
import com.ruoyi.aftersales.domain.AfterSalesShippingDevice;
import com.ruoyi.aftersales.domain.vo.SelectMaterialsVO;
@ -12,7 +14,9 @@ import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.domain.SysSalesOrderChild;
import com.ruoyi.system.domain.SysSalesShippingInform;
import com.ruoyi.system.mapper.SysSalesOrderChildMapper;
import com.ruoyi.system.mapper.SysSalesShippingInformMapper;
import com.ruoyi.warehouse.domain.WarehouseOutOrder;
import com.ruoyi.warehouse.domain.WarehouseOutOrderDetail;
import com.ruoyi.warehouse.mapper.WarehouseOutOrderDetailMapper;
@ -22,6 +26,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.aftersales.service.IAftersalesWarehouseOutService;
import com.ruoyi.common.core.text.Convert;
import org.springframework.transaction.annotation.Transactional;
/**
* 出库单Service业务层处理
@ -45,6 +50,9 @@ public class AftersalesWarehouseOutServiceImpl implements IAftersalesWarehouseOu
@Autowired
private WarehouseOutOrderDetailMapper outOrderDetailMapper;
@Autowired
private SysSalesShippingInformMapper shippingInformMapper;
/**
* 查询出库单
*
@ -184,6 +192,104 @@ public class AftersalesWarehouseOutServiceImpl implements IAftersalesWarehouseOu
return warehouseOutOrderDetails;
}
/**
* 展示售后第一次维护设备 添加出货设备 料号相关出货设备信息
* */
@Override
public List<SelectShippingDeviceVO> selectAftersalesShippingDeviceListByMaterialNo(WarehouseOutOrderDetail warehouseOutOrderDetail) {
List<SelectShippingDeviceVO> selectShippingDeviceVOs = new ArrayList<>();
AfterSalesShippingDevice afterSalesShippingDevice = new AfterSalesShippingDevice();
afterSalesShippingDevice.setMaterialNo(warehouseOutOrderDetail.getMaterialNo());
List<AfterSalesShippingDevice> afterSalesShippingDevices = shippingDeviceMapper.selectShippingDeviceListByMaterialNo(afterSalesShippingDevice);
if (!StringUtils.isNotEmpty(afterSalesShippingDevices)) {
// 记录日志
log.warn("未查找到与物料号关联的出库设备数据, 物料号: {}",warehouseOutOrderDetail.getMaterialNo());
}
for (AfterSalesShippingDevice tempAfterSalesShippingDevice : afterSalesShippingDevices) {
SelectShippingDeviceVO shippingDeviceVO = new SelectShippingDeviceVO();
shippingDeviceVO.setShippingDeviceId(tempAfterSalesShippingDevice.getShippingDeviceId());
shippingDeviceVO.setDeviceModelCode(tempAfterSalesShippingDevice.getDeviceModelCode());
shippingDeviceVO.setDeviceRunningNumber(tempAfterSalesShippingDevice.getDeviceRunningNumber());
shippingDeviceVO.setMakePhotoUrl(tempAfterSalesShippingDevice.getMakePhotourl());
shippingDeviceVO.setQuoteId(tempAfterSalesShippingDevice.getSalesOrderCode());
selectShippingDeviceVOs.add(shippingDeviceVO);
}
return selectShippingDeviceVOs;
}
/**
* 展示售后第一次维护设备料号已选择添加出货设备的相关出货设备信息
* */
@Override
public List<SelectShippingDeviceVO> showAftersalesShippingDeviceList(String materialNo) {
List<SelectShippingDeviceVO> selectShippingDeviceVOs = new ArrayList<>();
AfterSalesShippingDevice afterSalesShippingDevice = new AfterSalesShippingDevice();
afterSalesShippingDevice.setMaterialNo(materialNo);
List<AfterSalesShippingDevice> afterSalesShippingDevices = shippingDeviceMapper.selectShippingDeviceListByMaterialNo(afterSalesShippingDevice);
List<AfterSalesShippingDevice> filterAfterSalesShippingDevices = afterSalesShippingDevices.stream().filter(shippingDevice -> "0".equals(shippingDevice.getAddShippingDeviceFlag())).collect(Collectors.toList());
if (!StringUtils.isNotEmpty(filterAfterSalesShippingDevices)) {
// 记录日志
log.warn("未查找到与物料号关联的出库设备数据, 物料号: {}",materialNo);
}
for (AfterSalesShippingDevice tempAfterSalesShippingDevice : filterAfterSalesShippingDevices) {
SelectShippingDeviceVO shippingDeviceVO = new SelectShippingDeviceVO();
shippingDeviceVO.setShippingDeviceId(tempAfterSalesShippingDevice.getShippingDeviceId());
shippingDeviceVO.setDeviceModelCode(tempAfterSalesShippingDevice.getDeviceModelCode());
shippingDeviceVO.setDeviceRunningNumber(tempAfterSalesShippingDevice.getDeviceRunningNumber());
shippingDeviceVO.setMakePhotoUrl(tempAfterSalesShippingDevice.getMakePhotourl());
shippingDeviceVO.setQuoteId(tempAfterSalesShippingDevice.getSalesOrderCode());
selectShippingDeviceVOs.add(shippingDeviceVO);
}
return selectShippingDeviceVOs;
}
/**
* 修改保存售后第一次维护设备
*/
@Transactional(rollbackFor = Exception.class)
@Override
public int updateMaintenanceEquipmentOne(WarehouseOutOrder warehouseOutOrder) {
String loginName = ShiroUtils.getLoginName();
List<SelectShippingDeviceVO> selectShippingDeviceVOList = warehouseOutOrder.getSelectShippingDeviceVOList();
for (SelectShippingDeviceVO selectShippingDeviceVO : selectShippingDeviceVOList) {
AfterSalesShippingDevice afterSalesShippingDevice = new AfterSalesShippingDevice();
afterSalesShippingDevice.setShippingDeviceId(selectShippingDeviceVO.getShippingDeviceId());
afterSalesShippingDevice.setSnCode(selectShippingDeviceVO.getSnCode());
afterSalesShippingDevice.setUpdateBy(loginName);
afterSalesShippingDevice.setUpdateTime(new Date());
int updateShippingDeviceResult = shippingDeviceMapper.updateAfterSalesShippingDevice(afterSalesShippingDevice);
if (updateShippingDeviceResult <= 0){
throw new BusinessException("更新出货设备数据失败");
}
}
//设置出库单为待业务确认发货
warehouseOutOrder.setWarehouseOutStatus("2");
//更新销售管理销售出库的出货状态 待业务确认发货
SysSalesShippingInform sysSalesShippingInform = new SysSalesShippingInform();
sysSalesShippingInform.setOutOrderCode(warehouseOutOrder.getOutOrderCode());
sysSalesShippingInform.setWarehouseOutStatus("2");
sysSalesShippingInform.setUpdateBy(loginName);
sysSalesShippingInform.setUpdateTime(new Date());
int updateShippingInformResult = shippingInformMapper.updateSysSalesShippingInformByOutOrderCode(sysSalesShippingInform);
if (updateShippingInformResult <= 0){
log.warn("出库单号为空:{}",warehouseOutOrder.getOutOrderCode());
throw new BusinessException("更新销售出库单数据失败");
}
return warehouseOutOrderMapper.updateWarehouseOutOrder(warehouseOutOrder);
}
/*
* 售后第一次维护设备信息根据设备ID删除出货设备信息
* */

1
ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysMakeOrderController.java

@ -257,6 +257,7 @@ public class SysMakeOrderController extends BaseController
AfterSalesShippingDevice afterSalesShippingDevice = new AfterSalesShippingDevice();
afterSalesShippingDevice.setMakeNo(makeNo);
afterSalesShippingDevice.setSalesOrderCode(salesOrderCode);
afterSalesShippingDevice.setMaterialNo(equipMaterialDto.getMaterialCode());
List<SysEquipDetailDto> equipDetailDtos = salesShippingDeviceService.selectAfterSalesShippingDeviceByNoAndCode(afterSalesShippingDevice);
return getDataTable(equipDetailDtos);
}

43
ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesOrderController.java

@ -28,6 +28,8 @@ import com.ruoyi.system.domain.exportDto.SysSalesFinishDto;
import com.ruoyi.system.domain.exportDto.SysSalesOrderDto;
import com.ruoyi.system.mapper.SysSalesOrderMapper;
import com.ruoyi.system.service.*;
import com.ruoyi.warehouse.domain.WarehouseStorageOrder;
import com.ruoyi.warehouse.domain.WarehouseStorageOrderDetail;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
import org.activiti.engine.runtime.ProcessInstance;
@ -88,12 +90,11 @@ public class SysSalesOrderController extends BaseController
@Autowired
private ISysMakeOrderService sysMakeOrderService;
@Autowired
private SysSalesOrderMapper sysSalesOrderMapper;
@Autowired
private IFinancialReceivablesService financialReceivablesService;
@Autowired
private ISysSalesOrderChildService sysSalesOrderChildService;
@RequiresPermissions("system:salesOrder:view")
@GetMapping()
@ -522,4 +523,40 @@ public class SysSalesOrderController extends BaseController
List<SysUser> list = sysUserService.selectRoleToUserList("ywyRole,ywjlRole,ywzgRole,zozjRole,admin");
return getDataTable(list);
}
/**
* 发起出货
*/
@GetMapping("/salesDeliverGoods/{salesOrderId}")
public String salesDeliverGoods(@PathVariable("salesOrderId") Long salesOrderId, ModelMap mmap)
{
SysSalesOrder sysSalesOrder = sysSalesOrderService.selectSysSalesOrderById(salesOrderId);
mmap.put("sysSalesOrder", sysSalesOrder);
return prefix + "/salesDeliverGoods";
}
/**
* 修改保存发起出货
*/
@RequiresPermissions("system:salesOrder:salesDeliverGoods")
@Log(title = "销售出货通知", businessType = BusinessType.UPDATE)
@PostMapping("/salesDeliverGoods")
@ResponseBody
public AjaxResult salesDeliverGoodsSave(@RequestBody SysSalesOrder sysSalesOrder)
{
return toAjax(sysSalesOrderService.updateSalesDeliverGoods(sysSalesOrder));
}
/**
* 发起出货 物料详情列表
*/
@ResponseBody
@RequestMapping("/salesDeliverGoodsDetailList")
public TableDataInfo storageMakeDetailList(SysSalesOrder sysSalesOrder){
startPage();
String salesOrderCode = sysSalesOrder.getSalesOrderCode();
List<SysSalesOrderChild> list = sysSalesOrderChildService.selectOrderChildListBySalesOrderCode(salesOrderCode);
return getDataTable(list) ;
}
}

34
ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSalesOrderChild.java

@ -137,6 +137,15 @@ public class SysSalesOrderChild extends BaseEntity {
@Excel(name = "未出库数量")
private Integer unBoundQuantity;
//已完成数
private Integer finishNum;
//申请出货数
private Integer applyShippingNum;
//已申请出货数
private Integer hasApplyShippingNum;
private String bomId;
public Long getId() {
@ -436,7 +445,29 @@ public class SysSalesOrderChild extends BaseEntity {
this.bomId = bomId;
}
public Integer getFinishNum() {
return finishNum;
}
public void setFinishNum(Integer finishNum) {
this.finishNum = finishNum;
}
public Integer getApplyShippingNum() {
return applyShippingNum;
}
public void setApplyShippingNum(Integer applyShippingNum) {
this.applyShippingNum = applyShippingNum;
}
public Integer getHasApplyShippingNum() {
return hasApplyShippingNum;
}
public void setHasApplyShippingNum(Integer hasApplyShippingNum) {
this.hasApplyShippingNum = hasApplyShippingNum;
}
@Override
public String toString() {
@ -477,6 +508,9 @@ public class SysSalesOrderChild extends BaseEntity {
.add("taxRate", taxRate)
.add("outBoundQuantity", outBoundQuantity)
.add("unBoundQuantity", unBoundQuantity)
.add("finishNum", finishNum)
.add("applyShippingNum", applyShippingNum)
.add("hasApplyShippingNum", hasApplyShippingNum)
.toString();
}
}

10
ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSalesOrderChildMapper.java

@ -27,4 +27,14 @@ public interface SysSalesOrderChildMapper {
* 根据物料号和销售订单号查询销售订单子表数据
* */
SysSalesOrderChild selectSalesOrderChildByCodeAndNo(SysSalesOrderChild sysSalesOrderChild);
/*
* 通过销售订单号查询销售订单子表
* */
List<SysSalesOrderChild> selectOrderChildListBySalesOrderCode(String salesOrderCode);
/*
* 根据销售单号和物料号更新销售单子表数据
* */
int updateSysSalesOrderChildByCodeAndQuoteId(SysSalesOrderChild sysSalesOrderChild);
}

10
ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSalesShippingInformMapper.java

@ -43,6 +43,16 @@ public interface SysSalesShippingInformMapper
*/
public int updateSysSalesShippingInform(SysSalesShippingInform sysSalesShippingInform);
/**
* 修改销售出货通知
*
* @param sysSalesShippingInform 销售出货通知
* @return 结果
*/
public int updateSysSalesShippingInformByOutOrderCode(SysSalesShippingInform sysSalesShippingInform);
/**
* 删除销售出货通知
*

4
ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesOrderChildService.java

@ -23,4 +23,8 @@ public interface ISysSalesOrderChildService {
SysSalesOrderChild selectOneByQuoteIdAndMaterialCode(String quoteId,String materialCode);
/*
* 通过销售订单号查询销售订单子表
* */
List<SysSalesOrderChild> selectOrderChildListBySalesOrderCode(String salesOrderCode);
}

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

@ -87,4 +87,9 @@ public interface ISysSalesOrderService
* 根据销售单号更新销售订单
* */
int updateSysSalesOrderBySalesOrderCode(SysSalesOrder sysSalesOrder);
/**
* 修改保存发起出货
*/
int updateSalesDeliverGoods(SysSalesOrder sysSalesOrder);
}

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

@ -1,6 +1,8 @@
package com.ruoyi.system.service;
import java.util.List;
import com.ruoyi.system.domain.SysSalesOrder;
import com.ruoyi.system.domain.SysSalesShippingInform;
/**
@ -72,4 +74,9 @@ public interface ISysSalesShippingInformService
* @return
*/
int restoreSysSalesShippingInformById(Long shippingInformId);
/**
* 通过销售发起出货生成销售出货通知单列表
* */
int generateShippingInformBySalesOrder(SysSalesOrder sysSalesOrder, String outOrderCode);
}

9
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderChildServiceImpl.java

@ -51,4 +51,13 @@ public class SysSalesOrderChildServiceImpl implements ISysSalesOrderChildService
public SysSalesOrderChild selectOneByQuoteIdAndMaterialCode(String quoteId, String materialCode) {
return sysCustomerQuoteChildMapper.selectOneByQuoteIdAndMaterialCode(quoteId,materialCode);
}
/*
* 通过销售订单号查询销售订单子表
* */
@Override
public List<SysSalesOrderChild> selectOrderChildListBySalesOrderCode(String salesOrderCode) {
return sysCustomerQuoteChildMapper.selectOrderChildListBySalesOrderCode(salesOrderCode);
}
}

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

@ -6,6 +6,7 @@ import com.ruoyi.common.core.page.PageDomain;
import com.ruoyi.common.core.page.TableSupport;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.exception.BusinessException;
import com.ruoyi.common.service.ICommonService;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
@ -13,9 +14,11 @@ import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.process.general.service.IProcessService;
import com.ruoyi.process.todoitem.mapper.BizTodoItemMapper;
import com.ruoyi.system.domain.*;
import com.ruoyi.system.mapper.SysSalesOrderChildMapper;
import com.ruoyi.system.mapper.SysSalesOrderMapper;
import com.ruoyi.system.mapper.SysUserMapper;
import com.ruoyi.system.service.*;
import com.ruoyi.warehouse.service.IWarehouseOutOrderService;
import org.activiti.engine.TaskService;
import org.activiti.engine.impl.persistence.entity.TaskEntityImpl;
import org.activiti.engine.runtime.ProcessInstance;
@ -70,6 +73,15 @@ public class SysSalesOrderServiceImpl implements ISysSalesOrderService
@Autowired
private ISysSalesOrderChildService sysSalesOrderChildService;
@Autowired
private SysSalesOrderChildMapper salesOrderChildMapper;
@Autowired
private ISysSalesShippingInformService sysSalesShippingInformService;
@Autowired
private IWarehouseOutOrderService warehouseOutOrderService;
/**
* 查询销售订单
*
@ -352,6 +364,42 @@ public class SysSalesOrderServiceImpl implements ISysSalesOrderService
return sysSalesOrderMapper.updateSysSalesOrderBySalesOrderCode(sysSalesOrder);
}
/**
* 修改保存发起出货
*/
@Transactional(rollbackFor = Exception.class)
@Override
public int updateSalesDeliverGoods(SysSalesOrder sysSalesOrder) {
String loginName = ShiroUtils.getLoginName();
sysSalesOrder.setUpdateBy(loginName);
sysSalesOrder.setUpdateTime(new Date());
for (SysSalesOrderChild sysSalesOrderChild : sysSalesOrder.getSysSalesOrderChildList()) {
sysSalesOrderChild.setUpdateTime(new Date());
sysSalesOrderChild.setUpdateBy(loginName);
sysSalesOrderChild.setQuoteId(sysSalesOrder.getSalesOrderCode());
sysSalesOrderChild.setHasApplyShippingNum(sysSalesOrderChild.getApplyShippingNum());
int updateSysSalesOrderChildResult = salesOrderChildMapper.updateSysSalesOrderChildByCodeAndQuoteId(sysSalesOrderChild);
if (updateSysSalesOrderChildResult <= 0){
throw new BusinessException("更新销售订单子表数据失败");
}
}
//两个表生成同一个出库单号
String outOrderCode = redisCache.generateBillNo("CK");
//通过销售发起出货生成仓库出库单
int insertWarehouseOutOrderResult = warehouseOutOrderService.generateWarehouseOutOrderBySalesOrder(sysSalesOrder,outOrderCode);
//通过销售发起出货生成销售出货通知单列表
int insertShippingInformResult = sysSalesShippingInformService.generateShippingInformBySalesOrder(sysSalesOrder,outOrderCode);
return sysSalesOrderMapper.updateSysSalesOrderBySalesOrderCode(sysSalesOrder);
}
private ProcessInstance startProcessInstance(String applyTitle,String instanceType,SysSalesOrder sysSalesOrder, SysUser user) {
Long nessKey = sysSalesOrder.getSalesOrderId();

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

@ -1,8 +1,18 @@
package com.ruoyi.system.service.impl;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.domain.SysSalesOrder;
import com.ruoyi.system.domain.SysSalesOrderVo;
import com.ruoyi.system.mapper.SysSalesOrderMapper;
import com.ruoyi.warehouse.domain.WarehouseOutOrder;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysSalesShippingInformMapper;
@ -16,12 +26,19 @@ import com.ruoyi.common.core.text.Convert;
* @author 刘晓旭
* @date 2024-07-09
*/
@Slf4j
@Service
public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInformService
{
@Autowired
private SysSalesShippingInformMapper sysSalesShippingInformMapper;
@Autowired
private SysSalesOrderMapper sysSalesOrderMapper;
@Autowired
private RedisCache redisCache;
/**
* 查询销售出货通知
*
@ -123,4 +140,38 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor
{
return sysSalesShippingInformMapper.restoreSysSalesShippingInformById(shippingInformId);
}
/**
* 通过销售发起出货生成销售出货通知单列表
* */
@Override
public int generateShippingInformBySalesOrder(SysSalesOrder sysSalesOrder,String outOrderCode) {
SysSalesShippingInform sysSalesShippingInform = new SysSalesShippingInform();
String salesOrderCode = sysSalesOrder.getSalesOrderCode();
if (StringUtils.isEmpty(salesOrderCode)){
log.warn("销售订单编号为空:{}",salesOrderCode);
}
//从数据库查询的数据
SysSalesOrderVo sysSalesOrderVo = sysSalesOrderMapper.selectSysSalesOrderBySalesOrderCode(salesOrderCode);
sysSalesShippingInform.setOutOrderCode(outOrderCode);
//出库状态为 待仓库准备物料
sysSalesShippingInform.setWarehouseOutStatus("0");
sysSalesShippingInform.setSalesOrderCode(salesOrderCode);
//订单类型设置为 销售订单
sysSalesShippingInform.setWarehouseOrderType("0");
//出库类型设置为 销售出库
sysSalesShippingInform.setWarehouseOutType("0");
sysSalesShippingInform.setCustomerId(sysSalesOrderVo.getEnterpriseCode());
sysSalesShippingInform.setCustomerName(sysSalesOrderVo.getEnterpriseName());
sysSalesShippingInform.setDeliveryCondition(sysSalesOrderVo.getDeliveryConditions());
sysSalesShippingInform.setCreateTime(new Date());
sysSalesShippingInform.setCreateBy(ShiroUtils.getLoginName());
sysSalesShippingInform.setAllPriceExcludingTaxDollar(BigDecimal.valueOf(sysSalesOrderVo.getNoUsdSum()));
sysSalesShippingInform.setAllPriceExcludingTaxRmb(BigDecimal.valueOf(sysSalesOrderVo.getNoRmbSum()));
sysSalesShippingInform.setAllPriceIncludesTax(BigDecimal.valueOf(sysSalesOrderVo.getRmbTaxSum()));
return sysSalesShippingInformMapper.insertSysSalesShippingInform(sysSalesShippingInform);
}
}

15
ruoyi-admin/src/main/java/com/ruoyi/warehouse/domain/WarehouseOutOrder.java

@ -4,6 +4,7 @@ import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.aftersales.domain.vo.SelectShippingDeviceVO;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
@ -130,6 +131,11 @@ public class WarehouseOutOrder extends BaseEntity
/** 仓库出库单详情*/
private List<WarehouseOutOrderDetail> warehouseOutOrderDetailList;
/** 添加出货设备列表*/
private List<SelectShippingDeviceVO> selectShippingDeviceVOList;
public void setOutOrderId(Long outOrderId)
{
this.outOrderId = outOrderId;
@ -428,6 +434,14 @@ public class WarehouseOutOrder extends BaseEntity
this.warehouseOutOrderDetailList = warehouseOutOrderDetailList;
}
public List<SelectShippingDeviceVO> getSelectShippingDeviceVOList() {
return selectShippingDeviceVOList;
}
public void setSelectShippingDeviceVOList(List<SelectShippingDeviceVO> selectShippingDeviceVOList) {
this.selectShippingDeviceVOList = selectShippingDeviceVOList;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@ -469,6 +483,7 @@ public class WarehouseOutOrder extends BaseEntity
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.append("warehouseOutOrderDetailList",getWarehouseOutOrderDetailList())
.append("selectShippingDeviceVOList",getSelectShippingDeviceVOList())
.toString();
}
}

16
ruoyi-admin/src/main/java/com/ruoyi/warehouse/domain/WarehouseOutOrderDetail.java

@ -1,7 +1,10 @@
package com.ruoyi.warehouse.domain;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.aftersales.domain.vo.SelectShippingDeviceVO;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
@ -199,6 +202,10 @@ public class WarehouseOutOrderDetail extends BaseEntity
@Excel(name = "收货电话")
private String deliveryNumber;
/** 添加出货设备列表*/
private List<SelectShippingDeviceVO> SelectShippingDeviceVOList;
public void setOutOrderDetailId(Long outOrderDetailId)
{
this.outOrderDetailId = outOrderDetailId;
@ -605,6 +612,14 @@ public class WarehouseOutOrderDetail extends BaseEntity
return deliveryNumber;
}
public List<SelectShippingDeviceVO> getSelectShippingDeviceVOList() {
return SelectShippingDeviceVOList;
}
public void setSelectShippingDeviceVOList(List<SelectShippingDeviceVO> selectShippingDeviceVOList) {
SelectShippingDeviceVOList = selectShippingDeviceVOList;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@ -658,6 +673,7 @@ public class WarehouseOutOrderDetail extends BaseEntity
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("selectShippingDeviceVOList",getSelectShippingDeviceVOList())
.toString();
}
}

5
ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseOutOrderDetailService.java

@ -91,4 +91,9 @@ public interface IWarehouseOutOrderDetailService
* 退换货-出库 供应商物料详情列表
*/
List<WarehouseOutOrderDetail> selectWarehouseOutOrderDetailListByCode(String outOrderCode);
/**
* 修改保存售后第一次维护设备 添加出货设备信息
*/
int addShippingDevicesOne(WarehouseOutOrderDetail warehouseOutOrderDetail);
}

6
ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseOutOrderService.java

@ -3,6 +3,7 @@ package com.ruoyi.warehouse.service;
import java.util.List;
import com.ruoyi.system.domain.SysMakeorderPickVo;
import com.ruoyi.system.domain.SysSalesOrder;
import com.ruoyi.warehouse.domain.WarehouseOutOrder;
/**
@ -100,4 +101,9 @@ public interface IWarehouseOutOrderService
* 生产单-出库
* */
int updateMakeOutWarehouse(WarehouseOutOrder warehouseOutOrder);
/**
* 通过销售发起出货生成仓库出库单
* */
int generateWarehouseOutOrderBySalesOrder(SysSalesOrder sysSalesOrder, String outOrderCode);
}

24
ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseOutOrderDetailServiceImpl.java

@ -3,7 +3,9 @@ package com.ruoyi.warehouse.service.impl;
import java.util.List;
import com.ruoyi.aftersales.domain.AfterSalesShippingDevice;
import com.ruoyi.aftersales.domain.vo.SelectShippingDeviceVO;
import com.ruoyi.aftersales.mapper.AfterSalesShippingDeviceMapper;
import com.ruoyi.common.exception.BusinessException;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.StringUtils;
@ -16,6 +18,7 @@ import com.ruoyi.warehouse.mapper.WarehouseOutOrderDetailMapper;
import com.ruoyi.warehouse.domain.WarehouseOutOrderDetail;
import com.ruoyi.warehouse.service.IWarehouseOutOrderDetailService;
import com.ruoyi.common.core.text.Convert;
import org.springframework.transaction.annotation.Transactional;
/**
* 出库单详情Service业务层处理
@ -165,4 +168,25 @@ public class WarehouseOutOrderDetailServiceImpl implements IWarehouseOutOrderDet
return warehouseOutOrderDetailMapper.selectOutOrderDetailListByCode(outOrderCode);
}
/**
* 修改保存售后第一次维护设备 添加出货设备信息
*/
@Transactional(rollbackFor = Exception.class)
@Override
public int addShippingDevicesOne(WarehouseOutOrderDetail warehouseOutOrderDetail) {
List<SelectShippingDeviceVO> selectShippingDeviceVOList = warehouseOutOrderDetail.getSelectShippingDeviceVOList();
int updateShippingDeviceResult = 0;
for (SelectShippingDeviceVO selectShippingDeviceVO : selectShippingDeviceVOList) {
AfterSalesShippingDevice afterSalesShippingDevice = new AfterSalesShippingDevice();
afterSalesShippingDevice.setShippingDeviceId(selectShippingDeviceVO.getShippingDeviceId());
//设置为已经添加出货设备
afterSalesShippingDevice.setAddShippingDeviceFlag("0");
updateShippingDeviceResult += afterSalesShippingDeviceMapper.updateAfterSalesShippingDevice(afterSalesShippingDevice);
if (updateShippingDeviceResult <= 0){
throw new BusinessException("更新出货设备信息失败");
}
}
return updateShippingDeviceResult;
}
}

105
ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseOutOrderServiceImpl.java

@ -8,15 +8,10 @@ import com.ruoyi.common.exception.BusinessException;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.domain.SysMakeOrder;
import com.ruoyi.system.domain.SysMakeorderPickDetail;
import com.ruoyi.system.domain.SysMakeorderPickVo;
import com.ruoyi.system.domain.SysSalesOrder;
import com.ruoyi.system.mapper.SysMakeOrderMapper;
import com.ruoyi.system.mapper.SysMakeorderPickDetailMapper;
import com.ruoyi.system.mapper.SysMakeorderPickMapper;
import com.ruoyi.system.mapper.SysSalesOrderMapper;
import com.ruoyi.system.domain.*;
import com.ruoyi.system.mapper.*;
import com.ruoyi.warehouse.domain.WarehouseOutOrderDetail;
import com.ruoyi.warehouse.domain.WarehouseStorageOrder;
import com.ruoyi.warehouse.domain.WarehouseStorageOrderDetail;
import com.ruoyi.warehouse.mapper.WarehouseOutOrderDetailMapper;
import lombok.extern.slf4j.Slf4j;
@ -60,6 +55,10 @@ public class WarehouseOutOrderServiceImpl implements IWarehouseOutOrderService
@Autowired
private RedisCache redisCache;
@Autowired
private SysSalesShippingInformMapper shippingInformMapper;
/**
* 查询仓库出库单
*
@ -172,20 +171,39 @@ public class WarehouseOutOrderServiceImpl implements IWarehouseOutOrderService
String loginName = ShiroUtils.getLoginName();
warehouseOutOrder.setUpdateBy(loginName);
warehouseOutOrder.setUpdateTime(new Date());
warehouseOutOrderMapper.updateWarehouseOutOrder(warehouseOutOrder);
//更改出库状态为 第一次维护设备信息
warehouseOutOrder.setWarehouseOutStatus("1");
List<WarehouseOutOrderDetail> warehouseOutOrderDetailList = warehouseOutOrder.getWarehouseOutOrderDetailList();
if (StringUtils.isEmpty(warehouseOutOrderDetailList)){
log.warn("保存销售单-准备物料,物料列表信息为空:{}",warehouseOutOrder);
}
int updateRows = 0;
for (WarehouseOutOrderDetail warehouseOutOrderDetail : warehouseOutOrderDetailList) {
warehouseOutOrderDetail.setUpdateBy(loginName);
warehouseOutOrderDetail.setUpdateTime(new Date());
warehouseOutOrderDetail.setRemark(warehouseOutOrder.getRemark());
//更新数据库记录
updateRows += outOrderDetailMapper.updateWarehouseOutOrderDetail(warehouseOutOrderDetail);
int updateOutOrderDetail = outOrderDetailMapper.updateWarehouseOutOrderDetail(warehouseOutOrderDetail);
if (updateOutOrderDetail <= 0){
throw new BusinessException("更新出库单详情数据失败");
}
return updateRows;
}
SysSalesShippingInform sysSalesShippingInform = new SysSalesShippingInform();
sysSalesShippingInform.setOutOrderCode(warehouseOutOrder.getOutOrderCode());
//更新销售管理销售出库的出货状态 待售后维护设备1
sysSalesShippingInform.setWarehouseOutStatus("1");
sysSalesShippingInform.setUpdateBy(loginName);
sysSalesShippingInform.setUpdateTime(new Date());
int updateShippingInformResult = shippingInformMapper.updateSysSalesShippingInformByOutOrderCode(sysSalesShippingInform);
if (updateShippingInformResult <= 0){
log.warn("出库单号为空:{}",warehouseOutOrder.getOutOrderCode());
throw new BusinessException("更新销售出库单数据失败");
}
int updateWarehouseOutOrderResult = warehouseOutOrderMapper.updateWarehouseOutOrder(warehouseOutOrder);
return updateWarehouseOutOrderResult;
}
@ -513,4 +531,67 @@ public class WarehouseOutOrderServiceImpl implements IWarehouseOutOrderService
}
return warehouseOutOrderMapper.updateWarehouseOutOrder(warehouseOutOrder);
}
/**
* 通过销售发起出货生成仓库出库单
* */
@Override
public int generateWarehouseOutOrderBySalesOrder(SysSalesOrder sysSalesOrder,String outOrderCode) {
String salesOrderCode = sysSalesOrder.getSalesOrderCode();
if (StringUtils.isEmpty(salesOrderCode)){
log.warn("销售订单编号为空:{}",salesOrderCode);
}
//从数据库查询的数据
SysSalesOrderVo sysSalesOrderVo = sysSalesOrderMapper.selectSysSalesOrderBySalesOrderCode(salesOrderCode);
WarehouseOutOrder warehouseOutOrder = new WarehouseOutOrder();
warehouseOutOrder.setOutOrderCode(outOrderCode);
//出库状态为 待仓库准备物料
warehouseOutOrder.setWarehouseOutStatus("0");
warehouseOutOrder.setRelatedOrderCode(salesOrderCode);
warehouseOutOrder.setSalesOrderCode(salesOrderCode);
//订单类型设置为 销售订单
warehouseOutOrder.setWarehouseOrderType("0");
//出库类型设置为 销售出库
warehouseOutOrder.setWarehouseOutType("0");
warehouseOutOrder.setBusinessName(sysSalesOrderVo.getBusinessMembers());
warehouseOutOrder.setCustomerId(sysSalesOrderVo.getEnterpriseCode());
warehouseOutOrder.setCustomerName(sysSalesOrderVo.getEnterpriseName());
warehouseOutOrder.setApplyName(sysSalesOrderVo.getApplyUserName());
warehouseOutOrder.setDeliveryCondition(sysSalesOrderVo.getDeliveryConditions());
warehouseOutOrder.setCreateTime(new Date());
warehouseOutOrder.setCreateBy(ShiroUtils.getLoginName());
//新增出库单明细
CreateOutOrderDetailBySalesOrderChildList(sysSalesOrder, salesOrderCode, sysSalesOrderVo, outOrderCode);
return warehouseOutOrderMapper.insertWarehouseOutOrder(warehouseOutOrder);
}
//新增出库单明细
private void CreateOutOrderDetailBySalesOrderChildList(SysSalesOrder sysSalesOrder, String salesOrderCode, SysSalesOrderVo sysSalesOrderVo, String outOrderCode) {
List<SysSalesOrderChild> sysSalesOrderChildList = sysSalesOrder.getSysSalesOrderChildList();
for (SysSalesOrderChild sysSalesOrderChild : sysSalesOrderChildList) {
WarehouseOutOrderDetail warehouseOutOrderDetail = new WarehouseOutOrderDetail();
warehouseOutOrderDetail.setOutOrderCode(outOrderCode);
warehouseOutOrderDetail.setRelatedOrderCode(salesOrderCode);
warehouseOutOrderDetail.setMaterialNo(sysSalesOrderChild.getMaterialCode());
warehouseOutOrderDetail.setMaterialName(sysSalesOrderChild.getMaterialName());
warehouseOutOrderDetail.setMaterialType(sysSalesOrderChild.getMaterialType());
warehouseOutOrderDetail.setMaterialBrand(sysSalesOrderChild.getBrand());
warehouseOutOrderDetail.setMaterialUnit(sysSalesOrderChild.getUnit());
warehouseOutOrderDetail.setMaterialDescribe(sysSalesOrderChild.getDescribe());
warehouseOutOrderDetail.setMaterialProcessMethod(sysSalesOrderChild.getProcessMethod());
warehouseOutOrderDetail.setMakeNum(sysSalesOrderChild.getMaterialNum());
warehouseOutOrderDetail.setApplyOutOrderSum(sysSalesOrderChild.getApplyShippingNum());
warehouseOutOrderDetail.setCustomerId(sysSalesOrderVo.getEnterpriseCode());
warehouseOutOrderDetail.setCustomerName(sysSalesOrderVo.getEnterpriseName());
warehouseOutOrderDetail.setDeliveryCondition(sysSalesOrderVo.getDeliveryConditions());
warehouseOutOrderDetail.setCreateTime(new Date());
warehouseOutOrderDetail.setCreateBy(ShiroUtils.getLoginName());
int insertOutOrderDetailResult = outOrderDetailMapper.insertWarehouseOutOrderDetail(warehouseOutOrderDetail);
if (insertOutOrderDetailResult <= 0){
throw new BusinessException("新增出库单明细数据失败");
}
}
}
}

19
ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseStorageOrderServiceImpl.java

@ -20,7 +20,9 @@ import com.ruoyi.quality.mapper.QualityOrderReportUnqualifiedMapper;
import com.ruoyi.quality.service.IQualityOrderService;
import com.ruoyi.system.domain.SysMakeOrder;
import com.ruoyi.system.domain.SysSalesOrder;
import com.ruoyi.system.domain.SysSalesOrderChild;
import com.ruoyi.system.mapper.SysMakeOrderMapper;
import com.ruoyi.system.mapper.SysSalesOrderChildMapper;
import com.ruoyi.system.mapper.SysSalesOrderMapper;
import com.ruoyi.system.service.ISysMakeOrderService;
import com.ruoyi.system.service.ISysSalesOrderService;
@ -69,6 +71,8 @@ public class WarehouseStorageOrderServiceImpl implements IWarehouseStorageOrderS
@Autowired
private SysMakeOrderMapper sysMakeOrderMapper;
@Autowired
private SysSalesOrderChildMapper salesOrderChildMapper;
@Autowired
private RedisCache redisCache;
@ -790,6 +794,7 @@ public class WarehouseStorageOrderServiceImpl implements IWarehouseStorageOrderS
throw new BusinessException("更新生产订单数据失败");
}
//更新销售订单数据
SysSalesOrder sysSalesOrder = salesOrderMapper.selectSysSalesOrderBySalesOrderCode(tempSysMakeOrder.getSaleNo());
//设置为全部完成
@ -801,6 +806,20 @@ public class WarehouseStorageOrderServiceImpl implements IWarehouseStorageOrderS
throw new BusinessException("更新销售订单数据失败");
}
//更新销售订单子表的数据
for (WarehouseStorageOrderDetail warehouseStorageOrderDetail : warehouseStorageOrderDetailList) {
SysSalesOrderChild sysSalesOrderChild = new SysSalesOrderChild();
sysSalesOrderChild.setQuoteId(tempSysMakeOrder.getSaleNo());
sysSalesOrderChild.setMaterialCode(warehouseStorageOrderDetail.getMaterialNo());
sysSalesOrderChild.setFinishNum(warehouseStorageOrderDetail.getStorageNum());
sysSalesOrderChild.setUpdateBy(loginName);
sysSalesOrderChild.setUpdateTime(new Date());
int updateSalesOrderChildResult = salesOrderChildMapper.updateSysSalesOrderChildByCodeAndQuoteId(sysSalesOrderChild);
if (updateSalesOrderChildResult <= 0){
throw new BusinessException("更新销售订单子表数据失败");
}
}
// //更新生产单数据
// int updateMakeOrderResult = sysMakeOrderService.updateSysMakeOrderByWarehouseStorageOrder(warehouseStorageOrder, warehouseStorageOrderDetailList);

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

@ -43,10 +43,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="addShippingDeviceFlag" column="add_shipping_device_flag" />
</resultMap>
<sql id="selectAfterSalesShippingDeviceVo">
select shipping_device_code, shipping_device_id, make_no,sales_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 from aftersales_shipping_device
select shipping_device_code, shipping_device_id, make_no,sales_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 from aftersales_shipping_device
</sql>
<select id="selectAfterSalesShippingDeviceList" parameterType="AfterSalesShippingDevice" resultMap="AfterSalesShippingDeviceResult">
@ -77,6 +79,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where shipping_device_code = #{shippingDeviceCode}
</select>
<select id="selectAfterSalesShippingDeviceByShippingDeviceId" parameterType="String" resultMap="AfterSalesShippingDeviceResult">
<include refid="selectAfterSalesShippingDeviceVo"/>
where shipping_device_id = #{shippingDeviceId}
</select>
<select id="selectShippingDeviceByMakeNo" parameterType="String" resultMap="AfterSalesShippingDeviceResult">
<include refid="selectAfterSalesShippingDeviceVo"/>
where make_no = #{makeNo}
@ -98,6 +108,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectAfterSalesShippingDeviceVo"/>
where make_no = #{makeNo}
and sales_order_code = #{salesOrderCode}
and material_no = #{materialNo}
</select>
<select id="selectShippingDeviceListByMaterialNo" parameterType="AfterSalesShippingDevice" resultMap="AfterSalesShippingDeviceResult">
<include refid="selectAfterSalesShippingDeviceVo"/>
where material_no = #{materialNo}
</select>
@ -141,6 +158,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="addShippingDeviceFlag != null">add_shipping_device_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="shippingDeviceId != null and shippingDeviceId != ''">#{shippingDeviceId},</if>
@ -179,6 +197,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="addShippingDeviceFlag != null">#{addShippingDeviceFlag}</if>
</trim>
</insert>
@ -221,6 +240,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">create_time = #{createTime},</if>
<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>
</trim>
where shipping_device_id= #{shippingDeviceId}
</update>

68
ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderChildMapper.xml

@ -32,6 +32,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="expiryDay" column="expiry_day" />
<result property="outBoundQuantity" column="out_bound_quantity" />
<result property="unBoundQuantity" column="un_bound_quantity" />
<result property="finishNum" column="finish_num" />
<result property="applyShippingNum" column="apply_shipping_num" />
<result property="hasApplyShippingNum" column="has_apply_shipping_num" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
@ -84,6 +87,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and materialCode = #{materialCode}
</select>
<select id="selectOrderChildListBySalesOrderCode" resultMap="SysSalesOrderChildResult">
select id, quoteId, materialId, materialCode, materialName, materialType, processMethod, brand,
warehouseDept,materialNum, photoUrl,finish_num,apply_shipping_num,has_apply_shipping_num
from sys_sales_order_child
where quoteId = #{quoteId}
</select>
<insert id="insertSysSalesOrderChild" parameterType="SysSalesOrderChild" useGeneratedKeys="true" keyProperty="id">
insert into sys_sales_order_child
@ -115,6 +125,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="expiryDay != null">expiry_day,</if>
<if test="outBoundQuantity != null">out_bound_quantity,</if>
<if test="unBoundQuantity != null">un_bound_quantity,</if>
<if test="finishNum != null">finish_num,</if>
<if test="applyShippingNum != null">apply_shipping_num,</if>
<if test="hasApplyShippingNum != null">has_apply_shipping_num,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="remark != null">remark,</if>
@ -151,6 +164,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="expiryDay != null">#{expiryDay},</if>
<if test="outBoundQuantity != null">#{outBoundQuantity},</if>
<if test="unBoundQuantity != null">#{unBoundQuantity},</if>
<if test="finishNum != null">#{finishNum},</if>
<if test="applyShippingNum != null">#{applyShippingNum}</if>
<if test="hasApplyShippingNum != null">#{hasApplyShippingNum},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="remark != null">#{remark},</if>
@ -191,6 +207,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="expiryDay != null">expiry_day = #{expiryDay},</if>
<if test="outBoundQuantity != null">out_bound_quantity = #{outBoundQuantity},</if>
<if test="unBoundQuantity != null">un_bound_quantity = #{unBoundQuantity},</if>
<if test="finishNum != null">finish_num = #{finishNum},</if>
<if test="applyShippingNum != null">apply_shipping_num = #{applyShippingNum},</if>
<if test="hasApplyShippingNum != null">has_apply_shipping_num = #{hasApplyShippingNum},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="auditStatus != null">audit_status = #{auditStatus},</if>
@ -202,6 +221,55 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
where id = #{id}
</update>
<update id="updateSysSalesOrderChildByCodeAndQuoteId" parameterType="SysSalesOrderChild">
update sys_sales_order_child
<trim prefix="SET" suffixOverrides=",">
<if test="quoteId != null">quoteId = #{quoteId},</if>
<if test="materialId != null">materialId = #{materialId},</if>
<if test="materialCode != null">materialCode = #{materialCode},</if>
<if test="materialName != null">materialName = #{materialName},</if>
<if test="materialType != null">materialType = #{materialType},</if>
<if test="processMethod != null">processMethod = #{processMethod},</if>
<if test="brand != null">brand = #{brand},</if>
<if test="photoUrl != null">photoUrl = #{photoUrl},</if>
<if test="unit != null">unit = #{unit},</if>
<if test="describe != null">`describe` = #{describe},</if>
<if test="warehouseDept != null">warehouseDept = #{warehouseDept},</if>
<if test="countTax != null">countTax = #{countTax},</if>
<if test="usdTax != null">usdTax = #{usdTax},</if>
<if test="materialNum != null">materialNum = #{materialNum},</if>
<if test="materialSole != null">materialSole = #{materialSole},</if>
<if test="materialRmb != null">materialRmb = #{materialRmb},</if>
<if test="materialNoRmb != null">materialNoRmb = #{materialNoRmb},</if>
<if test="materialNoUsd != null">materialNoUsd = #{materialNoUsd},</if>
<if test="materialUsd != null">materialUsd = #{materialUsd},</if>
<if test="materialUsdSum != null">materialUsdSum = #{materialUsdSum},</if>
<if test="materialNoUsdSum != null">materialNoUsdSum = #{materialNoUsdSum},</if>
<if test="materialNoRmbSum != null">materialNoRmbSum = #{materialNoRmbSum},</if>
<if test="materialRmbSum != null">materialRmbSum = #{materialRmbSum},</if>
<if test="deliveryTime != null">delivery_time = #{deliveryTime},</if>
<if test="expiryDay != null">expiry_day = #{expiryDay},</if>
<if test="outBoundQuantity != null">out_bound_quantity = #{outBoundQuantity},</if>
<if test="unBoundQuantity != null">un_bound_quantity = #{unBoundQuantity},</if>
<if test="finishNum != null">finish_num = #{finishNum},</if>
<if test="applyShippingNum != null">apply_shipping_num = #{applyShippingNum},</if>
<if test="hasApplyShippingNum != null">has_apply_shipping_num = #{hasApplyShippingNum},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="auditStatus != null">audit_status = #{auditStatus},</if>
<if test="useStatus != null">use_status = #{useStatus},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
</trim>
where quoteId = #{quoteId}
and materialCode = #{materialCode}
</update>
<delete id="deleteSysSalesOrderChildById" parameterType="Long">
delete from sys_sales_order_child where id = #{id}
</delete>

36
ruoyi-admin/src/main/resources/mapper/system/SysSalesShippingInformMapper.xml

@ -151,6 +151,42 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where shipping_inform_id = #{shippingInformId}
</update>
<update id="updateSysSalesShippingInformByOutOrderCode" parameterType="SysSalesShippingInform">
update sys_sales_shipping_inform
<trim prefix="SET" suffixOverrides=",">
<if test="outOrderCode != null">out_order_code = #{outOrderCode},</if>
<if test="warehouseOutStatus != null">warehouse_out_status = #{warehouseOutStatus},</if>
<if test="salesOrderCode != null">sales_order_code = #{salesOrderCode},</if>
<if test="warehouseOutType != null">warehouse_out_type = #{warehouseOutType},</if>
<if test="warehouseOrderType != null">warehouse_order_type = #{warehouseOrderType},</if>
<if test="customerId != null">customer_id = #{customerId},</if>
<if test="customerName != null">customer_name = #{customerName},</if>
<if test="businessMembers != null">business_members = #{businessMembers},</if>
<if test="salesOrderNumber != null">sales_order_number = #{salesOrderNumber},</if>
<if test="materialSum != null">material_sum = #{materialSum},</if>
<if test="enterpriseSum != null">enterprise_sum = #{enterpriseSum},</if>
<if test="customerContact != null">customer_contact = #{customerContact},</if>
<if test="contactNumber != null">contact_number = #{contactNumber},</if>
<if test="customerContactAddress != null">customer_contact_address = #{customerContactAddress},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="allPriceExcludingTaxRmb != null">all_price_excluding_tax_rmb = #{allPriceExcludingTaxRmb},</if>
<if test="allPriceExcludingTaxDollar != null">all_price_excluding_tax_dollar = #{allPriceExcludingTaxDollar},</if>
<if test="allPriceIncludesTax != null">all_price_includes_tax = #{allPriceIncludesTax},</if>
<if test="plannedDeliveryTime != null">planned_delivery_time = #{plannedDeliveryTime},</if>
<if test="acceptanceTime != null">acceptance_time = #{acceptanceTime},</if>
<if test="paymentCondition != null">payment_condition = #{paymentCondition},</if>
<if test="deliveryCondition != null">delivery_condition = #{deliveryCondition},</if>
<if test="deliverTime != null">deliver_time = #{deliverTime},</if>
</trim>
where out_order_code = #{outOrderCode}
</update>
<delete id="deleteSysSalesShippingInformById" parameterType="Long">
delete from sys_sales_shipping_inform where shipping_inform_id = #{shippingInformId}
</delete>

186
ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/addShippingDevices.html

@ -1,186 +0,0 @@
<!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" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-warehouseOutOrder-edit" th:object="${selectMaterialsVO}">
<!-- <input name="quoteId" th:field="*{quoteId}" type="hidden">-->
<!-- <input name="materialCode" th:field="*{materialCode}" type="hidden">-->
<div class="col-sm-12 select-table table-striped">
<h3 class="mb-4">物料信息</h3>
<table id="table-material"></table>
</div>
<div class="col-sm-12 select-table table-striped">
<h3 class="mb-4">出货设备</h3>
<table id="table-shippingDevices"></table>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
// var addFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:addShippingDevice')}]];
// var addFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:addShippingDevice')}]];
var prefix = ctx + "aftersales/warehouseOutOrder";
var selectMaterialsVO = [[${selectMaterialsVO}]];
$("#form-warehouseOutOrder-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-warehouseOutOrder-edit').serialize());
}
}
$("input[name='outOrderTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='planDeliveryTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
/*物料信息列表*/
$(function() {
// 物料信息
$('#table-material').bootstrapTable('destroy');
var materialOptions = {
id:"table-material",
url: prefix + "/addShippingDevicesMaterial",
modalName: "物料信息",
showColumns: false,
pagination: false,
showToggle: false,
showRefresh:false,
showSearch:false,
queryParams:queryParams,
columns: [{
checkbox: true
},
{ title:'销售订单号',
field:'quoteId',
visible: false
},
{
title: '料号',
field: 'materialCode',
},
{
title: '图片',
field: 'photoUrl',
},
{
title: '物料名称',
field: 'materialName',
},
{
title: '物料类型',
field: 'materialType',
},
{
title: '单位',
field: 'materialUnit',
},
{
title: '品牌',
field: 'brand',
},
{
title: '描述',
field: 'describe',
},
]
};
$.table.init(materialOptions);
})
function queryParams(params) {
var curParams = {
// 传递参数查询参数
quoteId: selectMaterialsVO.quoteId,
materialCode: selectMaterialsVO.materialCode,
};
return curParams;
}
/* 出货设备列表 */
$(function() {
// 物料信息
$('#table-shippingDevices').bootstrapTable('destroy');
var shippingDevicesOptions = {
id: "table-shippingDevices",
url: prefix + "/addShippingDevicesOptions",
modalName: "物料信息",
showColumns: false,
pagination: false,
showToggle: false,
showRefresh: false,
showSearch: false,
queryParams:shippingDevicesQueryParams,
columns: [
{
checkbox: true // 保留原有全选checkbox
},
{
title: '销售订单号',
field: 'quoteId',
visible: false
},
{
title: '出货设备ID',
field: 'shippingDeviceId',
},
{
title: '设备型号',
field: 'deviceModelCode',
},
{
title: '流水号',
field: 'deviceRunningNumber',
},
{
title: '生产图片',
field: 'makePhotoUrl',
},
{
title: '确认添加', // 修改标题为操作
align: 'center',
// formatter: function(value, row, index) {
// // 自定义操作列内容,包含一个确认添加按钮和一个独立的checkbox
// var checkboxHtml = '<input type="checkbox" value="' + row.shippingDeviceId + '" class="custom-checkbox">';
// var addButtonHtml = '<a class="btn btn-success btn-xs ' + addFlag + '" href="javascript:void(0)" onclick="addShippingDevices(\'' + row.materialCode + '\')"><i class="fa fa-add"></i>添加出货设备</a>';
// return checkboxHtml + ' ' + addButtonHtml;
// },
// events: { // 添加事件处理器
// 'click .custom-checkbox': function(e, value, row, index) {
// // 这里可以添加点击checkbox时的处理逻辑
// var checkbox = e.target;
// console.log("Checkbox for device ID: " + row.shippingDeviceId + " was clicked. Checked: " + checkbox.checked);
// }
// }
}
]
};
$.table.init(shippingDevicesOptions);
});
function shippingDevicesQueryParams(params) {
var curParams = {
// 传递参数查询参数
quoteId: selectMaterialsVO.quoteId,
};
return curParams;
}
</script>
</body>
</html>

308
ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/addShippingDevicesOne.html

@ -0,0 +1,308 @@
<!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" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-addShippingDevicesOne-edit" th:object="${warehouseOutOrderDetail}">
<div class="form-group">
<label class="col-sm-4 control-label">料号:</label>
<div class="col-sm-8">
<input readonly name="materialNo" th:field="*{materialNo}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">图片:</label>
<div class="col-sm-8">
<input readonly name="materialPhotourl" th:field="*{materialPhotourl}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">物料名称:</label>
<div class="col-sm-8">
<input readonly name="materialName" th:field="*{materialName}" class="form-control" type="text">
</div>
</div>
<!-- <div class="form-group">-->
<!-- <label class="col-sm-4 control-label">物料类型:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <input readonly name="materialType" th:field="*{materialType}" class="form-control" type="text">-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label class="col-sm-4 control-label">物料类别:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <input readonly name="materialClass" th:field="*{materialClass}" class="form-control" type="text">-->
<!-- </div>-->
<!-- </div>-->
<div class="form-group">
<label class="col-sm-4 control-label">型号:</label>
<div class="col-sm-8">
<input readonly name="materialModel" th:field="*{materialModel}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">规格:</label>
<div class="col-sm-8">
<input readonly name="materialSpecification" th:field="*{materialSpecification}" class="form-control"
type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">单位:</label>
<div class="col-sm-8">
<input readonly name="materialUnit" th:field="*{materialUnit}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">品牌:</label>
<div class="col-sm-8">
<input readonly name="materialBrand" th:field="*{materialBrand}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">描述:</label>
<div class="col-sm-8">
<input readonly name="materialDescribe" th:field="*{materialDescribe}" class="form-control" type="text">
</div>
</div>
<!-- <div class="col-sm-12 select-table table-striped">-->
<!-- <h3 class="mb-4">物料信息</h3>-->
<!-- <table id="table-material"></table>-->
<!-- </div>-->
</form>
<div class="container">
<!-- 选择出货设备 -->
<div class="row">
<div class="col-sm-12 select-table table-striped">
<h3 class="mb-4">出货设备</h3>
<table id="table-shippingDevices"></table>
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
// var addFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:addShippingDevice')}]];
// var addFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:addShippingDevice')}]];
var prefix = ctx + "aftersales/warehouseOutOrder";
var warehouseOutOrderDetail = [[${warehouseOutOrderDetail}]];
$("#form-addShippingDevicesOne-edit").validate({
focusCleanup: true
});
/*
* 提交设备履历信息
* */
function submitHandler() {
// 获取表单数据
const shippingDevicesData = $("#form-addShippingDevicesOne-edit").serializeArray().reduce((obj, item) => {
obj[item.name] = item.value;
return obj;
}, {});
// 获取bootstrap-table的数据,这里假设你使用bootstrap-table的API获取所有数据
// var table = $('#table-shippingDevices').bootstrapTable('getData');
//获取选中复选框行的数据
const selectedRows = $("#table-shippingDevices").bootstrapTable('getSelections');
// 检查表格数据是否为空
if (selectedRows.length===0){
$.modal.alertWarning("请至少选择一条出货设备信息后再保存!");
return;
}
// 将表数据转换成与complaintNoticeData格式一致的数组
var equipDetailDataList = selectedRows.map(function(item) {
// 根据实际字段名调整
return {
"shippingDeviceId": item.shippingDeviceId,
"deviceModelCode": item.deviceModelCode,
"deviceRunningNumber": item.deviceRunningNumber,
"makePhotoUrl": item.makePhotoUrl
// ...其他字段
};
});
// 合并表单数据和表格数据
const combinedData = Object.assign({}, shippingDevicesData, { selectShippingDeviceVOList: equipDetailDataList });
console.log(combinedData)
// 使用 JSON.stringify() 序列化数据
const jsonData = JSON.stringify(combinedData);
// 发送 AJAX 请求到后端接口
$.operate.saveJson(prefix + "/addShippingDevicesOne", jsonData);
}
$("input[name='outOrderTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='planDeliveryTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
//
// /*物料信息列表*/
// $(function() {
// // 物料信息
// $('#table-material').bootstrapTable('destroy');
// var materialOptions = {
// id:"table-material",
// url: prefix + "/addShippingDevicesMaterial",
// modalName: "物料信息",
// showColumns: false,
// pagination: false,
// showToggle: false,
// showRefresh:false,
// showSearch:false,
// queryParams:queryParams,
// columns: [{
// checkbox: true
// },
// { title:'销售订单号',
// field:'quoteId',
// visible: false
// },
// {
// title: '料号',
// field: 'materialCode',
// },
// {
// title: '图片',
// field: 'photoUrl',
// },
// {
// title: '物料名称',
// field: 'materialName',
// },
// {
// title: '物料类型',
// field: 'materialType',
// },
// {
// title: '单位',
// field: 'materialUnit',
// },
// {
// title: '品牌',
// field: 'brand',
// },
// {
// title: '描述',
// field: 'describe',
// },
// ]
// };
// $.table.init(materialOptions);
//
// })
// function queryParams(params) {
// var curParams = {
// // 传递参数查询参数
// quoteId: selectMaterialsVO.quoteId,
// materialCode: selectMaterialsVO.materialCode,
// };
// return curParams;
// }
$(function(){
var options = {
id: "table-shippingDevices",
url: prefix + "/getEquipMaterialDetailByMaterialNo",
pagination: false,
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
queryParams:queryParams,
sidePagination: "client",
columns: [{
checkbox: true
},
{
field: 'equipmentIndex',
align: 'center',
title: "序号",
formatter: function (value, row, index) {
// 使用bootstrap-table的内置序号生成
return index + 1;
}
},
{
field: 'shippingDeviceId',
align: 'center',
title: '出货设备id',
},
{
field: 'deviceModelCode',
align: 'center',
title: '设备型号',
},
{
field: 'deviceRunningNumber',
align: 'center',
title: '流水号',
},
{
field: 'makePhotoUrl',
align: 'center',
title: '生产图片',
},
{
title: '操作',
align: 'center',
formatter: function (value, row, index) {
return '<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeRow(' + index + ')"><i class="fa fa-remove"></i>删除</a>';
}
}
]
};
$.table.init(options);
})
function queryParams(params) {
var curParams = {
// 传递参数查询参数
materialNo: warehouseOutOrderDetail.materialNo
};
return curParams;
}
function removeRow(index) {
var data = $('#table-shippingDevices').bootstrapTable('getData');
var row = data[index]; // 获取要删除的行数据
if (row) {
$('#table-shippingDevices').bootstrapTable('remove', {
field: 'equipmentIndex',
values: [row.equipmentIndex]
});
}
}
</script>
</body>
</html>

109
ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/maintenanceEquipmentOne.html

@ -6,7 +6,7 @@
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-warehouseOutOrder-edit" th:object="${warehouseOutOrder}">
<form class="form-horizontal m" id="form-maintenanceEquipmentOne-edit" th:object="${warehouseOutOrder}">
<input name="outOrderId" th:field="*{outOrderId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">出库单号:</label>
@ -85,16 +85,53 @@
var prefix = ctx + "aftersales/warehouseOutOrder";
var warehouseOutOrder = [[${warehouseOutOrder}]];
$("#form-warehouseOutOrder-edit").validate({
$("#form-maintenanceEquipmentOne-edit").validate({
focusCleanup: true
});
// function submitHandler() {
// if ($.validate.form()) {
// $.operate.save(prefix + "/maintenanceEquipmentOne", $('#form-maintenanceEquipmentOne-edit').serialize());
// }
// }
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-warehouseOutOrder-edit').serialize());
}
// 获取表单数据
const shippingDevicesData = $("#form-maintenanceEquipmentOne-edit").serializeArray().reduce((obj, item) => {
obj[item.name] = item.value;
return obj;
}, {});
// 在需要收集所有子表数据的地方调用此函数
var allSubData = getAllSubTablesData();
// 将表数据转换成与complaintNoticeData格式一致的数组
var equipDetailDataList = allSubData.map(function(item) {
// 根据实际字段名调整
return {
"shippingDeviceId": item.shippingDeviceId,
"deviceModelCode": item.deviceModelCode,
"deviceRunningNumber": item.deviceRunningNumber,
"makePhotoUrl": item.makePhotoUrl,
"snCode": item.snCode
// ...其他字段
};
});
// 合并表单数据和表格数据
const combinedData = Object.assign({}, shippingDevicesData, { selectShippingDeviceVOList: equipDetailDataList });
console.log(combinedData)
// 使用 JSON.stringify() 序列化数据
const jsonData = JSON.stringify(combinedData);
// 发送 AJAX 请求到后端接口
$.operate.saveJson(prefix + "/maintenanceEquipmentOne", jsonData);
}
$("input[name='outOrderTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
@ -107,8 +144,10 @@
autoclose: true
});
$(function() {
var options = {
id:'bootstrap-table',
url: prefix + "/getMaintenanceEquipmentOneMaterials",
modalName: "物料信息",
showColumns: false,
@ -124,13 +163,20 @@
columns: [{
checkbox: true
},
{ title:'销售订单号',
field:'quoteId',
visible: false
},
{
title:'出库单详情Id',
field:'outOrderDetailId',
visible: false
},
{
title: '料号',
field: 'materialCode',
field: 'materialNo',
},
{
title: '图片',
@ -156,19 +202,34 @@
title: '描述',
field: 'describe',
},
{
title: '订单数量',
field: 'makeNum',
},
{
title: '已出库数',
field: 'hasOutOrderSum',
},
{
title: '申请出库数',
field: 'applyOutOrderSum',
},
{
title: '准备出库数',
field: 'prepareOutOrderSum',
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + addFlag + '" href="javascript:void(0)" onclick="addShippingDevices(\'' + row.quoteId + '\',\'' + row.materialCode + '\')"><i class="fa fa-add"></i>添加出货设备</a>');
actions.push('<a class="btn btn-success btn-xs ' + addFlag + '" href="javascript:void(0)" onclick="addShippingDevicesOne(\'' + row.outOrderDetailId + '\')"><i class="fa fa-add"></i>添加出货设备</a>');
return actions.join('');
}
}
]
};
$.table.init(options);
})
@ -177,12 +238,12 @@
var childTableId = 'child_table_'+index;
$detail.html('<table id="'+childTableId+'"></table>');
$('#'+childTableId).bootstrapTable({
url: prefix + "/showAftersalesShippingDevicelist",
url: prefix + "/showAftersalesShippingDeviceList",
method: 'post',
sidePagination: "server",
contentType: "application/x-www-form-urlencoded",
queryParams : {
salesOrderCode: warehouseOutOrder.salesOrderCode,
// salesOrderCode: warehouseOutOrder.salesOrderCode,
materialNo: parentRow.materialNo
},
columns: [
@ -214,6 +275,7 @@
});
};
function queryParams(params) {
var curParams = {
// 传递参数查询参数
@ -223,6 +285,21 @@
}
// 获取所有子表数据的函数
// 获取所有子表数据的函数
function getAllSubTablesData() {
var allSubData = [];
// 获取所有被展开的行
var parentLength = $("#bootstrap-table").bootstrapTable("getData").length;
for (let i = 0; i < parentLength; i++) {
var sonData = $('#'+"child_table_" + i).bootstrapTable("getData");
//循环获取子表中存在的行数据,每个行数据转换添加到allSubData数组中
allSubData = allSubData.concat(sonData);
}
return allSubData;
}
function deleteRow(shippingDeviceId) {
// 弹出确认框询问用户是否确定删除
if (confirm("确定要删除这条记录吗?")) {
@ -255,12 +332,18 @@
/*添加出货设备*/
function addShippingDevices(quoteId, materialCode) {
// 确保URL编码,特别是如果materialCode中可能含有特殊字符
var url = ctx + 'aftersales/warehouseOutOrder/addShippingDevices/' + encodeURIComponent(quoteId) + '/' + encodeURIComponent(materialCode);
// function addShippingDevicesOne(quoteId, materialCode) {
// // 确保URL编码,特别是如果materialCode中可能含有特殊字符
// var url = ctx + 'aftersales/warehouseOutOrder/addShippingDevicesOne/' + encodeURIComponent(quoteId) + '/' + encodeURIComponent(materialCode);
// $.modal.open("添加出货设备", url);
// }
function addShippingDevicesOne(outOrderDetailId) {
var url = prefix + '/addShippingDevicesOne/' + outOrderDetailId
$.modal.open("添加出货设备", url);
}
</script>
</body>
</html>

3
ruoyi-admin/src/main/resources/templates/system/makeorder/addEquipmentResume.html

@ -207,7 +207,8 @@
var curParams = {
// 传递参数查询参数
makeNo: equipMaterial.makeNo,
quoteId: equipMaterial.quoteId
quoteId: equipMaterial.quoteId,
materialCode: equipMaterial.materialCode
};
return curParams;
}

231
ruoyi-admin/src/main/resources/templates/system/salesOrder/salesDeliverGoods.html

@ -0,0 +1,231 @@
<!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" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-salesDeliverGoods-edit" th:object="${sysSalesOrder}">
<input name="salesOrderId" th:field="*{salesOrderId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">订单类型:</label>
<div class="col-sm-8">
<select name="salesOrderType" class="form-control m-b" th:with="type=${@dict.getType('sys_order_type')}" disabled>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{salesOrderType}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">销售单号:</label>
<div class="col-sm-8">
<input name="salesOrderCode" th:field="*{salesOrderCode}" 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="applyUser" th:field="*{applyUser}" class="form-control" type="text" disabled>
</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')}" disabled>-->
<!-- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{warehouseOutType}"></option>-->
<!-- </select>-->
<!-- </div>-->
<!-- </div>-->
<div class="form-group">
<label class="col-sm-3 control-label">客户ID:</label>
<div class="col-sm-8">
<input name="enterpriseCode" th:field="*{enterpriseCode}" 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="enterpriseName" th:field="*{enterpriseName}" 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="customerDelivery" th:field="*{customerDelivery}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">收货电话:</label>
<div class="col-sm-8">
<input name="deliveryPhone" th:field="*{deliveryPhone}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">收货地址:</label>
<div class="col-sm-8">
<input name="deliveryAddress" th:field="*{deliveryAddress}" class="form-control" type="text" disabled>
</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">
</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 sysSalesOrder = [[${sysSalesOrder}]];
var prefix = ctx + "system/salesOrder";
$("#form-salesDeliverGoods-edit").validate({
focusCleanup: true
});
// 新增提交
function submitHandler() {
// 获取表单数据
const salesOrderData = $("#form-salesDeliverGoods-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 {
"id":item.id,
"materialCode": item.materialCode,
"materialName": item.materialName,
"materialType": item.materialType,
"describe": item.describe,
"unit": item.unit,
"brand": item.brand,
"processMethod": item.processMethod,
"materialNum": item.materialNum,
"finishNum": item.finishNum,
"hasApplyShippingNum": item.hasApplyShippingNum,
"outBoundQuantity": item.outBoundQuantity,
"applyShippingNum": item.applyShippingNum,
// ...其他字段
};
});
const combinedData = Object.assign({}, salesOrderData, {
sysSalesOrderChildList: materialDataList,
});
// 合并表单数据和表格数据
console.log(combinedData)
// 使用 JSON.stringify() 序列化数据
const jsonData = JSON.stringify(combinedData);
// 发送 AJAX 请求到后端接口
$.operate.saveJson(prefix + "/salesDeliverGoods", jsonData);
}
//物料信息展示列表
$(function() {
var options = {
modalName: "选择物料",
url: prefix + "/salesDeliverGoodsDetailList",
queryParams: queryParams,
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
pagination: false, // 设置不分页
columns: [{
checkbox: true
},
{
title: '销售订单详情ID',
field: 'id',
visible: false
},
{
title: '料号',
field: 'materialCode',
},
{
title: '图片',
field: 'photoUrl',
},
{
title: '物料名称',
field: 'materialName',
},
{
title: '物料类型',
field: 'materialType',
},
{
title: '描述',
field: 'describe',
},
{
title: '单位',
field: 'unit',
},
{
title: '品牌',
field: 'brand',
},
{
title: '加工方式',
field: 'processMethod',
},
{
title: '订单数量',
field: 'materialNum',
},
{
title: '已完成数',
field: 'finishNum',
},
{
title: '已申请出货数',
field: 'hasApplyShippingNum',
},
{
title: '已出库数',
field: 'outBoundQuantity',
},
{
title: '申请出货数',
field: 'applyShippingNum',
editable:true,
},
]
};
$.table.init(options);
})
function queryParams(params) {
var curParams = {
// 传递参数查询参数
salesOrderCode: sysSalesOrder.salesOrderCode
};
return curParams;
}
</script>
</body>
</html>

12
ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/prepareMaterial.html

@ -117,7 +117,17 @@
"outOrderDetailId":item.outOrderDetailId,
"outOrderCode":item.outOrderCode,
"materialNo": item.materialNo, // 假设id对应materialId
"prepareOutOrderSum":item.prepareOutOrderSum,
"materialName": item.materialName,
"materialType": item.materialType,
"materialPhotourl": item.materialPhotourl,
"materialDescribe": item.materialDescribe,
"materialBrand": item.materialBrand,
"materialUnit": item.materialUnit,
"materialProcessMethod": item.materialProcessMethod,
"makeNum": item.makeNum,
"hasOutOrderSum": item.hasOutOrderSum,
"applyOutOrderSum": item.applyOutOrderSum,
"prepareOutOrderSum": item.prepareOutOrderSum,
// ...其他字段
};
});

Loading…
Cancel
Save