Browse Source

[feat]

基础资料 员工领料单
修改员工领料单列表页面详情按钮样式及跳转url;
修改审核流程方法,新增审核通过后调用生成出库单方法;
仓库管理 仓库出库单
新增service及其接口员工领料单审核通过后生成出库单方法;
新增根据员工领料单详情列表生成出库单详情方法;
dev
王晓迪 4 months ago
parent
commit
e954f5cbd1
  1. 8
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/BaseEmpRequisiteOrderController.java
  2. 6
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseOutOrderService.java
  3. 68
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseOutOrderServiceImpl.java
  4. 3
      ruoyi-admin/src/main/resources/templates/system/empRequisiteOrder/empRequisiteOrder.html

8
ruoyi-admin/src/main/java/com/ruoyi/system/controller/BaseEmpRequisiteOrderController.java

@ -6,6 +6,8 @@ import java.util.List;
import com.ruoyi.process.general.service.IProcessService;
import com.ruoyi.system.domain.Vo.BaseEmpRequisiteOrderVO;
import com.ruoyi.system.domain.Vo.OutsourceQuoteVO;
import com.ruoyi.warehouse.domain.WarehouseOutOrder;
import com.ruoyi.warehouse.service.IWarehouseOutOrderService;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
import org.activiti.engine.runtime.ProcessInstance;
@ -52,6 +54,9 @@ public class BaseEmpRequisiteOrderController extends BaseController
@Autowired
private IProcessService processService;
@Autowired
private IWarehouseOutOrderService warehouseOutOrderService;
@RequiresPermissions("system:empRequisiteOrder:view")
@GetMapping()
public String empRequisiteOrder()
@ -161,7 +166,7 @@ public class BaseEmpRequisiteOrderController extends BaseController
if (processIsFinish) {
// 审核通过
baseEmpRequisiteOrderVO.setAuditStatus("1");
warehouseOutOrderService.generateWarehouseOutOrderByBaseEmpRequisiteOrder(baseEmpRequisiteOrderVO);
// 提交
if("submit".equals(instanceType)){
@ -186,7 +191,6 @@ public class BaseEmpRequisiteOrderController extends BaseController
}
return success("任务已完成");
}
/**
* 修改员工领料单
*/

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

@ -5,6 +5,7 @@ import java.util.List;
import com.ruoyi.erp.domain.vo.ErpDevelopModifyorderPickingVo;
import com.ruoyi.system.domain.SysMakeorderPickVo;
import com.ruoyi.system.domain.SysSalesOrder;
import com.ruoyi.system.domain.Vo.BaseEmpRequisiteOrderVO;
import com.ruoyi.warehouse.domain.WarehouseOutOrder;
/**
@ -122,4 +123,9 @@ public interface IWarehouseOutOrderService
* 修改保存 开发修改单-出库
* */
int updateDevelopModifyOutWarehouse(WarehouseOutOrder warehouseOutOrder);
/*
* 员工领料单审核通过后生成出库单
* */
int generateWarehouseOutOrderByBaseEmpRequisiteOrder(BaseEmpRequisiteOrderVO baseEmpRequisiteOrderVO);
}

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

@ -16,6 +16,7 @@ import com.ruoyi.erp.mapper.ErpDevelopModifyorderDetailMapper;
import com.ruoyi.erp.mapper.ErpDevelopModifyorderPickingDetailMapper;
import com.ruoyi.erp.mapper.ErpDevelopModifyorderPickingMapper;
import com.ruoyi.system.domain.*;
import com.ruoyi.system.domain.Vo.BaseEmpRequisiteOrderVO;
import com.ruoyi.system.mapper.*;
import com.ruoyi.warehouse.domain.WarehouseOutOrderDetail;
import com.ruoyi.warehouse.domain.WarehouseStorageOrder;
@ -833,9 +834,76 @@ public class WarehouseOutOrderServiceImpl implements IWarehouseOutOrderService
return new ArrayList<>(aggregatedMap.values());
}
/*
* 员工领料单审核通过后生成出库单
* */
@Override
public int generateWarehouseOutOrderByBaseEmpRequisiteOrder(BaseEmpRequisiteOrderVO baseEmpRequisiteOrderVO) {
WarehouseOutOrder warehouseOutOrder = new WarehouseOutOrder();
String outOrderCode = redisCache.generateBillNo("CK");
warehouseOutOrder.setOutOrderCode(outOrderCode);
String empRequisiteCode = baseEmpRequisiteOrderVO.getRequisitieCode();
if (StringUtils.isEmpty(empRequisiteCode)){
log.warn("员工领料单编号为空:{}",empRequisiteCode);
}else {
warehouseOutOrder.setRelatedOrderCode(empRequisiteCode);
}
String relatedCode = baseEmpRequisiteOrderVO.getCorrelationCode();
if (StringUtils.isEmpty(relatedCode)){
log.warn("关联订单号为空:{}",relatedCode);
}
//出库状态为 待仓库准备物料
warehouseOutOrder.setWarehouseOutStatus("0");
//订单类型设置为 请购订单
warehouseOutOrder.setWarehouseOrderType("2");
//出库类型设置为 员工领料
warehouseOutOrder.setWarehouseOutType("2");
//物料合计
warehouseOutOrder.setMaterialSum(Math.toIntExact(baseEmpRequisiteOrderVO.getMaterialAmount()));
//数量合计
warehouseOutOrder.setEnterpriseSum(Math.toIntExact(baseEmpRequisiteOrderVO.getMaterialSum()));
warehouseOutOrder.setBusinessName(baseEmpRequisiteOrderVO.getApplyUser());
warehouseOutOrder.setApplyName(baseEmpRequisiteOrderVO.getApplyUser());
warehouseOutOrder.setCreateTime(DateUtils.getNowDate());
warehouseOutOrder.setCreateBy(baseEmpRequisiteOrderVO.getApplyUser());
//新增出库单明细
CreateOutOrderDetailByRequisiteOrderChildList(baseEmpRequisiteOrderVO,outOrderCode);
return warehouseOutOrderMapper.insertWarehouseOutOrder(warehouseOutOrder);
}
//新增出库单明细
private void CreateOutOrderDetailByRequisiteOrderChildList(BaseEmpRequisiteOrderVO baseEmpRequisiteOrderVO, String outOrderCode) {
List<BaseEmpRequisiteOrderChild> childList = baseEmpRequisiteOrderVO.getBaseEmpRequisiteOrderChildList();
String requisiteCode = baseEmpRequisiteOrderVO.getRequisitieCode();
if(childList!=null){
for (BaseEmpRequisiteOrderChild child : childList) {
WarehouseOutOrderDetail warehouseOutOrderDetail = new WarehouseOutOrderDetail();
warehouseOutOrderDetail.setOutOrderCode(outOrderCode);
warehouseOutOrderDetail.setRelatedOrderCode(requisiteCode);
warehouseOutOrderDetail.setMaterialNo(child.getMaterialCode());
warehouseOutOrderDetail.setMaterialName(child.getMaterialName());
warehouseOutOrderDetail.setMaterialType(child.getMaterialType());
warehouseOutOrderDetail.setMaterialBrand(child.getBrand());
warehouseOutOrderDetail.setMaterialPhotourl(child.getPhotoUrl());
// warehouseOutOrderDetail.setMaterialUnit(child.getUnit());
warehouseOutOrderDetail.setMaterialDescribe(child.getDescribe());
// warehouseOutOrderDetail.setMaterialProcessMethod(child.getProcessMethod());
warehouseOutOrderDetail.setEnterpriseSum(Math.toIntExact(child.getMaterialNum()));
warehouseOutOrderDetail.setMakeNum(Math.toIntExact(child.getMaterialNum()));
warehouseOutOrderDetail.setCreateTime(DateUtils.getNowDate());
warehouseOutOrderDetail.setCreateBy(child.getCreateBy());
int insertOutOrderDetailResult = outOrderDetailMapper.insertWarehouseOutOrderDetail(warehouseOutOrderDetail);
if (insertOutOrderDetailResult <= 0){
throw new BusinessException("新增出库单明细数据失败");
}
}
}
}
/**
* 仓库出库单通用修改保持方法
* */

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

@ -54,6 +54,7 @@
<script th:src="@{/js/activiti.js}"></script>
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('system:empRequisiteOrder:edit')}]];
var detailFlag = [[${@permission.hasPermi('system:empRequisiteOrder:detail')}]];
var removeFlag = [[${@permission.hasPermi('system:empRequisiteOrder:remove')}]];
var cancelFlag = [[${@permission.hasPermi('system:empRequisiteOrder:cancel')}]];
var restoreFlag = [[${@permission.hasPermi('system:empRequisiteOrder:restore')}]];
@ -127,7 +128,7 @@
actions.push('<a class="btn btn-info btn-xs" href="javascript:void(0)" onclick="showProcessImgDialog(\'' + row.instanceId + '\')"><i class="fa fa-image"></i> 进度查看</a> ');
}
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.requisiteId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-primary btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.requisiteId + '\')"><i class="fa fa-deatil"></i>详情</a> ');
actions.push('<a class="btn btn-primary btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.requisiteId + '\')"><i class="fa fa-search"></i>详情</a> ');
return actions.join('');
}
}

Loading…
Cancel
Save