审核模块相关接口开发
This commit is contained in:
@@ -3,28 +3,45 @@
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zg.project.wisdom.mapper.AuditSignatureMapper">
|
||||
|
||||
<resultMap type="AuditSignature" id="AuditSignatureResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="billNo" column="bill_no" />
|
||||
<result property="billType" column="bill_type" />
|
||||
<result property="signerId" column="signer_id" />
|
||||
<result property="signerRole" column="signer_role" />
|
||||
<result property="signUrl" column="sign_url" />
|
||||
<result property="signTime" column="sign_time" />
|
||||
<result property="pcode" column="pcode" />
|
||||
<result property="trayCode" column="tray_code" />
|
||||
<result property="approverId" column="approver_id" />
|
||||
<result property="approverSignUrl" column="approver_sign_url" />
|
||||
<result property="auditResult" column="audit_result" />
|
||||
<result property="imageType" column="image_type" />
|
||||
<result property="isCurrent" column="is_current" />
|
||||
<result property="remark" column="remark" />
|
||||
<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="isDelete" column="is_delete" />
|
||||
|
||||
<!-- 主记录映射 -->
|
||||
<resultMap type="com.zg.project.wisdom.domain.AuditSignature" id="AuditSignatureResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="billNo" column="bill_no" />
|
||||
<result property="rkId" column="rk_id" />
|
||||
<result property="billType" column="bill_type" />
|
||||
<result property="signerId" column="signer_id" />
|
||||
<result property="signerRole" column="signer_role" />
|
||||
<result property="signUrl" column="sign_url" />
|
||||
<result property="signTime" column="sign_time" />
|
||||
<result property="pcode" column="pcode" />
|
||||
<result property="trayCode" column="tray_code" />
|
||||
<result property="approverId" column="approver_id" />
|
||||
<result property="approverSignUrl" column="approver_sign_url" />
|
||||
<result property="auditResult" column="audit_result" />
|
||||
<result property="imageType" column="image_type" />
|
||||
<result property="isCurrent" column="is_current" />
|
||||
<result property="remark" column="remark" />
|
||||
<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="isDelete" column="is_delete" />
|
||||
</resultMap>
|
||||
|
||||
<!-- VO对象映射(带扩展字段) -->
|
||||
<resultMap id="AuditSignatureVoResult"
|
||||
type="com.zg.project.wisdom.domain.vo.AuditSignatureVo"
|
||||
extends="AuditSignatureResult">
|
||||
<result column="xmNo" property="xmNo"/>
|
||||
<result column="xmMs" property="xmMs"/>
|
||||
<result column="wlMs" property="wlMs"/>
|
||||
<result column="gysMc" property="gysMc"/>
|
||||
<result column="wlNo" property="wlNo"/>
|
||||
<result column="realQty" property="realQty"/>
|
||||
<result column="dw" property="dw"/>
|
||||
<result column="pcode" property="pcode"/>
|
||||
<result column="rkRemark" property="rkRemark"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAuditSignatureVo">
|
||||
@@ -77,6 +94,77 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
AND is_delete = '0'
|
||||
</select>
|
||||
|
||||
<select id="selectPhotoUrlByRkId"
|
||||
resultMap="AuditSignatureResult"
|
||||
parameterType="java.lang.Long">
|
||||
SELECT sign_url, audit_result
|
||||
FROM audit_signature
|
||||
WHERE is_delete = '0'
|
||||
AND rk_id = #{rkId}
|
||||
AND image_type = '1'
|
||||
ORDER BY create_time DESC
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
<!-- 查询主记录列表(审批记录) signer_role=1 image_type=0 -->
|
||||
<select id="selectAuditMainList" parameterType="com.zg.project.wisdom.domain.AuditSignature" resultMap="AuditSignatureResult">
|
||||
SELECT * FROM audit_signature
|
||||
<where>
|
||||
AND signer_role = '0'
|
||||
AND image_type = '0'
|
||||
<if test="billNo != null and billNo != ''">AND bill_no = #{billNo}</if>
|
||||
<if test="billType != null and billType != ''">AND bill_type = #{billType}</if>
|
||||
<if test="auditResult != null and auditResult != ''">AND audit_result = #{auditResult}</if>
|
||||
<if test="approverId != null and approverId != ''">AND approver_id = #{approverId}</if>
|
||||
<if test="isDelete != null and isDelete != ''">AND is_delete = #{isDelete}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!-- 查询关联入库信息的现场照片 -->
|
||||
<select id="selectScenePhotosWithGoodsByBillNo"
|
||||
parameterType="String"
|
||||
resultMap="AuditSignatureVoResult">
|
||||
SELECT
|
||||
a.id,
|
||||
a.rk_id,
|
||||
a.bill_no,
|
||||
a.sign_url,
|
||||
a.sign_time,
|
||||
a.signer_role,
|
||||
a.image_type,
|
||||
a.tray_code,
|
||||
a.is_delete,
|
||||
a.remark AS remark,
|
||||
|
||||
r.xm_no AS xmNo,
|
||||
r.xm_ms AS xmMs,
|
||||
r.wl_ms AS wlMs,
|
||||
r.gys_mc AS gysMc,
|
||||
r.wl_no AS wlNo,
|
||||
r.real_qty AS realQty,
|
||||
r.dw AS dw,
|
||||
r.pcode AS pcode,
|
||||
r.remark AS rkRemark
|
||||
FROM audit_signature a
|
||||
LEFT JOIN rk_info r ON a.rk_id = r.id
|
||||
WHERE a.bill_no = #{billNo}
|
||||
AND a.signer_role = '2'
|
||||
AND a.image_type = '1'
|
||||
AND a.is_delete = '0'
|
||||
</select>
|
||||
|
||||
<select id="selectAuditMainListBySubmitter" parameterType="AuditSignature" resultMap="AuditSignatureResult">
|
||||
<include refid="selectAuditSignatureVo"/>
|
||||
<where>
|
||||
and signer_id = #{signerId}
|
||||
and signer_role in ('0', '2')
|
||||
and image_type = '0'
|
||||
and is_delete = '0'
|
||||
<if test="billNo != null and billNo != ''"> and bill_no = #{billNo}</if>
|
||||
<if test="billType != null and billType != ''"> and bill_type = #{billType}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="insertAuditSignature" parameterType="AuditSignature" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into audit_signature
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
@@ -136,7 +224,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
is_current,
|
||||
is_delete,
|
||||
create_by,
|
||||
create_time
|
||||
create_time,
|
||||
rk_id
|
||||
)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
@@ -152,7 +241,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
#{item.isCurrent},
|
||||
#{item.isDelete},
|
||||
#{item.createBy},
|
||||
#{item.createTime}
|
||||
#{item.createTime},
|
||||
#{item.rkId}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
@@ -193,6 +283,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
AND is_delete = '0'
|
||||
</update>
|
||||
|
||||
<update id="approveAuditByBillNo" parameterType="AuditSignature">
|
||||
UPDATE audit_signature
|
||||
<set>
|
||||
<if test="auditResult != null"> audit_result = #{auditResult},</if>
|
||||
<if test="approverSignUrl != null"> approver_sign_url = #{approverSignUrl},</if>
|
||||
<if test="remark != null"> remark = #{remark},</if>
|
||||
<if test="updateBy != null"> update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null"> update_time = #{updateTime},</if>
|
||||
</set>
|
||||
WHERE bill_no = #{billNo}
|
||||
AND signer_role = '1'
|
||||
AND is_delete = '0'
|
||||
AND is_current = '1'
|
||||
</update>
|
||||
|
||||
<delete id="deleteAuditSignatureById" parameterType="Long">
|
||||
delete from audit_signature where id = #{id}
|
||||
</delete>
|
||||
|
||||
@@ -84,7 +84,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
LEFT JOIN construction_team ct ON ri.team_code = ct.team_code
|
||||
</sql>
|
||||
|
||||
<insert id="batchInsertRkInfo" parameterType="java.util.List">
|
||||
<insert id="batchInsertRkInfo"
|
||||
parameterType="java.util.List"
|
||||
useGeneratedKeys="true"
|
||||
keyProperty="id">
|
||||
INSERT INTO rk_info (
|
||||
bill_no,
|
||||
rk_type, wl_type, cangku, lihuo_y, rk_time,
|
||||
@@ -340,6 +343,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
GROUP BY pcode
|
||||
</select>
|
||||
|
||||
<select id="selectOneForEachBillNo" parameterType="java.util.List" resultType="com.zg.project.wisdom.domain.RkInfo">
|
||||
SELECT
|
||||
r.bill_no AS billNo,
|
||||
MAX(r.lihuo_y) AS lihuoY,
|
||||
MAX(rkType.type_name) AS rkTypeName,
|
||||
MAX(cangku.warehouse_name) AS cangkuName,
|
||||
MAX(wlType.type_name) AS wlTypeName
|
||||
FROM rk_info r
|
||||
LEFT JOIN stock_in_type rkType ON r.rk_type = rkType.type_code
|
||||
LEFT JOIN warehouse_info cangku ON r.cangku = cangku.warehouse_code
|
||||
LEFT JOIN material_type wlType ON r.wl_type = wlType.type_code
|
||||
WHERE r.is_delete = '0'
|
||||
AND r.bill_no IN
|
||||
<foreach collection="billNos" item="billNo" open="(" separator="," close=")">
|
||||
#{billNo}
|
||||
</foreach>
|
||||
GROUP BY r.bill_no
|
||||
</select>
|
||||
|
||||
<update id="updateRkInfo" parameterType="RkInfo">
|
||||
update rk_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
|
||||
Reference in New Issue
Block a user