diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/basic/RecordErrorController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/basic/RecordErrorController.java new file mode 100644 index 0000000..3f62f06 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/basic/RecordErrorController.java @@ -0,0 +1,127 @@ +package com.ruoyi.web.controller.basic; + +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.system.domain.RecordError; +import com.ruoyi.system.service.IRecordErrorService; +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 Frank zhou + * @date 2021-09-16 + */ +@Controller +@RequestMapping("/system/recorderror") +public class RecordErrorController extends BaseController +{ + private String prefix = "system/recorderror"; + + @Autowired + private IRecordErrorService recordErrorService; + + @RequiresPermissions("system:recorderror:view") + @GetMapping() + public String recorderror() + { + return prefix + "/recorderror"; + } + + /** + * 查询异常记录列表 + */ + @RequiresPermissions("system:recorderror:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(RecordError recordError) + { + startPage(); + recordError.setTaskStatus(Long.valueOf(4)); + List list = recordErrorService.selectRecordErrorList(recordError); + return getDataTable(list); + } + + /** + * 导出异常记录列表 + */ + @RequiresPermissions("system:recorderror:export") + @Log(title = "异常记录", businessType = BusinessType.EXPORT) + @PostMapping("/export") + @ResponseBody + public AjaxResult export(RecordError recordError) + { + List list = recordErrorService.selectRecordErrorList(recordError); + ExcelUtil util = new ExcelUtil(RecordError.class); + return util.exportExcel(list, "异常记录数据"); + } + + /** + * 新增异常记录 + */ + @GetMapping("/add") + public String add() + { + return prefix + "/add"; + } + + /** + * 新增保存异常记录 + */ + @RequiresPermissions("system:recorderror:add") + @Log(title = "异常记录", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(RecordError recordError) + { + return toAjax(recordErrorService.insertRecordError(recordError)); + } + + /** + * 修改异常记录 + */ + @GetMapping("/edit/{objid}") + public String edit(@PathVariable("objid") String objid, ModelMap mmap) + { + RecordError recordError = recordErrorService.selectRecordErrorByObjid(objid); + mmap.put("recordError", recordError); + return prefix + "/edit"; + } + + /** + * 修改保存异常记录 + */ + @RequiresPermissions("system:recorderror:edit") + @Log(title = "异常记录", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(RecordError recordError) + { + return toAjax(recordErrorService.updateRecordError(recordError)); + } + + /** + * 删除异常记录 + */ + @RequiresPermissions("system:recorderror:remove") + @Log(title = "异常记录", businessType = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + return toAjax(recordErrorService.deleteRecordErrorByObjids(ids)); + } +} diff --git a/ruoyi-admin/src/main/resources/templates/system/recorderror/add.html b/ruoyi-admin/src/main/resources/templates/system/recorderror/add.html new file mode 100644 index 0000000..3ae1233 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/recorderror/add.html @@ -0,0 +1,140 @@ + + + + + + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+ + +
+
+
+
+ +
+
+ + +
+
+
+
+ +
+
+ + +
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/recorderror/edit.html b/ruoyi-admin/src/main/resources/templates/system/recorderror/edit.html new file mode 100644 index 0000000..91dc4b2 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/recorderror/edit.html @@ -0,0 +1,141 @@ + + + + + + + +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+ + +
+
+
+
+ +
+
+ + +
+
+
+
+ +
+
+ + +
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/recorderror/recorderror.html b/ruoyi-admin/src/main/resources/templates/system/recorderror/recorderror.html new file mode 100644 index 0000000..b9029d1 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/recorderror/recorderror.html @@ -0,0 +1,197 @@ + + + + + + +
+
+
+
+
+
    +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • +  搜索 +  重置 +
  • +
+
+
+
+ + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/RecordError.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/RecordError.java new file mode 100644 index 0000000..22b928d --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/RecordError.java @@ -0,0 +1,238 @@ +package com.ruoyi.system.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; + +/** + * 异常记录对象 record_task + * + * @author Frank zhou + * @date 2021-09-16 + */ +public class RecordError extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private String objid; + + /** 任务编号 */ + @Excel(name = "任务编号") + private String taskCode; + + /** 箱体编码 */ + @Excel(name = "箱体编码") + private String boxCode; + + /** 门体/物料编码 */ + @Excel(name = "门体/物料编码") + private String materialCode; + + /** 物料类型 */ + @Excel(name = "物料类型") + private Long materialType; + + /** 仓库编码 */ + @Excel(name = "仓库编码") + private String storeCode; + + /** 库位编码 */ + @Excel(name = "库位编码") + private String locationCode; + + /** 库位区域 */ + @Excel(name = "库位区域") + private String locationArea; + + /** 操作类型 */ + @Excel(name = "操作类型") + private Long operationType; + + /** 任务类型 */ + @Excel(name = "任务类型") + private Long taskType; + + /** 任务状态 */ + @Excel(name = "任务状态") + private Long taskStatus; + + /** 返回标识 */ + @Excel(name = "返回标识") + private String returnFlag; + + /** 开始时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date beginTime; + + /** 结束时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date endTime; + + /** 记录时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "记录时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date recordTime; + + public void setObjid(String objid) + { + this.objid = objid; + } + + public String getObjid() + { + return objid; + } + public void setTaskCode(String taskCode) + { + this.taskCode = taskCode; + } + + public String getTaskCode() + { + return taskCode; + } + public void setBoxCode(String boxCode) + { + this.boxCode = boxCode; + } + + public String getBoxCode() + { + return boxCode; + } + public void setMaterialCode(String materialCode) + { + this.materialCode = materialCode; + } + + public String getMaterialCode() + { + return materialCode; + } + public void setMaterialType(Long materialType) + { + this.materialType = materialType; + } + + public Long getMaterialType() + { + return materialType; + } + public void setStoreCode(String storeCode) + { + this.storeCode = storeCode; + } + + public String getStoreCode() + { + return storeCode; + } + public void setLocationCode(String locationCode) + { + this.locationCode = locationCode; + } + + public String getLocationCode() + { + return locationCode; + } + public void setLocationArea(String locationArea) + { + this.locationArea = locationArea; + } + + public String getLocationArea() + { + return locationArea; + } + public void setOperationType(Long operationType) + { + this.operationType = operationType; + } + + public Long getOperationType() + { + return operationType; + } + public void setTaskType(Long taskType) + { + this.taskType = taskType; + } + + public Long getTaskType() + { + return taskType; + } + public void setTaskStatus(Long taskStatus) + { + this.taskStatus = taskStatus; + } + + public Long getTaskStatus() + { + return taskStatus; + } + public void setReturnFlag(String returnFlag) + { + this.returnFlag = returnFlag; + } + + public String getReturnFlag() + { + return returnFlag; + } + public void setBeginTime(Date beginTime) + { + this.beginTime = beginTime; + } + + public Date getBeginTime() + { + return beginTime; + } + public void setEndTime(Date endTime) + { + this.endTime = endTime; + } + + public Date getEndTime() + { + return endTime; + } + public void setRecordTime(Date recordTime) + { + this.recordTime = recordTime; + } + + public Date getRecordTime() + { + return recordTime; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("objid", getObjid()) + .append("taskCode", getTaskCode()) + .append("boxCode", getBoxCode()) + .append("materialCode", getMaterialCode()) + .append("materialType", getMaterialType()) + .append("storeCode", getStoreCode()) + .append("locationCode", getLocationCode()) + .append("locationArea", getLocationArea()) + .append("operationType", getOperationType()) + .append("taskType", getTaskType()) + .append("taskStatus", getTaskStatus()) + .append("returnFlag", getReturnFlag()) + .append("beginTime", getBeginTime()) + .append("endTime", getEndTime()) + .append("recordTime", getRecordTime()) + .toString(); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/RecordErrorMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/RecordErrorMapper.java new file mode 100644 index 0000000..1d483a9 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/RecordErrorMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import com.ruoyi.system.domain.RecordError; + +/** + * 异常记录Mapper接口 + * + * @author Frank zhou + * @date 2021-09-16 + */ +public interface RecordErrorMapper +{ + /** + * 查询异常记录 + * + * @param objid 异常记录主键 + * @return 异常记录 + */ + public RecordError selectRecordErrorByObjid(String objid); + + /** + * 查询异常记录列表 + * + * @param recordError 异常记录 + * @return 异常记录集合 + */ + public List selectRecordErrorList(RecordError recordError); + + /** + * 新增异常记录 + * + * @param recordError 异常记录 + * @return 结果 + */ + public int insertRecordError(RecordError recordError); + + /** + * 修改异常记录 + * + * @param recordError 异常记录 + * @return 结果 + */ + public int updateRecordError(RecordError recordError); + + /** + * 删除异常记录 + * + * @param objid 异常记录主键 + * @return 结果 + */ + public int deleteRecordErrorByObjid(String objid); + + /** + * 批量删除异常记录 + * + * @param objids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteRecordErrorByObjids(String[] objids); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/IRecordErrorService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/IRecordErrorService.java new file mode 100644 index 0000000..816d660 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/IRecordErrorService.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.service; + +import java.util.List; +import com.ruoyi.system.domain.RecordError; + +/** + * 异常记录Service接口 + * + * @author Frank zhou + * @date 2021-09-16 + */ +public interface IRecordErrorService +{ + /** + * 查询异常记录 + * + * @param objid 异常记录主键 + * @return 异常记录 + */ + public RecordError selectRecordErrorByObjid(String objid); + + /** + * 查询异常记录列表 + * + * @param recordError 异常记录 + * @return 异常记录集合 + */ + public List selectRecordErrorList(RecordError recordError); + + /** + * 新增异常记录 + * + * @param recordError 异常记录 + * @return 结果 + */ + public int insertRecordError(RecordError recordError); + + /** + * 修改异常记录 + * + * @param recordError 异常记录 + * @return 结果 + */ + public int updateRecordError(RecordError recordError); + + /** + * 批量删除异常记录 + * + * @param objids 需要删除的异常记录主键集合 + * @return 结果 + */ + public int deleteRecordErrorByObjids(String objids); + + /** + * 删除异常记录信息 + * + * @param objid 异常记录主键 + * @return 结果 + */ + public int deleteRecordErrorByObjid(String objid); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/RecordErrorServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/RecordErrorServiceImpl.java new file mode 100644 index 0000000..bbb5e54 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/RecordErrorServiceImpl.java @@ -0,0 +1,94 @@ +package com.ruoyi.system.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.system.mapper.RecordErrorMapper; +import com.ruoyi.system.domain.RecordError; +import com.ruoyi.system.service.IRecordErrorService; +import com.ruoyi.common.core.text.Convert; + +/** + * 异常记录Service业务层处理 + * + * @author Frank zhou + * @date 2021-09-16 + */ +@Service +public class RecordErrorServiceImpl implements IRecordErrorService +{ + @Autowired + private RecordErrorMapper recordErrorMapper; + + /** + * 查询异常记录 + * + * @param objid 异常记录主键 + * @return 异常记录 + */ + @Override + public RecordError selectRecordErrorByObjid(String objid) + { + return recordErrorMapper.selectRecordErrorByObjid(objid); + } + + /** + * 查询异常记录列表 + * + * @param recordError 异常记录 + * @return 异常记录 + */ + @Override + public List selectRecordErrorList(RecordError recordError) + { + return recordErrorMapper.selectRecordErrorList(recordError); + } + + /** + * 新增异常记录 + * + * @param recordError 异常记录 + * @return 结果 + */ + @Override + public int insertRecordError(RecordError recordError) + { + return recordErrorMapper.insertRecordError(recordError); + } + + /** + * 修改异常记录 + * + * @param recordError 异常记录 + * @return 结果 + */ + @Override + public int updateRecordError(RecordError recordError) + { + return recordErrorMapper.updateRecordError(recordError); + } + + /** + * 批量删除异常记录 + * + * @param objids 需要删除的异常记录主键 + * @return 结果 + */ + @Override + public int deleteRecordErrorByObjids(String objids) + { + return recordErrorMapper.deleteRecordErrorByObjids(Convert.toStrArray(objids)); + } + + /** + * 删除异常记录信息 + * + * @param objid 异常记录主键 + * @return 结果 + */ + @Override + public int deleteRecordErrorByObjid(String objid) + { + return recordErrorMapper.deleteRecordErrorByObjid(objid); + } +} diff --git a/ruoyi-system/src/main/resources/mapper/system/RecordErrorMapper.xml b/ruoyi-system/src/main/resources/mapper/system/RecordErrorMapper.xml new file mode 100644 index 0000000..f6bd6e1 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/RecordErrorMapper.xml @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + select objid, task_code, box_code, material_code, material_type, store_code, location_code, location_area, operation_type, task_type, task_status, return_flag, begin_time, end_time, record_time from record_task + + + + + + + + + SELECT seq_record_task.NEXTVAL as objid FROM DUAL + + insert into record_task + + objid, + task_code, + box_code, + material_code, + material_type, + store_code, + location_code, + location_area, + operation_type, + task_type, + task_status, + return_flag, + begin_time, + end_time, + record_time, + + + #{objid}, + #{taskCode}, + #{boxCode}, + #{materialCode}, + #{materialType}, + #{storeCode}, + #{locationCode}, + #{locationArea}, + #{operationType}, + #{taskType}, + #{taskStatus}, + #{returnFlag}, + #{beginTime}, + #{endTime}, + #{recordTime}, + + + + + update record_task + + task_code = #{taskCode}, + box_code = #{boxCode}, + material_code = #{materialCode}, + material_type = #{materialType}, + store_code = #{storeCode}, + location_code = #{locationCode}, + location_area = #{locationArea}, + operation_type = #{operationType}, + task_type = #{taskType}, + task_status = #{taskStatus}, + return_flag = #{returnFlag}, + begin_time = #{beginTime}, + end_time = #{endTime}, + record_time = #{recordTime}, + + where objid = #{objid} + + + + delete from record_task where objid = #{objid} + + + + delete from record_task where objid in + + #{objid} + + + \ No newline at end of file