| New file |
| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.core.common.DateUtils; |
| | | import com.zy.asrs.entity.InventoryReserve; |
| | | import com.zy.asrs.service.InventoryReserveService; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | | public class InventoryReserveController extends BaseController { |
| | | |
| | | @Autowired |
| | | private InventoryReserveService inventoryReserveService; |
| | | |
| | | @RequestMapping(value = "/inventoryReserve/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(inventoryReserveService.selectById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/inventoryReserve/list/auth") |
| | | @ManagerAuth |
| | | public R list(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<InventoryReserve> wrapper = new EntityWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | allLike(InventoryReserve.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(inventoryReserveService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | | String[] dates = val.split(RANGE_TIME_LINK); |
| | | wrapper.ge(entry.getKey(), DateUtils.convert(dates[0])); |
| | | wrapper.le(entry.getKey(), DateUtils.convert(dates[1])); |
| | | } else { |
| | | wrapper.like(entry.getKey(), val); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/inventoryReserve/add/auth") |
| | | @ManagerAuth |
| | | public R add(InventoryReserve inventoryReserve) { |
| | | |
| | | Date date = new Date(); |
| | | inventoryReserve.setId(null); |
| | | inventoryReserve.setCreateTime(date); |
| | | inventoryReserve.setCreateBy(getUserId()); |
| | | inventoryReserve.setUpdateTime(date); |
| | | inventoryReserve.setUpdateBy(getUserId()); |
| | | inventoryReserveService.insert(inventoryReserve); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/inventoryReserve/update/auth") |
| | | @ManagerAuth |
| | | public R update(InventoryReserve inventoryReserve){ |
| | | if (Cools.isEmpty(inventoryReserve) || null==inventoryReserve.getId()){ |
| | | return R.error(); |
| | | } |
| | | Date date = new Date(); |
| | | inventoryReserve.setUpdateTime(date); |
| | | inventoryReserve.setUpdateBy(getUserId()); |
| | | inventoryReserveService.updateById(inventoryReserve); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/inventoryReserve/delete/auth") |
| | | @ManagerAuth |
| | | public R delete(@RequestParam(value="ids[]") Long[] ids){ |
| | | for (Long id : ids){ |
| | | inventoryReserveService.deleteById(id); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/inventoryReserve/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | EntityWrapper<InventoryReserve> wrapper = new EntityWrapper<>(); |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("inventoryReserve")); |
| | | convert(map, wrapper); |
| | | List<InventoryReserve> list = inventoryReserveService.selectList(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/inventoryReserveQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<InventoryReserve> wrapper = new EntityWrapper<>(); |
| | | wrapper.like("id", condition); |
| | | Page<InventoryReserve> page = inventoryReserveService.selectPage(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (InventoryReserve inventoryReserve : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", inventoryReserve.getId()); |
| | | map.put("value", inventoryReserve.getId()); |
| | | result.add(map); |
| | | } |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @RequestMapping(value = "/inventoryReserve/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<InventoryReserve> wrapper = new EntityWrapper<InventoryReserve>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != inventoryReserveService.selectOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(InventoryReserve.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.core.common.DateUtils; |
| | | import com.zy.asrs.entity.InventoryReserveLog; |
| | | import com.zy.asrs.service.InventoryReserveLogService; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | | public class InventoryReserveLogController extends BaseController { |
| | | |
| | | @Autowired |
| | | private InventoryReserveLogService inventoryReserveLogService; |
| | | |
| | | @RequestMapping(value = "/inventoryReserveLog/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(inventoryReserveLogService.selectById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/inventoryReserveLog/list/auth") |
| | | @ManagerAuth |
| | | public R list(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<InventoryReserveLog> wrapper = new EntityWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | allLike(InventoryReserveLog.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(inventoryReserveLogService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | | String[] dates = val.split(RANGE_TIME_LINK); |
| | | wrapper.ge(entry.getKey(), DateUtils.convert(dates[0])); |
| | | wrapper.le(entry.getKey(), DateUtils.convert(dates[1])); |
| | | } else { |
| | | wrapper.like(entry.getKey(), val); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/inventoryReserveLog/add/auth") |
| | | @ManagerAuth |
| | | public R add(InventoryReserveLog inventoryReserveLog) { |
| | | inventoryReserveLogService.insert(inventoryReserveLog); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/inventoryReserveLog/update/auth") |
| | | @ManagerAuth |
| | | public R update(InventoryReserveLog inventoryReserveLog){ |
| | | if (Cools.isEmpty(inventoryReserveLog) || null==inventoryReserveLog.getId()){ |
| | | return R.error(); |
| | | } |
| | | inventoryReserveLogService.updateById(inventoryReserveLog); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/inventoryReserveLog/delete/auth") |
| | | @ManagerAuth |
| | | public R delete(@RequestParam(value="ids[]") Long[] ids){ |
| | | for (Long id : ids){ |
| | | inventoryReserveLogService.deleteById(id); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/inventoryReserveLog/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | EntityWrapper<InventoryReserveLog> wrapper = new EntityWrapper<>(); |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("inventoryReserveLog")); |
| | | convert(map, wrapper); |
| | | List<InventoryReserveLog> list = inventoryReserveLogService.selectList(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/inventoryReserveLogQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<InventoryReserveLog> wrapper = new EntityWrapper<>(); |
| | | wrapper.like("id", condition); |
| | | Page<InventoryReserveLog> page = inventoryReserveLogService.selectPage(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (InventoryReserveLog inventoryReserveLog : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", inventoryReserveLog.getId()); |
| | | map.put("value", inventoryReserveLog.getId()); |
| | | result.add(map); |
| | | } |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @RequestMapping(value = "/inventoryReserveLog/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<InventoryReserveLog> wrapper = new EntityWrapper<InventoryReserveLog>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != inventoryReserveLogService.selectOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(InventoryReserveLog.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @TableName("man_inventory_reserve") |
| | | public class InventoryReserve implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ID |
| | | */ |
| | | @ApiModelProperty(value= "ID") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 物料编码 |
| | | */ |
| | | @ApiModelProperty(value= "物料编码") |
| | | private String matnr; |
| | | |
| | | /** |
| | | * 物料名称 |
| | | */ |
| | | @ApiModelProperty(value= "物料名称") |
| | | private String maktx; |
| | | |
| | | /** |
| | | * 订单号 |
| | | */ |
| | | @ApiModelProperty(value= "订单号") |
| | | @TableField("order_no") |
| | | private String orderNo; |
| | | |
| | | /** |
| | | * 批次 |
| | | */ |
| | | @ApiModelProperty(value= "批次") |
| | | private String batch; |
| | | |
| | | /** |
| | | * 数量 |
| | | */ |
| | | @ApiModelProperty(value= "数量") |
| | | private BigDecimal quantity; |
| | | |
| | | /** |
| | | * 过期时间 |
| | | */ |
| | | @ApiModelProperty(value= "过期时间") |
| | | @TableField("expice_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date expiceTime; |
| | | |
| | | /** |
| | | * 部门ID |
| | | */ |
| | | @ApiModelProperty(value= "部门ID") |
| | | @TableField("dept_id") |
| | | private Long deptId; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty(value= "创建时间") |
| | | @TableField("create_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 创建人员 |
| | | */ |
| | | @ApiModelProperty(value= "创建人员") |
| | | @TableField("create_by") |
| | | private Long createBy; |
| | | |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | @ApiModelProperty(value= "更新时间") |
| | | @TableField("update_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * 更新人员 |
| | | */ |
| | | @ApiModelProperty(value= "更新人员") |
| | | @TableField("update_by") |
| | | private Long updateBy; |
| | | |
| | | public InventoryReserve() {} |
| | | |
| | | public InventoryReserve(String matnr,String maktx,String orderNo,String batch,BigDecimal quantity,Date expiceTime,Long deptId,Date createTime,Long createBy,Date updateTime,Long updateBy) { |
| | | this.matnr = matnr; |
| | | this.maktx = maktx; |
| | | this.orderNo = orderNo; |
| | | this.batch = batch; |
| | | this.quantity = quantity; |
| | | this.expiceTime = expiceTime; |
| | | this.deptId = deptId; |
| | | this.createTime = createTime; |
| | | this.createBy = createBy; |
| | | this.updateTime = updateTime; |
| | | this.updateBy = updateBy; |
| | | } |
| | | |
| | | // InventoryReserve inventoryReserve = new InventoryReserve( |
| | | // null, // 物料编码 |
| | | // null, // 物料名称 |
| | | // null, // 订单号 |
| | | // null, // 批次 |
| | | // null, // 数量 |
| | | // null, // 过期时间 |
| | | // null, // 部门ID |
| | | // null, // 创建时间 |
| | | // null, // 创建人员 |
| | | // null, // 更新时间 |
| | | // null // 更新人员 |
| | | // ); |
| | | |
| | | public String getExpiceTime$(){ |
| | | if (Cools.isEmpty(this.expiceTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.expiceTime); |
| | | } |
| | | |
| | | public String getCreateTime$(){ |
| | | if (Cools.isEmpty(this.createTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime); |
| | | } |
| | | |
| | | public String getUpdateTime$(){ |
| | | if (Cools.isEmpty(this.updateTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @TableName("man_inventory_reserve_log") |
| | | public class InventoryReserveLog implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ID |
| | | */ |
| | | @ApiModelProperty(value= "ID") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 物料编码 |
| | | */ |
| | | @ApiModelProperty(value= "物料编码") |
| | | private String matnr; |
| | | |
| | | /** |
| | | * 物料名称 |
| | | */ |
| | | @ApiModelProperty(value= "物料名称") |
| | | private String maktx; |
| | | |
| | | /** |
| | | * 订单号 |
| | | */ |
| | | @ApiModelProperty(value= "订单号") |
| | | @TableField("order_no") |
| | | private String orderNo; |
| | | |
| | | /** |
| | | * 批次 |
| | | */ |
| | | @ApiModelProperty(value= "批次") |
| | | private String batch; |
| | | |
| | | /** |
| | | * 数量 |
| | | */ |
| | | @ApiModelProperty(value= "数量") |
| | | private BigDecimal quantity; |
| | | |
| | | /** |
| | | * 过期时间 |
| | | */ |
| | | @ApiModelProperty(value= "过期时间") |
| | | @TableField("expice_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date expiceTime; |
| | | |
| | | /** |
| | | * 部门ID |
| | | */ |
| | | @ApiModelProperty(value= "部门ID") |
| | | @TableField("dept_id") |
| | | private Long deptId; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty(value= "创建时间") |
| | | @TableField("create_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 创建人员 |
| | | */ |
| | | @ApiModelProperty(value= "创建人员") |
| | | @TableField("create_by") |
| | | private Long createBy; |
| | | |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | @ApiModelProperty(value= "更新时间") |
| | | @TableField("update_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * 更新人员 |
| | | */ |
| | | @ApiModelProperty(value= "更新人员") |
| | | @TableField("update_by") |
| | | private Long updateBy; |
| | | |
| | | public InventoryReserveLog() {} |
| | | |
| | | public InventoryReserveLog(String matnr,String maktx,String orderNo,String batch,BigDecimal quantity,Date expiceTime,Long deptId,Date createTime,Long createBy,Date updateTime,Long updateBy) { |
| | | this.matnr = matnr; |
| | | this.maktx = maktx; |
| | | this.orderNo = orderNo; |
| | | this.batch = batch; |
| | | this.quantity = quantity; |
| | | this.expiceTime = expiceTime; |
| | | this.deptId = deptId; |
| | | this.createTime = createTime; |
| | | this.createBy = createBy; |
| | | this.updateTime = updateTime; |
| | | this.updateBy = updateBy; |
| | | } |
| | | |
| | | // InventoryReserveLog inventoryReserveLog = new InventoryReserveLog( |
| | | // null, // 物料编码 |
| | | // null, // 物料名称 |
| | | // null, // 订单号 |
| | | // null, // 批次 |
| | | // null, // 数量 |
| | | // null, // 过期时间 |
| | | // null, // 部门ID |
| | | // null, // 创建时间 |
| | | // null, // 创建人员 |
| | | // null, // 更新时间 |
| | | // null // 更新人员 |
| | | // ); |
| | | |
| | | public String getExpiceTime$(){ |
| | | if (Cools.isEmpty(this.expiceTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.expiceTime); |
| | | } |
| | | |
| | | public String getCreateTime$(){ |
| | | if (Cools.isEmpty(this.createTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime); |
| | | } |
| | | |
| | | public String getUpdateTime$(){ |
| | | if (Cools.isEmpty(this.updateTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.zy.asrs.entity.InventoryReserveLog; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface InventoryReserveLogMapper extends BaseMapper<InventoryReserveLog> { |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.zy.asrs.entity.InventoryReserve; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface InventoryReserveMapper extends BaseMapper<InventoryReserve> { |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.zy.asrs.entity.InventoryReserveLog; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | |
| | | public interface InventoryReserveLogService extends IService<InventoryReserveLog> { |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.zy.asrs.entity.InventoryReserve; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | |
| | | public interface InventoryReserveService extends IService<InventoryReserve> { |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.zy.asrs.mapper.InventoryReserveLogMapper; |
| | | import com.zy.asrs.entity.InventoryReserveLog; |
| | | import com.zy.asrs.service.InventoryReserveLogService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("inventoryReserveLogService") |
| | | public class InventoryReserveLogServiceImpl extends ServiceImpl<InventoryReserveLogMapper, InventoryReserveLog> implements InventoryReserveLogService { |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.zy.asrs.mapper.InventoryReserveMapper; |
| | | import com.zy.asrs.entity.InventoryReserve; |
| | | import com.zy.asrs.service.InventoryReserveService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("inventoryReserveService") |
| | | public class InventoryReserveServiceImpl extends ServiceImpl<InventoryReserveMapper, InventoryReserve> implements InventoryReserveService { |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.task; |
| | | |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.asrs.task.handler.InventoryReserveExpireHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * 预留库存过期定时任务调度器 |
| | | * 定期检查并处理过期的预留库存 |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | public class InventoryReserveScheduler { |
| | | |
| | | @Autowired |
| | | private InventoryReserveExpireHandler inventoryReserveExpireHandler; |
| | | |
| | | /** |
| | | * 每分钟执行一次,检查过期的预留库存 |
| | | */ |
| | | @Scheduled(cron = "0 * * * * ?") |
| | | public void checkExpiredReserve() { |
| | | try { |
| | | ReturnT<String> result = inventoryReserveExpireHandler.start(); |
| | | if (!result.isSuccess()) { |
| | | log.error("预留库存过期处理失败: {}", result.getMsg()); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("预留库存过期定时任务异常", e); |
| | | } |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.task.handler; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.zy.asrs.entity.InventoryReserve; |
| | | import com.zy.asrs.entity.InventoryReserveLog; |
| | | import com.zy.asrs.service.InventoryReserveLogService; |
| | | import com.zy.asrs.service.InventoryReserveService; |
| | | import com.zy.asrs.task.AbstractHandler; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 预留库存过期处理器 |
| | | * 将过期的预留库存转移到日志表 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class InventoryReserveExpireHandler extends AbstractHandler<String> { |
| | | |
| | | @Autowired |
| | | private InventoryReserveService inventoryReserveService; |
| | | |
| | | @Autowired |
| | | private InventoryReserveLogService inventoryReserveLogService; |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public ReturnT<String> start() { |
| | | // 查询过期的预留库存(过期时间不为空且小于当前时间) |
| | | Date now = new Date(); |
| | | List<InventoryReserve> expiredList = inventoryReserveService.selectList( |
| | | new EntityWrapper<InventoryReserve>() |
| | | .isNotNull("expice_time") |
| | | .lt("expice_time", now)); |
| | | |
| | | if (expiredList.isEmpty()) { |
| | | return SUCCESS; |
| | | } |
| | | |
| | | log.info("发现 {} 条过期的预留库存记录", expiredList.size()); |
| | | |
| | | for (InventoryReserve reserve : expiredList) { |
| | | try { |
| | | // 转移到日志表 |
| | | InventoryReserveLog logRecord = new InventoryReserveLog(); |
| | | logRecord.setMatnr(reserve.getMatnr()); |
| | | logRecord.setMaktx(reserve.getMaktx()); |
| | | logRecord.setOrderNo(reserve.getOrderNo()); |
| | | logRecord.setBatch(reserve.getBatch()); |
| | | logRecord.setQuantity(reserve.getQuantity()); |
| | | logRecord.setExpiceTime(reserve.getExpiceTime()); |
| | | logRecord.setDeptId(reserve.getDeptId()); |
| | | logRecord.setCreateTime(reserve.getCreateTime()); |
| | | logRecord.setCreateBy(reserve.getCreateBy()); |
| | | logRecord.setUpdateTime(new Date()); |
| | | |
| | | inventoryReserveLogService.insert(logRecord); |
| | | |
| | | // 删除原记录 |
| | | inventoryReserveService.deleteById(reserve.getId()); |
| | | |
| | | log.info("预留库存过期处理完成: id={}, matnr={}, batch={}", |
| | | reserve.getId(), reserve.getMatnr(), reserve.getBatch()); |
| | | |
| | | } catch (Exception e) { |
| | | log.error("预留库存过期处理失败: id={}, error={}", reserve.getId(), e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | return SUCCESS; |
| | | } |
| | | |
| | | } |
| | |
| | | generator.url = "192.168.4.15:1433;databasename=yhfzasrs"; |
| | | generator.username = "sa"; |
| | | generator.password = "sa@123"; |
| | | generator.table = "asr_department"; |
| | | generator.table = "man_inventory_reserve_log"; |
| | | generator.packagePath = "com.zy.asrs"; |
| | | generator.html = false; |
| | | generator.js = false; |
| | | generator.build(); |
| | | } |
| | | |
| New file |
| | |
| | | -- save inventoryReserve record |
| | | -- mysql |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'inventoryReserve/inventoryReserve.html', 'inventoryReserve管理', null , '2', null , '1'); |
| | | |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'inventoryReserve#view', '查询', '', '3', '0', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'inventoryReserve#btn-add', '新增', '', '3', '1', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'inventoryReserve#btn-edit', '编辑', '', '3', '2', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'inventoryReserve#btn-delete', '删除', '', '3', '3', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'inventoryReserve#btn-export', '导出', '', '3', '4', '1'); |
| | | |
| | | -- sqlserver |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'inventoryReserve/inventoryReserve.html', N'inventoryReserve管理', null, '2', null, '1'); |
| | | |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'inventoryReserve#view', N'查询', '', '3', '0', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'inventoryReserve#btn-add', N'新增', '', '3', '1', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'inventoryReserve#btn-edit', N'编辑', '', '3', '2', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'inventoryReserve#btn-delete', N'删除', '', '3', '3', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'inventoryReserve#btn-export', N'导出', '', '3', '4', '1'); |
| New file |
| | |
| | | -- save inventoryReserveLog record |
| | | -- mysql |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'inventoryReserveLog/inventoryReserveLog.html', 'inventoryReserveLog管理', null , '2', null , '1'); |
| | | |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'inventoryReserveLog#view', '查询', '', '3', '0', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'inventoryReserveLog#btn-add', '新增', '', '3', '1', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'inventoryReserveLog#btn-edit', '编辑', '', '3', '2', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'inventoryReserveLog#btn-delete', '删除', '', '3', '3', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'inventoryReserveLog#btn-export', '导出', '', '3', '4', '1'); |
| | | |
| | | -- sqlserver |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'inventoryReserveLog/inventoryReserveLog.html', N'inventoryReserveLog管理', null, '2', null, '1'); |
| | | |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'inventoryReserveLog#view', N'查询', '', '3', '0', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'inventoryReserveLog#btn-add', N'新增', '', '3', '1', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'inventoryReserveLog#btn-edit', N'编辑', '', '3', '2', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'inventoryReserveLog#btn-delete', N'删除', '', '3', '3', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'inventoryReserveLog#btn-export', N'导出', '', '3', '4', '1'); |
| New file |
| | |
| | | <?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.zy.asrs.mapper.InventoryReserveLogMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.zy.asrs.entity.InventoryReserveLog"> |
| | | <id column="id" property="id" /> |
| | | <result column="matnr" property="matnr" /> |
| | | <result column="maktx" property="maktx" /> |
| | | <result column="order_no" property="orderNo" /> |
| | | <result column="batch" property="batch" /> |
| | | <result column="quantity" property="quantity" /> |
| | | <result column="expice_time" property="expiceTime" /> |
| | | <result column="dept_id" property="deptId" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="create_by" property="createBy" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="update_by" property="updateBy" /> |
| | | |
| | | </resultMap> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | <?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.zy.asrs.mapper.InventoryReserveMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.zy.asrs.entity.InventoryReserve"> |
| | | <id column="id" property="id" /> |
| | | <result column="matnr" property="matnr" /> |
| | | <result column="maktx" property="maktx" /> |
| | | <result column="order_no" property="orderNo" /> |
| | | <result column="batch" property="batch" /> |
| | | <result column="quantity" property="quantity" /> |
| | | <result column="expice_time" property="expiceTime" /> |
| | | <result column="dept_id" property="deptId" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="create_by" property="createBy" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="update_by" property="updateBy" /> |
| | | |
| | | </resultMap> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | var pageCurr; |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).use(['table', 'laydate', 'form', 'admin', 'xmSelect'], function () { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | var admin = layui.admin; |
| | | var xmSelect = layui.xmSelect; |
| | | |
| | | // 数据渲染 |
| | | var tableIns = table.render({ |
| | | elem: '#inventoryReserve', |
| | | headers: { token: localStorage.getItem('token') }, |
| | | url: baseUrl + '/inventoryReserve/list/auth', |
| | | page: true, |
| | | limit: 15, |
| | | limits: [15, 30, 50, 100, 200], |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | height: 'full-150', |
| | | cols: [[ |
| | | { type: 'checkbox' }, |
| | | { type: 'numbers', title: '#' }, |
| | | { field: 'matnr', align: 'center', title: '物料编码', }, |
| | | { field: 'maktx', align: 'center', title: '物料名称', }, |
| | | { field: 'orderNo', align: 'center', title: '订单号', width: 150 }, |
| | | { field: 'batch', align: 'center', title: '批次', width: 120 }, |
| | | { field: 'quantity', align: 'center', title: '数量', width: 100 }, |
| | | { field: 'expiceTime$', align: 'center', title: '过期时间', width: 180 }, |
| | | { field: 'createTime$', align: 'center', title: '创建时间', width: 180 }, |
| | | { fixed: 'right', title: '操作', align: 'center', toolbar: '#operate', width: 150 } |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } |
| | | pageCurr = curr; |
| | | limit(); |
| | | } |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(inventoryReserve)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id).data; |
| | | switch (obj.event) { |
| | | case 'addData': |
| | | showEditModel(); |
| | | break; |
| | | case 'deleteData': |
| | | if (checkStatus.length === 0) { |
| | | layer.msg('请选择要删除的数据', { icon: 2 }); |
| | | return; |
| | | } |
| | | del(checkStatus.map(function (d) { |
| | | return d.id; |
| | | })); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 监听行工具事件 |
| | | table.on('tool(inventoryReserve)', function (obj) { |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | case 'edit': |
| | | showEditModel(data); |
| | | break; |
| | | case 'del': |
| | | del([data.id]); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 添加按钮点击 |
| | | $('#addBtn').click(function () { |
| | | showEditModel(); |
| | | }); |
| | | |
| | | /* 弹窗 - 新增、修改 */ |
| | | function showEditModel(mData) { |
| | | admin.open({ |
| | | type: 1, |
| | | area: '500px', |
| | | title: (mData ? '修改' : '添加') + '预留库存', |
| | | content: $('#editDialog').html(), |
| | | success: function (layero, dIndex) { |
| | | // 回显表单数据 |
| | | form.val('detail', mData); |
| | | |
| | | // 渲染日期选择器 |
| | | layDate.render({ |
| | | elem: '#expiceTime', |
| | | type: 'datetime', |
| | | format: 'yyyy-MM-dd HH:mm:ss' |
| | | }); |
| | | |
| | | // 物料选择器 |
| | | var matXmSelect = xmSelect.render({ |
| | | el: '#matSelect', |
| | | style: { width: '100%' }, |
| | | radio: true, |
| | | clickClose: true, |
| | | filterable: true, |
| | | remoteSearch: true, |
| | | remoteMethod: function (val, cb, show) { |
| | | $.ajax({ |
| | | url: baseUrl + "/mat/all/get/kv", |
| | | headers: { 'token': localStorage.getItem('token') }, |
| | | data: { condition: val }, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | cb(res.data); |
| | | } else { |
| | | cb([]); |
| | | layer.msg(res.msg, { icon: 2 }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | on: function (data) { |
| | | if (data.arr.length > 0) { |
| | | var selected = data.arr[0]; |
| | | $('input[name="matnr"]').val(selected.value); |
| | | $('input[name="maktx"]').val(selected.name); |
| | | } else { |
| | | $('input[name="matnr"]').val(''); |
| | | $('input[name="maktx"]').val(''); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | // 编辑时回显物料 |
| | | if (mData && mData.matnr) { |
| | | matXmSelect.setValue([{ |
| | | name: mData.maktx || mData.matnr, |
| | | value: mData.matnr |
| | | }]); |
| | | } |
| | | |
| | | // 表单提交事件 |
| | | form.on('submit(editSubmit)', function (data) { |
| | | // 验证物料 |
| | | if (!data.field.matnr) { |
| | | layer.msg('请选择物料', { icon: 2 }); |
| | | return false; |
| | | } |
| | | |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl + "/inventoryReserve/" + (mData ? 'update' : 'add') + "/auth", |
| | | headers: { 'token': localStorage.getItem('token') }, |
| | | data: data.field, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | if (res.code === 200) { |
| | | layer.close(dIndex); |
| | | layer.msg(res.msg, { icon: 1 }); |
| | | tableReload(); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg, { icon: 2 }); |
| | | } |
| | | } |
| | | }); |
| | | return false; |
| | | }); |
| | | |
| | | // 弹窗不出现滚动条 |
| | | $(layero).children('.layui-layer-content').css('overflow', 'visible'); |
| | | layui.form.render('select'); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /* 删除 */ |
| | | function del(ids) { |
| | | layer.confirm('确定要删除选中数据吗?', { |
| | | skin: 'layui-layer-admin', |
| | | shade: .1 |
| | | }, function (i) { |
| | | layer.close(i); |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl + "/inventoryReserve/delete/auth", |
| | | headers: { 'token': localStorage.getItem('token') }, |
| | | data: { 'ids[]': ids }, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | if (res.code === 200) { |
| | | layer.msg(res.msg, { icon: 1 }); |
| | | tableReload(); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg, { icon: 2 }); |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | // 搜索 |
| | | form.on('submit(search)', function (data) { |
| | | pageCurr = 1; |
| | | tableReload(); |
| | | }); |
| | | |
| | | // 重置 |
| | | form.on('submit(reset)', function (data) { |
| | | pageCurr = 1; |
| | | clearFormVal($('#search-box')); |
| | | tableReload(); |
| | | }); |
| | | |
| | | // 表格重载 |
| | | function tableReload() { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function () { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: { curr: pageCurr } |
| | | }); |
| | | } |
| | | |
| | | // 清空表单 |
| | | function clearFormVal(el) { |
| | | $(':input', el) |
| | | .val('') |
| | | .removeAttr('checked') |
| | | .removeAttr('selected'); |
| | | } |
| | | |
| | | }); |
| New file |
| | |
| | | var pageCurr; |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).use(['table', 'laydate', 'form'], function () { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var form = layui.form; |
| | | |
| | | // 数据渲染(只读模式,无增删改操作) |
| | | var tableIns = table.render({ |
| | | elem: '#inventoryReserveLog', |
| | | headers: { token: localStorage.getItem('token') }, |
| | | url: baseUrl + '/inventoryReserveLog/list/auth', |
| | | page: true, |
| | | limit: 15, |
| | | limits: [15, 30, 50, 100, 200], |
| | | cellMinWidth: 50, |
| | | height: 'full-150', |
| | | cols: [[ |
| | | { type: 'numbers', title: '#' }, |
| | | { field: 'matnr', align: 'center', title: '物料编码' }, |
| | | { field: 'maktx', align: 'center', title: '物料名称' }, |
| | | { field: 'orderNo', align: 'center', title: '订单号', width: 150 }, |
| | | { field: 'batch', align: 'center', title: '批次', width: 120 }, |
| | | { field: 'quantity', align: 'center', title: '数量', width: 100 }, |
| | | { field: 'expiceTime$', align: 'center', title: '过期时间', width: 180 }, |
| | | { field: 'createTime$', align: 'center', title: '原创建时间', width: 180 }, |
| | | { field: 'updateTime$', align: 'center', title: '转移时间', width: 180 } |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } |
| | | pageCurr = curr; |
| | | } |
| | | }); |
| | | |
| | | // 搜索 |
| | | form.on('submit(search)', function (data) { |
| | | pageCurr = 1; |
| | | tableReload(); |
| | | }); |
| | | |
| | | // 重置 |
| | | form.on('submit(reset)', function (data) { |
| | | pageCurr = 1; |
| | | clearFormVal($('#search-box')); |
| | | tableReload(); |
| | | }); |
| | | |
| | | // 表格重载 |
| | | function tableReload() { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function () { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: { curr: pageCurr } |
| | | }); |
| | | } |
| | | |
| | | // 清空表单 |
| | | function clearFormVal(el) { |
| | | $(':input', el) |
| | | .val('') |
| | | .removeAttr('checked') |
| | | .removeAttr('selected'); |
| | | } |
| | | |
| | | }); |
| New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <title>预留库存管理</title> |
| | | <meta name="renderer" content="webkit"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/admin.css?v=318" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/cool.css" media="all"> |
| | | <style> |
| | | .btn-add { |
| | | display: none; |
| | | } |
| | | |
| | | .btn-edit { |
| | | display: none; |
| | | } |
| | | |
| | | .btn-delete { |
| | | display: none; |
| | | } |
| | | </style> |
| | | </head> |
| | | |
| | | <body> |
| | | |
| | | <!-- 正文开始 --> |
| | | <div class="layui-fluid"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-body"> |
| | | <!-- 表格顶部工具栏 --> |
| | | <div id="search-box" class="layui-form toolbar"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="padding: 8px 15px;">物料编码:</label> |
| | | <div class="layui-input-inline"> |
| | | <input name="matnr" class="layui-input" type="text" placeholder="输入物料编码" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="padding: 8px 15px;">订单号:</label> |
| | | <div class="layui-input-inline"> |
| | | <input name="order_no" class="layui-input" type="text" placeholder="输入订单号" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="padding: 8px 15px;">批次:</label> |
| | | <div class="layui-input-inline"> |
| | | <input name="batch" class="layui-input" type="text" placeholder="输入批次" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <button class="layui-btn icon-btn" lay-filter="search" lay-submit> |
| | | <i class="layui-icon"></i>搜索 |
| | | </button> |
| | | <button class="layui-btn icon-btn" lay-filter="reset" lay-submit> |
| | | <i class="layui-icon"></i>重置 |
| | | </button> |
| | | <!-- <button id="addBtn" class="layui-btn icon-btn btn-add"><i--> |
| | | <!-- class="layui-icon"></i>添加</button>--> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <table id="inventoryReserve" lay-filter="inventoryReserve"></table> |
| | | </div> |
| | | </div> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-body"> |
| | | 预留库存管理:用于预留入库物料的库存数量,确保关键订单的物料供应。 |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- 表格操作列 --> |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn layui-btn-sm layui-btn-normal btn-add" lay-event="addData"><i class="layui-icon"></i>添加</button> |
| | | <button class="layui-btn layui-btn-sm layui-btn-danger btn-delete" lay-event="deleteData"><i class="layui-icon"></i>删除</button> |
| | | </div> |
| | | </script> |
| | | |
| | | <!-- 表格操作列 --> |
| | | <script type="text/html" id="operate"> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="edit">修改</a> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs btn-delete" lay-event="del">删除</a> |
| | | </script> |
| | | |
| | | <!-- 表单弹窗 --> |
| | | <script type="text/html" id="editDialog"> |
| | | <form id="detail" lay-filter="detail" class="layui-form" style="padding: 25px 30px 0 0;"> |
| | | <input name="id" type="hidden"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">物料</label> |
| | | <div class="layui-input-block"> |
| | | <div id="matSelect"></div> |
| | | <input name="matnr" type="hidden"> |
| | | <input name="maktx" type="hidden"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">订单号</label> |
| | | <div class="layui-input-block"> |
| | | <input name="orderNo" placeholder="输入订单号(可选)" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">批次</label> |
| | | <div class="layui-input-block"> |
| | | <input name="batch" placeholder="输入批次" class="layui-input" lay-vertype="tips" lay-verify="required" required=""> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">数量</label> |
| | | <div class="layui-input-block"> |
| | | <input name="quantity" placeholder="输入数量" class="layui-input" lay-vertype="tips" lay-verify="required|number" required=""> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">过期时间</label> |
| | | <div class="layui-input-block"> |
| | | <input id="expiceTime" name="expiceTime" placeholder="选择过期时间(可选)" class="layui-input" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <hr class="layui-bg-gray"> |
| | | <div class="layui-form-item text-right"> |
| | | <button class="layui-btn" lay-filter="editSubmit" lay-submit="">保存</button> |
| | | <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button> |
| | | </div> |
| | | </form> |
| | | </script> |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/inventoryReserve/inventoryReserve.js" charset="utf-8"></script> |
| | | |
| | | </body> |
| | | |
| | | </html> |
| New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <title>预留库存日志</title> |
| | | <meta name="renderer" content="webkit"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/admin.css?v=318" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/cool.css" media="all"> |
| | | </head> |
| | | |
| | | <body> |
| | | |
| | | <!-- 正文开始 --> |
| | | <div class="layui-fluid"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-body"> |
| | | <!-- 表格顶部工具栏 --> |
| | | <div id="search-box" class="layui-form toolbar"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="padding: 8px 15px;">物料编码:</label> |
| | | <div class="layui-input-inline"> |
| | | <input name="matnr" class="layui-input" type="text" placeholder="输入物料编码" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="padding: 8px 15px;">订单号:</label> |
| | | <div class="layui-input-inline"> |
| | | <input name="order_no" class="layui-input" type="text" placeholder="输入订单号" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="padding: 8px 15px;">批次:</label> |
| | | <div class="layui-input-inline"> |
| | | <input name="batch" class="layui-input" type="text" placeholder="输入批次" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <button class="layui-btn icon-btn" lay-filter="search" lay-submit> |
| | | <i class="layui-icon"></i>搜索 |
| | | </button> |
| | | <button class="layui-btn icon-btn" lay-filter="reset" lay-submit> |
| | | <i class="layui-icon"></i>重置 |
| | | </button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <table id="inventoryReserveLog" lay-filter="inventoryReserveLog"></table> |
| | | </div> |
| | | </div> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-body"> |
| | | 预留库存日志:记录已过期的预留库存历史数据。 |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/inventoryReserveLog/inventoryReserveLog.js" |
| | | charset="utf-8"></script> |
| | | |
| | | </body> |
| | | |
| | | </html> |