Browse Source

[feat] 销售管理 仓库管理

新增销售出库通知单 确认发货前端页面
新增销售出库通知单 取消发货前端页面
新增销售出库通知单 确认发货跳转页面后端接口和修改保存数据后端接口
新增销售出库通知单 取消发货跳转页面后端接口和修改保存数据后端接口
出库单新增 根据出库单号查询出库单数据后端接口
dev
liuxiaoxu 4 months ago
parent
commit
9ec6b3a035
  1. 55
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesShippingInformController.java
  2. 11
      ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesShippingInformService.java
  3. 48
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformServiceImpl.java
  4. 5
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseOutOrderMapper.java
  5. 8
      ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseOutOrderMapper.xml
  6. 35
      ruoyi-admin/src/main/resources/templates/system/salesShippingInform/cancelShipping.html
  7. 49
      ruoyi-admin/src/main/resources/templates/system/salesShippingInform/confirmShipping.html
  8. 19
      ruoyi-admin/src/main/resources/templates/system/salesShippingInform/salesShippingInform.html

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

@ -1,15 +1,13 @@
package com.ruoyi.system.controller;
import java.util.List;
import com.ruoyi.system.domain.SysSalesOrder;
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.system.domain.SysSalesShippingInform;
@ -147,5 +145,52 @@ public class SysSalesShippingInformController extends BaseController
return toAjax(sysSalesShippingInformService.restoreSysSalesShippingInformById(id));
}
/**
* 确认发货
*/
@GetMapping("/confirmShipping/{shippingInformId}")
public String confirmShipping(@PathVariable("shippingInformId") Long shippingInformId, ModelMap mmap)
{
SysSalesShippingInform sysSalesShippingInform = sysSalesShippingInformService.selectSysSalesShippingInformById(shippingInformId);
mmap.put("sysSalesShippingInform", sysSalesShippingInform);
return prefix + "/confirmShipping";
}
/**
* 修改保存确认发货
*/
@RequiresPermissions("system:salesShippingInform:confirmShipping")
@Log(title = "销售确认发货", businessType = BusinessType.UPDATE)
@PostMapping("/confirmShipping")
@ResponseBody
public AjaxResult confirmShippingSave(SysSalesShippingInform sysSalesShippingInform)
{
return toAjax(sysSalesShippingInformService.updateConfirmShipping(sysSalesShippingInform));
}
/**
* 取消发货
*/
@GetMapping("/cancelShipping/{shippingInformId}")
public String cancelShipping(@PathVariable("shippingInformId") Long shippingInformId, ModelMap mmap)
{
SysSalesShippingInform sysSalesShippingInform = sysSalesShippingInformService.selectSysSalesShippingInformById(shippingInformId);
mmap.put("sysSalesShippingInform", sysSalesShippingInform);
return prefix + "/cancelShipping";
}
/**
* 修改保存取消发货
*/
@RequiresPermissions("system:salesShippingInform:cancelShipping")
@Log(title = "销售取消发货", businessType = BusinessType.UPDATE)
@PostMapping("/cancelShipping")
@ResponseBody
public AjaxResult cancelShippingSave(SysSalesShippingInform sysSalesShippingInform)
{
return toAjax(sysSalesShippingInformService.updateCancelShipping(sysSalesShippingInform));
}
}

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

@ -79,4 +79,15 @@ public interface ISysSalesShippingInformService
* 通过销售发起出货生成销售出货通知单列表
* */
int generateShippingInformBySalesOrder(SysSalesOrder sysSalesOrder, String outOrderCode);
/**
* 修改保存确认发货
*/
int updateConfirmShipping(SysSalesShippingInform sysSalesShippingInform);
/**
* 修改保存取消发货
*/
int updateCancelShipping(SysSalesShippingInform sysSalesShippingInform);
}

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

@ -5,6 +5,7 @@ import java.util.Date;
import java.util.List;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.exception.BusinessException;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.StringUtils;
@ -12,6 +13,8 @@ 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 com.ruoyi.warehouse.mapper.WarehouseOutOrderMapper;
import com.ruoyi.warehouse.mapper.WarehouseStorageOrderMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -19,6 +22,7 @@ import com.ruoyi.system.mapper.SysSalesShippingInformMapper;
import com.ruoyi.system.domain.SysSalesShippingInform;
import com.ruoyi.system.service.ISysSalesShippingInformService;
import com.ruoyi.common.core.text.Convert;
import org.springframework.transaction.annotation.Transactional;
/**
* 销售出货通知Service业务层处理
@ -28,7 +32,7 @@ import com.ruoyi.common.core.text.Convert;
*/
@Slf4j
@Service
public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInformService
public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInformService
{
@Autowired
private SysSalesShippingInformMapper sysSalesShippingInformMapper;
@ -39,6 +43,9 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor
@Autowired
private RedisCache redisCache;
@Autowired
private WarehouseOutOrderMapper warehouseOutOrderMapper;
/**
* 查询销售出货通知
*
@ -174,4 +181,43 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor
return sysSalesShippingInformMapper.insertSysSalesShippingInform(sysSalesShippingInform);
}
/**
* 修改保存确认发货
*/
@Transactional(rollbackFor = Exception.class)
@Override
public int updateConfirmShipping(SysSalesShippingInform sysSalesShippingInform) {
String loginName = ShiroUtils.getLoginName();
//设置出库状态为 待设备维护2
sysSalesShippingInform.setWarehouseOutStatus("3");
sysSalesShippingInform.setUpdateBy(loginName);
sysSalesShippingInform.setUpdateTime(new Date());
//更新出库单数据
String outOrderCode = sysSalesShippingInform.getOutOrderCode();
if (StringUtils.isEmpty(outOrderCode)){
log.warn("出库单号为空:{}",outOrderCode);
}
WarehouseOutOrder warehouseOutOrder = warehouseOutOrderMapper.selectWarehouseOutOrderByCode(outOrderCode);
warehouseOutOrder.setWarehouseOutStatus("3");
warehouseOutOrder.setUpdateBy(loginName);
warehouseOutOrder.setUpdateTime(new Date());
int updateWarehouseOutOrderResult = warehouseOutOrderMapper.updateWarehouseOutOrder(warehouseOutOrder);
if (updateWarehouseOutOrderResult <= 0){
throw new BusinessException("更新出库单数据失败");
}
return sysSalesShippingInformMapper.updateSysSalesShippingInformByOutOrderCode(sysSalesShippingInform);
}
/**
* 修改保存取消发货 后续完善
*/
@Override
public int updateCancelShipping(SysSalesShippingInform sysSalesShippingInform) {
return 1;
}
}

5
ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseOutOrderMapper.java

@ -83,4 +83,9 @@ public interface WarehouseOutOrderMapper
* @return 结果
*/
public int restoreWarehouseOutOrderById(Long outOrderId);
/*
* 根据出库单号查询出库单数据
* */
WarehouseOutOrder selectWarehouseOutOrderByCode(String outOrderCode);
}

8
ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseOutOrderMapper.xml

@ -89,6 +89,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectWarehouseOutOrderVo"/>
where out_order_id = #{outOrderId}
</select>
<select id="selectWarehouseOutOrderByCode" parameterType="String" resultMap="WarehouseOutOrderResult">
<include refid="selectWarehouseOutOrderVo"/>
where out_order_code = #{outOrderCode}
</select>
<insert id="insertWarehouseOutOrder" parameterType="WarehouseOutOrder" useGeneratedKeys="true" keyProperty="outOrderId">
insert into warehouse_out_order

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

@ -0,0 +1,35 @@
<!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-cancelShipping-add">
<input name="outOrderCode" th:field="*{outOrderCode}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<textarea name="remark" class="form-control"></textarea>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "system/salesShippingInform"
$("#form-cancelShipping-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/cancelShipping", $('#form-cancelShipping-add').serialize());
}
}
</script>
</body>
</html>

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

@ -0,0 +1,49 @@
<!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" id="form-confirmShipping-add" th:object="${sysSalesShippingInform}">
<input name="outOrderCode" th:field="*{outOrderCode}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">送货日期:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="deliverTime" th:value="${#dates.format(sysSalesShippingInform.deliverTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<textarea name="remark" th:field="*{remark}" class="form-control"></textarea>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "system/salesShippingInform"
$("#form-confirmShipping-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/confirmShipping", $('#form-confirmShipping-add').serialize());
}
}
$("input[name='deliverTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
</script>
</body>
</html>

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

@ -70,6 +70,12 @@
var removeFlag = [[${@permission.hasPermi('system:salesShippingInform:remove')}]];
var cancelFlag = [[${@permission.hasPermi('system:salesShippingInform:cancel')}]];
var restoreFlag = [[${@permission.hasPermi('system:salesShippingInform:restore')}]];
var confirmShippingFlag = [[${@permission.hasPermi('system:salesShippingInform:confirmShipping')}]];
var warehouseOutStatusDatas = [[${@dict.getType('warehouse_out_status')}]];
var warehouseOutTypeDatas = [[${@dict.getType('warehouse_out_type')}]];
var warehouseOrderTypeDatas = [[${@dict.getType('warehouse_order_type')}]];
@ -217,11 +223,8 @@
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.shippingInformId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.shippingInformId + '\')"><i class="fa fa-remove"></i>删除</a> ');
if(row.delFlag == '0'){
actions.push('<a class="btn btn-danger btn-xs ' + cancelFlag + '" href="javascript:void(0)" onclick="$.operate.cancel(\'' + row.id + '\')"><i class="fa fa-remove"></i>作废</a> ');
}else{
actions.push('<a class="btn btn-success btn-xs ' + restoreFlag + '" href="javascript:void(0)" onclick="$.operate.restore(\'' + row.id + '\')"><i class="fa fa-window-restore"></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> ');
}
return actions.join('');
}
@ -229,6 +232,12 @@
};
$.table.init(options);
});
//确认发货
function confirmShipping(shippingInformId){
var url = prefix +'/confirmShipping/' + shippingInformId;
$.modal.open("确认发货",url);
}
</script>
</body>
</html>
Loading…
Cancel
Save