Browse Source

[delete]

删除旧版无用的领料单对象 material_requisition_head和系统中对应的前端所有代码和后端所有代码 和对应的系统菜单数据
dev
liuxiaoxu 1 month ago
parent
commit
d08bd8b18f
  1. 195
      ruoyi-admin/src/main/java/com/ruoyi/produce/controller/MaterialRequisitionHeadController.java
  2. 462
      ruoyi-admin/src/main/java/com/ruoyi/produce/domain/MaterialRequisitionHead.java
  3. 66
      ruoyi-admin/src/main/java/com/ruoyi/produce/mapper/MaterialRequisitionHeadMapper.java
  4. 68
      ruoyi-admin/src/main/java/com/ruoyi/produce/service/IMaterialRequisitionHeadService.java
  5. 150
      ruoyi-admin/src/main/java/com/ruoyi/produce/service/impl/MaterialRequisitionHeadServiceImpl.java
  6. 209
      ruoyi-admin/src/main/resources/mapper/produce/MaterialRequisitionHeadMapper.xml
  7. 1224
      ruoyi-admin/src/main/resources/templates/produce/materialRequisitionHead/add.html
  8. 1224
      ruoyi-admin/src/main/resources/templates/produce/materialRequisitionHead/edit.html
  9. 430
      ruoyi-admin/src/main/resources/templates/produce/materialRequisitionHead/materialRequisitionHead.html

195
ruoyi-admin/src/main/java/com/ruoyi/produce/controller/MaterialRequisitionHeadController.java

@ -1,195 +0,0 @@
package com.ruoyi.produce.controller;
import com.alibaba.druid.util.StringUtils;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.ck.utils.Result;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.produce.domain.MaterialRequisitionHead;
import com.ruoyi.produce.domain.MaterialRequisitionHeadWithList;
import com.ruoyi.produce.domain.MaterialRequisitionList;
import com.ruoyi.produce.service.IMaterialRequisitionHeadService;
import com.ruoyi.produce.service.IMaterialRequisitionListService;
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.*;
import java.util.List;
/**
* 领料单Controller
*
* @author ruoyi
* @date 2022-01-06
*/
@Controller
@RequestMapping("/produce/materialRequisitionHead")
public class MaterialRequisitionHeadController extends BaseController {
private String prefix = "produce/materialRequisitionHead";
@Autowired
private IMaterialRequisitionHeadService materialRequisitionHeadService;
@Autowired
private IMaterialRequisitionListService materialRequisitionListService;
@RequiresPermissions("produce:materialRequisitionHead:view")
@GetMapping()
public String materialRequisitionHead() {
return prefix + "/materialRequisitionHead";
}
/**
* 查询领料单列表
*/
@RequiresPermissions("produce:materialRequisitionHead:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(MaterialRequisitionHead materialRequisitionHead) {
startPage();
List<MaterialRequisitionHead> list = materialRequisitionHeadService.selectMaterialRequisitionHeadList(materialRequisitionHead);
return getDataTable(list);
}
/**
* 导出领料单列表
*/
@RequiresPermissions("produce:materialRequisitionHead:export")
@Log(title = "领料单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(MaterialRequisitionHead materialRequisitionHead) {
List<MaterialRequisitionHead> list = materialRequisitionHeadService.selectMaterialRequisitionHeadList(materialRequisitionHead);
ExcelUtil<MaterialRequisitionHead> util = new ExcelUtil<MaterialRequisitionHead>(MaterialRequisitionHead.class);
return util.exportExcel(list, "领料单数据");
}
/**
* 新增领料单
*/
@GetMapping("/add")
public String add() {
return prefix + "/add";
}
/**
* 新增保存领料单
*/
@RequiresPermissions("produce:materialRequisitionHead:add")
@Log(title = "领料单", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public Result addSave(String jsonStr) throws Exception {
JSONObject jsonObject = JSONObject.parseObject(jsonStr);
MaterialRequisitionHead materialRequisitionHead = jsonObject.toJavaObject(MaterialRequisitionHead.class);
String materialRequisitionNo = materialRequisitionHead.getMaterialRequisitionNo();
if (StringUtils.isEmpty(materialRequisitionNo)) {
return Result.getFailResult("请输入领料单号!", null);
}
String workOrderNo = materialRequisitionHead.getWorkOrderNo();
String outsourceOrderNo = materialRequisitionHead.getOutsourceOrderNo();
if (StringUtils.isEmpty(workOrderNo) && StringUtils.isEmpty(outsourceOrderNo)) {
return Result.getFailResult("请选择制工单或委外单!", null);
}
List<MaterialRequisitionList> list = materialRequisitionHead.getMaterialRequisitionLists();
for (MaterialRequisitionList each : list) {
Long planQty = each.getPlanQty();
if (planQty == null || planQty <= 0) {
return Result.getFailResult("计划数量不能小于0!", null);
}
String spare2 = each.getSpare2();
if (Integer.parseInt(spare2) <= 0) {
return Result.getFailResult("使用量不能小于0!", null);
}
}
int i = materialRequisitionHeadService.insertMaterialRequisitionHead(materialRequisitionHead);
return Result.getSuccessResult(i);
}
/**
* 修改领料单
*/
@GetMapping("/edit/{materialRequisitionNo}")
public String edit(@PathVariable("materialRequisitionNo") String materialRequisitionNo, ModelMap mmap) {
MaterialRequisitionHead materialRequisitionHead = materialRequisitionHeadService.selectMaterialRequisitionHeadById(materialRequisitionNo);
MaterialRequisitionList materialRequisitionList = new MaterialRequisitionList();
materialRequisitionList.setMaterialRequisitionNo(materialRequisitionNo);
List<MaterialRequisitionList> list = materialRequisitionListService.selectMaterialRequisitionListList(materialRequisitionList);
mmap.put("materialRequisitionHead", materialRequisitionHead);
mmap.put("list", list);
return prefix + "/edit";
}
/**
* 修改保存领料单
*/
@RequiresPermissions("produce:materialRequisitionHead:edit")
@Log(title = "领料单", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public Result editSave(String jsonStr) throws Exception {
JSONObject jsonObject = JSONObject.parseObject(jsonStr);
MaterialRequisitionHead materialRequisitionHead = jsonObject.toJavaObject(MaterialRequisitionHead.class);
String materialRequisitionNo = materialRequisitionHead.getMaterialRequisitionNo();
if (StringUtils.isEmpty(materialRequisitionNo)) {
return Result.getFailResult("请输入领料单号!", null);
}
String workOrderNo = materialRequisitionHead.getWorkOrderNo();
String outsourceOrderNo = materialRequisitionHead.getOutsourceOrderNo();
if (StringUtils.isEmpty(workOrderNo) && StringUtils.isEmpty(outsourceOrderNo)) {
return Result.getFailResult("请选择制工单或委外单!", null);
}
List<MaterialRequisitionList> list = materialRequisitionHead.getMaterialRequisitionLists();
for (MaterialRequisitionList each : list) {
Long planQty = each.getPlanQty();
if (planQty == null || planQty <= 0) {
return Result.getFailResult("计划数量不能小于0!", null);
}
String spare2 = each.getSpare2();
if (Integer.parseInt(spare2) <= 0) {
return Result.getFailResult("使用量不能小于0!", null);
}
}
int i = materialRequisitionHeadService.updateMaterialRequisitionHead(materialRequisitionHead);
return Result.getSuccessResult(i);
}
/**
* 删除领料单
*/
@RequiresPermissions("produce:materialRequisitionHead:remove")
@Log(title = "领料单", businessType = BusinessType.DELETE)
@PostMapping("/remove")
@ResponseBody
public AjaxResult remove(String ids) {
return toAjax(materialRequisitionHeadService.deleteMaterialRequisitionHeadByIds(ids));
}
@PostMapping("/headWithList")
@ResponseBody
public TableDataInfo selectHeadWithList(MaterialRequisitionHeadWithList materialRequisitionHeadWithList) throws Exception {
startPage();
List<MaterialRequisitionHeadWithList> list = materialRequisitionHeadService.selectHeadWithList(materialRequisitionHeadWithList);
System.out.println(list);
return getDataTable(list);
}
@PostMapping("/end")
@ResponseBody
public Result end(MaterialRequisitionHead materialRequisitionHead) throws Exception {
materialRequisitionHead.setEndFlag("1");
return Result.getSuccessResult(materialRequisitionHeadService.updateMaterialRequisitionHead(materialRequisitionHead));
}
@PostMapping("/id")
@ResponseBody
public Result getId() throws Exception {
return Result.getSuccessResult(materialRequisitionHeadService.getId());
}
}

462
ruoyi-admin/src/main/java/com/ruoyi/produce/domain/MaterialRequisitionHead.java

@ -1,462 +0,0 @@
package com.ruoyi.produce.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import java.util.Date;
import java.util.List;
/**
* 领料单对象 material_requisition_head
*
* @author ruoyi
* @date 2022-01-06
*/
public class MaterialRequisitionHead extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 领料单号 */
@Excel(name = "领料单号")
private String materialRequisitionNo;
/** 制工单号 */
@Excel(name = "制工单号")
private String workOrderNo;
/** 部门名称 */
@Excel(name = "部门名称")
private String departmentName;
/** 领料人 */
@Excel(name = "领料人")
private String linkman;
/** 仓库号 */
@Excel(name = "仓库号")
private String stockNo;
/** 仓库名称 */
@Excel(name = "仓库名称")
private String stockName;
/** 出库类型 */
@Excel(name = "出库类型")
private String outputClass;
/** 领料日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "领料日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date outputDate;
/** 结案否 */
@Excel(name = "结案否")
private String endFlag;
/** 物料类别 */
@Excel(name = "物料类别")
private String itemClass;
/** 确认否 */
@Excel(name = "确认否")
private String confirmFlag;
/** 确认人 */
@Excel(name = "确认人")
private String confirmMan;
/** 确认时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "确认时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date confirmDate;
/** 审核否 */
@Excel(name = "审核否")
private String auditingFlag;
/** 审核人 */
@Excel(name = "审核人")
private String auditingMan;
/** 审核日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "审核日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date auditingDate;
/** 核准否 */
@Excel(name = "核准否")
private String approveFlag;
/** 核准人 */
@Excel(name = "核准人")
private String approveMan;
/** 核准日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "核准日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date spproveDate;
/** 开单日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "开单日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date createDate;
/** 委外单号 */
@Excel(name = "委外单号")
private String outsourceOrderNo;
/** 领料否 */
@Excel(name = "领料否")
private String getFlag;
/** 订单号 */
@Excel(name = "订单号")
private String orderNo;
/** 生产批号 */
@Excel(name = "生产批号")
private String batchNum;
/** 成品代码 */
@Excel(name = "成品代码")
private String spare1;
/** 工单数量 */
@Excel(name = "工单数量")
private String spare2;
/** */
@Excel(name = "")
private String spare3;
/** */
@Excel(name = "")
private String spare4;
/** */
@Excel(name = "")
private String spare5;
/** */
@Excel(name = "")
private String spare6;
private List<MaterialRequisitionList> materialRequisitionLists;
public List<MaterialRequisitionList> getMaterialRequisitionLists() {
return materialRequisitionLists;
}
public void setMaterialRequisitionLists(List<MaterialRequisitionList> materialRequisitionLists) {
this.materialRequisitionLists = materialRequisitionLists;
}
public void setMaterialRequisitionNo(String materialRequisitionNo)
{
this.materialRequisitionNo = materialRequisitionNo;
}
public String getMaterialRequisitionNo()
{
return materialRequisitionNo;
}
public void setWorkOrderNo(String workOrderNo)
{
this.workOrderNo = workOrderNo;
}
public String getWorkOrderNo()
{
return workOrderNo;
}
public void setDepartmentName(String departmentName)
{
this.departmentName = departmentName;
}
public String getDepartmentName()
{
return departmentName;
}
public void setLinkman(String linkman)
{
this.linkman = linkman;
}
public String getLinkman()
{
return linkman;
}
public void setStockNo(String stockNo)
{
this.stockNo = stockNo;
}
public String getStockNo()
{
return stockNo;
}
public void setStockName(String stockName)
{
this.stockName = stockName;
}
public String getStockName()
{
return stockName;
}
public void setOutputClass(String outputClass)
{
this.outputClass = outputClass;
}
public String getOutputClass()
{
return outputClass;
}
public void setOutputDate(Date outputDate)
{
this.outputDate = outputDate;
}
public Date getOutputDate()
{
return outputDate;
}
public void setEndFlag(String endFlag)
{
this.endFlag = endFlag;
}
public String getEndFlag()
{
return endFlag;
}
public void setItemClass(String itemClass)
{
this.itemClass = itemClass;
}
public String getItemClass()
{
return itemClass;
}
public void setConfirmFlag(String confirmFlag)
{
this.confirmFlag = confirmFlag;
}
public String getConfirmFlag()
{
return confirmFlag;
}
public void setConfirmMan(String confirmMan)
{
this.confirmMan = confirmMan;
}
public String getConfirmMan()
{
return confirmMan;
}
public void setConfirmDate(Date confirmDate)
{
this.confirmDate = confirmDate;
}
public Date getConfirmDate()
{
return confirmDate;
}
public void setAuditingFlag(String auditingFlag)
{
this.auditingFlag = auditingFlag;
}
public String getAuditingFlag()
{
return auditingFlag;
}
public void setAuditingMan(String auditingMan)
{
this.auditingMan = auditingMan;
}
public String getAuditingMan()
{
return auditingMan;
}
public void setAuditingDate(Date auditingDate)
{
this.auditingDate = auditingDate;
}
public Date getAuditingDate()
{
return auditingDate;
}
public void setApproveFlag(String approveFlag)
{
this.approveFlag = approveFlag;
}
public String getApproveFlag()
{
return approveFlag;
}
public void setApproveMan(String approveMan)
{
this.approveMan = approveMan;
}
public String getApproveMan()
{
return approveMan;
}
public void setSpproveDate(Date spproveDate)
{
this.spproveDate = spproveDate;
}
public Date getSpproveDate()
{
return spproveDate;
}
public void setCreateDate(Date createDate)
{
this.createDate = createDate;
}
public Date getCreateDate()
{
return createDate;
}
public void setOutsourceOrderNo(String outsourceOrderNo)
{
this.outsourceOrderNo = outsourceOrderNo;
}
public String getOutsourceOrderNo()
{
return outsourceOrderNo;
}
public void setGetFlag(String getFlag)
{
this.getFlag = getFlag;
}
public String getGetFlag()
{
return getFlag;
}
public void setOrderNo(String orderNo)
{
this.orderNo = orderNo;
}
public String getOrderNo()
{
return orderNo;
}
public void setBatchNum(String batchNum)
{
this.batchNum = batchNum;
}
public String getBatchNum()
{
return batchNum;
}
public void setSpare1(String spare1)
{
this.spare1 = spare1;
}
public String getSpare1()
{
return spare1;
}
public void setSpare2(String spare2)
{
this.spare2 = spare2;
}
public String getSpare2()
{
return spare2;
}
public void setSpare3(String spare3)
{
this.spare3 = spare3;
}
public String getSpare3()
{
return spare3;
}
public void setSpare4(String spare4)
{
this.spare4 = spare4;
}
public String getSpare4()
{
return spare4;
}
public void setSpare5(String spare5)
{
this.spare5 = spare5;
}
public String getSpare5()
{
return spare5;
}
public void setSpare6(String spare6)
{
this.spare6 = spare6;
}
public String getSpare6()
{
return spare6;
}
@Override
public String toString() {
return "MaterialRequisitionHead{" +
"materialRequisitionNo='" + materialRequisitionNo + '\'' +
", workOrderNo='" + workOrderNo + '\'' +
", departmentName='" + departmentName + '\'' +
", linkman='" + linkman + '\'' +
", stockNo='" + stockNo + '\'' +
", stockName='" + stockName + '\'' +
", outputClass='" + outputClass + '\'' +
", outputDate=" + outputDate +
", endFlag='" + endFlag + '\'' +
", itemClass='" + itemClass + '\'' +
", confirmFlag='" + confirmFlag + '\'' +
", confirmMan='" + confirmMan + '\'' +
", confirmDate=" + confirmDate +
", auditingFlag='" + auditingFlag + '\'' +
", auditingMan='" + auditingMan + '\'' +
", auditingDate=" + auditingDate +
", approveFlag='" + approveFlag + '\'' +
", approveMan='" + approveMan + '\'' +
", spproveDate=" + spproveDate +
", createDate=" + createDate +
", outsourceOrderNo='" + outsourceOrderNo + '\'' +
", getFlag='" + getFlag + '\'' +
", orderNo='" + orderNo + '\'' +
", batchNum='" + batchNum + '\'' +
", spare1='" + spare1 + '\'' +
", spare2='" + spare2 + '\'' +
", spare3='" + spare3 + '\'' +
", spare4='" + spare4 + '\'' +
", spare5='" + spare5 + '\'' +
", spare6='" + spare6 + '\'' +
", materialRequisitionLists=" + materialRequisitionLists +
'}';
}
}

66
ruoyi-admin/src/main/java/com/ruoyi/produce/mapper/MaterialRequisitionHeadMapper.java

@ -1,66 +0,0 @@
package com.ruoyi.produce.mapper;
import com.ruoyi.produce.domain.MaterialRequisitionHead;
import com.ruoyi.produce.domain.MaterialRequisitionHeadWithList;
import java.util.List;
/**
* 领料单Mapper接口
*
* @author ruoyi
* @date 2022-01-06
*/
public interface MaterialRequisitionHeadMapper {
/**
* 查询领料单
*
* @param materialRequisitionNo 领料单ID
* @return 领料单
*/
public MaterialRequisitionHead selectMaterialRequisitionHeadById(String materialRequisitionNo);
/**
* 查询领料单列表
*
* @param materialRequisitionHead 领料单
* @return 领料单集合
*/
public List<MaterialRequisitionHead> selectMaterialRequisitionHeadList(MaterialRequisitionHead materialRequisitionHead);
/**
* 新增领料单
*
* @param materialRequisitionHead 领料单
* @return 结果
*/
public int insertMaterialRequisitionHead(MaterialRequisitionHead materialRequisitionHead);
/**
* 修改领料单
*
* @param materialRequisitionHead 领料单
* @return 结果
*/
public int updateMaterialRequisitionHead(MaterialRequisitionHead materialRequisitionHead);
/**
* 删除领料单
*
* @param materialRequisitionNo 领料单ID
* @return 结果
*/
public int deleteMaterialRequisitionHeadById(String materialRequisitionNo);
/**
* 批量删除领料单
*
* @param materialRequisitionNos 需要删除的数据ID
* @return 结果
*/
public int deleteMaterialRequisitionHeadByIds(String[] materialRequisitionNos);
public List<MaterialRequisitionHeadWithList> selectHeadWithList(MaterialRequisitionHeadWithList materialRequisitionHeadWithList);
public Integer selectCountByDay();
}

68
ruoyi-admin/src/main/java/com/ruoyi/produce/service/IMaterialRequisitionHeadService.java

@ -1,68 +0,0 @@
package com.ruoyi.produce.service;
import com.ruoyi.produce.domain.MaterialRequisitionHead;
import com.ruoyi.produce.domain.MaterialRequisitionHeadWithList;
import java.util.List;
/**
* 领料单Service接口
*
* @author ruoyi
* @date 2022-01-06
*/
public interface IMaterialRequisitionHeadService
{
/**
* 查询领料单
*
* @param materialRequisitionNo 领料单ID
* @return 领料单
*/
public MaterialRequisitionHead selectMaterialRequisitionHeadById(String materialRequisitionNo);
/**
* 查询领料单列表
*
* @param materialRequisitionHead 领料单
* @return 领料单集合
*/
public List<MaterialRequisitionHead> selectMaterialRequisitionHeadList(MaterialRequisitionHead materialRequisitionHead);
/**
* 新增领料单
*
* @param materialRequisitionHead 领料单
* @return 结果
*/
public int insertMaterialRequisitionHead(MaterialRequisitionHead materialRequisitionHead);
/**
* 修改领料单
*
* @param materialRequisitionHead 领料单
* @return 结果
*/
public int updateMaterialRequisitionHead(MaterialRequisitionHead materialRequisitionHead);
/**
* 批量删除领料单
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteMaterialRequisitionHeadByIds(String ids);
/**
* 删除领料单信息
*
* @param materialRequisitionNo 领料单ID
* @return 结果
*/
public int deleteMaterialRequisitionHeadById(String materialRequisitionNo);
public List<MaterialRequisitionHeadWithList> selectHeadWithList(MaterialRequisitionHeadWithList materialRequisitionHeadWithList);
public String getId();
}

150
ruoyi-admin/src/main/java/com/ruoyi/produce/service/impl/MaterialRequisitionHeadServiceImpl.java

@ -1,150 +0,0 @@
package com.ruoyi.produce.service.impl;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.produce.domain.MaterialRequisitionHead;
import com.ruoyi.produce.domain.MaterialRequisitionHeadWithList;
import com.ruoyi.produce.domain.MaterialRequisitionList;
import com.ruoyi.produce.mapper.MaterialRequisitionHeadMapper;
import com.ruoyi.produce.mapper.MaterialRequisitionListMapper;
import com.ruoyi.produce.service.IMaterialRequisitionHeadService;
import com.ruoyi.stock.domain.StockInfo;
import com.ruoyi.stock.mapper.StockInfoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.util.Date;
import java.util.List;
/**
* 领料单Service业务层处理
*
* @author ruoyi
* @date 2022-01-06
*/
@Service
public class MaterialRequisitionHeadServiceImpl implements IMaterialRequisitionHeadService {
@Autowired
private MaterialRequisitionHeadMapper materialRequisitionHeadMapper;
@Autowired
private MaterialRequisitionListMapper materialRequisitionListMapper;
@Autowired
private StockInfoMapper stockInfoMapper;
/**
* 查询领料单
*
* @param materialRequisitionNo 领料单ID
* @return 领料单
*/
@Override
public MaterialRequisitionHead selectMaterialRequisitionHeadById(String materialRequisitionNo) {
return materialRequisitionHeadMapper.selectMaterialRequisitionHeadById(materialRequisitionNo);
}
/**
* 查询领料单列表
*
* @param materialRequisitionHead 领料单
* @return 领料单
*/
@Override
public List<MaterialRequisitionHead> selectMaterialRequisitionHeadList(MaterialRequisitionHead materialRequisitionHead) {
return materialRequisitionHeadMapper.selectMaterialRequisitionHeadList(materialRequisitionHead);
}
/**
* 新增领料单
*
* @param materialRequisitionHead 领料单
* @return 结果
*/
@Override
public int insertMaterialRequisitionHead(MaterialRequisitionHead materialRequisitionHead) {
List<MaterialRequisitionList> list = materialRequisitionHead.getMaterialRequisitionLists();
String no = materialRequisitionHead.getMaterialRequisitionNo();
for (int i = 0; i < list.size(); i++) {
MaterialRequisitionList each = list.get(i);
each.setBatchNum(i + 1 + "");
each.setMaterialRequisitionNo(no);
materialRequisitionListMapper.insertMaterialRequisitionList(each);
}
materialRequisitionHead.setOutputDate(new Date());
materialRequisitionHead.setEndFlag("0");
materialRequisitionHead.setGetFlag("0");
StockInfo stockInfo = new StockInfo();
stockInfo.setStockName(materialRequisitionHead.getStockName());
stockInfo = stockInfoMapper.selectStockInfoList(stockInfo).get(0);
materialRequisitionHead.setStockNo(stockInfo.getStockNO());
return materialRequisitionHeadMapper.insertMaterialRequisitionHead(materialRequisitionHead);
}
/**
* 修改领料单
*
* @param materialRequisitionHead 领料单
* @return 结果
*/
@Override
public int updateMaterialRequisitionHead(MaterialRequisitionHead materialRequisitionHead) {
String no = materialRequisitionHead.getMaterialRequisitionNo();
materialRequisitionListMapper.deleteMaterialRequisitionListById(no);
List<MaterialRequisitionList> list = materialRequisitionHead.getMaterialRequisitionLists();
for (int i = 0; i < list.size(); i++) {
MaterialRequisitionList each = list.get(i);
each.setBatchNum(i + 1 + "");
each.setMaterialRequisitionNo(no);
materialRequisitionListMapper.insertMaterialRequisitionList(each);
}
StockInfo stockInfo = new StockInfo();
stockInfo.setStockName(materialRequisitionHead.getStockName());
stockInfo = stockInfoMapper.selectStockInfoList(stockInfo).get(0);
materialRequisitionHead.setStockNo(stockInfo.getStockNO());
return materialRequisitionHeadMapper.updateMaterialRequisitionHead(materialRequisitionHead);
}
/**
* 删除领料单对象
*
* @param ids 需要删除的数据ID
* @return 结果
*/
@Override
public int deleteMaterialRequisitionHeadByIds(String ids) {
return materialRequisitionHeadMapper.deleteMaterialRequisitionHeadByIds(Convert.toStrArray(ids));
}
/**
* 删除领料单信息
*
* @param materialRequisitionNo 领料单ID
* @return 结果
*/
@Override
public int deleteMaterialRequisitionHeadById(String materialRequisitionNo) {
return materialRequisitionHeadMapper.deleteMaterialRequisitionHeadById(materialRequisitionNo);
}
@Override
public List<MaterialRequisitionHeadWithList> selectHeadWithList(MaterialRequisitionHeadWithList materialRequisitionHeadWithList) {
return materialRequisitionHeadMapper.selectHeadWithList(materialRequisitionHeadWithList);
}
@Override
public String getId() {
int count = materialRequisitionHeadMapper.selectCountByDay() + 1;
LocalDate now = LocalDate.now();
String s = now.toString().replaceAll("-", "");
String id = "WLLL" + s;
if (count >= 100) {
id += count;
} else if (count >= 10) {
id += "0" + count;
} else {
id += "00" + count;
}
return id;
}
}

209
ruoyi-admin/src/main/resources/mapper/produce/MaterialRequisitionHeadMapper.xml

@ -1,209 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.produce.mapper.MaterialRequisitionHeadMapper">
<resultMap type="MaterialRequisitionHead" id="MaterialRequisitionHeadResult">
<result property="materialRequisitionNo" column="materialRequisitionNo" />
<result property="workOrderNo" column="workOrderNo" />
<result property="departmentName" column="departmentName" />
<result property="linkman" column="linkman" />
<result property="stockNo" column="stockNo" />
<result property="stockName" column="stockName" />
<result property="outputClass" column="outputClass" />
<result property="outputDate" column="outputDate" />
<result property="remark" column="remark" />
<result property="endFlag" column="endFlag" />
<result property="itemClass" column="itemClass" />
<result property="confirmFlag" column="confirmFlag" />
<result property="confirmMan" column="confirmMan" />
<result property="confirmDate" column="confirmDate" />
<result property="auditingFlag" column="auditingFlag" />
<result property="auditingMan" column="auditingMan" />
<result property="auditingDate" column="auditingDate" />
<result property="approveFlag" column="approveFlag" />
<result property="approveMan" column="approveMan" />
<result property="spproveDate" column="spproveDate" />
<result property="createDate" column="createDate" />
<result property="outsourceOrderNo" column="outsourceOrderNo" />
<result property="getFlag" column="getFlag" />
<result property="orderNo" column="orderNo" />
<result property="batchNum" column="batchNum" />
<result property="spare1" column="spare1" />
<result property="spare2" column="spare2" />
<result property="spare3" column="spare3" />
<result property="spare4" column="spare4" />
<result property="spare5" column="spare5" />
<result property="spare6" column="spare6" />
</resultMap>
<sql id="selectMaterialRequisitionHeadVo">
select materialRequisitionNo, workOrderNo, departmentName, linkman, stockNo, stockName, outputClass, outputDate, remark, endFlag, itemClass, confirmFlag, confirmMan, confirmDate, auditingFlag, auditingMan, auditingDate, approveFlag, approveMan, spproveDate, createDate, outsourceOrderNo, getFlag, orderNo, batchNum, spare1, spare2, spare3, spare4, spare5, spare6 from material_requisition_head
</sql>
<select id="selectMaterialRequisitionHeadList" parameterType="MaterialRequisitionHead" resultMap="MaterialRequisitionHeadResult">
<include refid="selectMaterialRequisitionHeadVo"/>
<where>
<if test="materialRequisitionNo != null and materialRequisitionNo != ''"> and materialRequisitionNo like concat('%', #{materialRequisitionNo}, '%')</if>
<if test="workOrderNo != null and workOrderNo != ''"> and workOrderNo like concat('%', #{workOrderNo}, '%')</if>
<if test="departmentName != null and departmentName != ''"> and departmentName like concat('%', #{departmentName}, '%')</if>
<if test="linkman != null and linkman != ''"> and linkman like concat('%', #{linkman}, '%')</if>
<if test="stockNo != null and stockNo != ''"> and stockNo like concat('%', #{stockNo}, '%')</if>
<if test="stockName != null and stockName != ''"> and stockName like concat('%', #{stockName}, '%')</if>
<if test="outputClass != null and outputClass != ''"> and outputClass = #{outputClass}</if>
<if test="params.beginOutputDate != null and params.beginOutputDate != '' and params.endOutputDate != null and params.endOutputDate != ''"> and outputDate between #{params.beginOutputDate} and #{params.endOutputDate}</if>
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
<if test="endFlag != null and endFlag != ''"> and endFlag = #{endFlag}</if>
<if test="itemClass != null and itemClass != ''"> and itemClass = #{itemClass}</if>
<if test="confirmFlag != null and confirmFlag != ''"> and confirmFlag = #{confirmFlag}</if>
<if test="confirmMan != null and confirmMan != ''"> and confirmMan like concat('%', #{confirmMan}, '%')</if>
<if test="params.beginConfirmDate != null and params.beginConfirmDate != '' and params.endConfirmDate != null and params.endConfirmDate != ''"> and confirmDate between #{params.beginConfirmDate} and #{params.endConfirmDate}</if>
<if test="auditingFlag != null and auditingFlag != ''"> and auditingFlag = #{auditingFlag}</if>
<if test="auditingMan != null and auditingMan != ''"> and auditingMan like concat('%', #{auditingMan}, '%')</if>
<if test="params.beginAuditingDate != null and params.beginAuditingDate != '' and params.endAuditingDate != null and params.endAuditingDate != ''"> and auditingDate between #{params.beginAuditingDate} and #{params.endAuditingDate}</if>
<if test="approveFlag != null and approveFlag != ''"> and approveFlag = #{approveFlag}</if>
<if test="approveMan != null and approveMan != ''"> and approveMan like concat('%', #{approveMan}, '%')</if>
<if test="params.beginSpproveDate != null and params.beginSpproveDate != '' and params.endSpproveDate != null and params.endSpproveDate != ''"> and spproveDate between #{params.beginSpproveDate} and #{params.endSpproveDate}</if>
<if test="params.beginCreateDate != null and params.beginCreateDate != '' and params.endCreateDate != null and params.endCreateDate != ''"> and createDate between #{params.beginCreateDate} and #{params.endCreateDate}</if>
<if test="outsourceOrderNo != null and outsourceOrderNo != ''"> and outsourceOrderNo like concat('%', #{outsourceOrderNo}, '%')</if>
<if test="getFlag != null and getFlag != ''"> and getFlag = #{getFlag}</if>
<if test="orderNo != null and orderNo != ''"> and orderNo like concat('%', #{orderNo}, '%')</if>
<if test="batchNum != null and batchNum != ''"> and batchNum like concat('%', #{batchNum}, '%')</if>
<if test="spare1 != null and spare1 != ''"> and spare1 = #{spare1}</if>
<if test="spare2 != null and spare2 != ''"> and spare2 = #{spare2}</if>
<if test="spare3 != null and spare3 != ''"> and spare3 = #{spare3}</if>
<if test="spare4 != null and spare4 != ''"> and spare4 = #{spare4}</if>
<if test="spare5 != null and spare5 != ''"> and spare5 = #{spare5}</if>
<if test="spare6 != null and spare6 != ''"> and spare6 = #{spare6}</if>
</where>
</select>
<select id="selectMaterialRequisitionHeadById" parameterType="String" resultMap="MaterialRequisitionHeadResult">
<include refid="selectMaterialRequisitionHeadVo"/>
where materialRequisitionNo = #{materialRequisitionNo}
</select>
<insert id="insertMaterialRequisitionHead" parameterType="MaterialRequisitionHead">
insert into material_requisition_head
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="materialRequisitionNo != null and materialRequisitionNo != ''">materialRequisitionNo,</if>
<if test="workOrderNo != null">workOrderNo,</if>
<if test="departmentName != null">departmentName,</if>
<if test="linkman != null">linkman,</if>
<if test="stockNo != null">stockNo,</if>
<if test="stockName != null">stockName,</if>
<if test="outputClass != null and outputClass != ''">outputClass,</if>
<if test="outputDate != null">outputDate,</if>
<if test="remark != null">remark,</if>
<if test="endFlag != null">endFlag,</if>
<if test="itemClass != null">itemClass,</if>
<if test="confirmFlag != null">confirmFlag,</if>
<if test="confirmMan != null">confirmMan,</if>
<if test="confirmDate != null">confirmDate,</if>
<if test="auditingFlag != null">auditingFlag,</if>
<if test="auditingMan != null">auditingMan,</if>
<if test="auditingDate != null">auditingDate,</if>
<if test="approveFlag != null">approveFlag,</if>
<if test="approveMan != null">approveMan,</if>
<if test="spproveDate != null">spproveDate,</if>
<if test="createDate != null">createDate,</if>
<if test="outsourceOrderNo != null">outsourceOrderNo,</if>
<if test="getFlag != null">getFlag,</if>
<if test="orderNo != null">orderNo,</if>
<if test="batchNum != null">batchNum,</if>
<if test="spare1 != null">spare1,</if>
<if test="spare2 != null">spare2,</if>
<if test="spare3 != null">spare3,</if>
<if test="spare4 != null">spare4,</if>
<if test="spare5 != null">spare5,</if>
<if test="spare6 != null">spare6,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="materialRequisitionNo != null and materialRequisitionNo != ''">#{materialRequisitionNo},</if>
<if test="workOrderNo != null">#{workOrderNo},</if>
<if test="departmentName != null">#{departmentName},</if>
<if test="linkman != null">#{linkman},</if>
<if test="stockNo != null">#{stockNo},</if>
<if test="stockName != null">#{stockName},</if>
<if test="outputClass != null and outputClass != ''">#{outputClass},</if>
<if test="outputDate != null">#{outputDate},</if>
<if test="remark != null">#{remark},</if>
<if test="endFlag != null">#{endFlag},</if>
<if test="itemClass != null">#{itemClass},</if>
<if test="confirmFlag != null">#{confirmFlag},</if>
<if test="confirmMan != null">#{confirmMan},</if>
<if test="confirmDate != null">#{confirmDate},</if>
<if test="auditingFlag != null">#{auditingFlag},</if>
<if test="auditingMan != null">#{auditingMan},</if>
<if test="auditingDate != null">#{auditingDate},</if>
<if test="approveFlag != null">#{approveFlag},</if>
<if test="approveMan != null">#{approveMan},</if>
<if test="spproveDate != null">#{spproveDate},</if>
<if test="createDate != null">#{createDate},</if>
<if test="outsourceOrderNo != null">#{outsourceOrderNo},</if>
<if test="getFlag != null">#{getFlag},</if>
<if test="orderNo != null">#{orderNo},</if>
<if test="batchNum != null">#{batchNum},</if>
<if test="spare1 != null">#{spare1},</if>
<if test="spare2 != null">#{spare2},</if>
<if test="spare3 != null">#{spare3},</if>
<if test="spare4 != null">#{spare4},</if>
<if test="spare5 != null">#{spare5},</if>
<if test="spare6 != null">#{spare6},</if>
</trim>
</insert>
<update id="updateMaterialRequisitionHead" parameterType="MaterialRequisitionHead">
update material_requisition_head
<trim prefix="SET" suffixOverrides=",">
<if test="workOrderNo != null">workOrderNo = #{workOrderNo},</if>
<if test="departmentName != null">departmentName = #{departmentName},</if>
<if test="linkman != null">linkman = #{linkman},</if>
<if test="stockNo != null">stockNo = #{stockNo},</if>
<if test="stockName != null">stockName = #{stockName},</if>
<if test="outputClass != null and outputClass != ''">outputClass = #{outputClass},</if>
<if test="outputDate != null">outputDate = #{outputDate},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="endFlag != null">endFlag = #{endFlag},</if>
<if test="itemClass != null">itemClass = #{itemClass},</if>
<if test="confirmFlag != null">confirmFlag = #{confirmFlag},</if>
<if test="confirmMan != null">confirmMan = #{confirmMan},</if>
<if test="confirmDate != null">confirmDate = #{confirmDate},</if>
<if test="auditingFlag != null">auditingFlag = #{auditingFlag},</if>
<if test="auditingMan != null">auditingMan = #{auditingMan},</if>
<if test="auditingDate != null">auditingDate = #{auditingDate},</if>
<if test="approveFlag != null">approveFlag = #{approveFlag},</if>
<if test="approveMan != null">approveMan = #{approveMan},</if>
<if test="spproveDate != null">spproveDate = #{spproveDate},</if>
<if test="createDate != null">createDate = #{createDate},</if>
<if test="outsourceOrderNo != null">outsourceOrderNo = #{outsourceOrderNo},</if>
<if test="getFlag != null">getFlag = #{getFlag},</if>
<if test="orderNo != null">orderNo = #{orderNo},</if>
<if test="batchNum != null">batchNum = #{batchNum},</if>
<if test="spare1 != null">spare1 = #{spare1},</if>
<if test="spare2 != null">spare2 = #{spare2},</if>
<if test="spare3 != null">spare3 = #{spare3},</if>
<if test="spare4 != null">spare4 = #{spare4},</if>
<if test="spare5 != null">spare5 = #{spare5},</if>
<if test="spare6 != null">spare6 = #{spare6},</if>
</trim>
where materialRequisitionNo = #{materialRequisitionNo}
</update>
<delete id="deleteMaterialRequisitionHeadById" parameterType="String">
delete from material_requisition_head where materialRequisitionNo = #{materialRequisitionNo}
</delete>
<delete id="deleteMaterialRequisitionHeadByIds" parameterType="String">
delete from material_requisition_head where materialRequisitionNo in
<foreach item="materialRequisitionNo" collection="array" open="(" separator="," close=")">
#{materialRequisitionNo}
</foreach>
</delete>
<select id="selectCountByDay" resultType="Integer">
select count(*) from material_requisition_head where to_days(outputDate) = to_days(now());
</select>
</mapper>

1224
ruoyi-admin/src/main/resources/templates/produce/materialRequisitionHead/add.html

File diff suppressed because it is too large

1224
ruoyi-admin/src/main/resources/templates/produce/materialRequisitionHead/edit.html

File diff suppressed because it is too large

430
ruoyi-admin/src/main/resources/templates/produce/materialRequisitionHead/materialRequisitionHead.html

@ -1,430 +0,0 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('领料单列表')"/>
<link th:href="@{/ajax/libs/select2/select2.css}" rel="stylesheet">
<link th:href="@{/ajax/libs/select2/select2-bootstrap.css}" rel="stylesheet">
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
<label>领料单号:</label>
<input type="text" name="materialRequisitionNo"/>
</li>
<li>
<label>制工单号:</label>
<input type="text" name="workOrderNo"/>
</li>
<li>
<label>物料代码:</label>
<input type="text" name="itemCode"/>
</li>
<li>
<label>物料名称:</label>
<input type="text" name="itemName"/>
</li>
<li>
<label>部门名称:</label>
<select name="departmentName" class="form-control m-b"
th:with="type=${@dict.getType('process_class')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<label>领料人:</label>
<input type="text" name="linkman"/>
</li>
<!-- <li>-->
<!-- <label>仓库号:</label>-->
<!-- <select name="stockNo">-->
<!-- <option value="">所有</option>-->
<!-- <option value="-1">代码生成请选择字典属性</option>-->
<!-- </select>-->
<!-- </li>-->
<li>
<label>仓库名称:</label>
<select name="stockName" class="form-control m-b">
<option value="">所有</option>
</select>
</li>
<li>
<label>出库类型:</label>
<select name="outputClass" class="form-control m-b"
th:with="type=${@dict.getType('sys_out_type')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}"></option>
</select>
</li>
<li class="select-time">
<label>领料日期:</label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间"
name="params[beginOutputDate]"/>
<span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间"
name="params[endOutputDate]"/>
</li>
<!-- <li>-->
<!-- <label>备注:</label>-->
<!-- <input type="text" name="remark"/>-->
<!-- </li>-->
<li>
<label>结案否:</label>
<select name="endFlag">
<option value="">所有</option>
<option value="1">已结案</option>
<option value="0">未结案</option>
</select>
</li>
<li>
<label>物料类别:</label>
<select name="itemClass" class="form-control m-b"
th:with="type=${@dict.getType('ck_meterialt_type')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}"></option>
</select>
</li>
<!-- <li>-->
<!-- <label>确认否:</label>-->
<!-- <select name="confirmFlag">-->
<!-- <option value="">所有</option>-->
<!-- <option value="-1">代码生成请选择字典属性</option>-->
<!-- </select>-->
<!-- </li>-->
<!-- <li>-->
<!-- <label>确认人:</label>-->
<!-- <input type="text" name="confirmMan"/>-->
<!-- </li>-->
<!-- <li class="select-time">-->
<!-- <label>确认时间:</label>-->
<!-- <input type="text" class="time-input" id="startTime" placeholder="开始时间"-->
<!-- name="params[beginConfirmDate]"/>-->
<!-- <span>-</span>-->
<!-- <input type="text" class="time-input" id="endTime" placeholder="结束时间"-->
<!-- name="params[endConfirmDate]"/>-->
<!-- </li>-->
<!-- <li>-->
<!-- <label>审核否:</label>-->
<!-- <select name="auditingFlag">-->
<!-- <option value="">所有</option>-->
<!-- <option value="-1">代码生成请选择字典属性</option>-->
<!-- </select>-->
<!-- </li>-->
<!-- <li>-->
<!-- <label>审核人:</label>-->
<!-- <input type="text" name="auditingMan"/>-->
<!-- </li>-->
<!-- <li class="select-time">-->
<!-- <label>审核日期:</label>-->
<!-- <input type="text" class="time-input" id="startTime" placeholder="开始时间"-->
<!-- name="params[beginAuditingDate]"/>-->
<!-- <span>-</span>-->
<!-- <input type="text" class="time-input" id="endTime" placeholder="结束时间"-->
<!-- name="params[endAuditingDate]"/>-->
<!-- </li>-->
<!-- <li>-->
<!-- <label>核准否:</label>-->
<!-- <select name="approveFlag">-->
<!-- <option value="">所有</option>-->
<!-- <option value="-1">代码生成请选择字典属性</option>-->
<!-- </select>-->
<!-- </li>-->
<!-- <li>-->
<!-- <label>核准人:</label>-->
<!-- <input type="text" name="approveMan"/>-->
<!-- </li>-->
<!-- <li class="select-time">-->
<!-- <label>核准日期:</label>-->
<!-- <input type="text" class="time-input" id="startTime" placeholder="开始时间"-->
<!-- name="params[beginSpproveDate]"/>-->
<!-- <span>-</span>-->
<!-- <input type="text" class="time-input" id="endTime" placeholder="结束时间"-->
<!-- name="params[endSpproveDate]"/>-->
<!-- </li>-->
<!-- <li class="select-time">-->
<!-- <label>开单日期:</label>-->
<!-- <input type="text" class="time-input" id="startTime" placeholder="开始时间"-->
<!-- name="params[beginCreateDate]"/>-->
<!-- <span>-</span>-->
<!-- <input type="text" class="time-input" id="endTime" placeholder="结束时间"-->
<!-- name="params[endCreateDate]"/>-->
<!-- </li>-->
<!-- <li>-->
<!-- <label>委外单号:</label>-->
<!-- <input type="text" name="outsourceOrderNo"/>-->
<!-- </li>-->
<!-- <li>-->
<!-- <label>领料否:</label>-->
<!-- <select name="getFlag">-->
<!-- <option value="">所有</option>-->
<!-- <option value="-1">代码生成请选择字典属性</option>-->
<!-- </select>-->
<!-- </li>-->
<!-- <li>-->
<!-- <label>订单号:</label>-->
<!-- <input type="text" name="orderNo"/>-->
<!-- </li>-->
<!-- <li>-->
<!-- <label>生产批号:</label>-->
<!-- <input type="text" name="batchNum"/>-->
<!-- </li>-->
<!-- <li>-->
<!-- <label>:</label>-->
<!-- <input type="text" name="spare1"/>-->
<!-- </li>-->
<!-- <li>-->
<!-- <label>:</label>-->
<!-- <input type="text" name="spare2"/>-->
<!-- </li>-->
<!-- <li>-->
<!-- <label>:</label>-->
<!-- <input type="text" name="spare3"/>-->
<!-- </li>-->
<!-- <li>-->
<!-- <label>:</label>-->
<!-- <input type="text" name="spare4"/>-->
<!-- </li>-->
<!-- <li>-->
<!-- <label>:</label>-->
<!-- <input type="text" name="spare5"/>-->
<!-- </li>-->
<!-- <li>-->
<!-- <label>:</label>-->
<!-- <input type="text" name="spare6"/>-->
<!-- </li>-->
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="reset()"><i
class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()"
shiro:hasPermission="produce:materialRequisitionHead:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="edit()"
shiro:hasPermission="produce:materialRequisitionHead:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick=""
shiro:hasPermission="produce:materialRequisitionHead:remove" disabled>
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()"
shiro:hasPermission="produce:materialRequisitionHead:export">
<i class="fa fa-download"></i> 导出
</a>
<a class="btn btn-primary single disabled" onclick="end()"
shiro:hasPermission="produce:materialRequisitionHead:edit">
<i class="fa fa-edit"></i> 结案
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer"/>
<script th:src="@{/ajax/libs/select2/select2.js}"></script>
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('produce:materialRequisitionHead:edit')}]];
var removeFlag = [[${@permission.hasPermi('produce:materialRequisitionHead:remove')}]];
var prefix = ctx + "produce/materialRequisitionHead";
//鼠标移入,显示完整的数据
function paramsMatter(value, row, index) {
var span = document.createElement("span");
span.setAttribute("title", value);
span.innerHTML = value;
return span.outerHTML;
}
//获取仓库名
$.ajax({
url: ctx + "stock/stockInfo/all",
type: "post",
dataType: "json",
success: function (resp) {
if (resp.code === 0) {
let data = resp.data;
//alert(JSON.stringify(data));
for (let i in data) {
$("select[name='stockName']").append("<option value='" + data[i].stockname + "'>" + data[i].stockname + "</option>");
}
} else {
$.modal.msgError(resp.msg);
}
},
error: function () {
$.modal.msgError("后台出错啦!");
}
})
$(function () {
var options = {
url: prefix + "/headWithList",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "领料单",
columns: [{
checkbox: true
},
{
field: 'materialRequisitionNo',
title: '领料单号'
},
{
field: 'workOrderNo',
title: '制工单号'
},
{
field: 'batchNum',
title: '生产批号'
},
{
field: 'itemCode',
title: '物料代码'
},
{
field: 'itemName',
title: '物料名称'
},
{
field: 'itemSpecification',
title: '规格型号'
},
{
field: 'unit',
title: '单位'
},
{
field: 'outputDate',
title: '领料日期'
},
{
field: 'planQty',
title: '计划数量'
},
{
field: 'coinType',
title: '币别'
},
{
field: 'price',
title: '单价'
},
{
field: 'totalPrice',
title: '总价'
},
{
field: 'departmentName',
title: '部门名称'
},
{
field: 'linkman',
title: '领料人'
},
{
field: 'stockName',
title: '仓库名称'
},
{
field: 'outputClass',
title: '出库类型'
},
{
field: 'endFlag',
title: '结案否',
visible: false
},
{
field: 'itemClass',
title: '物料类别'
},
{
field: 'getFlag',
title: '领料否',
visible: false
},
{
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.materialRequisitionNo + '\')"><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.materialRequisitionNo + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
function reset(){
$("select[name='departmentName']").val("").select2();
$("select[name='stockName']").val("").select2();
$("select[name='outputClass']").val("").select2();
$("select[name='endFlag']").val("").select2();
$("select[name='itemClass']").val("").select2();
$.form.reset();
}
//结案
function end() {
let row = $("#bootstrap-table").bootstrapTable("getSelections");
if (row[0].endFlag === "1") {
$.modal.msgError("已结案,无法再次结案!");
return false;
}
$.modal.confirm("是否确定结案?", function () {
$.ajax({
url: prefix+"/end",
type: "post",
dataType: "json",
data: {"materialRequisitionNo": row[0].materialRequisitionNo},
success: function (resp) {
if (resp.code === 0) {
//$.modal.msgSuccess("更新成功!");
alert("结案成功!");
window.location.reload();
} else {
$.modal.msgError(resp.msg);
}
},
error: function () {
$.modal.msgError("后台出错啦!");
}
})
});
}
//修改
function edit(){
let row = $("#bootstrap-table").bootstrapTable("getSelections");
if (row[0].getFlag==="1"){
$.modal.msgError("已出库!无法修改!");
return false;
}
$.operate.edit();
}
</script>
</body>
</html>
Loading…
Cancel
Save