feat:进港交接

master
wanghao 1 month ago
parent f2060df134
commit 5addf337d1

@ -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<RecordDeliveryTaskWaybill> 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<RecordDeliveryTaskWaybill> list = recordDeliveryTaskWaybillService.selectRecordDeliveryTaskWaybillList(recordDeliveryTaskWaybill);
ExcelUtil<RecordDeliveryTaskWaybill> util = new ExcelUtil<RecordDeliveryTaskWaybill>(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));
}
}

@ -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();
}
}

@ -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();
}
}

@ -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<String> stringList);
}

@ -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<RecordDeliveryTaskWaybill> 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);
}

@ -64,4 +64,6 @@ public interface IRecordDeliveryTaskBaseketService
public int insertRecordDeliveryTaskBaseket(String taskCode, List<LedgerInstantBinding> ids);
RecordDeliveryTaskBaseket selectRecordDeliveryTaskBaseketByBasket( RecordDeliveryTaskBaseket recordDeliveryTaskBaseket);
int insertRecordDeliveryTaskWaybill(String taskCode, List<String> stringList);
}

@ -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<RecordDeliveryTaskWaybill> 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);
}

@ -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<String> stringList) {
return recordDeliveryTaskBaseketMapper.insertRecordDeliveryTaskWaybill(taskCode,stringList);
}
}

@ -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<RecordDeliveryTaskWaybill> 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);
}
}

@ -86,4 +86,11 @@
order by rdt.create_time desc limit 1
</select>
<insert id="insertRecordDeliveryTaskWaybill" >
insert into record_delivery_task_waybill(waybill_number,task_code) values
<foreach collection="ids" item="item" separator=",">
(#{item},#{taskCode})
</foreach>
</insert>
</mapper>

@ -1,58 +1,79 @@
<?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">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.manager.mapper.RecordDeliveryTaskMapper">
<resultMap type="com.ruoyi.manager.domain.RecordDeliveryTask" id="RecordDeliveryTaskResult">
<result property="deliveryTaskId" column="delivery_task_id" />
<result property="taskCode" column="task_code" />
<result property="taskState" column="task_state" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="gpsLocation" column="gps_location" />
<result property="airCode" column="air_code" />
<result property="deliveryTaskId" column="delivery_task_id"/>
<result property="taskCode" column="task_code"/>
<result property="taskState" column="task_state"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="gpsLocation" column="gps_location"/>
<result property="airCode" column="air_code"/>
<result property="receiveGpsLocation" column="receive_gps_location"/>
<result property="taskType" column="task_type"/>
</resultMap>
<sql id="selectRecordDeliveryTaskVo">
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
</sql>
<select id="selectRecordDeliveryTaskList" parameterType="RecordDeliveryTask" resultMap="RecordDeliveryTaskResult">
<include refid="selectRecordDeliveryTaskVo"/>
<where>
<if test="taskState != null and taskState != ''"> and task_state = #{taskState}</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and crate_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
<where>
<if test="taskState != null and taskState != ''"> and task_state = #{taskState}</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
<if test="params.beginUpdateTime != null and params.beginUpdateTime != '' and params.endUpdateTime != null and params.endUpdateTime != ''"> and update_time between #{params.beginUpdateTime} and #{params.endUpdateTime}</if>
<if test="airCode != null and airCode != ''"> and air_code like concat('%', #{airCode}, '%')</if>
<if test="taskType != null and taskType != ''"> and task_type = #{taskType}</if>
</where>
</select>
<select id="selectRecordDeliveryTaskByDeliveryTaskId" parameterType="Long" resultMap="RecordDeliveryTaskResult">
<include refid="selectRecordDeliveryTaskVo"/>
where delivery_task_id = #{deliveryTaskId}
</select>
<insert id="insertRecordDeliveryTask" parameterType="RecordDeliveryTask" useGeneratedKeys="true" keyProperty="deliveryTaskId">
<insert id="insertRecordDeliveryTask" parameterType="RecordDeliveryTask" useGeneratedKeys="true"
keyProperty="deliveryTaskId">
insert into record_delivery_task
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="taskCode != null">task_code,</if>
<if test="taskState != null">task_state,</if>
<if test="airCode != null">air_code,</if>
<if test="gpsLocation != null">gps_location,</if>
<if test="receiveGpsLocation != null">receive_gps_location,</if>
<if test="taskType != null">task_type,</if>
<if test="createBy != null">create_by,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="taskCode != null">#{taskCode},</if>
<if test="taskState != null">#{taskState},</if>
<if test="airCode != null">#{airCode},</if>
<if test="gpsLocation != null">#{gpsLocation},</if>
<if test="receiveGpsLocation != null">#{receiveGpsLocation},</if>
<if test="taskType != null">#{taskType},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</trim>
</insert>
<update id="updateRecordDeliveryTask" parameterType="RecordDeliveryTask">
@ -61,18 +82,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="taskCode != null">task_code = #{taskCode},</if>
<if test="taskState != null">task_state = #{taskState},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="airCode != null">air_code = #{airCode},</if>
<if test="gpsLocation != null">gps_location = #{gpsLocation},</if>
<if test="receiveGpsLocation != null">receive_gps_location = #{receiveGpsLocation},</if>
<if test="taskType != null">task_type = #{taskType},</if>
</trim>
where delivery_task_id = #{deliveryTaskId}
</update>
<delete id="deleteRecordDeliveryTaskByDeliveryTaskId" parameterType="Long">
delete from record_delivery_task where delivery_task_id = #{deliveryTaskId}
delete
from record_delivery_task
where delivery_task_id = #{deliveryTaskId}
</delete>
<delete id="deleteRecordDeliveryTaskByDeliveryTaskIds" parameterType="String">
delete from record_delivery_task where delivery_task_id in
delete from record_delivery_task where delivery_task_id in
<foreach item="deliveryTaskId" collection="array" open="(" separator="," close=")">
#{deliveryTaskId}
</foreach>
@ -86,9 +114,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<update id="closeTaskByReceipt">
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}
</update>

@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.manager.mapper.RecordDeliveryTaskWaybillMapper">
<resultMap type="RecordDeliveryTaskWaybill" id="RecordDeliveryTaskWaybillResult">
<result property="objid" column="objid" />
<result property="createTime" column="create_time" />
<result property="waybillNumber" column="waybill_number" />
<result property="basketId" column="basket_id" />
<result property="basketEpc" column="basket_epc" />
<result property="taskCode" column="task_code" />
</resultMap>
<sql id="selectRecordDeliveryTaskWaybillVo">
select objid, create_time, waybill_number, basket_id, basket_epc, task_code from record_delivery_task_waybill
</sql>
<select id="selectRecordDeliveryTaskWaybillList" parameterType="RecordDeliveryTaskWaybill" resultMap="RecordDeliveryTaskWaybillResult">
<include refid="selectRecordDeliveryTaskWaybillVo"/>
<where>
<if test="waybillNumber != null and waybillNumber != ''"> and waybill_number = #{waybillNumber}</if>
<if test="basketId != null "> and basket_id = #{basketId}</if>
<if test="basketEpc != null and basketEpc != ''"> and basket_epc = #{basketEpc}</if>
<if test="taskCode != null and taskCode != ''"> and task_code = #{taskCode}</if>
</where>
</select>
<select id="selectRecordDeliveryTaskWaybillByObjid" parameterType="Long" resultMap="RecordDeliveryTaskWaybillResult">
<include refid="selectRecordDeliveryTaskWaybillVo"/>
where objid = #{objid}
</select>
<insert id="insertRecordDeliveryTaskWaybill" parameterType="RecordDeliveryTaskWaybill" useGeneratedKeys="true" keyProperty="objid">
insert into record_delivery_task_waybill
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="createTime != null">create_time,</if>
<if test="waybillNumber != null">waybill_number,</if>
<if test="basketId != null">basket_id,</if>
<if test="basketEpc != null">basket_epc,</if>
<if test="taskCode != null">task_code,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="createTime != null">#{createTime},</if>
<if test="waybillNumber != null">#{waybillNumber},</if>
<if test="basketId != null">#{basketId},</if>
<if test="basketEpc != null">#{basketEpc},</if>
<if test="taskCode != null">#{taskCode},</if>
</trim>
</insert>
<update id="updateRecordDeliveryTaskWaybill" parameterType="RecordDeliveryTaskWaybill">
update record_delivery_task_waybill
<trim prefix="SET" suffixOverrides=",">
<if test="createTime != null">create_time = #{createTime},</if>
<if test="waybillNumber != null">waybill_number = #{waybillNumber},</if>
<if test="basketId != null">basket_id = #{basketId},</if>
<if test="basketEpc != null">basket_epc = #{basketEpc},</if>
<if test="taskCode != null">task_code = #{taskCode},</if>
</trim>
where objid = #{objid}
</update>
<delete id="deleteRecordDeliveryTaskWaybillByObjid" parameterType="Long">
delete from record_delivery_task_waybill where objid = #{objid}
</delete>
<delete id="deleteRecordDeliveryTaskWaybillByObjids" parameterType="String">
delete from record_delivery_task_waybill where objid in
<foreach item="objid" collection="array" open="(" separator="," close=")">
#{objid}
</foreach>
</delete>
</mapper>

@ -6,19 +6,51 @@
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-delivery_task-add">
<div class="col-xs-12">
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-3 control-label">交接码:</label>
<label class="col-sm-4 control-label">交接码:</label>
<div class="col-sm-8">
<input name="taskCode" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-3 control-label">交接状态:</label>
<label class="col-sm-4 control-label">交接状态:</label>
<div class="col-sm-8">
<select name="taskState" class="form-control" th:with="type=${@dict.getType('delivery_task_state')}">
<input name="taskState" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label">航班号:</label>
<div class="col-sm-8">
<input name="airCode" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label">交货位置:</label>
<div class="col-sm-8">
<input name="gpsLocation" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label">接货位置:</label>
<div class="col-sm-8">
<input name="receiveGpsLocation" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label">类型:</label>
<div class="col-sm-8">
<select name="taskType" class="form-control" th:with="type=${@dict.getType('receive_task')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>

@ -1,78 +1,103 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<html lang="zh" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="include :: header('交接任务列列表')" />
<th:block th:include="include :: header('交接任务列列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
<label>交接状态:</label>
<select name="taskState" th:with="type=${@dict.getType('delivery_task_state')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li class="select-time">
<label>创建时间:</label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginCreateTime]"/>
<span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endCreateTime]"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
<label>交接状态:</label>
<input name="taskState" type="text"/>
</li>
<li class="select-time">
<label>创建时间:</label>
<input class="time-input" id="startTime" name="params[beginCreateTime]" placeholder="开始时间"
type="text"/>
<span>-</span>
<input class="time-input" id="endTime" name="params[endCreateTime]" placeholder="结束时间"
type="text"/>
</li>
<li class="select-time">
<label>接收时间:</label>
<input class="time-input" id="startTime" name="params[beginUpdateTime]" placeholder="开始时间"
type="text"/>
<span>-</span>
<input class="time-input" id="endTime" name="params[endUpdateTime]" placeholder="结束时间"
type="text"/>
</li>
<li>
<label>航班号:</label>
<input name="airCode" type="text"/>
</li>
<li>
<label>类型:</label>
<select name="taskType" th:with="type=${@dict.getType('receive_task')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="manager:delivery_task:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="manager:delivery_task:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="manager:delivery_task:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="manager:delivery_task:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="manager:delivery_task:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()"
shiro:hasPermission="manager:delivery_task:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()"
shiro:hasPermission="manager:delivery_task:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()"
shiro:hasPermission="manager:delivery_task:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('manager:delivery_task:edit')}]];
var removeFlag = [[${@permission.hasPermi('manager:delivery_task:remove')}]];
var taskStateDatas = [[${@dict.getType('delivery_task_state')}]];
var prefix = ctx + "manager/delivery_task";
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('manager:delivery_task:edit')}]];
var removeFlag = [[${@permission.hasPermi('manager:delivery_task:remove')}]];
var taskStateDatas = [[${@dict.getType('delivery_task_state')}]];
var taskTypeDatas = [[${@dict.getType('receive_task')}]];
var prefix = ctx + "manager/delivery_task";
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "交接任务列",
$(function () {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "交接任务列",
detailView: true,
onExpandRow: function (index, row, $detail) {
initTaskTable(index, row, $detail);
},
columns: [{
checkbox: true
},
columns: [{
checkbox: true
},
{
field: 'deliveryTaskId',
title: '自增主键',
@ -85,49 +110,72 @@
{
field: 'taskState',
title: '交接状态',
formatter: function(value, row, index) {
return $.table.selectDictLabel(taskStateDatas, value);
formatter: function (value, row, index) {
return $.table.selectDictLabel(taskStateDatas, value);
}
},
{
field: 'createBy',
title: '交人'
title: '交人'
},
{
field: 'createTime',
title: '创建时间'
title: '交货时间'
},
{
field: 'updateBy',
title: '接人'
title: '接人'
},
{
field: 'updateTime',
title: '接收时间'
},
{
field: 'airCode',
title: '航班号'
},
{
field: 'gpsLocation',
title: '交货位置',
visible: false
},
{
field: 'receiveGpsLocation',
title: '接货位置',
visible: false
},
{
field: 'taskType',
title: '交接类型',
formatter: function (value, row, index) {
return $.table.selectDictLabel(taskTypeDatas, value);
}
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
formatter: function (value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.deliveryTaskId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.deliveryTaskId + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
};
$.table.init(options);
});
initTaskTable = function (index, row, $detail) {
// 为每个展开行生成唯一的标识符
var uniqueId = 'tab-' + row.objid + '-';
var taskType = row.taskType;
var basketTypeDatas = [[${@dict.getType('basket_type')}]];
var [childTable, childTable1] = $detail.html('<div class="col-sm-12">\n' +
' <div class="tabs-container">\n' +
' <ul class="nav nav-tabs">\n' +
' <li class="active"><a data-toggle="tab" href="#' + uniqueId + '1" aria-expanded="true">待交接资产照片</a>\n' +
' </li>\n' +
' <li class=""><a data-toggle="tab" href="#' + uniqueId + '2" aria-expanded="false">待交接资产信息</a>\n' +
' <li class=""><a data-toggle="tab" href="#' + uniqueId + '2" aria-expanded="false">' + (taskType == 1 ? '集装器/散装斗代码' : '待交接资产信息') + '</a>\n' +
' </li>\n' +
' </ul>\n' +
' <div class="tab-content">\n' +
@ -140,9 +188,8 @@
' </div>\n' +
' </div>\n' +
' </div>').find('table');
console.log(childTable)
console.log(childTable1)
var basketTypeDatas = [[${@dict.getType('basket_type')}]];
// 第一个选项卡始终显示照片
$(childTable).bootstrapTable({
url: ctx + "manager/delivery_task_img/list",
method: 'post',
@ -163,59 +210,82 @@
title: '照片',
formatter: function (value, row, index) {
return $.table.imageView(value, 818, 460, null);
}
},
{
field: 'createTime',
title: '提交时间'
}
]
});
$(childTable1).bootstrapTable({
url: ctx + "manager/delivery_task_baseket/list",
method: 'post',
sidePagination: "server",
contentType: "application/x-www-form-urlencoded",
queryParams: {
taskCode: row.taskCode,
},
columns: [
{
title: '序号',
formatter: function (value, row, index) {
return index + 1
}
},
{
field: 'baseBasketInfo.basketType',
title: '资产类型',
formatter: function (value, row, index) {
return $.table.selectDictLabel(basketTypeDatas, value);
}
},
{
field: 'baseBasketInfo.steelGrade',
title: '钢号'
},
{
field: 'baseBasketInfo.selfCode',
title: '自编号'
},
{
field: 'createTime',
title: '绑定时间'
// 第二个选项卡根据taskType显示不同内容
if (taskType == 1) {
$(childTable1).bootstrapTable({
url: ctx + "manager/task_waybill/list",
method: 'post',
sidePagination: "server",
contentType: "application/x-www-form-urlencoded",
queryParams: {
taskCode: row.taskCode,
},
columns: [
{
title: '序号',
formatter: function (value, row, index) {
return index + 1
}
},
{
field: 'waybillNumber',
title: '集装器/散装斗代码'
},
// {
// field: 'basketEpc',
// title: '扫描RFID'
// },
]
});
});
} else {
$(childTable1).bootstrapTable({
url: ctx + "manager/delivery_task_baseket/list",
method: 'post',
sidePagination: "server",
contentType: "application/x-www-form-urlencoded",
queryParams: {
taskCode: row.taskCode,
},
columns: [
{
title: '序号',
formatter: function (value, row, index) {
return index + 1
}
},
{
field: 'baseBasketInfo.basketType',
title: '资产类型',
formatter: function (value, row, index) {
return $.table.selectDictLabel(basketTypeDatas, value);
}
},
{
field: 'baseBasketInfo.steelGrade',
title: '钢号'
},
{
field: 'baseBasketInfo.selfCode',
title: '自编号'
},
{
field: 'createTime',
title: '绑定时间'
}
]
});
}
};
</script>
</script>
</body>
</html>

@ -7,20 +7,52 @@
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-delivery_task-edit" th:object="${recordDeliveryTask}">
<input name="deliveryTaskId" th:field="*{deliveryTaskId}" type="hidden">
<div class="col-xs-12">
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-3 control-label">交接码:</label>
<label class="col-sm-4 control-label">交接码:</label>
<div class="col-sm-8">
<input name="taskCode" th:field="*{taskCode}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-3 control-label">交接状态:</label>
<label class="col-sm-4 control-label">交接状态:</label>
<div class="col-sm-8">
<select name="taskState" class="form-control" th:with="type=${@dict.getType('delivery_task_state')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{taskState}"></option>
<input name="taskState" th:field="*{taskState}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label">航班号:</label>
<div class="col-sm-8">
<input name="airCode" th:field="*{airCode}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label">交货位置:</label>
<div class="col-sm-8">
<input name="gpsLocation" th:field="*{gpsLocation}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label">接货位置:</label>
<div class="col-sm-8">
<input name="receiveGpsLocation" th:field="*{receiveGpsLocation}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label">类型:</label>
<div class="col-sm-8">
<select name="taskType" class="form-control" th:with="type=${@dict.getType('receive_task')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{taskType}"></option>
</select>
</div>
</div>

@ -0,0 +1,57 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增交接资产')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-task_waybill-add">
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">绑定条码:</label>
<div class="col-sm-8">
<input name="waybillNumber" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">资产ID</label>
<div class="col-sm-8">
<input name="basketId" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">扫描RFID</label>
<div class="col-sm-8">
<input name="basketEpc" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">交接码:</label>
<div class="col-sm-8">
<input name="taskCode" class="form-control" type="text">
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "manager/task_waybill"
$("#form-task_waybill-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-task_waybill-add').serialize());
}
}
</script>
</body>
</html>

@ -0,0 +1,58 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改交接资产')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-task_waybill-edit" th:object="${recordDeliveryTaskWaybill}">
<input name="objid" th:field="*{objid}" type="hidden">
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">绑定条码:</label>
<div class="col-sm-8">
<input name="waybillNumber" th:field="*{waybillNumber}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">资产ID</label>
<div class="col-sm-8">
<input name="basketId" th:field="*{basketId}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">扫描RFID</label>
<div class="col-sm-8">
<input name="basketEpc" th:field="*{basketEpc}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">交接码:</label>
<div class="col-sm-8">
<input name="taskCode" th:field="*{taskCode}" class="form-control" type="text">
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "manager/task_waybill";
$("#form-task_waybill-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-task_waybill-edit').serialize());
}
}
</script>
</body>
</html>

@ -0,0 +1,114 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('交接资产列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
<label>绑定条码:</label>
<input type="text" name="waybillNumber"/>
</li>
<li>
<label>资产ID</label>
<input type="text" name="basketId"/>
</li>
<li>
<label>扫描RFID</label>
<input type="text" name="basketEpc"/>
</li>
<li>
<label>交接码:</label>
<input type="text" name="taskCode"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="manager:task_waybill:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="manager:task_waybill:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="manager:task_waybill:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="manager:task_waybill:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('manager:task_waybill:edit')}]];
var removeFlag = [[${@permission.hasPermi('manager:task_waybill:remove')}]];
var prefix = ctx + "manager/task_waybill";
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "交接资产",
columns: [{
checkbox: true
},
{
field: 'objid',
title: '自增主键',
visible: false
},
{
field: 'createTime',
title: '绑定时间'
},
{
field: 'waybillNumber',
title: '绑定条码'
},
{
field: 'basketId',
title: '资产ID'
},
{
field: 'basketEpc',
title: '扫描RFID'
},
{
field: 'taskCode',
title: '交接码'
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.objid + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.objid + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
</script>
</body>
</html>

@ -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<MultipartFile> files) {
List<LedgerInstantBinding> ledgerInstantBindings = JSONArray.parseArray(json, LedgerInstantBinding.class);
public AjaxResult createDeliveryTask(String json, String airCode, String gps, String user, String type, List<MultipartFile> 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<Long> ids = ledgerInstantBindings.stream().map(LedgerInstantBinding::getBasketId).collect(Collectors.toList());
ledgerInstantBindingService.updateTaskStatebyBasketID(ids);
if (type.equals("0")){
// 出港
// 插入资产到任务表
List<LedgerInstantBinding> ledgerInstantBindings = JSONArray.parseArray(json, LedgerInstantBinding.class);
recordDeliveryTaskBaseketService.insertRecordDeliveryTaskBaseket(taskCode, ledgerInstantBindings);
// ledgerInstantBindingService.deleteLedgerInstantByBasket(ids);// 删除实时绑定记录
// 更新状态
List<Long> ids = ledgerInstantBindings.stream().map(LedgerInstantBinding::getBasketId).collect(Collectors.toList());
ledgerInstantBindingService.updateTaskStatebyBasketID(ids);
}else if (type.equals("1")){
List<String> 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);

Loading…
Cancel
Save