Commit 9354b86d authored by 耿迪迪's avatar 耿迪迪

发货

parent 9c4fb6dd
package com.zehong.web.controller.track;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.enums.BusinessType;
import com.zehong.system.domain.TProductLogistics;
import com.zehong.system.service.ITProductLogisticsService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
/**
* 出货物流Controller
*
* @author zehong
* @date 2024-08-30
*/
@RestController
@RequestMapping("/track/logistics")
public class TProductLogisticsController extends BaseController
{
@Autowired
private ITProductLogisticsService tProductLogisticsService;
/**
* 查询出货物流列表
*/
// @PreAuthorize("@ss.hasPermi('system:logistics:list')")
@GetMapping("/list")
public TableDataInfo list(TProductLogistics tProductLogistics)
{
startPage();
List<TProductLogistics> list = tProductLogisticsService.selectTProductLogisticsList(tProductLogistics);
return getDataTable(list);
}
/**
* 导出出货物流列表
*/
//@PreAuthorize("@ss.hasPermi('system:logistics:export')")
@Log(title = "出货物流", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TProductLogistics tProductLogistics)
{
List<TProductLogistics> list = tProductLogisticsService.selectTProductLogisticsList(tProductLogistics);
ExcelUtil<TProductLogistics> util = new ExcelUtil<TProductLogistics>(TProductLogistics.class);
return util.exportExcel(list, "出货物流数据");
}
/**
* 获取出货物流详细信息
*/
//@PreAuthorize("@ss.hasPermi('system:logistics:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(tProductLogisticsService.selectTProductLogisticsById(id));
}
/**
* 新增出货物流
*/
//@PreAuthorize("@ss.hasPermi('system:logistics:add')")
@Log(title = "出货物流", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TProductLogistics tProductLogistics)
{
return toAjax(tProductLogisticsService.insertTProductLogistics(tProductLogistics));
}
/**
* 修改出货物流
*/
//@PreAuthorize("@ss.hasPermi('system:logistics:edit')")
@Log(title = "出货物流", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TProductLogistics tProductLogistics)
{
return toAjax(tProductLogisticsService.updateTProductLogistics(tProductLogistics));
}
/**
* 删除出货物流
*/
//@PreAuthorize("@ss.hasPermi('system:logistics:remove')")
@Log(title = "出货物流", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(tProductLogisticsService.deleteTProductLogisticsByIds(ids));
}
}
package com.zehong.system.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
/**
* 出货物流对象 t_product_logistics
*
* @author zehong
* @date 2024-08-30
*/
public class TProductLogistics extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id;
/** 执行编号 */
private Long inspectId;
@Excel(name = "批次号")
private String batchNo;
/** 快递公司 */
@Excel(name = "快递公司")
private String express;
/** 快递员 */
@Excel(name = "快递员")
private String username;
/** 快递员电话 */
@Excel(name = "快递员电话")
private String tel;
/** 运单号 */
@Excel(name = "运单号")
private String expressNo;
/** 发货照片 */
@Excel(name = "发货照片")
private String imgUrl;
/** 创建人 */
@Excel(name = "创建人")
private Long createId;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setInspectId(Long inspectId)
{
this.inspectId = inspectId;
}
public Long getInspectId()
{
return inspectId;
}
public String getBatchNo() {
return batchNo;
}
public void setBatchNo(String batchNo) {
this.batchNo = batchNo;
}
public void setExpress(String express)
{
this.express = express;
}
public String getExpress()
{
return express;
}
public void setUsername(String username)
{
this.username = username;
}
public String getUsername()
{
return username;
}
public void setTel(String tel)
{
this.tel = tel;
}
public String getTel()
{
return tel;
}
public void setExpressNo(String expressNo)
{
this.expressNo = expressNo;
}
public String getExpressNo()
{
return expressNo;
}
public void setImgUrl(String imgUrl)
{
this.imgUrl = imgUrl;
}
public String getImgUrl()
{
return imgUrl;
}
public void setCreateId(Long createId)
{
this.createId = createId;
}
public Long getCreateId()
{
return createId;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("inspectId", getInspectId())
.append("express", getExpress())
.append("username", getUsername())
.append("tel", getTel())
.append("expressNo", getExpressNo())
.append("imgUrl", getImgUrl())
.append("createTime", getCreateTime())
.append("createId", getCreateId())
.toString();
}
}
package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.TProductLogistics;
/**
* 出货物流Mapper接口
*
* @author zehong
* @date 2024-08-30
*/
public interface TProductLogisticsMapper
{
/**
* 查询出货物流
*
* @param id 出货物流ID
* @return 出货物流
*/
public TProductLogistics selectTProductLogisticsById(Long id);
/**
* 查询出货物流列表
*
* @param tProductLogistics 出货物流
* @return 出货物流集合
*/
public List<TProductLogistics> selectTProductLogisticsList(TProductLogistics tProductLogistics);
/**
* 新增出货物流
*
* @param tProductLogistics 出货物流
* @return 结果
*/
public int insertTProductLogistics(TProductLogistics tProductLogistics);
/**
* 修改出货物流
*
* @param tProductLogistics 出货物流
* @return 结果
*/
public int updateTProductLogistics(TProductLogistics tProductLogistics);
/**
* 删除出货物流
*
* @param id 出货物流ID
* @return 结果
*/
public int deleteTProductLogisticsById(Long id);
/**
* 批量删除出货物流
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteTProductLogisticsByIds(Long[] ids);
}
package com.zehong.system.service;
import java.util.List;
import com.zehong.system.domain.TProductLogistics;
/**
* 出货物流Service接口
*
* @author zehong
* @date 2024-08-30
*/
public interface ITProductLogisticsService
{
/**
* 查询出货物流
*
* @param id 出货物流ID
* @return 出货物流
*/
public TProductLogistics selectTProductLogisticsById(Long id);
/**
* 查询出货物流列表
*
* @param tProductLogistics 出货物流
* @return 出货物流集合
*/
public List<TProductLogistics> selectTProductLogisticsList(TProductLogistics tProductLogistics);
/**
* 新增出货物流
*
* @param tProductLogistics 出货物流
* @return 结果
*/
public int insertTProductLogistics(TProductLogistics tProductLogistics);
/**
* 修改出货物流
*
* @param tProductLogistics 出货物流
* @return 结果
*/
public int updateTProductLogistics(TProductLogistics tProductLogistics);
/**
* 批量删除出货物流
*
* @param ids 需要删除的出货物流ID
* @return 结果
*/
public int deleteTProductLogisticsByIds(Long[] ids);
/**
* 删除出货物流信息
*
* @param id 出货物流ID
* @return 结果
*/
public int deleteTProductLogisticsById(Long id);
}
package com.zehong.system.service.impl;
import java.util.List;
import com.zehong.common.utils.DateUtils;
import com.zehong.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TProductLogisticsMapper;
import com.zehong.system.domain.TProductLogistics;
import com.zehong.system.service.ITProductLogisticsService;
/**
* 出货物流Service业务层处理
*
* @author zehong
* @date 2024-08-30
*/
@Service
public class TProductLogisticsServiceImpl implements ITProductLogisticsService
{
@Autowired
private TProductLogisticsMapper tProductLogisticsMapper;
/**
* 查询出货物流
*
* @param id 出货物流ID
* @return 出货物流
*/
@Override
public TProductLogistics selectTProductLogisticsById(Long id)
{
return tProductLogisticsMapper.selectTProductLogisticsById(id);
}
/**
* 查询出货物流列表
*
* @param tProductLogistics 出货物流
* @return 出货物流
*/
@Override
public List<TProductLogistics> selectTProductLogisticsList(TProductLogistics tProductLogistics)
{
return tProductLogisticsMapper.selectTProductLogisticsList(tProductLogistics);
}
/**
* 新增出货物流
*
* @param tProductLogistics 出货物流
* @return 结果
*/
@Override
public int insertTProductLogistics(TProductLogistics tProductLogistics)
{
tProductLogistics.setCreateTime(DateUtils.getNowDate());
tProductLogistics.setCreateId(SecurityUtils.getLoginUser().getUser().getUserId());
return tProductLogisticsMapper.insertTProductLogistics(tProductLogistics);
}
/**
* 修改出货物流
*
* @param tProductLogistics 出货物流
* @return 结果
*/
@Override
public int updateTProductLogistics(TProductLogistics tProductLogistics)
{
return tProductLogisticsMapper.updateTProductLogistics(tProductLogistics);
}
/**
* 批量删除出货物流
*
* @param ids 需要删除的出货物流ID
* @return 结果
*/
@Override
public int deleteTProductLogisticsByIds(Long[] ids)
{
return tProductLogisticsMapper.deleteTProductLogisticsByIds(ids);
}
/**
* 删除出货物流信息
*
* @param id 出货物流ID
* @return 结果
*/
@Override
public int deleteTProductLogisticsById(Long id)
{
return tProductLogisticsMapper.deleteTProductLogisticsById(id);
}
}
......@@ -37,7 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectTProductDeviceList" parameterType="TProductDevice" resultMap="TProductDeviceResult">
<include refid="selectTProductDeviceVo"/>
<where>
<if test="inspectId != null "> and device.inspect_id like concat('%', #{inspectId}, '%')</if>
<if test="batchNo != null and batchNo != ''"> and ins.batch_no like concat('%', #{batchNo}, '%')</if>
<if test="deviceNo != null and deviceNo != ''"> and device.device_no like concat('%', #{deviceNo}, '%')</if>
<if test="title != null and title != ''"> and device.title like concat('%', #{title}, '%')</if>
<if test="status != null and status != ''"> and device.status = #{status}</if>
......
<?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.zehong.system.mapper.TProductLogisticsMapper">
<resultMap type="TProductLogistics" id="TProductLogisticsResult">
<result property="id" column="id" />
<result property="inspectId" column="inspect_id" />
<result property="express" column="express" />
<result property="username" column="username" />
<result property="tel" column="tel" />
<result property="expressNo" column="express_no" />
<result property="imgUrl" column="img_url" />
<result property="createTime" column="create_time" />
<result property="createId" column="create_id" />
</resultMap>
<sql id="selectTProductLogisticsVo">
SELECT
log.id,
log.inspect_id,
log.express,
log.username,
log.tel,
log.express_no,
log.img_url,
log.create_time,
log.create_id,
ins.batch_no as batchNo,
(select nick_name from sys_user us where us.user_id = log.create_id) as createBy
FROM
t_product_logistics log
LEFT JOIN t_product_inspect ins ON ins.id = log.inspect_id
</sql>
<select id="selectTProductLogisticsList" parameterType="TProductLogistics" resultMap="TProductLogisticsResult">
<include refid="selectTProductLogisticsVo"/>
<where>
<if test="inspectId != null "> and log.inspect_id = #{inspectId}</if>
<if test="express != null and express != ''"> and log.express like concat('%', #{express}, '%')</if>
<if test="username != null and username != ''"> and log.username like concat('%', #{username}, '%')</if>
<if test="expressNo != null and expressNo != ''"> and log.express_no like concat('%', #{expressNo}, '%')</if>
<if test="batchNo != null and batchNo != ''"> and ins.batch_no like concat('%', #{batchNo}, '%')</if>
</where>
</select>
<select id="selectTProductLogisticsById" parameterType="Long" resultMap="TProductLogisticsResult">
<include refid="selectTProductLogisticsVo"/>
where log.id = #{id}
</select>
<insert id="insertTProductLogistics" parameterType="TProductLogistics" useGeneratedKeys="true" keyProperty="id">
insert into t_product_logistics
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="inspectId != null">inspect_id,</if>
<if test="express != null and express != ''">express,</if>
<if test="username != null and username != ''">username,</if>
<if test="tel != null and tel != ''">tel,</if>
<if test="expressNo != null and expressNo != ''">express_no,</if>
<if test="imgUrl != null">img_url,</if>
<if test="createTime != null">create_time,</if>
<if test="createId != null">create_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="inspectId != null">#{inspectId},</if>
<if test="express != null and express != ''">#{express},</if>
<if test="username != null and username != ''">#{username},</if>
<if test="tel != null and tel != ''">#{tel},</if>
<if test="expressNo != null and expressNo != ''">#{expressNo},</if>
<if test="imgUrl != null">#{imgUrl},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createId != null">#{createId},</if>
</trim>
</insert>
<update id="updateTProductLogistics" parameterType="TProductLogistics">
update t_product_logistics
<trim prefix="SET" suffixOverrides=",">
<if test="inspectId != null">inspect_id = #{inspectId},</if>
<if test="express != null and express != ''">express = #{express},</if>
<if test="username != null and username != ''">username = #{username},</if>
<if test="tel != null and tel != ''">tel = #{tel},</if>
<if test="expressNo != null and expressNo != ''">express_no = #{expressNo},</if>
<if test="imgUrl != null">img_url = #{imgUrl},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createId != null">create_id = #{createId},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteTProductLogisticsById" parameterType="Long">
delete from t_product_logistics where id = #{id}
</delete>
<delete id="deleteTProductLogisticsByIds" parameterType="String">
delete from t_product_logistics where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
import request from '@/utils/request'
// 查询出货物流列表
export function listLogistics(query) {
return request({
url: '/track/logistics/list',
method: 'get',
params: query
})
}
// 查询出货物流详细
export function getLogistics(id) {
return request({
url: '/track/logistics/' + id,
method: 'get'
})
}
// 新增出货物流
export function addLogistics(data) {
return request({
url: '/track/logistics',
method: 'post',
data: data
})
}
// 修改出货物流
export function updateLogistics(data) {
return request({
url: '/track/logistics',
method: 'put',
data: data
})
}
// 删除出货物流
export function delLogistics(id) {
return request({
url: '/track/logistics/' + id,
method: 'delete'
})
}
// 导出出货物流
export function exportLogistics(query) {
return request({
url: '/track/logistics/export',
method: 'get',
params: query
})
}
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="执行编号" prop="inspectId">
<el-form-item label="批次号" prop="batchNo">
<el-input
v-model="queryParams.inspectId"
placeholder="请输入执行编号"
v-model="queryParams.batchNo"
placeholder="请输入批次号"
clearable
size="small"
@keyup.enter.native="handleQuery"
......@@ -264,6 +264,7 @@ export default {
deviceNo: null,
title: null,
status: null,
batchNo: null
},
// 表单参数
form: {},
......
<template>
<el-dialog title="详情" :visible.sync="detailOpen" width="800px" append-to-body destroy-on-close :close-on-click-modal="false">
<el-form label-width="100px">
<el-row class="el-row-table">
<el-col :span="12">
<el-form-item label="批次号" prop="inspectId">
<span v-if="detailInfo.batchNo">{{ detailInfo.batchNo }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="快递公司" prop="express">
<span v-if="detailInfo.express">{{ detailInfo.express }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="快递员" prop="username">
<span v-if="detailInfo.username">{{ detailInfo.username }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="快递员电话" prop="tel">
<span v-if="detailInfo.tel">{{ detailInfo.tel }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="运单号" prop="expressNo">
<span v-if="detailInfo.expressNo">{{ detailInfo.expressNo }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="发货照片">
<el-image
v-if="detailInfo.imgUrl"
:src="detailInfo.imgUrl"
:preview-src-list="[detailInfo.imgUrl]"
:z-index="9999"
style="width: 200px;height: 200px;"
></el-image>
<span v-else>-</span>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-dialog>
</template>
<script>
import { getLogistics } from "@/api/project/info";
export default {
name: "detail-info",
data(){
return{
detailOpen: false,
detailInfo: {}
}
},
methods:{
getDetailInfo(id){
getLogistics(id).then(res =>{
if(res.code == 200){
this.detailInfo = res.data;
this.detailOpen = true;
}
})
}
}
}
</script>
<style scoped>
</style>
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment