Browse Source
仓库库存报损单 新增库存报损单Controller 新增库存报损单Service 新增库存报损单ServiceImpl 新增库存报损单inventoryReportDamage.html 完成数据填充,页面展示,条件查询操作 新增库存报损单添加页面 新增库存报损单编辑页面dev
liuxiaoxu
6 months ago
9 changed files with 1293 additions and 0 deletions
@ -0,0 +1,151 @@ |
|||
package com.ruoyi.warehouse.controller; |
|||
|
|||
import java.util.List; |
|||
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 com.ruoyi.common.annotation.Log; |
|||
import com.ruoyi.common.enums.BusinessType; |
|||
import com.ruoyi.warehouse.domain.WarehouseInventoryReportDamage; |
|||
import com.ruoyi.warehouse.service.IWarehouseInventoryReportDamageService; |
|||
import com.ruoyi.common.core.controller.BaseController; |
|||
import com.ruoyi.common.core.domain.AjaxResult; |
|||
import com.ruoyi.common.utils.poi.ExcelUtil; |
|||
import com.ruoyi.common.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 仓库库存报损Controller |
|||
* |
|||
* @author 刘晓旭 |
|||
* @date 2024-05-31 |
|||
*/ |
|||
@Controller |
|||
@RequestMapping("/warehouse/inventoryReportDamage") |
|||
public class WarehouseInventoryReportDamageController extends BaseController |
|||
{ |
|||
private String prefix = "warehouse/inventoryReportDamage"; |
|||
|
|||
@Autowired |
|||
private IWarehouseInventoryReportDamageService warehouseInventoryReportDamageService; |
|||
|
|||
@RequiresPermissions("warehouse:inventoryReportDamage:view") |
|||
@GetMapping() |
|||
public String inventoryReportDamage() |
|||
{ |
|||
return prefix + "/inventoryReportDamage"; |
|||
} |
|||
|
|||
/** |
|||
* 查询仓库库存报损列表 |
|||
*/ |
|||
@RequiresPermissions("warehouse:inventoryReportDamage:list") |
|||
@PostMapping("/list") |
|||
@ResponseBody |
|||
public TableDataInfo list(WarehouseInventoryReportDamage warehouseInventoryReportDamage) |
|||
{ |
|||
startPage(); |
|||
List<WarehouseInventoryReportDamage> list = warehouseInventoryReportDamageService.selectWarehouseInventoryReportDamageList(warehouseInventoryReportDamage); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
/** |
|||
* 导出仓库库存报损列表 |
|||
*/ |
|||
@RequiresPermissions("warehouse:inventoryReportDamage:export") |
|||
@Log(title = "仓库库存报损", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
@ResponseBody |
|||
public AjaxResult export(WarehouseInventoryReportDamage warehouseInventoryReportDamage) |
|||
{ |
|||
List<WarehouseInventoryReportDamage> list = warehouseInventoryReportDamageService.selectWarehouseInventoryReportDamageList(warehouseInventoryReportDamage); |
|||
ExcelUtil<WarehouseInventoryReportDamage> util = new ExcelUtil<WarehouseInventoryReportDamage>(WarehouseInventoryReportDamage.class); |
|||
return util.exportExcel(list, "仓库库存报损数据"); |
|||
} |
|||
|
|||
/** |
|||
* 新增仓库库存报损 |
|||
*/ |
|||
@GetMapping("/add") |
|||
public String add() |
|||
{ |
|||
return prefix + "/add"; |
|||
} |
|||
|
|||
/** |
|||
* 新增保存仓库库存报损 |
|||
*/ |
|||
@RequiresPermissions("warehouse:inventoryReportDamage:add") |
|||
@Log(title = "仓库库存报损", businessType = BusinessType.INSERT) |
|||
@PostMapping("/add") |
|||
@ResponseBody |
|||
public AjaxResult addSave(WarehouseInventoryReportDamage warehouseInventoryReportDamage) |
|||
{ |
|||
return toAjax(warehouseInventoryReportDamageService.insertWarehouseInventoryReportDamage(warehouseInventoryReportDamage)); |
|||
} |
|||
|
|||
/** |
|||
* 修改仓库库存报损 |
|||
*/ |
|||
@GetMapping("/edit/{reportDamageId}") |
|||
public String edit(@PathVariable("reportDamageId") Long reportDamageId, ModelMap mmap) |
|||
{ |
|||
WarehouseInventoryReportDamage warehouseInventoryReportDamage = warehouseInventoryReportDamageService.selectWarehouseInventoryReportDamageById(reportDamageId); |
|||
mmap.put("warehouseInventoryReportDamage", warehouseInventoryReportDamage); |
|||
return prefix + "/edit"; |
|||
} |
|||
|
|||
/** |
|||
* 修改保存仓库库存报损 |
|||
*/ |
|||
@RequiresPermissions("warehouse:inventoryReportDamage:edit") |
|||
@Log(title = "仓库库存报损", businessType = BusinessType.UPDATE) |
|||
@PostMapping("/edit") |
|||
@ResponseBody |
|||
public AjaxResult editSave(WarehouseInventoryReportDamage warehouseInventoryReportDamage) |
|||
{ |
|||
return toAjax(warehouseInventoryReportDamageService.updateWarehouseInventoryReportDamage(warehouseInventoryReportDamage)); |
|||
} |
|||
|
|||
/** |
|||
* 删除仓库库存报损 |
|||
*/ |
|||
@RequiresPermissions("warehouse:inventoryReportDamage:remove") |
|||
@Log(title = "仓库库存报损", businessType = BusinessType.DELETE) |
|||
@PostMapping( "/remove") |
|||
@ResponseBody |
|||
public AjaxResult remove(String ids) |
|||
{ |
|||
return toAjax(warehouseInventoryReportDamageService.deleteWarehouseInventoryReportDamageByIds(ids)); |
|||
} |
|||
|
|||
/** |
|||
* 作废仓库库存报损 |
|||
*/ |
|||
@RequiresPermissions("warehouse:inventoryReportDamage:cancel") |
|||
@Log(title = "仓库库存报损", businessType = BusinessType.CANCEL) |
|||
@GetMapping( "/cancel/{id}") |
|||
@ResponseBody |
|||
public AjaxResult cancel(@PathVariable("id") Long id){ |
|||
return toAjax(warehouseInventoryReportDamageService.cancelWarehouseInventoryReportDamageById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 恢复仓库库存报损 |
|||
*/ |
|||
@RequiresPermissions("warehouse:inventoryReportDamage:restore") |
|||
@Log(title = "仓库库存报损", businessType = BusinessType.RESTORE) |
|||
@GetMapping( "/restore/{id}") |
|||
@ResponseBody |
|||
public AjaxResult restore(@PathVariable("id")Long id) |
|||
{ |
|||
return toAjax(warehouseInventoryReportDamageService.restoreWarehouseInventoryReportDamageById(id)); |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,227 @@ |
|||
package com.ruoyi.warehouse.domain; |
|||
|
|||
import java.util.Date; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import org.apache.commons.lang3.builder.ToStringBuilder; |
|||
import org.apache.commons.lang3.builder.ToStringStyle; |
|||
import com.ruoyi.common.annotation.Excel; |
|||
import com.ruoyi.common.core.domain.BaseEntity; |
|||
|
|||
/** |
|||
* 仓库库存报损对象 warehouse_inventory_report_damage |
|||
* |
|||
* @author 刘晓旭 |
|||
* @date 2024-05-31 |
|||
*/ |
|||
public class WarehouseInventoryReportDamage extends BaseEntity |
|||
{ |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** 库存报损id */ |
|||
private Long reportDamageId; |
|||
|
|||
/** 报损单号 */ |
|||
@Excel(name = "报损单号") |
|||
private String reportDamageCode; |
|||
|
|||
/** 报废类型 */ |
|||
@Excel(name = "报废类型") |
|||
private String warehousScrapType; |
|||
|
|||
/** 关联生产单号 */ |
|||
@Excel(name = "关联生产单号") |
|||
private String makeNo; |
|||
|
|||
/** 是否关联生产单号 */ |
|||
@Excel(name = "是否关联生产单号") |
|||
private String whetherMakeNo; |
|||
|
|||
/** 申请部门 */ |
|||
@Excel(name = "申请部门") |
|||
private String applyDept; |
|||
|
|||
/** 申请时间 */ |
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
@Excel(name = "申请时间", width = 30, dateFormat = "yyyy-MM-dd") |
|||
private Date applyTime; |
|||
|
|||
/** 料号 */ |
|||
@Excel(name = "料号") |
|||
private String materialNo; |
|||
|
|||
/** 物料名称 */ |
|||
@Excel(name = "物料名称") |
|||
private String materialName; |
|||
|
|||
/** 物料数合计 */ |
|||
@Excel(name = "物料数合计") |
|||
private String materialTotal; |
|||
|
|||
/** 数量合计 */ |
|||
@Excel(name = "数量合计") |
|||
private String numTotal; |
|||
|
|||
/** 仓库ID */ |
|||
@Excel(name = "仓库ID") |
|||
private String warehouseCode; |
|||
|
|||
/** 仓库名称 */ |
|||
@Excel(name = "仓库名称") |
|||
private String warehouseName; |
|||
|
|||
/** 仓库存放地址 */ |
|||
@Excel(name = "仓库存放地址") |
|||
private String warehouseStoreAddress; |
|||
|
|||
public void setReportDamageId(Long reportDamageId) |
|||
{ |
|||
this.reportDamageId = reportDamageId; |
|||
} |
|||
|
|||
public Long getReportDamageId() |
|||
{ |
|||
return reportDamageId; |
|||
} |
|||
public void setReportDamageCode(String reportDamageCode) |
|||
{ |
|||
this.reportDamageCode = reportDamageCode; |
|||
} |
|||
|
|||
public String getReportDamageCode() |
|||
{ |
|||
return reportDamageCode; |
|||
} |
|||
public void setWarehousScrapType(String warehousScrapType) |
|||
{ |
|||
this.warehousScrapType = warehousScrapType; |
|||
} |
|||
|
|||
public String getWarehousScrapType() |
|||
{ |
|||
return warehousScrapType; |
|||
} |
|||
public void setMakeNo(String makeNo) |
|||
{ |
|||
this.makeNo = makeNo; |
|||
} |
|||
|
|||
public String getMakeNo() |
|||
{ |
|||
return makeNo; |
|||
} |
|||
public void setWhetherMakeNo(String whetherMakeNo) |
|||
{ |
|||
this.whetherMakeNo = whetherMakeNo; |
|||
} |
|||
|
|||
public String getWhetherMakeNo() |
|||
{ |
|||
return whetherMakeNo; |
|||
} |
|||
public void setApplyDept(String applyDept) |
|||
{ |
|||
this.applyDept = applyDept; |
|||
} |
|||
|
|||
public String getApplyDept() |
|||
{ |
|||
return applyDept; |
|||
} |
|||
public void setApplyTime(Date applyTime) |
|||
{ |
|||
this.applyTime = applyTime; |
|||
} |
|||
|
|||
public Date getApplyTime() |
|||
{ |
|||
return applyTime; |
|||
} |
|||
public void setMaterialNo(String materialNo) |
|||
{ |
|||
this.materialNo = materialNo; |
|||
} |
|||
|
|||
public String getMaterialNo() |
|||
{ |
|||
return materialNo; |
|||
} |
|||
public void setMaterialName(String materialName) |
|||
{ |
|||
this.materialName = materialName; |
|||
} |
|||
|
|||
public String getMaterialName() |
|||
{ |
|||
return materialName; |
|||
} |
|||
public void setMaterialTotal(String materialTotal) |
|||
{ |
|||
this.materialTotal = materialTotal; |
|||
} |
|||
|
|||
public String getMaterialTotal() |
|||
{ |
|||
return materialTotal; |
|||
} |
|||
public void setNumTotal(String numTotal) |
|||
{ |
|||
this.numTotal = numTotal; |
|||
} |
|||
|
|||
public String getNumTotal() |
|||
{ |
|||
return numTotal; |
|||
} |
|||
public void setWarehouseCode(String warehouseCode) |
|||
{ |
|||
this.warehouseCode = warehouseCode; |
|||
} |
|||
|
|||
public String getWarehouseCode() |
|||
{ |
|||
return warehouseCode; |
|||
} |
|||
public void setWarehouseName(String warehouseName) |
|||
{ |
|||
this.warehouseName = warehouseName; |
|||
} |
|||
|
|||
public String getWarehouseName() |
|||
{ |
|||
return warehouseName; |
|||
} |
|||
public void setWarehouseStoreAddress(String warehouseStoreAddress) |
|||
{ |
|||
this.warehouseStoreAddress = warehouseStoreAddress; |
|||
} |
|||
|
|||
public String getWarehouseStoreAddress() |
|||
{ |
|||
return warehouseStoreAddress; |
|||
} |
|||
|
|||
@Override |
|||
public String toString() { |
|||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
|||
.append("reportDamageId", getReportDamageId()) |
|||
.append("reportDamageCode", getReportDamageCode()) |
|||
.append("warehousScrapType", getWarehousScrapType()) |
|||
.append("makeNo", getMakeNo()) |
|||
.append("whetherMakeNo", getWhetherMakeNo()) |
|||
.append("applyDept", getApplyDept()) |
|||
.append("applyTime", getApplyTime()) |
|||
.append("materialNo", getMaterialNo()) |
|||
.append("materialName", getMaterialName()) |
|||
.append("materialTotal", getMaterialTotal()) |
|||
.append("numTotal", getNumTotal()) |
|||
.append("warehouseCode", getWarehouseCode()) |
|||
.append("warehouseName", getWarehouseName()) |
|||
.append("warehouseStoreAddress", getWarehouseStoreAddress()) |
|||
.append("remark", getRemark()) |
|||
.append("createTime", getCreateTime()) |
|||
.append("createBy", getCreateBy()) |
|||
.append("updateBy", getUpdateBy()) |
|||
.append("updateTime", getUpdateTime()) |
|||
.toString(); |
|||
} |
|||
} |
@ -0,0 +1,86 @@ |
|||
package com.ruoyi.warehouse.mapper; |
|||
|
|||
import java.util.List; |
|||
import com.ruoyi.warehouse.domain.WarehouseInventoryReportDamage; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
/** |
|||
* 仓库库存报损Mapper接口 |
|||
* |
|||
* @author 刘晓旭 |
|||
* @date 2024-05-31 |
|||
*/ |
|||
public interface WarehouseInventoryReportDamageMapper |
|||
{ |
|||
/** |
|||
* 查询仓库库存报损 |
|||
* |
|||
* @param reportDamageId 仓库库存报损ID |
|||
* @return 仓库库存报损 |
|||
*/ |
|||
public WarehouseInventoryReportDamage selectWarehouseInventoryReportDamageById(Long reportDamageId); |
|||
|
|||
/** |
|||
* 查询仓库库存报损列表 |
|||
* |
|||
* @param warehouseInventoryReportDamage 仓库库存报损 |
|||
* @return 仓库库存报损集合 |
|||
*/ |
|||
public List<WarehouseInventoryReportDamage> selectWarehouseInventoryReportDamageList(WarehouseInventoryReportDamage warehouseInventoryReportDamage); |
|||
|
|||
/** |
|||
* 新增仓库库存报损 |
|||
* |
|||
* @param warehouseInventoryReportDamage 仓库库存报损 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertWarehouseInventoryReportDamage(WarehouseInventoryReportDamage warehouseInventoryReportDamage); |
|||
|
|||
/** |
|||
* 修改仓库库存报损 |
|||
* |
|||
* @param warehouseInventoryReportDamage 仓库库存报损 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateWarehouseInventoryReportDamage(WarehouseInventoryReportDamage warehouseInventoryReportDamage); |
|||
|
|||
/** |
|||
* 删除仓库库存报损 |
|||
* |
|||
* @param reportDamageId 仓库库存报损ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteWarehouseInventoryReportDamageById(Long reportDamageId); |
|||
|
|||
/** |
|||
* 批量删除仓库库存报损 |
|||
* |
|||
* @param reportDamageIds 需要删除的数据ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteWarehouseInventoryReportDamageByIds(String[] reportDamageIds); |
|||
|
|||
/** |
|||
* 作废仓库库存报损 |
|||
* |
|||
* @param reportDamageId 仓库库存报损ID |
|||
* @return 结果 |
|||
*/ |
|||
public int cancelWarehouseInventoryReportDamageById(Long reportDamageId); |
|||
|
|||
/** |
|||
* 恢复仓库库存报损 |
|||
* |
|||
* @param reportDamageId 仓库库存报损ID |
|||
* @return 结果 |
|||
*/ |
|||
public int restoreWarehouseInventoryReportDamageById(Long reportDamageId); |
|||
|
|||
|
|||
/** |
|||
* 查询数据库中今天已经生产的最大序号 |
|||
* |
|||
* @param prefix 前面的:BS年月日 |
|||
*/ |
|||
public String findMaxRoundCode(@Param("prefix") String prefix); |
|||
} |
@ -0,0 +1,75 @@ |
|||
package com.ruoyi.warehouse.service; |
|||
|
|||
import java.util.List; |
|||
import com.ruoyi.warehouse.domain.WarehouseInventoryReportDamage; |
|||
|
|||
/** |
|||
* 仓库库存报损Service接口 |
|||
* |
|||
* @author 刘晓旭 |
|||
* @date 2024-05-31 |
|||
*/ |
|||
public interface IWarehouseInventoryReportDamageService |
|||
{ |
|||
/** |
|||
* 查询仓库库存报损 |
|||
* |
|||
* @param reportDamageId 仓库库存报损ID |
|||
* @return 仓库库存报损 |
|||
*/ |
|||
public WarehouseInventoryReportDamage selectWarehouseInventoryReportDamageById(Long reportDamageId); |
|||
|
|||
/** |
|||
* 查询仓库库存报损列表 |
|||
* |
|||
* @param warehouseInventoryReportDamage 仓库库存报损 |
|||
* @return 仓库库存报损集合 |
|||
*/ |
|||
public List<WarehouseInventoryReportDamage> selectWarehouseInventoryReportDamageList(WarehouseInventoryReportDamage warehouseInventoryReportDamage); |
|||
|
|||
/** |
|||
* 新增仓库库存报损 |
|||
* |
|||
* @param warehouseInventoryReportDamage 仓库库存报损 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertWarehouseInventoryReportDamage(WarehouseInventoryReportDamage warehouseInventoryReportDamage); |
|||
|
|||
/** |
|||
* 修改仓库库存报损 |
|||
* |
|||
* @param warehouseInventoryReportDamage 仓库库存报损 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateWarehouseInventoryReportDamage(WarehouseInventoryReportDamage warehouseInventoryReportDamage); |
|||
|
|||
/** |
|||
* 批量删除仓库库存报损 |
|||
* |
|||
* @param ids 需要删除的数据ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteWarehouseInventoryReportDamageByIds(String ids); |
|||
|
|||
/** |
|||
* 删除仓库库存报损信息 |
|||
* |
|||
* @param reportDamageId 仓库库存报损ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteWarehouseInventoryReportDamageById(Long reportDamageId); |
|||
|
|||
/** |
|||
* 作废仓库库存报损 |
|||
* @param reportDamageId 仓库库存报损ID |
|||
* @return |
|||
*/ |
|||
int cancelWarehouseInventoryReportDamageById(Long reportDamageId); |
|||
|
|||
/** |
|||
* 恢复仓库库存报损 |
|||
* @param reportDamageId 仓库库存报损ID |
|||
* @return |
|||
*/ |
|||
int restoreWarehouseInventoryReportDamageById(Long reportDamageId); |
|||
} |
@ -0,0 +1,174 @@ |
|||
package com.ruoyi.warehouse.service.impl; |
|||
|
|||
import java.text.DecimalFormat; |
|||
import java.text.SimpleDateFormat; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
import com.ruoyi.common.exception.BusinessException; |
|||
import com.ruoyi.common.utils.DateUtils; |
|||
import com.ruoyi.common.utils.ShiroUtils; |
|||
import com.ruoyi.common.utils.StringUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import com.ruoyi.warehouse.mapper.WarehouseInventoryReportDamageMapper; |
|||
import com.ruoyi.warehouse.domain.WarehouseInventoryReportDamage; |
|||
import com.ruoyi.warehouse.service.IWarehouseInventoryReportDamageService; |
|||
import com.ruoyi.common.core.text.Convert; |
|||
|
|||
/** |
|||
* 仓库库存报损Service业务层处理 |
|||
* |
|||
* @author 刘晓旭 |
|||
* @date 2024-05-31 |
|||
*/ |
|||
@Service |
|||
public class WarehouseInventoryReportDamageServiceImpl implements IWarehouseInventoryReportDamageService |
|||
{ |
|||
@Autowired |
|||
private WarehouseInventoryReportDamageMapper warehouseInventoryReportDamageMapper; |
|||
|
|||
/** |
|||
* 查询仓库库存报损 |
|||
* |
|||
* @param reportDamageId 仓库库存报损ID |
|||
* @return 仓库库存报损 |
|||
*/ |
|||
@Override |
|||
public WarehouseInventoryReportDamage selectWarehouseInventoryReportDamageById(Long reportDamageId) |
|||
{ |
|||
return warehouseInventoryReportDamageMapper.selectWarehouseInventoryReportDamageById(reportDamageId); |
|||
} |
|||
|
|||
/** |
|||
* 查询仓库库存报损列表 |
|||
* |
|||
* @param warehouseInventoryReportDamage 仓库库存报损 |
|||
* @return 仓库库存报损 |
|||
*/ |
|||
@Override |
|||
public List<WarehouseInventoryReportDamage> selectWarehouseInventoryReportDamageList(WarehouseInventoryReportDamage warehouseInventoryReportDamage) |
|||
{ |
|||
return warehouseInventoryReportDamageMapper.selectWarehouseInventoryReportDamageList(warehouseInventoryReportDamage); |
|||
} |
|||
|
|||
/** |
|||
* 新增仓库库存报损 |
|||
* |
|||
* @param warehouseInventoryReportDamage 仓库库存报损 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int insertWarehouseInventoryReportDamage(WarehouseInventoryReportDamage warehouseInventoryReportDamage) |
|||
{ |
|||
|
|||
|
|||
//更改日期格式,以提高可读性
|
|||
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); |
|||
String dataPart = df.format(new Date()); |
|||
|
|||
//移除日期中的分隔符以便于后续处理
|
|||
String prefix = "BS"+dataPart.replace("-",""); |
|||
|
|||
//查询数据库中最大的编号
|
|||
String maxCode = warehouseInventoryReportDamageMapper.findMaxRoundCode(prefix); |
|||
|
|||
String newCode = generateNewCode(prefix,maxCode); |
|||
|
|||
warehouseInventoryReportDamage.setReportDamageCode(newCode); |
|||
warehouseInventoryReportDamage.setCreateTime(DateUtils.getNowDate()); |
|||
String loginName = ShiroUtils.getLoginName(); |
|||
warehouseInventoryReportDamage.setCreateBy(loginName); |
|||
return warehouseInventoryReportDamageMapper.insertWarehouseInventoryReportDamage(warehouseInventoryReportDamage); |
|||
} |
|||
|
|||
/** |
|||
* 修改仓库库存报损 |
|||
* |
|||
* @param warehouseInventoryReportDamage 仓库库存报损 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int updateWarehouseInventoryReportDamage(WarehouseInventoryReportDamage warehouseInventoryReportDamage) |
|||
{ |
|||
String loginName = ShiroUtils.getLoginName(); |
|||
warehouseInventoryReportDamage.setUpdateBy(loginName); |
|||
warehouseInventoryReportDamage.setUpdateTime(DateUtils.getNowDate()); |
|||
return warehouseInventoryReportDamageMapper.updateWarehouseInventoryReportDamage(warehouseInventoryReportDamage); |
|||
} |
|||
|
|||
/** |
|||
* 删除仓库库存报损对象 |
|||
* |
|||
* @param ids 需要删除的数据ID |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteWarehouseInventoryReportDamageByIds(String ids) |
|||
{ |
|||
return warehouseInventoryReportDamageMapper.deleteWarehouseInventoryReportDamageByIds(Convert.toStrArray(ids)); |
|||
} |
|||
|
|||
/** |
|||
* 删除仓库库存报损信息 |
|||
* |
|||
* @param reportDamageId 仓库库存报损ID |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteWarehouseInventoryReportDamageById(Long reportDamageId) |
|||
{ |
|||
return warehouseInventoryReportDamageMapper.deleteWarehouseInventoryReportDamageById(reportDamageId); |
|||
} |
|||
|
|||
/** |
|||
* 作废仓库库存报损 |
|||
* |
|||
* @param reportDamageId 仓库库存报损ID |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int cancelWarehouseInventoryReportDamageById(Long reportDamageId) |
|||
{ |
|||
return warehouseInventoryReportDamageMapper.cancelWarehouseInventoryReportDamageById(reportDamageId); |
|||
} |
|||
|
|||
/** |
|||
* 恢复仓库库存报损信息 |
|||
* |
|||
* @param reportDamageId 仓库库存报损ID |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int restoreWarehouseInventoryReportDamageById(Long reportDamageId) |
|||
{ |
|||
return warehouseInventoryReportDamageMapper.restoreWarehouseInventoryReportDamageById(reportDamageId); |
|||
} |
|||
|
|||
|
|||
/** |
|||
*报损单号生产规则 |
|||
*系统自动生成,按照特定编码,编码暂用【BS+年月日+001】, |
|||
*自增长,如:BS20231111001,BS20231111002 |
|||
* |
|||
*/ |
|||
private String generateNewCode(String prefix, String maxCode) { |
|||
if (StringUtils.isEmpty(maxCode)){ |
|||
return prefix+"001"; |
|||
} |
|||
//解析并递增编号
|
|||
int sequence = Integer.parseInt(maxCode.substring(5)) + 1 ; |
|||
|
|||
//检查序列号是否溢出
|
|||
if (sequence > 999){ |
|||
throw new BusinessException("当日编号已达到最大值999,请检查或调整策略"); |
|||
} |
|||
|
|||
//格式化序列号,自动补零至三位
|
|||
DecimalFormat df = new DecimalFormat("000"); |
|||
|
|||
return prefix + df.format(sequence); |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,143 @@ |
|||
<?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.warehouse.mapper.WarehouseInventoryReportDamageMapper"> |
|||
|
|||
<resultMap type="WarehouseInventoryReportDamage" id="WarehouseInventoryReportDamageResult"> |
|||
<result property="reportDamageId" column="report_damage_id" /> |
|||
<result property="reportDamageCode" column="report_damage_code" /> |
|||
<result property="warehousScrapType" column="warehous_scrap_type" /> |
|||
<result property="makeNo" column="make_no" /> |
|||
<result property="whetherMakeNo" column="whether_make_no" /> |
|||
<result property="applyDept" column="apply_dept" /> |
|||
<result property="applyTime" column="apply_time" /> |
|||
<result property="materialNo" column="material_no" /> |
|||
<result property="materialName" column="material_name" /> |
|||
<result property="materialTotal" column="material_total" /> |
|||
<result property="numTotal" column="num_total" /> |
|||
<result property="warehouseCode" column="warehouse_code" /> |
|||
<result property="warehouseName" column="warehouse_name" /> |
|||
<result property="warehouseStoreAddress" column="warehouse_store_address" /> |
|||
<result property="remark" column="remark" /> |
|||
<result property="createTime" column="create_time" /> |
|||
<result property="createBy" column="create_by" /> |
|||
<result property="updateBy" column="update_by" /> |
|||
<result property="updateTime" column="update_time" /> |
|||
</resultMap> |
|||
|
|||
<sql id="selectWarehouseInventoryReportDamageVo"> |
|||
select report_damage_id, report_damage_code, warehous_scrap_type, make_no, whether_make_no, apply_dept, apply_time, material_no, material_name, material_total, num_total, warehouse_code, warehouse_name, warehouse_store_address, remark, create_time, create_by, update_by, update_time from warehouse_inventory_report_damage |
|||
</sql> |
|||
|
|||
<select id="selectWarehouseInventoryReportDamageList" parameterType="WarehouseInventoryReportDamage" resultMap="WarehouseInventoryReportDamageResult"> |
|||
<include refid="selectWarehouseInventoryReportDamageVo"/> |
|||
<where> |
|||
<if test="reportDamageCode != null and reportDamageCode != ''"> and report_damage_code = #{reportDamageCode}</if> |
|||
<if test="warehousScrapType != null and warehousScrapType != ''"> and warehous_scrap_type = #{warehousScrapType}</if> |
|||
<if test="makeNo != null and makeNo != ''"> and make_no = #{makeNo}</if> |
|||
<if test="whetherMakeNo != null and whetherMakeNo != ''"> and whether_make_no = #{whetherMakeNo}</if> |
|||
<if test="applyDept != null and applyDept != ''"> and apply_dept = #{applyDept}</if> |
|||
<if test="materialNo != null and materialNo != ''"> and material_no = #{materialNo}</if> |
|||
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if> |
|||
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if> |
|||
</where> |
|||
</select> |
|||
|
|||
<select id="selectWarehouseInventoryReportDamageById" parameterType="Long" resultMap="WarehouseInventoryReportDamageResult"> |
|||
<include refid="selectWarehouseInventoryReportDamageVo"/> |
|||
where report_damage_id = #{reportDamageId} |
|||
</select> |
|||
|
|||
<insert id="insertWarehouseInventoryReportDamage" parameterType="WarehouseInventoryReportDamage" useGeneratedKeys="true" keyProperty="reportDamageId"> |
|||
insert into warehouse_inventory_report_damage |
|||
<trim prefix="(" suffix=")" suffixOverrides=","> |
|||
<if test="reportDamageCode != null">report_damage_code,</if> |
|||
<if test="warehousScrapType != null">warehous_scrap_type,</if> |
|||
<if test="makeNo != null">make_no,</if> |
|||
<if test="whetherMakeNo != null">whether_make_no,</if> |
|||
<if test="applyDept != null">apply_dept,</if> |
|||
<if test="applyTime != null">apply_time,</if> |
|||
<if test="materialNo != null">material_no,</if> |
|||
<if test="materialName != null">material_name,</if> |
|||
<if test="materialTotal != null">material_total,</if> |
|||
<if test="numTotal != null">num_total,</if> |
|||
<if test="warehouseCode != null">warehouse_code,</if> |
|||
<if test="warehouseName != null">warehouse_name,</if> |
|||
<if test="warehouseStoreAddress != null">warehouse_store_address,</if> |
|||
<if test="remark != null">remark,</if> |
|||
<if test="createTime != null">create_time,</if> |
|||
<if test="createBy != null">create_by,</if> |
|||
<if test="updateBy != null">update_by,</if> |
|||
<if test="updateTime != null">update_time,</if> |
|||
</trim> |
|||
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|||
<if test="reportDamageCode != null">#{reportDamageCode},</if> |
|||
<if test="warehousScrapType != null">#{warehousScrapType},</if> |
|||
<if test="makeNo != null">#{makeNo},</if> |
|||
<if test="whetherMakeNo != null">#{whetherMakeNo},</if> |
|||
<if test="applyDept != null">#{applyDept},</if> |
|||
<if test="applyTime != null">#{applyTime},</if> |
|||
<if test="materialNo != null">#{materialNo},</if> |
|||
<if test="materialName != null">#{materialName},</if> |
|||
<if test="materialTotal != null">#{materialTotal},</if> |
|||
<if test="numTotal != null">#{numTotal},</if> |
|||
<if test="warehouseCode != null">#{warehouseCode},</if> |
|||
<if test="warehouseName != null">#{warehouseName},</if> |
|||
<if test="warehouseStoreAddress != null">#{warehouseStoreAddress},</if> |
|||
<if test="remark != null">#{remark},</if> |
|||
<if test="createTime != null">#{createTime},</if> |
|||
<if test="createBy != null">#{createBy},</if> |
|||
<if test="updateBy != null">#{updateBy},</if> |
|||
<if test="updateTime != null">#{updateTime},</if> |
|||
</trim> |
|||
</insert> |
|||
|
|||
<update id="updateWarehouseInventoryReportDamage" parameterType="WarehouseInventoryReportDamage"> |
|||
update warehouse_inventory_report_damage |
|||
<trim prefix="SET" suffixOverrides=","> |
|||
<if test="reportDamageCode != null">report_damage_code = #{reportDamageCode},</if> |
|||
<if test="warehousScrapType != null">warehous_scrap_type = #{warehousScrapType},</if> |
|||
<if test="makeNo != null">make_no = #{makeNo},</if> |
|||
<if test="whetherMakeNo != null">whether_make_no = #{whetherMakeNo},</if> |
|||
<if test="applyDept != null">apply_dept = #{applyDept},</if> |
|||
<if test="applyTime != null">apply_time = #{applyTime},</if> |
|||
<if test="materialNo != null">material_no = #{materialNo},</if> |
|||
<if test="materialName != null">material_name = #{materialName},</if> |
|||
<if test="materialTotal != null">material_total = #{materialTotal},</if> |
|||
<if test="numTotal != null">num_total = #{numTotal},</if> |
|||
<if test="warehouseCode != null">warehouse_code = #{warehouseCode},</if> |
|||
<if test="warehouseName != null">warehouse_name = #{warehouseName},</if> |
|||
<if test="warehouseStoreAddress != null">warehouse_store_address = #{warehouseStoreAddress},</if> |
|||
<if test="remark != null">remark = #{remark},</if> |
|||
<if test="createTime != null">create_time = #{createTime},</if> |
|||
<if test="createBy != null">create_by = #{createBy},</if> |
|||
<if test="updateBy != null">update_by = #{updateBy},</if> |
|||
<if test="updateTime != null">update_time = #{updateTime},</if> |
|||
</trim> |
|||
where report_damage_id = #{reportDamageId} |
|||
</update> |
|||
|
|||
<delete id="deleteWarehouseInventoryReportDamageById" parameterType="Long"> |
|||
delete from warehouse_inventory_report_damage where report_damage_id = #{reportDamageId} |
|||
</delete> |
|||
|
|||
<delete id="deleteWarehouseInventoryReportDamageByIds" parameterType="String"> |
|||
delete from warehouse_inventory_report_damage where report_damage_id in |
|||
<foreach item="reportDamageId" collection="array" open="(" separator="," close=")"> |
|||
#{reportDamageId} |
|||
</foreach> |
|||
</delete> |
|||
|
|||
<update id="cancelWarehouseInventoryReportDamageById" parameterType="Long"> |
|||
update warehouse_inventory_report_damage set del_flag = '1' where report_damage_id = #{reportDamageId} |
|||
</update> |
|||
|
|||
<update id="restoreWarehouseInventoryReportDamageById" parameterType="Long"> |
|||
update warehouse_inventory_report_damage set del_flag = '0' where report_damage_id = #{reportDamageId} |
|||
</update> |
|||
|
|||
<select id="findMaxRoundCode" resultType="String"> |
|||
select max(substring(report_damage_code,6)) from warehouse_inventory_report_damage WHERE report_damage_code LIKE CONCAT(#{prefix}, '%') |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,119 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
|||
<head> |
|||
<th:block th:include="include :: header('新增仓库库存报损')" /> |
|||
<th:block th:include="include :: datetimepicker-css" /> |
|||
</head> |
|||
<body class="white-bg"> |
|||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|||
<form class="form-horizontal m" id="form-inventoryReportDamage-add"> |
|||
<!-- <div class="form-group"> --> |
|||
<!-- <label class="col-sm-3 control-label">报废类型:</label>--> |
|||
<!-- <div class="col-sm-8">--> |
|||
<!-- <select name="warehousScrapType" class="form-control m-b" th:with="type=${@dict.getType('warehous_scrap_type')}">--> |
|||
<!-- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>--> |
|||
<!-- </select>--> |
|||
<!-- </div>--> |
|||
<!-- </div>--> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">关联生产单号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="makeNo" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">是否关联生产单号:</label> |
|||
<div class="col-sm-8"> |
|||
<div class="radio-box" th:each="dict : ${@dict.getType('yes_or_no')}"> |
|||
<input type="radio" th:id="${'whetherMakeNo_' + dict.dictCode}" name="whetherMakeNo" th:value="${dict.dictValue}" th:checked="${dict.default}"> |
|||
<label th:for="${'whetherMakeNo_' + dict.dictCode}" th:text="${dict.dictLabel}"></label> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">申请部门:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="applyDept" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">申请时间:</label> |
|||
<div class="col-sm-8"> |
|||
<div class="input-group date"> |
|||
<input name="applyTime" class="form-control" placeholder="yyyy-MM-dd" type="text"> |
|||
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">料号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="materialNo" 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="materialName" 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="materialTotal" 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="numTotal" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">仓库ID:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="warehouseCode" 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="warehouseName" 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="warehouseStoreAddress" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">备注:</label> |
|||
<div class="col-sm-8"> |
|||
<textarea name="remark" class="form-control"></textarea> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<th:block th:include="include :: datetimepicker-js" /> |
|||
<script th:inline="javascript"> |
|||
var prefix = ctx + "warehouse/inventoryReportDamage" |
|||
$("#form-inventoryReportDamage-add").validate({ |
|||
focusCleanup: true |
|||
}); |
|||
|
|||
function submitHandler() { |
|||
if ($.validate.form()) { |
|||
$.operate.save(prefix + "/add", $('#form-inventoryReportDamage-add').serialize()); |
|||
} |
|||
} |
|||
|
|||
$("input[name='applyTime']").datetimepicker({ |
|||
format: "yyyy-mm-dd", |
|||
minView: "month", |
|||
autoclose: true |
|||
}); |
|||
</script> |
|||
</body> |
|||
</html> |
@ -0,0 +1,126 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
|||
<head> |
|||
<th:block th:include="include :: header('修改仓库库存报损')" /> |
|||
<th:block th:include="include :: datetimepicker-css" /> |
|||
</head> |
|||
<body class="white-bg"> |
|||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|||
<form class="form-horizontal m" id="form-inventoryReportDamage-edit" th:object="${warehouseInventoryReportDamage}"> |
|||
<input name="reportDamageId" th:field="*{reportDamageId}" type="hidden"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">报损单号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="reportDamageCode" th:field="*{reportDamageCode}" 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 name="warehousScrapType" class="form-control m-b" th:with="type=${@dict.getType('warehous_scrap_type')}"> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{warehousScrapType}"></option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">关联生产单号:</label> |
|||
<div class="col-sm-8"> |
|||
<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> |
|||
<div class="col-sm-8"> |
|||
<div class="radio-box" th:each="dict : ${@dict.getType('yes_or_no')}"> |
|||
<input type="radio" th:id="${'whetherMakeNo_' + dict.dictCode}" name="whetherMakeNo" th:value="${dict.dictValue}" th:field="*{whetherMakeNo}"> |
|||
<label th:for="${'whetherMakeNo_' + dict.dictCode}" th:text="${dict.dictLabel}"></label> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">申请部门:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="applyDept" th:field="*{applyDept}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">申请时间:</label> |
|||
<div class="col-sm-8"> |
|||
<div class="input-group date"> |
|||
<input name="applyTime" th:value="${#dates.format(warehouseInventoryReportDamage.applyTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text"> |
|||
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">料号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="materialNo" th:field="*{materialNo}" 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="materialName" th:field="*{materialName}" 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="materialTotal" th:field="*{materialTotal}" 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="numTotal" th:field="*{numTotal}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">仓库ID:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="warehouseCode" th:field="*{warehouseCode}" 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="warehouseName" th:field="*{warehouseName}" 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="warehouseStoreAddress" th:field="*{warehouseStoreAddress}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">备注:</label> |
|||
<div class="col-sm-8"> |
|||
<textarea name="remark" class="form-control">[[*{remark}]]</textarea> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<th:block th:include="include :: datetimepicker-js" /> |
|||
<script th:inline="javascript"> |
|||
var prefix = ctx + "warehouse/inventoryReportDamage"; |
|||
$("#form-inventoryReportDamage-edit").validate({ |
|||
focusCleanup: true |
|||
}); |
|||
|
|||
function submitHandler() { |
|||
if ($.validate.form()) { |
|||
$.operate.save(prefix + "/edit", $('#form-inventoryReportDamage-edit').serialize()); |
|||
} |
|||
} |
|||
|
|||
$("input[name='applyTime']").datetimepicker({ |
|||
format: "yyyy-mm-dd", |
|||
minView: "month", |
|||
autoclose: true |
|||
}); |
|||
</script> |
|||
</body> |
|||
</html> |
@ -0,0 +1,192 @@ |
|||
<!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('仓库库存报损列表')" /> |
|||
</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="reportDamageCode"/> |
|||
</li> |
|||
<li> |
|||
<label>申请部门:</label> |
|||
<input type="text" name="applyDept"/> |
|||
</li> |
|||
<li> |
|||
<label>报废类型:</label> |
|||
<select name="warehousScrapType" th:with="type=${@dict.getType('warehous_scrap_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="whetherMakeNo" th:with="type=${@dict.getType('yes_or_no')}"> |
|||
<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="makeNo"/> |
|||
</li> |
|||
|
|||
<li> |
|||
<label>料号:</label> |
|||
<input type="text" name="materialNo"/> |
|||
</li> |
|||
<li> |
|||
<label>物料名称:</label> |
|||
<input type="text" name="materialName"/> |
|||
</li> |
|||
<li class="select-time"> |
|||
<label>录入时间:</label> |
|||
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginCreateTime]"/> |
|||
<span>-</span> |
|||
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endCreateTime]"/> |
|||
</li> |
|||
<li> |
|||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> |
|||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</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="warehouse:inventoryReportDamage:add"> |
|||
<i class="fa fa-plus"></i> 添加 |
|||
</a> |
|||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="warehouse:inventoryReportDamage:export"> |
|||
<i class="fa fa-download"></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:inline="javascript"> |
|||
var editFlag = [[${@permission.hasPermi('warehouse:inventoryReportDamage:edit')}]]; |
|||
|
|||
|
|||
var warehousScrapTypeDatas = [[${@dict.getType('warehous_scrap_type')}]]; |
|||
var whetherMakeNoDatas = [[${@dict.getType('yes_or_no')}]]; |
|||
var prefix = ctx + "warehouse/inventoryReportDamage"; |
|||
|
|||
$(function() { |
|||
var options = { |
|||
url: prefix + "/list", |
|||
createUrl: prefix + "/add", |
|||
updateUrl: prefix + "/edit/{id}", |
|||
removeUrl: prefix + "/remove", |
|||
cancelUrl: prefix + "/cancel/{id}", |
|||
restoreUrl: prefix + "/restore/{id}", |
|||
exportUrl: prefix + "/export", |
|||
modalName: "仓库库存报损", |
|||
columns: [{ |
|||
checkbox: true |
|||
}, |
|||
{ |
|||
title: '库存报损id', |
|||
field: 'reportDamageId', |
|||
visible: false |
|||
}, |
|||
{ |
|||
title: '报损单号', |
|||
field: 'reportDamageCode', |
|||
}, |
|||
|
|||
{ |
|||
title: '申请部门', |
|||
field: 'applyDept', |
|||
}, |
|||
{ |
|||
title: '申请时间', |
|||
field: 'applyTime', |
|||
}, |
|||
{ |
|||
title: '报废类型', |
|||
field: 'warehousScrapType', |
|||
formatter: function(value, row, index) { |
|||
return $.table.selectDictLabel(warehousScrapTypeDatas, value); |
|||
} |
|||
}, |
|||
{ |
|||
title: '是否关联生产单号', |
|||
field: 'whetherMakeNo', |
|||
formatter: function(value, row, index) { |
|||
return $.table.selectDictLabel(whetherMakeNoDatas, value); |
|||
} |
|||
}, |
|||
{ |
|||
title: '生产单号', |
|||
field: 'makeNo', |
|||
}, |
|||
{ |
|||
title: '料号', |
|||
field: 'materialNo', |
|||
}, |
|||
{ |
|||
title: '物料名称', |
|||
field: 'materialName', |
|||
}, |
|||
{ |
|||
title: '物料数合计', |
|||
field: 'materialTotal', |
|||
}, |
|||
{ |
|||
title: '数量合计', |
|||
field: 'numTotal', |
|||
}, |
|||
{ |
|||
title: '仓库ID', |
|||
field: 'warehouseCode', |
|||
}, |
|||
{ |
|||
title: '仓库名称', |
|||
field: 'warehouseName', |
|||
}, |
|||
{ |
|||
title: '仓库存放地址', |
|||
field: 'warehouseStoreAddress', |
|||
}, |
|||
{ |
|||
title: '备注', |
|||
field: 'remark', |
|||
}, |
|||
{ |
|||
title: '录入时间', |
|||
field: 'createTime', |
|||
}, |
|||
{ |
|||
title: '录入人', |
|||
field: 'createBy', |
|||
}, |
|||
{ |
|||
title: '更新人', |
|||
field: 'updateBy', |
|||
}, |
|||
{ |
|||
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.reportDamageId + '\')"><i class="fa fa-edit"></i>编辑</a> '); |
|||
return actions.join(''); |
|||
} |
|||
}] |
|||
}; |
|||
$.table.init(options); |
|||
}); |
|||
</script> |
|||
</body> |
|||
</html> |
Loading…
Reference in new issue