三方调度相关接口开发0724
This commit is contained in:
@@ -145,7 +145,11 @@ gen:
|
||||
|
||||
agv:
|
||||
job:
|
||||
create-url: http://192.168.1.155:1880/api/job/create
|
||||
create-url: http://192.168.1.245:9012/agv/task/create
|
||||
|
||||
wcs:
|
||||
job:
|
||||
create-url: http://192.168.1.230:8188/wcs/task/create
|
||||
|
||||
#rfid:
|
||||
# device:
|
||||
@@ -156,3 +160,7 @@ minio:
|
||||
accessKey: admin
|
||||
secretKey: admin123
|
||||
bucketName: jaz
|
||||
|
||||
mock:
|
||||
agv-job-create-url: http://localhost:8086/mock/agv/task/create
|
||||
wcs-job-create-url: http://localhost:8086/mock/wcs/task/create
|
||||
66
src/main/resources/mybatis/information/MtdMapper.xml
Normal file
66
src/main/resources/mybatis/information/MtdMapper.xml
Normal file
@@ -0,0 +1,66 @@
|
||||
<?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.zg.project.information.mapper.MtdMapper">
|
||||
|
||||
<resultMap id="MtdResultMap" type="com.zg.project.information.domain.Mtd">
|
||||
<id property="id" column="id"/>
|
||||
<result property="mid" column="mid"/>
|
||||
<result property="desMat" column="des_mat"/>
|
||||
<result property="grp" column="grp"/>
|
||||
<result property="unt" column="unt"/>
|
||||
<result property="uprc" column="uprc"/>
|
||||
<result property="btpe" column="btpe"/>
|
||||
<result property="mtpe" column="mtpe"/>
|
||||
<result property="stpe" column="stpe"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectMtdById" parameterType="Long" resultMap="MtdResultMap">
|
||||
SELECT * FROM mtd WHERE id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectMtdList" parameterType="Mtd" resultMap="MtdResultMap">
|
||||
SELECT * FROM mtd
|
||||
<where>
|
||||
<if test="mid != null and mid != ''">AND mid = #{mid}</if>
|
||||
<if test="desMat != null and desMat != ''">AND des_mat like concat('%', #{desMat}, '%')</if>
|
||||
<if test="grp != null and grp != ''">AND grp = #{grp}</if>
|
||||
<if test="unt != null and unt != ''">AND unt = #{unt}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectWlmsByWlbh" resultType="java.lang.String" parameterType="java.lang.String">
|
||||
SELECT des_mat FROM mtd WHERE mid = #{materialCode}
|
||||
</select>
|
||||
|
||||
<insert id="insertMtd" parameterType="Mtd">
|
||||
INSERT INTO mtd (mid, des_mat, grp, unt, uprc, btpe, mtpe, stpe)
|
||||
VALUES (#{mid}, #{desMat}, #{grp}, #{unt}, #{uprc}, #{btpe}, #{mtpe}, #{stpe})
|
||||
</insert>
|
||||
|
||||
<update id="updateMtd" parameterType="Mtd">
|
||||
UPDATE mtd
|
||||
SET mid = #{mid},
|
||||
des_mat = #{desMat},
|
||||
grp = #{grp},
|
||||
unt = #{unt},
|
||||
uprc = #{uprc},
|
||||
btpe = #{btpe},
|
||||
mtpe = #{mtpe},
|
||||
stpe = #{stpe}
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteMtdById" parameterType="Long">
|
||||
DELETE FROM mtd WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMtdByIds" parameterType="Long">
|
||||
DELETE FROM mtd WHERE id IN
|
||||
<foreach collection="array" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -4,28 +4,31 @@
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zg.project.information.mapper.PcdeDetailMapper">
|
||||
|
||||
|
||||
<resultMap type="PcdeDetail" id="PcdeDetailResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="pcode" column="pcode"/>
|
||||
<result property="scene" column="scene"/>
|
||||
<result property="sceneName" column="scene_name"/>
|
||||
<result property="warehouse" column="warehouse"/>
|
||||
<result property="encodedId" column="encoded_id"/>
|
||||
<result property="tag" column="tag"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="isDelete" column="is_delete"/>
|
||||
<result property="createdBy" column="created_by"/>
|
||||
<result property="createdAt" column="created_at"/>
|
||||
<result property="updatedBy" column="updated_by"/>
|
||||
<result property="updatedAt" column="updated_at"/>
|
||||
<result property="id" column="id"/>
|
||||
<result property="pcode" column="pcode"/>
|
||||
<result property="scene" column="scene"/>
|
||||
<result property="sceneName" column="scene_name"/>
|
||||
<result property="warehouse" column="warehouse"/>
|
||||
<result property="warehouseName" column="warehouse_name"/>
|
||||
<result property="encodedId" column="encoded_id"/>
|
||||
<result property="tag" column="tag"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="isDelete" column="is_delete"/>
|
||||
<result property="createdBy" column="created_by"/>
|
||||
<result property="createdAt" column="created_at"/>
|
||||
<result property="updatedBy" column="updated_by"/>
|
||||
<result property="updatedAt" column="updated_at"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectPcdeDetailVo">
|
||||
select d.id, d.pcode, d.scene, m.scene_name, d.warehouse,
|
||||
select d.id, d.pcode, d.scene, m.scene_name, d.warehouse, w.warehouse_name,
|
||||
d.encoded_id, d.tag, d.remark, d.is_delete,
|
||||
d.created_by, d.created_at, d.updated_by, d.updated_at
|
||||
from pcde_detail d
|
||||
left join scene_mapping m on d.scene = m.scene_code
|
||||
left join warehouse_info w on d.warehouse = w.warehouse_code
|
||||
</sql>
|
||||
|
||||
<select id="selectPcdeDetailList" parameterType="PcdeDetail" resultMap="PcdeDetailResult">
|
||||
@@ -55,6 +58,7 @@
|
||||
created_by, created_at, updated_by, updated_at, remark
|
||||
from pcde_detail
|
||||
where pcode = #{pcode}
|
||||
AND is_delete = '0'
|
||||
</select>
|
||||
|
||||
<insert id="insertPcdeDetail" parameterType="PcdeDetail" useGeneratedKeys="true" keyProperty="id">
|
||||
|
||||
@@ -35,14 +35,21 @@
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCountByRequestIdAndStatus" resultType="int">
|
||||
SELECT COUNT(1)
|
||||
FROM agv_task_result
|
||||
<select id="selectByRequestId" resultMap="AgvTaskResultResultMap">
|
||||
SELECT * FROM agv_task_result WHERE request_id = #{requestId} AND is_delete = '0'
|
||||
</select>
|
||||
|
||||
<select id="countByRequestIdAndStatus" resultType="int">
|
||||
SELECT COUNT(*) FROM agv_task_result
|
||||
WHERE request_id = #{requestId}
|
||||
AND status = #{status}
|
||||
AND is_delete = '0'
|
||||
</select>
|
||||
|
||||
<select id="selectByTaskNo" resultType="com.zg.project.wisdom.domain.AgvTaskResult">
|
||||
SELECT * FROM agv_task_result WHERE task_no = #{taskNo} AND is_delete = '0'
|
||||
</select>
|
||||
|
||||
<insert id="insertAgvTaskResult" parameterType="AgvTaskResult" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO agv_task_result
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
||||
20
src/main/resources/mybatis/wisdom/AgyWcsMapper.xml
Normal file
20
src/main/resources/mybatis/wisdom/AgyWcsMapper.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?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.zg.project.wisdom.mapper.AgyWcsMapper">
|
||||
|
||||
<resultMap id="AgyWcsResultMap" type="com.zg.project.wisdom.domain.AgyWcs">
|
||||
<id property="id" column="id"/>
|
||||
<result property="requestId" column="requestId"/>
|
||||
<result property="taskId" column="TaskID"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 插入 AGV-WCS 映射关系 -->
|
||||
<insert id="insertAgyWcs" parameterType="com.zg.project.wisdom.domain.AgyWcs">
|
||||
INSERT INTO agy_wcs (requestId, TaskID)
|
||||
VALUES (#{requestId}, #{taskId})
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
@@ -91,16 +91,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
AND is_delete = '0'
|
||||
</select>
|
||||
|
||||
<select id="selectPhotoUrlByBillNo"
|
||||
resultMap="AuditSignatureResult"
|
||||
parameterType="java.lang.String">
|
||||
<select id="selectPhotoUrlByRkId" resultMap="AuditSignatureResult" parameterType="java.lang.Long">
|
||||
SELECT sign_url, audit_result
|
||||
FROM audit_signature
|
||||
WHERE is_delete = '0'
|
||||
AND bill_no = #{billNo}
|
||||
AND image_type = '1'
|
||||
AND rk_id = #{rkId}
|
||||
AND image_type = '1'
|
||||
AND audit_result = '1'
|
||||
AND is_current = '1'
|
||||
ORDER BY create_time DESC
|
||||
LIMIT 1
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
<!-- 查询主记录列表(审批记录) signer_role=1 image_type=0 -->
|
||||
|
||||
@@ -50,6 +50,11 @@
|
||||
SELECT * FROM dd_task WHERE id = #{id} AND is_delete = '0'
|
||||
</select>
|
||||
|
||||
<!-- 根据任务编号查询 -->
|
||||
<select id="selectByTaskNo" resultMap="DdTaskResult" parameterType="String">
|
||||
SELECT * FROM dd_task WHERE task_no = #{taskNo} AND is_delete = '0' LIMIT 1
|
||||
</select>
|
||||
|
||||
<insert id="insertDdTask" parameterType="DdTask">
|
||||
INSERT INTO dd_task (
|
||||
task_no, task_dtl, task_type, task_status, mid_status, mid, num, mid_type, source_name,
|
||||
@@ -86,6 +91,14 @@
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateTaskStatusByTaskNo">
|
||||
UPDATE dd_task
|
||||
SET task_status = #{status},
|
||||
update_time = NOW()
|
||||
WHERE task_no = #{taskNo}
|
||||
AND is_delete = '0'
|
||||
</update>
|
||||
|
||||
<delete id="deleteDdTaskByIds">
|
||||
DELETE FROM dd_task WHERE id IN
|
||||
<foreach collection="array" item="id" open="(" separator="," close=")">
|
||||
|
||||
@@ -57,6 +57,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
AND status = '0'
|
||||
</select>
|
||||
|
||||
<select id="existsByUniqueKeys" resultType="boolean">
|
||||
SELECT COUNT(1)
|
||||
FROM gys_jh
|
||||
WHERE sap_no = #{sapNo}
|
||||
AND xm_no = #{xmNo}
|
||||
AND wl_no = #{wlNo}
|
||||
AND is_delete = '0'
|
||||
</select>
|
||||
|
||||
<insert id="insertGysJh" parameterType="GysJh" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into gys_jh
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
@@ -152,6 +161,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
#{sapNo}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<update id="batchUpdateStatusByIds">
|
||||
UPDATE gys_jh
|
||||
SET status = '1'
|
||||
WHERE id IN
|
||||
<foreach collection="idSet" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<delete id="deleteGysJhById" parameterType="Long">
|
||||
delete from gys_jh where id = #{id}
|
||||
</delete>
|
||||
|
||||
@@ -157,6 +157,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
update_time = NOW()
|
||||
WHERE bill_no_ck = #{billNoCk}
|
||||
</update>
|
||||
|
||||
<delete id="deleteByBillNo">
|
||||
DELETE FROM rk_info
|
||||
WHERE bill_no = #{billNo}
|
||||
|
||||
70
src/main/resources/mybatis/wisdom/WcsTaskResultMapper.xml
Normal file
70
src/main/resources/mybatis/wisdom/WcsTaskResultMapper.xml
Normal file
@@ -0,0 +1,70 @@
|
||||
<?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.zg.project.wisdom.mapper.WcsTaskResultMapper">
|
||||
|
||||
<resultMap id="WcsTaskResultResultMap" type="com.zg.project.wisdom.domain.WcsTaskResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="taskId" column="task_id"/>
|
||||
<result property="taskStatus" column="task_status"/>
|
||||
<result property="msg" column="msg"/>
|
||||
<result property="jobId" column="job_id"/>
|
||||
<result property="owner" column="owner"/>
|
||||
<result property="type" column="type"/>
|
||||
<result property="priority" column="priority"/>
|
||||
<result property="sourceName" column="source_name"/>
|
||||
<result property="targetName" column="target_name"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="isDelete" column="is_delete"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
</resultMap>
|
||||
|
||||
<insert id="insertWcsTaskResult" parameterType="com.zg.project.wisdom.domain.WcsTaskResult" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO wcs_task_result
|
||||
(
|
||||
task_id,
|
||||
task_status,
|
||||
msg,
|
||||
job_id,
|
||||
owner,
|
||||
type,
|
||||
priority,
|
||||
source_name,
|
||||
target_name,
|
||||
create_time,
|
||||
update_time,
|
||||
is_delete,
|
||||
create_by,
|
||||
update_by
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
#{taskId},
|
||||
#{TaskStatus},
|
||||
#{msg},
|
||||
#{jobId},
|
||||
#{owner},
|
||||
#{type},
|
||||
#{priority},
|
||||
#{sourceName},
|
||||
#{targetName},
|
||||
#{createTime},
|
||||
#{updateTime},
|
||||
#{isDelete},
|
||||
#{createBy},
|
||||
#{updateBy}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<select id="countByTaskId" resultType="java.lang.Integer" parameterType="java.lang.String">
|
||||
SELECT COUNT(*)
|
||||
FROM wcs_status
|
||||
WHERE TaskID = #{taskId}
|
||||
AND TaskStatus = '1'
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user