From 5addf337d1cdf8d5688f32b30e39e8d8ba633317 Mon Sep 17 00:00:00 2001 From: wanghao Date: Thu, 14 May 2026 15:24:06 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E8=BF=9B=E6=B8=AF=E4=BA=A4=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RecordDeliveryTaskWaybillController.java | 128 ++++++++ .../manager/domain/RecordDeliveryTask.java | 88 +++-- .../domain/RecordDeliveryTaskWaybill.java | 98 ++++++ .../RecordDeliveryTaskBaseketMapper.java | 2 + .../RecordDeliveryTaskWaybillMapper.java | 61 ++++ .../IRecordDeliveryTaskBaseketService.java | 2 + .../IRecordDeliveryTaskWaybillService.java | 61 ++++ .../RecordDeliveryTaskBaseketServiceImpl.java | 5 + .../RecordDeliveryTaskWaybillServiceImpl.java | 96 ++++++ .../RecordDeliveryTaskBaseketMapper.xml | 7 + .../manager/RecordDeliveryTaskMapper.xml | 78 +++-- .../RecordDeliveryTaskWaybillMapper.xml | 76 +++++ .../templates/manager/delivery_task/add.html | 42 ++- .../manager/delivery_task/delivery_task.html | 306 +++++++++++------- .../templates/manager/delivery_task/edit.html | 44 ++- .../templates/manager/task_waybill/add.html | 57 ++++ .../templates/manager/task_waybill/edit.html | 58 ++++ .../manager/task_waybill/task_waybill.html | 114 +++++++ .../webapi/controller/ApiController.java | 53 +-- 19 files changed, 1166 insertions(+), 210 deletions(-) create mode 100644 ruoyi-manager/src/main/java/com/ruoyi/manager/controller/RecordDeliveryTaskWaybillController.java create mode 100644 ruoyi-manager/src/main/java/com/ruoyi/manager/domain/RecordDeliveryTaskWaybill.java create mode 100644 ruoyi-manager/src/main/java/com/ruoyi/manager/mapper/RecordDeliveryTaskWaybillMapper.java create mode 100644 ruoyi-manager/src/main/java/com/ruoyi/manager/service/IRecordDeliveryTaskWaybillService.java create mode 100644 ruoyi-manager/src/main/java/com/ruoyi/manager/service/impl/RecordDeliveryTaskWaybillServiceImpl.java create mode 100644 ruoyi-manager/src/main/resources/mapper/manager/RecordDeliveryTaskWaybillMapper.xml create mode 100644 ruoyi-manager/src/main/resources/templates/manager/task_waybill/add.html create mode 100644 ruoyi-manager/src/main/resources/templates/manager/task_waybill/edit.html create mode 100644 ruoyi-manager/src/main/resources/templates/manager/task_waybill/task_waybill.html diff --git a/ruoyi-manager/src/main/java/com/ruoyi/manager/controller/RecordDeliveryTaskWaybillController.java b/ruoyi-manager/src/main/java/com/ruoyi/manager/controller/RecordDeliveryTaskWaybillController.java new file mode 100644 index 0000000..df6694f --- /dev/null +++ b/ruoyi-manager/src/main/java/com/ruoyi/manager/controller/RecordDeliveryTaskWaybillController.java @@ -0,0 +1,128 @@ +package com.ruoyi.manager.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.manager.domain.RecordDeliveryTaskWaybill; +import com.ruoyi.manager.service.IRecordDeliveryTaskWaybillService; +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 ruoyi + * @date 2026-05-14 + */ +@Controller +@RequestMapping("/manager/task_waybill") +public class RecordDeliveryTaskWaybillController extends BaseController +{ + private String prefix = "manager/task_waybill"; + + @Autowired + private IRecordDeliveryTaskWaybillService recordDeliveryTaskWaybillService; + + @RequiresPermissions("manager:task_waybill:view") + @GetMapping() + public String task_waybill() + { + return prefix + "/task_waybill"; + } + + /** + * 查询交接资产列表 + */ + // @RequiresPermissions("manager:task_waybill:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(RecordDeliveryTaskWaybill recordDeliveryTaskWaybill) + { + startPage(); + List list = recordDeliveryTaskWaybillService.selectRecordDeliveryTaskWaybillList(recordDeliveryTaskWaybill); + return getDataTable(list); + } + + /** + * 导出交接资产列表 + */ + @RequiresPermissions("manager:task_waybill:export") + @Log(title = "交接资产", businessType = BusinessType.EXPORT) + @PostMapping("/export") + @ResponseBody + public AjaxResult export(RecordDeliveryTaskWaybill recordDeliveryTaskWaybill) + { + List list = recordDeliveryTaskWaybillService.selectRecordDeliveryTaskWaybillList(recordDeliveryTaskWaybill); + ExcelUtil util = new ExcelUtil(RecordDeliveryTaskWaybill.class); + return util.exportExcel(list, "交接资产数据"); + } + + /** + * 新增交接资产 + */ + @RequiresPermissions("manager:task_waybill:add") + @GetMapping("/add") + public String add() + { + return prefix + "/add"; + } + + /** + * 新增保存交接资产 + */ + @RequiresPermissions("manager:task_waybill:add") + @Log(title = "交接资产", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(RecordDeliveryTaskWaybill recordDeliveryTaskWaybill) + { + return toAjax(recordDeliveryTaskWaybillService.insertRecordDeliveryTaskWaybill(recordDeliveryTaskWaybill)); + } + + /** + * 修改交接资产 + */ + @RequiresPermissions("manager:task_waybill:edit") + @GetMapping("/edit/{objid}") + public String edit(@PathVariable("objid") Long objid, ModelMap mmap) + { + RecordDeliveryTaskWaybill recordDeliveryTaskWaybill = recordDeliveryTaskWaybillService.selectRecordDeliveryTaskWaybillByObjid(objid); + mmap.put("recordDeliveryTaskWaybill", recordDeliveryTaskWaybill); + return prefix + "/edit"; + } + + /** + * 修改保存交接资产 + */ + @RequiresPermissions("manager:task_waybill:edit") + @Log(title = "交接资产", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(RecordDeliveryTaskWaybill recordDeliveryTaskWaybill) + { + return toAjax(recordDeliveryTaskWaybillService.updateRecordDeliveryTaskWaybill(recordDeliveryTaskWaybill)); + } + + /** + * 删除交接资产 + */ + @RequiresPermissions("manager:task_waybill:remove") + @Log(title = "交接资产", businessType = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + return toAjax(recordDeliveryTaskWaybillService.deleteRecordDeliveryTaskWaybillByObjids(ids)); + } +} diff --git a/ruoyi-manager/src/main/java/com/ruoyi/manager/domain/RecordDeliveryTask.java b/ruoyi-manager/src/main/java/com/ruoyi/manager/domain/RecordDeliveryTask.java index 1d3119a..f0e44d1 100644 --- a/ruoyi-manager/src/main/java/com/ruoyi/manager/domain/RecordDeliveryTask.java +++ b/ruoyi-manager/src/main/java/com/ruoyi/manager/domain/RecordDeliveryTask.java @@ -1,18 +1,17 @@ package com.ruoyi.manager.domain; -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; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; /** * 交接任务列对象 record_delivery_task - * + * * @author ruoyi * @date 2026-03-04 */ -public class RecordDeliveryTask extends BaseEntity -{ +public class RecordDeliveryTask extends BaseEntity { private static final long serialVersionUID = 1L; /** 自增主键 */ @@ -21,14 +20,43 @@ public class RecordDeliveryTask extends BaseEntity /** 交接码 */ @Excel(name = "交接码") private String taskCode; - private String airCode; - /** 交接状态 */ @Excel(name = "交接状态") private String taskState; + + /** 航班号 */ + @Excel(name = "航班号") + private String airCode; + + /** 交货位置 */ + @Excel(name = "交货位置") private String gpsLocation; + /** 接货位置 */ + @Excel(name = "接货位置") + private String receiveGpsLocation; + + /** 类型 */ + @Excel(name = "类型") + private String taskType; + + + public String getReceiveGpsLocation() { + return receiveGpsLocation; + } + + public void setReceiveGpsLocation(String receiveGpsLocation) { + this.receiveGpsLocation = receiveGpsLocation; + } + + public String getTaskType() { + return taskType; + } + + public void setTaskType(String taskType) { + this.taskType = taskType; + } public String getGpsLocation() { return gpsLocation; @@ -46,46 +74,40 @@ public class RecordDeliveryTask extends BaseEntity this.airCode = airCode; } - public void setDeliveryTaskId(Long deliveryTaskId) - { - this.deliveryTaskId = deliveryTaskId; - } - - public Long getDeliveryTaskId() - { + public Long getDeliveryTaskId() { return deliveryTaskId; } - public void setTaskCode(String taskCode) - { - this.taskCode = taskCode; + public void setDeliveryTaskId(Long deliveryTaskId) { + this.deliveryTaskId = deliveryTaskId; } - public String getTaskCode() - { + public String getTaskCode() { return taskCode; } - public void setTaskState(String taskState) - { - this.taskState = taskState; + public void setTaskCode(String taskCode) { + this.taskCode = taskCode; } - public String getTaskState() - { + public String getTaskState() { return taskState; } + public void setTaskState(String taskState) { + this.taskState = taskState; + } + @Override public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("deliveryTaskId", getDeliveryTaskId()) - .append("taskCode", getTaskCode()) - .append("taskState", getTaskState()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .toString(); + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("deliveryTaskId", getDeliveryTaskId()) + .append("taskCode", getTaskCode()) + .append("taskState", getTaskState()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); } } diff --git a/ruoyi-manager/src/main/java/com/ruoyi/manager/domain/RecordDeliveryTaskWaybill.java b/ruoyi-manager/src/main/java/com/ruoyi/manager/domain/RecordDeliveryTaskWaybill.java new file mode 100644 index 0000000..6b44a0d --- /dev/null +++ b/ruoyi-manager/src/main/java/com/ruoyi/manager/domain/RecordDeliveryTaskWaybill.java @@ -0,0 +1,98 @@ +package com.ruoyi.manager.domain; + +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_delivery_task_waybill + * + * @author ruoyi + * @date 2026-05-14 + */ +public class RecordDeliveryTaskWaybill extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 自增主键 */ + private Long objid; + + /** 绑定条码 */ + @Excel(name = "绑定条码") + private String waybillNumber; + + /** 资产ID */ + @Excel(name = "资产ID") + private Long basketId; + + /** 扫描RFID */ + @Excel(name = "扫描RFID") + private String basketEpc; + + /** 交接码 */ + @Excel(name = "交接码") + private String taskCode; + + public void setObjid(Long objid) + { + this.objid = objid; + } + + public Long getObjid() + { + return objid; + } + + public void setWaybillNumber(String waybillNumber) + { + this.waybillNumber = waybillNumber; + } + + public String getWaybillNumber() + { + return waybillNumber; + } + + public void setBasketId(Long basketId) + { + this.basketId = basketId; + } + + public Long getBasketId() + { + return basketId; + } + + public void setBasketEpc(String basketEpc) + { + this.basketEpc = basketEpc; + } + + public String getBasketEpc() + { + return basketEpc; + } + + public void setTaskCode(String taskCode) + { + this.taskCode = taskCode; + } + + public String getTaskCode() + { + return taskCode; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("objid", getObjid()) + .append("createTime", getCreateTime()) + .append("waybillNumber", getWaybillNumber()) + .append("basketId", getBasketId()) + .append("basketEpc", getBasketEpc()) + .append("taskCode", getTaskCode()) + .toString(); + } +} diff --git a/ruoyi-manager/src/main/java/com/ruoyi/manager/mapper/RecordDeliveryTaskBaseketMapper.java b/ruoyi-manager/src/main/java/com/ruoyi/manager/mapper/RecordDeliveryTaskBaseketMapper.java index a6a942e..46b1bee 100644 --- a/ruoyi-manager/src/main/java/com/ruoyi/manager/mapper/RecordDeliveryTaskBaseketMapper.java +++ b/ruoyi-manager/src/main/java/com/ruoyi/manager/mapper/RecordDeliveryTaskBaseketMapper.java @@ -63,4 +63,6 @@ public interface RecordDeliveryTaskBaseketMapper public int deleteRecordDeliveryTaskBaseketByObjids(String[] objids); RecordDeliveryTaskBaseket selectRecordDeliveryTaskBaseketByBasket(RecordDeliveryTaskBaseket recordDeliveryTaskBaseket); + + int insertRecordDeliveryTaskWaybill(@Param("taskCode")String taskCode,@Param("ids") List stringList); } diff --git a/ruoyi-manager/src/main/java/com/ruoyi/manager/mapper/RecordDeliveryTaskWaybillMapper.java b/ruoyi-manager/src/main/java/com/ruoyi/manager/mapper/RecordDeliveryTaskWaybillMapper.java new file mode 100644 index 0000000..2a5e39e --- /dev/null +++ b/ruoyi-manager/src/main/java/com/ruoyi/manager/mapper/RecordDeliveryTaskWaybillMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.manager.mapper; + +import java.util.List; +import com.ruoyi.manager.domain.RecordDeliveryTaskWaybill; + +/** + * 交接资产Mapper接口 + * + * @author ruoyi + * @date 2026-05-14 + */ +public interface RecordDeliveryTaskWaybillMapper +{ + /** + * 查询交接资产 + * + * @param objid 交接资产主键 + * @return 交接资产 + */ + public RecordDeliveryTaskWaybill selectRecordDeliveryTaskWaybillByObjid(Long objid); + + /** + * 查询交接资产列表 + * + * @param recordDeliveryTaskWaybill 交接资产 + * @return 交接资产集合 + */ + public List selectRecordDeliveryTaskWaybillList(RecordDeliveryTaskWaybill recordDeliveryTaskWaybill); + + /** + * 新增交接资产 + * + * @param recordDeliveryTaskWaybill 交接资产 + * @return 结果 + */ + public int insertRecordDeliveryTaskWaybill(RecordDeliveryTaskWaybill recordDeliveryTaskWaybill); + + /** + * 修改交接资产 + * + * @param recordDeliveryTaskWaybill 交接资产 + * @return 结果 + */ + public int updateRecordDeliveryTaskWaybill(RecordDeliveryTaskWaybill recordDeliveryTaskWaybill); + + /** + * 删除交接资产 + * + * @param objid 交接资产主键 + * @return 结果 + */ + public int deleteRecordDeliveryTaskWaybillByObjid(Long objid); + + /** + * 批量删除交接资产 + * + * @param objids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteRecordDeliveryTaskWaybillByObjids(String[] objids); +} diff --git a/ruoyi-manager/src/main/java/com/ruoyi/manager/service/IRecordDeliveryTaskBaseketService.java b/ruoyi-manager/src/main/java/com/ruoyi/manager/service/IRecordDeliveryTaskBaseketService.java index c414b0a..f7b2db1 100644 --- a/ruoyi-manager/src/main/java/com/ruoyi/manager/service/IRecordDeliveryTaskBaseketService.java +++ b/ruoyi-manager/src/main/java/com/ruoyi/manager/service/IRecordDeliveryTaskBaseketService.java @@ -64,4 +64,6 @@ public interface IRecordDeliveryTaskBaseketService public int insertRecordDeliveryTaskBaseket(String taskCode, List ids); RecordDeliveryTaskBaseket selectRecordDeliveryTaskBaseketByBasket( RecordDeliveryTaskBaseket recordDeliveryTaskBaseket); + + int insertRecordDeliveryTaskWaybill(String taskCode, List stringList); } diff --git a/ruoyi-manager/src/main/java/com/ruoyi/manager/service/IRecordDeliveryTaskWaybillService.java b/ruoyi-manager/src/main/java/com/ruoyi/manager/service/IRecordDeliveryTaskWaybillService.java new file mode 100644 index 0000000..063c50d --- /dev/null +++ b/ruoyi-manager/src/main/java/com/ruoyi/manager/service/IRecordDeliveryTaskWaybillService.java @@ -0,0 +1,61 @@ +package com.ruoyi.manager.service; + +import java.util.List; +import com.ruoyi.manager.domain.RecordDeliveryTaskWaybill; + +/** + * 交接资产Service接口 + * + * @author ruoyi + * @date 2026-05-14 + */ +public interface IRecordDeliveryTaskWaybillService +{ + /** + * 查询交接资产 + * + * @param objid 交接资产主键 + * @return 交接资产 + */ + public RecordDeliveryTaskWaybill selectRecordDeliveryTaskWaybillByObjid(Long objid); + + /** + * 查询交接资产列表 + * + * @param recordDeliveryTaskWaybill 交接资产 + * @return 交接资产集合 + */ + public List selectRecordDeliveryTaskWaybillList(RecordDeliveryTaskWaybill recordDeliveryTaskWaybill); + + /** + * 新增交接资产 + * + * @param recordDeliveryTaskWaybill 交接资产 + * @return 结果 + */ + public int insertRecordDeliveryTaskWaybill(RecordDeliveryTaskWaybill recordDeliveryTaskWaybill); + + /** + * 修改交接资产 + * + * @param recordDeliveryTaskWaybill 交接资产 + * @return 结果 + */ + public int updateRecordDeliveryTaskWaybill(RecordDeliveryTaskWaybill recordDeliveryTaskWaybill); + + /** + * 批量删除交接资产 + * + * @param objids 需要删除的交接资产主键集合 + * @return 结果 + */ + public int deleteRecordDeliveryTaskWaybillByObjids(String objids); + + /** + * 删除交接资产信息 + * + * @param objid 交接资产主键 + * @return 结果 + */ + public int deleteRecordDeliveryTaskWaybillByObjid(Long objid); +} diff --git a/ruoyi-manager/src/main/java/com/ruoyi/manager/service/impl/RecordDeliveryTaskBaseketServiceImpl.java b/ruoyi-manager/src/main/java/com/ruoyi/manager/service/impl/RecordDeliveryTaskBaseketServiceImpl.java index 774bf6a..c28a19a 100644 --- a/ruoyi-manager/src/main/java/com/ruoyi/manager/service/impl/RecordDeliveryTaskBaseketServiceImpl.java +++ b/ruoyi-manager/src/main/java/com/ruoyi/manager/service/impl/RecordDeliveryTaskBaseketServiceImpl.java @@ -97,4 +97,9 @@ public class RecordDeliveryTaskBaseketServiceImpl implements IRecordDeliveryTask public RecordDeliveryTaskBaseket selectRecordDeliveryTaskBaseketByBasket( RecordDeliveryTaskBaseket recordDeliveryTaskBaseket) { return recordDeliveryTaskBaseketMapper.selectRecordDeliveryTaskBaseketByBasket(recordDeliveryTaskBaseket); } + + @Override + public int insertRecordDeliveryTaskWaybill(String taskCode, List stringList) { + return recordDeliveryTaskBaseketMapper.insertRecordDeliveryTaskWaybill(taskCode,stringList); + } } diff --git a/ruoyi-manager/src/main/java/com/ruoyi/manager/service/impl/RecordDeliveryTaskWaybillServiceImpl.java b/ruoyi-manager/src/main/java/com/ruoyi/manager/service/impl/RecordDeliveryTaskWaybillServiceImpl.java new file mode 100644 index 0000000..a8999a9 --- /dev/null +++ b/ruoyi-manager/src/main/java/com/ruoyi/manager/service/impl/RecordDeliveryTaskWaybillServiceImpl.java @@ -0,0 +1,96 @@ +package com.ruoyi.manager.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.manager.mapper.RecordDeliveryTaskWaybillMapper; +import com.ruoyi.manager.domain.RecordDeliveryTaskWaybill; +import com.ruoyi.manager.service.IRecordDeliveryTaskWaybillService; +import com.ruoyi.common.core.text.Convert; + +/** + * 交接资产Service业务层处理 + * + * @author ruoyi + * @date 2026-05-14 + */ +@Service +public class RecordDeliveryTaskWaybillServiceImpl implements IRecordDeliveryTaskWaybillService +{ + @Autowired + private RecordDeliveryTaskWaybillMapper recordDeliveryTaskWaybillMapper; + + /** + * 查询交接资产 + * + * @param objid 交接资产主键 + * @return 交接资产 + */ + @Override + public RecordDeliveryTaskWaybill selectRecordDeliveryTaskWaybillByObjid(Long objid) + { + return recordDeliveryTaskWaybillMapper.selectRecordDeliveryTaskWaybillByObjid(objid); + } + + /** + * 查询交接资产列表 + * + * @param recordDeliveryTaskWaybill 交接资产 + * @return 交接资产 + */ + @Override + public List selectRecordDeliveryTaskWaybillList(RecordDeliveryTaskWaybill recordDeliveryTaskWaybill) + { + return recordDeliveryTaskWaybillMapper.selectRecordDeliveryTaskWaybillList(recordDeliveryTaskWaybill); + } + + /** + * 新增交接资产 + * + * @param recordDeliveryTaskWaybill 交接资产 + * @return 结果 + */ + @Override + public int insertRecordDeliveryTaskWaybill(RecordDeliveryTaskWaybill recordDeliveryTaskWaybill) + { + recordDeliveryTaskWaybill.setCreateTime(DateUtils.getNowDate()); + return recordDeliveryTaskWaybillMapper.insertRecordDeliveryTaskWaybill(recordDeliveryTaskWaybill); + } + + /** + * 修改交接资产 + * + * @param recordDeliveryTaskWaybill 交接资产 + * @return 结果 + */ + @Override + public int updateRecordDeliveryTaskWaybill(RecordDeliveryTaskWaybill recordDeliveryTaskWaybill) + { + return recordDeliveryTaskWaybillMapper.updateRecordDeliveryTaskWaybill(recordDeliveryTaskWaybill); + } + + /** + * 批量删除交接资产 + * + * @param objids 需要删除的交接资产主键 + * @return 结果 + */ + @Override + public int deleteRecordDeliveryTaskWaybillByObjids(String objids) + { + return recordDeliveryTaskWaybillMapper.deleteRecordDeliveryTaskWaybillByObjids(Convert.toStrArray(objids)); + } + + /** + * 删除交接资产信息 + * + * @param objid 交接资产主键 + * @return 结果 + */ + @Override + public int deleteRecordDeliveryTaskWaybillByObjid(Long objid) + { + return recordDeliveryTaskWaybillMapper.deleteRecordDeliveryTaskWaybillByObjid(objid); + } +} diff --git a/ruoyi-manager/src/main/resources/mapper/manager/RecordDeliveryTaskBaseketMapper.xml b/ruoyi-manager/src/main/resources/mapper/manager/RecordDeliveryTaskBaseketMapper.xml index d1a1431..04d19e3 100644 --- a/ruoyi-manager/src/main/resources/mapper/manager/RecordDeliveryTaskBaseketMapper.xml +++ b/ruoyi-manager/src/main/resources/mapper/manager/RecordDeliveryTaskBaseketMapper.xml @@ -86,4 +86,11 @@ order by rdt.create_time desc limit 1 + + insert into record_delivery_task_waybill(waybill_number,task_code) values + + (#{item},#{taskCode}) + + + \ No newline at end of file diff --git a/ruoyi-manager/src/main/resources/mapper/manager/RecordDeliveryTaskMapper.xml b/ruoyi-manager/src/main/resources/mapper/manager/RecordDeliveryTaskMapper.xml index b48fb42..fb17c4a 100644 --- a/ruoyi-manager/src/main/resources/mapper/manager/RecordDeliveryTaskMapper.xml +++ b/ruoyi-manager/src/main/resources/mapper/manager/RecordDeliveryTaskMapper.xml @@ -1,58 +1,79 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + - - - - - - - - - + + + + + + + + + + + - select delivery_task_id, task_code, task_state, create_by, create_time, update_by, update_time, gps_location, air_code from record_delivery_task + select delivery_task_id, + task_code, + task_state, + create_by, + create_time, + update_by, + update_time, + gps_location, + air_code, + receive_gps_location, + task_type + from record_delivery_task - + - + insert into record_delivery_task task_code, task_state, air_code, gps_location, + receive_gps_location, + task_type, create_by, update_by, update_time, - + #{taskCode}, #{taskState}, #{airCode}, #{gpsLocation}, + #{receiveGpsLocation}, + #{taskType}, #{createBy}, #{updateBy}, #{updateTime}, - + @@ -61,18 +82,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" task_code = #{taskCode}, task_state = #{taskState}, create_by = #{createBy}, + create_time = #{createTime}, update_by = #{updateBy}, update_time = #{updateTime}, + air_code = #{airCode}, + gps_location = #{gpsLocation}, + receive_gps_location = #{receiveGpsLocation}, + task_type = #{taskType}, where delivery_task_id = #{deliveryTaskId} - delete from record_delivery_task where delivery_task_id = #{deliveryTaskId} + delete + from record_delivery_task + where delivery_task_id = #{deliveryTaskId} - delete from record_delivery_task where delivery_task_id in + delete from record_delivery_task where delivery_task_id in #{deliveryTaskId} @@ -86,9 +114,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" UPDATE record_delivery_task - SET task_state = '1', - update_by = #{user}, - update_time = now(), + SET task_state = '1', + update_by = #{user}, + update_time = now(), receive_gps_location = #{receiveGpsLocation} WHERE task_code = #{taskCode} diff --git a/ruoyi-manager/src/main/resources/mapper/manager/RecordDeliveryTaskWaybillMapper.xml b/ruoyi-manager/src/main/resources/mapper/manager/RecordDeliveryTaskWaybillMapper.xml new file mode 100644 index 0000000..e6d1e93 --- /dev/null +++ b/ruoyi-manager/src/main/resources/mapper/manager/RecordDeliveryTaskWaybillMapper.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + select objid, create_time, waybill_number, basket_id, basket_epc, task_code from record_delivery_task_waybill + + + + + + + + insert into record_delivery_task_waybill + + create_time, + waybill_number, + basket_id, + basket_epc, + task_code, + + + #{createTime}, + #{waybillNumber}, + #{basketId}, + #{basketEpc}, + #{taskCode}, + + + + + update record_delivery_task_waybill + + create_time = #{createTime}, + waybill_number = #{waybillNumber}, + basket_id = #{basketId}, + basket_epc = #{basketEpc}, + task_code = #{taskCode}, + + where objid = #{objid} + + + + delete from record_delivery_task_waybill where objid = #{objid} + + + + delete from record_delivery_task_waybill where objid in + + #{objid} + + + + \ No newline at end of file diff --git a/ruoyi-manager/src/main/resources/templates/manager/delivery_task/add.html b/ruoyi-manager/src/main/resources/templates/manager/delivery_task/add.html index 5b6f152..29b16a0 100644 --- a/ruoyi-manager/src/main/resources/templates/manager/delivery_task/add.html +++ b/ruoyi-manager/src/main/resources/templates/manager/delivery_task/add.html @@ -6,19 +6,51 @@
-
+
- +
-
+
- +
- +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+
diff --git a/ruoyi-manager/src/main/resources/templates/manager/delivery_task/delivery_task.html b/ruoyi-manager/src/main/resources/templates/manager/delivery_task/delivery_task.html index 4a32cb9..a3cf828 100644 --- a/ruoyi-manager/src/main/resources/templates/manager/delivery_task/delivery_task.html +++ b/ruoyi-manager/src/main/resources/templates/manager/delivery_task/delivery_task.html @@ -1,78 +1,103 @@ - + - + -
-
-
- -
-
    -
  • - - -
  • -
  • - - - - - -
  • -
  • -  搜索 -  重置 -
  • -
-
- -
+
+
+
+
+
+
    +
  • + + +
  • +
  • + + + - + +
  • +
  • + + + - + +
  • +
  • + + +
  • +
  • + + +
  • +
  • +  搜索 +  重置 +
  • +
+
+
+
- -
-
-
+ +
+
- - + \ No newline at end of file diff --git a/ruoyi-manager/src/main/resources/templates/manager/delivery_task/edit.html b/ruoyi-manager/src/main/resources/templates/manager/delivery_task/edit.html index aa93d1e..b765b3d 100644 --- a/ruoyi-manager/src/main/resources/templates/manager/delivery_task/edit.html +++ b/ruoyi-manager/src/main/resources/templates/manager/delivery_task/edit.html @@ -7,20 +7,52 @@
-
+
- +
-
+
- +
- +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+
diff --git a/ruoyi-manager/src/main/resources/templates/manager/task_waybill/add.html b/ruoyi-manager/src/main/resources/templates/manager/task_waybill/add.html new file mode 100644 index 0000000..c4467ed --- /dev/null +++ b/ruoyi-manager/src/main/resources/templates/manager/task_waybill/add.html @@ -0,0 +1,57 @@ + + + + + + +
+ +
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+ +
+ + + + \ No newline at end of file diff --git a/ruoyi-manager/src/main/resources/templates/manager/task_waybill/edit.html b/ruoyi-manager/src/main/resources/templates/manager/task_waybill/edit.html new file mode 100644 index 0000000..4da6e98 --- /dev/null +++ b/ruoyi-manager/src/main/resources/templates/manager/task_waybill/edit.html @@ -0,0 +1,58 @@ + + + + + + +
+
+ +
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-manager/src/main/resources/templates/manager/task_waybill/task_waybill.html b/ruoyi-manager/src/main/resources/templates/manager/task_waybill/task_waybill.html new file mode 100644 index 0000000..e7e0722 --- /dev/null +++ b/ruoyi-manager/src/main/resources/templates/manager/task_waybill/task_waybill.html @@ -0,0 +1,114 @@ + + + + + + +
+
+
+
+
+
    +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • +  搜索 +  重置 +
  • +
+
+
+
+ + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-webapi/src/main/java/com/ruoyi/webapi/controller/ApiController.java b/ruoyi-webapi/src/main/java/com/ruoyi/webapi/controller/ApiController.java index c5771bc..581b036 100644 --- a/ruoyi-webapi/src/main/java/com/ruoyi/webapi/controller/ApiController.java +++ b/ruoyi-webapi/src/main/java/com/ruoyi/webapi/controller/ApiController.java @@ -16,6 +16,7 @@ import com.ruoyi.webapi.doman.BindingSubmitBeen; import com.ruoyi.webapi.doman.ReceiptSubmitBeen; import com.ruoyi.webapi.service.ApiService; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; @@ -114,43 +115,49 @@ public class ApiController extends BaseController { } // 交货任务生成 + @Transactional @PostMapping("/delivery/createTask") - public AjaxResult createDeliveryTask(String json, String airCode, String gps, String user, List files) { - List ledgerInstantBindings = JSONArray.parseArray(json, LedgerInstantBinding.class); + public AjaxResult createDeliveryTask(String json, String airCode, String gps, String user, String type, List files) { // 生成任务编码 int taskNumber = recordDeliveryTaskService.countNowDateTaskNumber(); taskNumber++; String taskCode = "Task" + DateUtils.dateTime() + String.format("%03d", taskNumber); // 插入任务 - RecordDeliveryTask recordDeliveryTask = new RecordDeliveryTask(); - recordDeliveryTask.setTaskCode(taskCode); - recordDeliveryTask.setCreateBy(user); - recordDeliveryTask.setAirCode(airCode); - recordDeliveryTask.setGpsLocation(gps); - recordDeliveryTaskService.insertRecordDeliveryTask(recordDeliveryTask); - // 插入资产到任务表 - recordDeliveryTaskBaseketService.insertRecordDeliveryTaskBaseket(taskCode, ledgerInstantBindings); + recordDeliveryTaskService.insertRecordDeliveryTask(new RecordDeliveryTask() {{ + setTaskCode(taskCode); + setCreateBy(user); + setAirCode(airCode); + setGpsLocation(gps); + setTaskType(type); + }}); + if (files != null && !files.isEmpty()) { - // 插入图片 String filePath = RuoYiConfig.getUploadPath() + "/task"; for (MultipartFile file : files) { try { - String fileName = FileUploadUtils.upload(filePath, file); - RecordDeliveryTaskImg recordDeliveryTaskImg = new RecordDeliveryTaskImg(); - recordDeliveryTaskImg.setTaskCode(taskCode); - recordDeliveryTaskImg.setImgPath(fileName); - recordDeliveryTaskImgService.insertRecordDeliveryTaskImg(recordDeliveryTaskImg); + // 插入图片 + recordDeliveryTaskImgService.insertRecordDeliveryTaskImg( new RecordDeliveryTaskImg(){{ + setTaskCode(taskCode); + setImgPath(FileUploadUtils.upload(filePath, file)); + }}); } catch (IOException e) { throw new RuntimeException(e); } } } - - // ledgerInstantBindingService.deleteLedgerInstantByBasket(ids);// 删除实时绑定记录 - // 更新状态 - - List ids = ledgerInstantBindings.stream().map(LedgerInstantBinding::getBasketId).collect(Collectors.toList()); - ledgerInstantBindingService.updateTaskStatebyBasketID(ids); + if (type.equals("0")){ + // 出港 + // 插入资产到任务表 + List ledgerInstantBindings = JSONArray.parseArray(json, LedgerInstantBinding.class); + recordDeliveryTaskBaseketService.insertRecordDeliveryTaskBaseket(taskCode, ledgerInstantBindings); + // ledgerInstantBindingService.deleteLedgerInstantByBasket(ids);// 删除实时绑定记录 + // 更新状态 + List ids = ledgerInstantBindings.stream().map(LedgerInstantBinding::getBasketId).collect(Collectors.toList()); + ledgerInstantBindingService.updateTaskStatebyBasketID(ids); + }else if (type.equals("1")){ + List stringList = JSONArray.parseArray(json, String.class); + recordDeliveryTaskBaseketService.insertRecordDeliveryTaskWaybill(taskCode,stringList); + } return AjaxResult.success(); } @@ -191,7 +198,7 @@ public class ApiController extends BaseController { @PostMapping("/receipt/scanEpc") public AjaxResult ReceiptScanEpc(@RequestParam(name = "epc", required = false, defaultValue = "") String epc, @RequestParam(name = "waybillNumber", required = false, defaultValue = "") String waybillNumber) { - Long objId = null; + Long objId = null; if (epc != null && !epc.equals("")) { BaseBasketInfo baseBasketInfo = baseBasketInfoService.selectBaseBasketInfoByEpc(epc);