Browse Source

[feat] 工程管理

修改开发修改单的前端页面:新增领料按钮;新增领料前端权限注解;新增打开领料页面前端js方法;
修改开发修改单实体类:新增领料员字段;新增 开发修改单领料详情;
修改开发修改单Controller层:新增加载添加领料弹窗后端接口;
新增 添加领料页面开发修改单物料详情后端接口;
修改开发修改单详情实体类:新增 领料数量字段;新增 已领料数量字段;新增 可用库存数字段;
修改开发修改单领料Controller层:修改新增保存开发修改单领料后端接口方法;
修改开发修改单领料Impl层:修改新增保持开发修改单领料后端接口方法;关联Bom表,关联领料单详情表
新增添加领料单页面:按照prd展示数据
修改出差单上级部门经理审批文件命名
修改出差单上级部门主管审批文件命名
修改报销单上级部门经理审批文件命名
修改报销单上级部门主管审批文件命名
dev
liuxiaoxu 4 months ago
parent
commit
f2f7c95b9e
  1. 25
      ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpDevelopModifyorderController.java
  2. 14
      ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpDevelopModifyorderPickingController.java
  3. 23
      ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpDevelopModifyorder.java
  4. 56
      ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpDevelopModifyorderDetail.java
  5. 8
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/IErpDevelopModifyorderPickingService.java
  6. 161
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpDevelopModifyorderPickingServiceImpl.java
  7. 6
      ruoyi-admin/src/main/resources/mapper/erp/ErpDevelopModifyorderMapper.xml
  8. 32
      ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/developModifyOrder.html
  9. 509
      ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/pickAdd.html
  10. 0
      ruoyi-admin/src/main/resources/templates/system/baseEvectionForm/taskCcjlVerify.html
  11. 0
      ruoyi-admin/src/main/resources/templates/system/baseEvectionForm/taskCczgVerify.html
  12. 0
      ruoyi-admin/src/main/resources/templates/system/baseExpense/taskBxjlVerify.html
  13. 0
      ruoyi-admin/src/main/resources/templates/system/baseExpense/taskBxzgVerify.html

25
ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpDevelopModifyorderController.java

@ -381,9 +381,14 @@ public class ErpDevelopModifyorderController extends BaseController
mmap.put("erpDevelopModifyorder", erpDevelopModifyorder);
return prefix + "/confirm";
}
/**领料确认*/
@GetMapping("/pickingOrder/{developOrderId}")
public String pickingOrder(@PathVariable("developOrderId") Long developOrderId, ModelMap mmap)
/**
* 加载添加领料弹窗
* */
@GetMapping("/pickAdd/{developOrderId}")
public String pickAdd(@PathVariable("developOrderId") Long developOrderId, ModelMap mmap)
{
ErpDevelopModifyorder erpDevelopModifyorder = erpDevelopModifyorderService.selectErpDevelopModifyorderById(developOrderId);
mmap.put("erpDevelopModifyorder", erpDevelopModifyorder);
@ -391,6 +396,20 @@ public class ErpDevelopModifyorderController extends BaseController
}
/**
* 添加领料页面开发修改单物料详情
* */
@PostMapping("/showPickingDevelopModifyorderDetailList")
@ResponseBody
public TableDataInfo showPickingDevelopModifyorderDetailList(@RequestParam("developOrderCode") String developOrderCode)
{
startPage();
List<ErpDevelopModifyorderDetail> erpDevelopModifyorderDetailList = erpDevelopModifyorderService.selectDevelopModifyDetailMaterialByCode(developOrderCode);
return getDataTable(erpDevelopModifyorderDetailList);
}
/**
* 删除开发修改单
*/

14
ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpDevelopModifyorderPickingController.java

@ -1,15 +1,13 @@
package com.ruoyi.erp.controller;
import java.util.List;
import com.ruoyi.erp.domain.ErpDevelopModifyorder;
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.erp.domain.ErpDevelopModifyorderPicking;
@ -80,13 +78,13 @@ public class ErpDevelopModifyorderPickingController extends BaseController
/**
* 新增保存开发修改单领料
*/
@RequiresPermissions("erp:developModifyorderPicking:add")
@RequiresPermissions("erp:developModifyOrder:pickAdd")
@Log(title = "开发修改单领料", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(ErpDevelopModifyorderPicking erpDevelopModifyorderPicking)
public AjaxResult addSave(@RequestBody ErpDevelopModifyorder erpDevelopModifyorder)
{
return toAjax(erpDevelopModifyorderPickingService.insertErpDevelopModifyorderPicking(erpDevelopModifyorderPicking));
return toAjax(erpDevelopModifyorderPickingService.addErpDevelopModifyorderPicking(erpDevelopModifyorder));
}
/**

23
ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpDevelopModifyorder.java

@ -98,6 +98,9 @@ public class ErpDevelopModifyorder extends BaseEntity
@Excel(name = "工程员姓名")
private String userName;
/** 领料员 */
private String pickingUser;
/** 修改完成时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
private Date updateFinishTime;
@ -148,6 +151,9 @@ public class ErpDevelopModifyorder extends BaseEntity
/** 开发修改单物料Vo */
private List<ErpDevelopModifyorderMaterialVo> developModifyorderMaterialVoList;
/** 开发修改单领料详情*/
private List<ErpDevelopModifyorderPickingDetail> developModifyorderPickingDetails;
public String getMakeNo() {
return makeNo;
}
@ -329,6 +335,13 @@ public class ErpDevelopModifyorder extends BaseEntity
return userName;
}
public String getPickingUser() {
return pickingUser;
}
public void setPickingUser(String pickingUser) {
this.pickingUser = pickingUser;
}
public Date getUpdateFinishTime() {
return updateFinishTime;
@ -434,6 +447,14 @@ public class ErpDevelopModifyorder extends BaseEntity
this.developModifyorderMaterialVoList = developModifyorderMaterialVoList;
}
public List<ErpDevelopModifyorderPickingDetail> getDevelopModifyorderPickingDetails() {
return developModifyorderPickingDetails;
}
public void setDevelopModifyorderPickingDetails(List<ErpDevelopModifyorderPickingDetail> developModifyorderPickingDetails) {
this.developModifyorderPickingDetails = developModifyorderPickingDetails;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@ -457,6 +478,7 @@ public class ErpDevelopModifyorder extends BaseEntity
.append("materialProcessMethod", getMaterialProcessMethod())
.append("userId", getUserId())
.append("userName", getUserName())
.append("pickingUser", getPickingUser())
.append("updateFinishTime", getUpdateFinishTime())
.append("beforeUpdateRemark", getBeforeUpdateRemark())
.append("afterUpdateRemark", getAfterUpdateRemark())
@ -475,6 +497,7 @@ public class ErpDevelopModifyorder extends BaseEntity
.append("restoreInstanceId", getRestoreInstanceId())
.append("developModifyorderDetailList",getDevelopModifyorderDetailList())
.append("developModifyorderMaterialVoList",getDevelopModifyorderMaterialVoList())
.append("developModifyorderPickingDetails",getDevelopModifyorderPickingDetails())
.toString();
}
}

56
ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpDevelopModifyorderDetail.java

@ -1,6 +1,8 @@
package com.ruoyi.erp.domain;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
@ -78,6 +80,23 @@ public class ErpDevelopModifyorderDetail extends BaseEntity
@Excel(name = "修改完成时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date updateFinishTime;
@Excel(name = "领料数量")
private Integer pickNum;
/** 已领料数量 */
@Excel(name = "已领料数量")
private Integer hasPickNum;
/** 可用库存数 */
@Excel(name = "可用库存数")
private Integer availableStockNum;
/** 开发修改单领料详情*/
private List<ErpDevelopModifyorderPickingDetail> developModifyorderPickingDetails;
public void setDevelopOrderDetailId(Long developOrderDetailId)
{
this.developOrderDetailId = developOrderDetailId;
@ -213,6 +232,39 @@ public class ErpDevelopModifyorderDetail extends BaseEntity
this.warehouseDept = warehouseDept;
}
public List<ErpDevelopModifyorderPickingDetail> getDevelopModifyorderPickingDetails() {
return developModifyorderPickingDetails;
}
public void setDevelopModifyorderPickingDetails(List<ErpDevelopModifyorderPickingDetail> developModifyorderPickingDetails) {
this.developModifyorderPickingDetails = developModifyorderPickingDetails;
}
public Integer getPickNum() {
return pickNum;
}
public void setPickNum(Integer pickNum) {
this.pickNum = pickNum;
}
public Integer getHasPickNum() {
return hasPickNum;
}
public void setHasPickNum(Integer hasPickNum) {
this.hasPickNum = hasPickNum;
}
public Integer getAvailableStockNum() {
return availableStockNum;
}
public void setAvailableStockNum(Integer availableStockNum) {
this.availableStockNum = availableStockNum;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@ -236,6 +288,10 @@ public class ErpDevelopModifyorderDetail extends BaseEntity
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.append("developModifyorderPickingDetails",getDevelopModifyorderPickingDetails())
.append("pickNum",getPickNum())
.append("hasPickNum",getHasPickNum())
.append("availableStockNum",getAvailableStockNum())
.toString();
}
}

8
ruoyi-admin/src/main/java/com/ruoyi/erp/service/IErpDevelopModifyorderPickingService.java

@ -1,6 +1,8 @@
package com.ruoyi.erp.service;
import java.util.List;
import com.ruoyi.erp.domain.ErpDevelopModifyorder;
import com.ruoyi.erp.domain.ErpDevelopModifyorderPicking;
/**
@ -72,4 +74,10 @@ public interface IErpDevelopModifyorderPickingService
* @return
*/
int restoreErpDevelopModifyorderPickingById(Long developOrderPickingId);
/**
* 开发修改单领料
* */
int addErpDevelopModifyorderPicking(ErpDevelopModifyorder erpDevelopModifyorder);
}

161
ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpDevelopModifyorderPickingServiceImpl.java

@ -1,14 +1,23 @@
package com.ruoyi.erp.service.impl;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
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.erp.domain.*;
import com.ruoyi.erp.mapper.ErpDevelopModifyorderPickingDetailMapper;
import com.ruoyi.erp.service.IErpBomService;
import com.ruoyi.purchase.domain.PurchasePlanChild;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.erp.mapper.ErpDevelopModifyorderPickingMapper;
import com.ruoyi.erp.domain.ErpDevelopModifyorderPicking;
import com.ruoyi.erp.service.IErpDevelopModifyorderPickingService;
import com.ruoyi.common.core.text.Convert;
import org.springframework.util.CollectionUtils;
/**
* 开发修改单领料Service业务层处理
@ -16,12 +25,22 @@ import com.ruoyi.common.core.text.Convert;
* @author 刘晓旭
* @date 2024-07-29
*/
@Slf4j
@Service
public class ErpDevelopModifyorderPickingServiceImpl implements IErpDevelopModifyorderPickingService
{
@Autowired
private ErpDevelopModifyorderPickingMapper erpDevelopModifyorderPickingMapper;
@Autowired
private RedisCache redisCache;
@Autowired
private ErpDevelopModifyorderPickingDetailMapper pickingDetailMapper;
@Autowired
private IErpBomService erpBomService;
/**
* 查询开发修改单领料
*
@ -123,4 +142,142 @@ public class ErpDevelopModifyorderPickingServiceImpl implements IErpDevelopModif
{
return erpDevelopModifyorderPickingMapper.restoreErpDevelopModifyorderPickingById(developOrderPickingId);
}
/**
* 开发修改单领料
* */
@Override
public int addErpDevelopModifyorderPicking(ErpDevelopModifyorder erpDevelopModifyorder) {
List<ErpDevelopModifyorderDetail> developModifyorderDetailList = erpDevelopModifyorder.getDevelopModifyorderDetailList();
if (CollectionUtils.isEmpty(developModifyorderDetailList)){
log.warn("开发修改单领料主表数据为空");
}
int countAllMaterialNum = 0;
for (ErpDevelopModifyorderDetail erpDevelopModifyorderDetail : developModifyorderDetailList) {
ErpBom erpBom = new ErpBom();
erpBom.setId(Long.valueOf(erpDevelopModifyorderDetail.getBomId()));
List<ErpBom> erpBoms = erpBomService.selectErpBomAllLevelList(erpBom);
countAllMaterialNum += erpBoms.size();
}
countAllMaterialNum -= developModifyorderDetailList.size();
if (erpDevelopModifyorder.getDevelopModifyorderPickingDetails().size() < countAllMaterialNum){
throw new BusinessException("请将所有物料数据展开,并填写本次领料数!");
}
String pickingOrderCode = redisCache.generateBillNo("KFLL");
String loginName = ShiroUtils.getLoginName();
ErpDevelopModifyorderPicking developModifyorderPicking = new ErpDevelopModifyorderPicking();
developModifyorderPicking.setDevelopOderCode(erpDevelopModifyorder.getDevelopOrderCode());
developModifyorderPicking.setMakeNo(erpDevelopModifyorder.getMakeNo());
developModifyorderPicking.setPickingOrderCode(pickingOrderCode);
developModifyorderPicking.setPickingOrderType("2");
developModifyorderPicking.setPickUser(erpDevelopModifyorder.getPickingUser());
developModifyorderPicking.setPickingStatus("0");
developModifyorderPicking.setMakeNo(erpDevelopModifyorder.getMakeNo());
developModifyorderPicking.setAuditStatus("0");
developModifyorderPicking.setCreateBy(loginName);
developModifyorderPicking.setCreateTime(new Date());
List<ErpDevelopModifyorderPickingDetail> developModifyorderPickingDetails = erpDevelopModifyorder.getDevelopModifyorderPickingDetails();
for (ErpDevelopModifyorderDetail erpDevelopModifyorderDetail : developModifyorderDetailList) {
if (erpDevelopModifyorderDetail.getPickNum() != null){
ErpDevelopModifyorderPickingDetail dvelopModifyorderPickingDetail = new ErpDevelopModifyorderPickingDetail();
dvelopModifyorderPickingDetail.setDevelopOderCode(erpDevelopModifyorder.getDevelopOrderCode());
dvelopModifyorderPickingDetail.setPickNum(erpDevelopModifyorderDetail.getPickNum());
dvelopModifyorderPickingDetail.setMaterialNo(erpDevelopModifyorderDetail.getMaterialNo());
dvelopModifyorderPickingDetail.setMaterialName(erpDevelopModifyorderDetail.getMaterialName());
dvelopModifyorderPickingDetail.setMaterialDescribe(erpDevelopModifyorderDetail.getMaterialDescribe());
dvelopModifyorderPickingDetail.setMaterialUnit(erpDevelopModifyorderDetail.getMaterialUnit());
dvelopModifyorderPickingDetail.setMaterialBrand(erpDevelopModifyorderDetail.getMaterialBrand());
dvelopModifyorderPickingDetail.setMaterialType(erpDevelopModifyorderDetail.getMaterialType());
dvelopModifyorderPickingDetail.setMaterialProcessMethod(erpDevelopModifyorderDetail.getMaterialProcessMethod());
dvelopModifyorderPickingDetail.setMaterialPhotoUrl(erpDevelopModifyorderDetail.getMaterialPhotoUrl());
dvelopModifyorderPickingDetail.setMaterialNum(erpDevelopModifyorderDetail.getMaterialNum());
dvelopModifyorderPickingDetail.setBomId(Long.valueOf(erpDevelopModifyorderDetail.getBomId()));
dvelopModifyorderPickingDetail.setWarehouseDept(erpDevelopModifyorderDetail.getWarehouseDept());
dvelopModifyorderPickingDetail.setMakeNo(erpDevelopModifyorderDetail.getMakeNo());
dvelopModifyorderPickingDetail.setCreateTime(new Date());
dvelopModifyorderPickingDetail.setCreateBy(loginName);
developModifyorderPickingDetails.add(dvelopModifyorderPickingDetail);
}
}
if (CollectionUtils.isEmpty(developModifyorderPickingDetails)){
log.warn("开发修改单领料子表数据为空");
}
List<ErpDevelopModifyorderPickingDetail> filterPickingDetail = developModifyorderPickingDetails.stream()
.filter(developModifyorderPickingDetail -> developModifyorderPickingDetail.getPickNum() != null)
.collect(Collectors.toList());
//计算主表的物料合计
int materialSum = filterPickingDetail.size();
developModifyorderPicking.setMaterialSum(materialSum);
//计算主表的数量合计
int enterpriseSum = filterPickingDetail.stream().mapToInt(ErpDevelopModifyorderPickingDetail::getPickNum).sum();
developModifyorderPicking.setEnterpriseSum(enterpriseSum);
for (ErpDevelopModifyorderPickingDetail developModifyorderPickingDetail : developModifyorderPickingDetails) {
if (developModifyorderPickingDetail.getPickNum() != null){
developModifyorderPickingDetail.setPickingOrderCode(pickingOrderCode);
developModifyorderPickingDetail.setDevelopOderCode(erpDevelopModifyorder.getDevelopOrderCode());
developModifyorderPickingDetail.setPickNum(developModifyorderPickingDetail.getPickNum());
//已领料数
developModifyorderPickingDetail.setHasPickNum(developModifyorderPickingDetail.getPickNum());
developModifyorderPickingDetail.setMaterialNo(developModifyorderPickingDetail.getMaterialNo());
developModifyorderPickingDetail.setMaterialName(developModifyorderPickingDetail.getMaterialName());
developModifyorderPickingDetail.setMaterialDescribe(developModifyorderPickingDetail.getMaterialDescribe());
developModifyorderPickingDetail.setMaterialUnit(developModifyorderPickingDetail.getMaterialUnit());
developModifyorderPickingDetail.setMaterialBrand(developModifyorderPickingDetail.getMaterialBrand());
developModifyorderPickingDetail.setMaterialType(developModifyorderPickingDetail.getMaterialType());
developModifyorderPickingDetail.setMaterialProcessMethod(developModifyorderPickingDetail.getMaterialProcessMethod());
developModifyorderPickingDetail.setMaterialPhotoUrl(developModifyorderPickingDetail.getMaterialPhotoUrl());
developModifyorderPickingDetail.setMaterialNum(developModifyorderPickingDetail.getMaterialNum());
developModifyorderPickingDetail.setBomId(Long.valueOf(developModifyorderPickingDetail.getBomId()));
developModifyorderPickingDetail.setWarehouseDept(developModifyorderPickingDetail.getWarehouseDept());
developModifyorderPickingDetail.setAvailableStockNum(developModifyorderPickingDetail.getAvailableStockNum());
developModifyorderPickingDetail.setMakeNo(developModifyorderPickingDetail.getMakeNo());
developModifyorderPickingDetail.setPickUser(erpDevelopModifyorder.getPickingUser());
developModifyorderPickingDetail.setBomNo(developModifyorderPickingDetail.getBomNo());
developModifyorderPickingDetail.setCreateTime(new Date());
developModifyorderPickingDetail.setCreateBy(loginName);
pickingDetailMapper.insertErpDevelopModifyorderPickingDetail(developModifyorderPickingDetail);
}
}
return erpDevelopModifyorderPickingMapper.insertErpDevelopModifyorderPicking(developModifyorderPicking);
}
private List<ErpDevelopModifyorderPickingDetail> mergePickingDetailList(List<ErpDevelopModifyorderPickingDetail> pickingDetailList) {
Map<String, ErpDevelopModifyorderPickingDetail> aggregatedMap = new HashMap<>();
for (ErpDevelopModifyorderPickingDetail pickingDetail : pickingDetailList) {
String materialNo = pickingDetail.getMaterialNo();
if (aggregatedMap.containsKey(materialNo)) {
ErpDevelopModifyorderPickingDetail existing = aggregatedMap.get(materialNo);
existing.setMaterialNum(existing.getPickNum() + pickingDetail.getPickNum());
} else {
aggregatedMap.put(materialNo, pickingDetail);
}
}
return new ArrayList<>(aggregatedMap.values());
}
}

6
ruoyi-admin/src/main/resources/mapper/erp/ErpDevelopModifyorderMapper.xml

@ -25,6 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="materialProcessMethod" column="material_process_method" />
<result property="userId" column="user_id" />
<result property="userName" column="user_name" />
<result property="pickingUser" column="picking_user"/>
<result property="updateFinishTime" column="update_finish_time" />
<result property="beforeUpdateRemark" column="before_update_remark" />
<result property="afterUpdateRemark" column="after_update_remark" />
@ -45,7 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectErpDevelopModifyorderVo">
select develop_order_id, develop_order_code, make_no, material_no, purchase_storage_status, quality_status, audit_status, complete_status, finsh_status, use_status, order_type, material_name, material_type, material_photo_url, material_unit, material_brand, material_describe, material_process_method, user_id, update_finish_time, before_update_remark, after_update_remark, create_by, create_time, user_name, update_by, update_time, remark, instance_id, instance_type, submit_instance_id, apply_title, apply_time, apply_user, cancel_instance_id, restore_instance_id from erp_develop_modifyorder
select develop_order_id, develop_order_code, make_no, material_no, purchase_storage_status, quality_status, audit_status, complete_status, finsh_status, use_status, order_type, material_name, material_type, material_photo_url, material_unit, material_brand, material_describe, material_process_method, user_id, update_finish_time, before_update_remark, after_update_remark, create_by, create_time, user_name, picking_user,update_by, update_time, remark, instance_id, instance_type, submit_instance_id, apply_title, apply_time, apply_user, cancel_instance_id, restore_instance_id from erp_develop_modifyorder
</sql>
<select id="selectErpDevelopModifyorderList" parameterType="ErpDevelopModifyorderVo" resultMap="ErpDevelopModifyorderResult">
@ -104,6 +105,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="userName != null">user_name,</if>
<if test="pickingUser != null">picking_user,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
@ -141,6 +143,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="userName != null">#{userName},</if>
<if test="pickingUser != null">#{pickingUser},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
@ -182,6 +185,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="userName != null">user_name = #{userName},</if>
<if test="pickingUser != null">picking_user = #{pickingUser},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>

32
ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/developModifyOrder.html

@ -73,7 +73,7 @@
var removeFlag = [[${@permission.hasPermi('erp:developModifyOrder:remove')}]];
var cancelFlag = [[${@permission.hasPermi('erp:developModifyOrder:cancel')}]];
var restoreFlag = [[${@permission.hasPermi('erp:developModifyOrder:restore')}]];
var pickAddFlag = [[${@permission.hasPermi('erp:developModifyOrder:pickAdd')}]];
var purchaseStorageStatusDatas = [[${@dict.getType('eceiptStatus')}]];
var qualityStatusDatas = [[${@dict.getType('qualityStatus')}]];
@ -210,24 +210,6 @@
{title: '录入时间',field: 'createTime',},
{title: '更新人',field: 'updateBy',},
{title: '上次更新时间',field: 'updateTime',},
// {title: '操作',align: 'center',
// 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.developOrderId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
// actions.push('<a class="btn btn-success btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.developOrderId + '\')"><i class="fa fa-edit"></i>详情</a> ');
// actions.push('<a class="btn btn-success btn-xs ' + restoreFlag + '" href="javascript:void(0)" onclick="readConfirm(\'' + row.developOrderId + '\')"><i class="fa fa-window-restore"></i>确认</a> ');
// actions.push('<a class="btn btn-success btn-xs ' + restoreFlag + '" href="javascript:void(0)" onclick="pickingOrder(\'' + row.developOrderId + '\')"><i class="fa fa-window-restore"></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.auditStatus == '2' && row.purchaseStorageStatus == '3' ||row.purchaseStorageStatus == '4'){
// actions.push('<a class="btn btn-success btn-xs ' + restoreFlag + '" href="javascript:void(0)" onclick="readConfirm(\'' + row.developOrderId + '\')"><i class="fa fa-window-restore"></i>确认</a> ');
// }
// return actions.join('');
// }
// }
{
title: '操作',
align: 'center',
@ -237,6 +219,10 @@
if(row.auditStatus=="1"){
// 编辑
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.developOrderId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
if (row.purchaseStorageStatus == 7 || row.purchaseStorageStatus == 8){
actions.push('<a class="btn btn-success btn-xs ' + pickAddFlag + '" href="javascript:void(0)" onclick="pickAdd(\'' + row.developOrderId + '\')"><i class="fa fa-edit"></i>领料</a> ');
}
}
// 有流程实例id
if (row.instanceId) {
@ -281,12 +267,10 @@
}
//添加开发修改单领料单
function pickAdd(developOrderId){
var options = {
title: '开发修改单领料',
url: prefix + '/pickAdd/' + developOrderId,
};
$.modal.openOptions(options);
var url = prefix + '/pickAdd/' +developOrderId;
$.modal.open("添加领料单",url);
}

509
ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/pickAdd.html

@ -8,38 +8,36 @@
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-picking-add">
<form class="form-horizontal m" id="form-picking-add" th:object="${erpDevelopModifyorder}">
<div class="form-group">
<label class="col-sm-3 control-label">开发修改单号:</label>
<div class="col-sm-8">
<input name="developOrder" class="form-control" type="text">
<input name="developOrderCode" th:field="*{developOrderCode}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">关联生产订单号:</label>
<div class="col-sm-8">
<select id="makeNo" name="makeNo" class="form-control" type="text" required>
<option value="">请选择</option>
</select>
<input name="makeNo" th:field="*{makeNo}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">业务员:</label>
<label class="col-sm-3 control-label">领料员:</label>
<div class="col-sm-8">
<input name="userName" class="form-control" type="text">
<input name="pickingUser" th:field="*{pickingUser}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">订单类型:</label>
<div class="col-sm-8">
<input name="types" class="form-control" type="text">
<input name="orderType" th:field="*{orderType}" 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-sub-table-material"></table>
<table id="bootstrap-table-picking"></table>
</div>
</div>
</div>
@ -48,139 +46,307 @@
<th:block th:include="include :: bootstrap-table-editable-js" />
<th:block th:include="include :: select2-js" />
<script th:inline="javascript">
var prefix = ctx + "erp/developModifyOrder";
var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]];
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
var levelDatas = [[${@dict.getType('bomLevel')}]];
var bomLevelSelectDatas = [[${@dict.getTypeSelect('bomLevel')}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]];
var loginName = [[${@permission.getPrincipalProperty('loginName')}]];
var userName = [[${@permission.getPrincipalProperty('userName')}]];
var prefix = ctx + "system/picking"
$("#form-picking-add").validate({focusCleanup: true});
$(function () {
$("#makeNo").select2({
theme: "bootstrap",
allowClear: true,
placeholder: "请选择生产单号",
ajax: {
url: ctx + "/system/makeorder/getAllMakeNos",
dataType: 'json',
type: "POST",
delay: 250,
processResults: function (res, params) {
var options = [];
if(res.code==0){
var resultList = res.data;
console.log(resultList);
for(var i= 0, len=resultList.length;i<len;i++){
var option = resultList[i];
option.id = resultList[i]["makeNo"];
option.text = resultList[i]["makeNo"];
options.push(option);
}
}
return {
results: options
};
var prefix = ctx + "erp/developModifyorderPicking"
function submitHandler() {
// 获取表单数据
const developModifyorderData = $("#form-picking-add").serializeArray().reduce((obj, item) => {
obj[item.name] = item.value;
return obj;
}, {});
var parentTable = $("#bootstrap-table-picking").bootstrapTable("getData");
var parentDataList = parentTable.map(function(item) {
// 根据实际字段名调整
return {
"developOrderDetailId":item.developOrderDetailId,
"bomId": item.bomId,
"materialNo": item.materialNo,
"materialName": item.materialName,
"materialType": item.materialType,
"materialUnit": item.materialUnit,
"materialBrand": item.materialBrand,
"materialDescribe": item.materialDescribe,
"materialProcessMethod": item.materialProcessMethod,
"materialNum": item.materialNum,
"availableStockNum": item.availableStockNum,
"pickNum": item.pickNum,
"hasPickNum": item.hasPickNum,
"warehouseDept": item.warehouseDept,
// ..其他字段
};
});
// 在需要收集所有子表数据的地方调用此函数
var allSubData = getAllSubTablesData();
// 将表数据转换成与complaintNoticeData格式一致的数组
var childDataList = allSubData.map(function(item) {
// 验证表格元素是否存在
var $tableElement = $('#' + item.tableId);
var bomId;
if ($tableElement.length > 0) {
var parentRow = $tableElement.data('parentRow');
if (parentRow && parentRow.bomId) {
bomId = parentRow.bomId;
} else {
// 处理 parentRow 为空或不包含 bomId 的情况
console.error('主表没有BomId:', parentRow);
// 可以在这里提供一个默认值
bomId = null; // 或者使用某个默认值
}
} else {
// 处理表格元素不存在的情况
console.error('没有找到BomId字段:', item.tableId);
// 可以在这里提供一个默认值
bomId = null; // 或者使用某个默认值
}
// 根据实际字段名调整
return {
"id":item.id,
"bomId": bomId, // 获取主表的 bomId
"bomNo":item.bomNo,
"materialNo": item.materialNo,
"materialName": item.materialName,
"materialType": item.materialType,
"materialUnit": item.materialUnit,
"materialBrand": item.brand,
"materialDescribe": item.describe,
"materialProcessMethod": item.materialProcessMethod,
"materialNum": item.materialNum,
"availableStockNum": item.availableStockNum,
"pickNum": item.pickNum,
"hasPickNum": item.hasPickNum,
"warehouseDept": item.warehouseDept,
"useNum": item.useNum,
"lossRate":item.lossRate,
"sortNo":item.sortNo,
// ..其他字段
};
});
var option1 = {
id: "bootstrap-sub-table-material",
// url: prefix + "/list",
// 合并表单数据和表格数据
const combinedData = Object.assign({}, developModifyorderData,
{ developModifyorderPickingDetails: childDataList,
developModifyorderDetailList: parentDataList
}
);
console.log(combinedData)
// 使用 JSON.stringify() 序列化数据
const jsonData = JSON.stringify(combinedData);
// 发送 AJAX 请求到后端接口
$.operate.saveJson(prefix + "/add", jsonData);
}
$("#form-picking-add").validate({focusCleanup: true});
// 选择采购物料
$(function(){
var options = {
id: 'bootstrap-table-picking',
url: ctx + "erp/developModifyOrder/showPickingDevelopModifyorderDetailList",
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
modalName: "bom",
uniqueId: "id",
pagination: false, // 设置不分页
sidePagination: "client",
detailView: true,
height: $(window).height() - 100,
//指定父id列
queryParams: queryParams,
onExpandRow : function(index, row, $detail) {
$detail.html('<table class="table-container" id="all_level_table_'+row.id+'"></table>').find('table');
// 多阶
initAllLevelTable(index,row,$detail);
// $.table.bootstrapTable('resetView');
initChildTable(index, row, $detail);
},
columns: [
{checkbox: false},
{title: 'bom号',field: 'bomNo', },
{title: '关联料号',field: 'materialNo', },
{field: 'photoUrl',title: '图片',formatter: function(value, row, index) {return $.table.imageView(value);}},
{title: '物料名称',field: 'materialName', },
{field: 'materialType',title: '物料类型',formatter: function(value, row, index) { return $.table.selectCategoryLabel(materialTypeDatas, value);}},
{field: 'processMethod', title: '半成品类型',formatter: function(value, row, index) {return $.table.selectDictLabel(processMethodDatas, value);}},
{field: 'unit',title: '单位',},
{ title: '品牌',field: 'brand', },
{title: '描述',field: 'describe'},
{field: 'num',title: '订单数量',},
{field: 'parentId',title: '父级id',visible:false},
{title: '操作',align: 'center',
{
field: 'developOrderDetailId',
title: '主键id',
visible: false
},
{
field: 'bomId',
title: 'bom主键Id',
},
{
field: 'materialNo',
align: 'center',
title: '料号'
},
{
field: 'materialName',
align: 'center',
title: '物料名称',
},
{
field: 'materialType',
align: 'center',
title: '物料类型',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{
field: 'materialUnit',
align: 'center',
title: '单位',
},
{
field: 'materialBrand',
align: 'center',
title: '品牌'
},
{
field: 'materialDescribe',
align: 'center',
title: '描述'
},
{
field: 'materialProcessMethod',
align: 'center',
title: '物料加工方式',
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
},
{
field: 'materialNum',
align: 'center',
title: '订单数量',
editable:true
},
{
field: 'availableStockNum',
title: '可用库存数',
visible: shouldVisibleFields
},
{
field: 'hasPickNum',
title: '已领料数',
visible: shouldVisibleFields
},
{
field: 'pickNum',
title: '本次领料数',
visible: shouldVisibleFields,
editable:true
},
{
field: 'warehouseDept',
align: 'center',
title: '入库部门',
visible: false
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="remove(\'' + row.id + '\')"><i class="fa fa-eye"></i> 删除</a> ');
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removePurchase(\'' + row.materialNo + '\')"><i class="fa fa-remove"></i>删除</a> ');
return actions.join('');
}
}]
}
]
};
$.table.init(option1);
});
initAllLevelTable = function(index, row, $detail) {
$("#"+"all_level_table_"+row.id).bootstrapTable({
// url: prefix + "/allLevelList",
$.table.init(options);
})
initChildTable = function(index, row, $detail) {
var parentRow = row;
var childTableId = 'child_table_'+index;
$detail.html('<table id="'+childTableId+'"></table>');
// 将 parentRow 保存为表格的数据属性
$('#' + childTableId).data('parentRow', parentRow);
// BOM展示
$('#' + childTableId).bootstrapTable({
url: ctx + "erp/bom/allLevelList",
method: 'post',
sidePagination: "server",
contentType: "application/x-www-form-urlencoded",
queryParams : {
parentId: row.id
},
columns: [{
field: 'id',
title: '主键id'
queryParams: {
parentId: parentRow.bomId
},
columns: [
{
field: 'id',
title: '主键id',
visible: false
},
{
field: 'bomId',
title: 'BOM的Id',
visible: false,
formatter: function (value, row, index) {
var parentRow = $('#' + childTableId).data('parentRow'); // 从表格的数据属性中获取 parentRow
var curIndex = row.sortNo - 1;
return '<input class="hidden form-control" data-id="bomId_' + curIndex + '" name="developModifyorderPickingDetails[' + curIndex + '].bomId" value="' + parentRow.bomId + '">';
}
},
{
field: 'level',
title: '层级',
formatter: function(value, row, index) {
title: '层',
formatter: function (value, row, index) {
return $.table.selectDictLabel(levelDatas, value);
}
},
{
field: 'bomNo',
title: 'bom号',
formatter:function (value,row,index){
if (value == null || value == ''){
title: 'BOM号',
formatter: function (value, row, index) {
if (value == null || value == '') {
return '/';
}else{
} else {
return value
}
}
},
{
field: 'photoUrl',
title: '图片',
formatter: function(value, row, index) {
return $.table.imageView(value);
}
},
{
field: 'materialNo',
title: '料号',
formatter: function (value,row,index){
if (value == null || value == ''){
formatter: function (value, row, index) {
if (value == null || value == '') {
return '/';
}else{
} else {
return value
}
}
},
{
field: 'photoUrl',
title: '图片',
formatter: function (value, row, index) {
return $.table.imageView(value);
}
},
{
field: 'materialName',
title: '物料名称',
formatter: function (value,row,index){
if (value == null || value == ''){
formatter: function (value, row, index) {
if (value == null || value == '') {
return '/';
}else{
} else {
return value
}
}
@ -188,29 +354,28 @@
{
field: 'materialType',
title: '物料类型',
formatter: function(value, row, index) {
formatter: function (value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{
field: 'describe',
title: '描述',
formatter: function (value,row,index){
if (value == null || value == ''){
formatter: function (value, row, index) {
if (value == null || value == '') {
return '/';
}else{
} else {
return value
}
}
},
{
field: 'brand',
title: '品牌',
formatter: function (value,row,index){
if (value == null || value == ''){
formatter: function (value, row, index) {
if (value == null || value == '') {
return '/';
}else{
} else {
return value
}
}
@ -218,21 +383,37 @@
{
field: 'unit',
title: '单位',
formatter: function (value,row,index){
if (value == null || value == ''){
formatter: function (value, row, index) {
if (value == null || value == '') {
return '/';
}else{
} else {
return value
}
}
},
{
field: 'processMethod',
title: '加工方式',
formatter: function (value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
},
{
field: 'warehouseDept',
align: 'center',
title: '入库部门', visible: false,
formatter: function (value, row, index) {
return $.table.selectDictLabel(warehouseDates, value);
}
},
{
field: 'useNum',
title: '用量',
formatter: function (value,row,index){
if (value == null || value == ''){
formatter: function (value, row, index) {
if (value == null || value == '') {
return '/';
}else{
} else {
return value
}
}
@ -240,64 +421,90 @@
{
field: 'lossRate',
title: '损耗率',
formatter: function (value,row,index){
if (value == null || value == ''){
return "/";
}
return value + "%";
}
},
{
field: 'processMethod',
title: '半成品类型',
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
field: 'materialNum',
title: '订单用量',
formatter: function (value, row, index) {
// 获取父行的materialNum值,如果不存在则为0
var materialNum = parentRow.materialNum || 0;
// 获取当前行的useNum值,如果不存在则为0
var useNum = row.useNum || 0;
// 计算结果
var result = materialNum * useNum;
// 如果result为0且materialNum或useNum为null/undefined,则返回空字符串
return (materialNum === 0 || useNum === 0) && (parentRow.materialNum === null || row.useNum === null) ? '' : result;
}
},
{
field: 'parentId',
title: '父级id',
visible: false,
field: 'availableStockNum',
title: '可用库存数',
},
{
field: 'lossRate',
title: '已领料数',
},
{
field: 'pickNum',
title: '本次领料数',
editable:true
},
{
field: 'sortNo',
title: '排序',
visible: false
}]
});
};
initChildSonTable = function(index, row, $detail) {
var childSonTable = $detail.html('<table style="table-layout:fixed"></table>').find('table');
$(childSonTable).bootstrapTable({
// url: prefix + "/subList",
method: 'post',
detailView: true,
sidePagination: "server",
contentType: "application/x-www-form-urlencoded",
queryParams : {parentId: row.id},
onExpandRow : function(index, row, $detail) {initChildSonTable(index, row, $detail);},
columns: [
{field: 'id',title: '主键id'},
{field: 'level',title: '层级',formatter: function(value, row, index) {return $.table.selectDictLabel(levelDatas, value);}},
{field: 'bomNo',title: 'bom号',formatter:function (value,row,index){if (value == null || value == ''){return '/'; }else{ return value;}}},
{field: 'photoUrl',title: '图片',formatter:function (value,row,index){if (value == null || value == ''){ return '/';}else{return $.table.imageView(value);}}},
{field: 'materialNo',title: '料号',},
{field: 'materialName',title: '物料名称',},
{field: 'materialType',title: '物料类型',formatter: function(value, row, index) {return $.table.selectCategoryLabel(materialTypeDatas, value);}},
{field: 'describe',title: '描述',},
{field: 'brand',title: '品牌',},
{field: 'unit',title: '单位',},
{field: 'lossRate',title: '损耗率(%)',formatter:function (value,row,index){return value + '%';}},
{field: 'processMethod',title: '半成品类型',formatter: function(value, row, index) {return $.table.selectDictLabel(processMethodDatas, value);}},
{field: 'useNum',title: '订单用量',},
{field: 'parentId',title: '父级id',visible: false,},
]
}],
// 当所有数据被加载时触发
onLoadSuccess: function (data) {
},
});
}
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-picking-add').serialize());
function queryParams(params) {
var curParams = {
// 传递参数查询参数
developOrderCode: $("#developOrderCode").val()
};
console.log(curParams);
return curParams;
}
var shouldVisibleFields = false; // 假设这是你的条件
visibleField();
//判断是否显示主表的字段
function visibleField() {
var parentLength = $("#bootstrap-table-picking").bootstrapTable("getData").length;
for (let i = 0; i < parentLength; i++) {
var sonData = $('#'+"child_table_" + i).bootstrapTable("getData");
if (sonData.length < 0){
shouldVisibleFields = true;
}
}
}
// 获取所有子表数据的函数
function getAllSubTablesData() {
var allSubData = [];
// 获取所有被展开的行
var parentLength = $("#bootstrap-table-picking").bootstrapTable("getData").length;
for (let i = 0; i < parentLength; i++) {
var childTableId = "child_table_" + i;
var sonData = $('#' + childTableId).bootstrapTable("getData");
// 循环获取子表中存在的行数据,每个行数据转换添加到allSubData数组中
sonData.forEach(function (item) {
item.tableId = childTableId;
allSubData.push(item);
});
}
return allSubData;
}
</script>
</body>

0
ruoyi-admin/src/main/resources/templates/system/baseEvectionForm/taskccjlVerify.html → ruoyi-admin/src/main/resources/templates/system/baseEvectionForm/taskCcjlVerify.html

0
ruoyi-admin/src/main/resources/templates/system/baseEvectionForm/taskcczgVerify.html → ruoyi-admin/src/main/resources/templates/system/baseEvectionForm/taskCczgVerify.html

0
ruoyi-admin/src/main/resources/templates/system/baseExpense/taskbxjlVerify.html → ruoyi-admin/src/main/resources/templates/system/baseExpense/taskBxjlVerify.html

0
ruoyi-admin/src/main/resources/templates/system/baseExpense/taskbxzgVerify.html → ruoyi-admin/src/main/resources/templates/system/baseExpense/taskBxzgVerify.html

Loading…
Cancel
Save