This commit is contained in:
parent
fd650d2f3c
commit
9dab95e001
|
|
@ -7,6 +7,7 @@ import lombok.Data;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author ma_sh
|
* @Author ma_sh
|
||||||
|
|
@ -71,6 +72,8 @@ public class MaCodeVo {
|
||||||
@ApiModelProperty(value = "协议ID")
|
@ApiModelProperty(value = "协议ID")
|
||||||
private Long agreementId;
|
private Long agreementId;
|
||||||
|
|
||||||
|
private List<String> agreementIds;
|
||||||
|
|
||||||
private String createBy;
|
private String createBy;
|
||||||
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
|
|
||||||
|
|
@ -243,4 +243,8 @@ public interface MaterialBackInfoMapper {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<MaCodeVo> getMachine(MaterialBackApplyInfo dto);
|
List<MaCodeVo> getMachine(MaterialBackApplyInfo dto);
|
||||||
|
|
||||||
|
MaterialBackApplyInfo getAgreementInfo(MaterialBackApplyInfo backApplyInfo);
|
||||||
|
|
||||||
|
List<String> getAgreementList(MaterialBackApplyInfo agreement);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -296,6 +296,12 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe
|
||||||
MaterialBackApplyRequestVo backApplyRequestVo = new MaterialBackApplyRequestVo();
|
MaterialBackApplyRequestVo backApplyRequestVo = new MaterialBackApplyRequestVo();
|
||||||
//先根据外层id查询上层信息
|
//先根据外层id查询上层信息
|
||||||
MaterialBackApplyInfo backApplyInfo = materialBackInfoMapper.selectBackApplyInfoById(id);
|
MaterialBackApplyInfo backApplyInfo = materialBackInfoMapper.selectBackApplyInfoById(id);
|
||||||
|
//根据退料任务查询班组id和工程id,然后查询协议集合
|
||||||
|
MaterialBackApplyInfo agreement = materialBackInfoMapper.getAgreementInfo(backApplyInfo);
|
||||||
|
|
||||||
|
List<String> list = materialBackInfoMapper.getAgreementList(agreement);
|
||||||
|
backApplyInfo.setAgreementIds(list);
|
||||||
|
|
||||||
if (StringUtils.isNotBlank(backApplyInfo.getBackSignUrl())) {
|
if (StringUtils.isNotBlank(backApplyInfo.getBackSignUrl())) {
|
||||||
if (!backApplyInfo.getBackSignUrl().startsWith("http")) {
|
if (!backApplyInfo.getBackSignUrl().startsWith("http")) {
|
||||||
backApplyInfo.setBackSignUrl("data:image/png;base64," + backApplyInfo.getBackSignUrl());
|
backApplyInfo.setBackSignUrl("data:image/png;base64," + backApplyInfo.getBackSignUrl());
|
||||||
|
|
@ -314,11 +320,12 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe
|
||||||
List<MaCodeVo> maCodeList = fetchMaCodeList(id);
|
List<MaCodeVo> maCodeList = fetchMaCodeList(id);
|
||||||
if ("0".equals(backApplyInfo.getStatus())) {
|
if ("0".equals(backApplyInfo.getStatus())) {
|
||||||
if (CollectionUtils.isNotEmpty(maCodeList)) {
|
if (CollectionUtils.isNotEmpty(maCodeList)) {
|
||||||
// 根据id查询协议id
|
// // 根据id查询协议id
|
||||||
Long agreementId = materialBackInfoMapper.selectAgreementId(backApplyInfo);
|
// Long agreementId = materialBackInfoMapper.selectAgreementId(backApplyInfo);
|
||||||
for (MaCodeVo maCodeVo : maCodeList) {
|
for (MaCodeVo maCodeVo : maCodeList) {
|
||||||
if (maCodeVo.getMaId() != null) {
|
if (maCodeVo.getMaId() != null) {
|
||||||
maCodeVo.setAgreementId(agreementId);
|
// maCodeVo.setAgreementId(agreementId);
|
||||||
|
maCodeVo.setAgreementIds(backApplyInfo.getAgreementIds());
|
||||||
// 根据协议id以及typeId,maId查询设备是否还在用
|
// 根据协议id以及typeId,maId查询设备是否还在用
|
||||||
MaterialBackApplyInfo info1 = materialBackInfoMapper.selectByAgreementIdAndTypeId(maCodeVo);
|
MaterialBackApplyInfo info1 = materialBackInfoMapper.selectByAgreementIdAndTypeId(maCodeVo);
|
||||||
if (info1 == null) {
|
if (info1 == null) {
|
||||||
|
|
|
||||||
|
|
@ -813,14 +813,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<select id="selectByAgreementIdAndTypeId" resultType="com.bonus.material.clz.domain.back.MaterialBackApplyInfo">
|
<select id="selectByAgreementIdAndTypeId" resultType="com.bonus.material.clz.domain.back.MaterialBackApplyInfo">
|
||||||
SELECT
|
SELECT
|
||||||
agreement_id AS agreementId,
|
|
||||||
type_id AS typeId,
|
type_id AS typeId,
|
||||||
ma_id AS maId
|
ma_id AS maId
|
||||||
FROM
|
FROM
|
||||||
clz_slt_agreement_info
|
clz_slt_agreement_info
|
||||||
WHERE
|
WHERE
|
||||||
status = '0'
|
status = '0'
|
||||||
AND agreement_id = #{agreementId}
|
<if test="agreementIds != null ">
|
||||||
|
and agreement_id in
|
||||||
|
<foreach item="item" collection="agreementIds" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
AND type_id = #{typeId}
|
AND type_id = #{typeId}
|
||||||
<if test="maId != null">
|
<if test="maId != null">
|
||||||
AND ma_id = #{maId}
|
AND ma_id = #{maId}
|
||||||
|
|
@ -869,5 +873,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
AND mm.qr_code = #{qrCode}
|
AND mm.qr_code = #{qrCode}
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getAgreementInfo" resultType="com.bonus.material.clz.domain.back.MaterialBackApplyInfo">
|
||||||
|
select
|
||||||
|
csa.unit_id AS teamId,
|
||||||
|
csa.project_id AS proId
|
||||||
|
from
|
||||||
|
tm_task_agreement tta
|
||||||
|
LEFT JOIN clz_bm_agreement_info csa ON tta.agreement_id = csa.agreement_id
|
||||||
|
WHERE tta.task_id = #{taskId}
|
||||||
|
</select>
|
||||||
|
<select id="getAgreementList" resultType="java.lang.String">
|
||||||
|
select csa.agreement_id AS agreementId
|
||||||
|
from clz_bm_agreement_info csa
|
||||||
|
where csa.unit_id = #{teamId}
|
||||||
|
and csa.project_id = #{proId}
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue