This commit is contained in:
mashuai 2025-10-16 18:47:21 +08:00
parent 271fcfc103
commit 2b71b89aa0
10 changed files with 80 additions and 10 deletions

View File

@ -313,7 +313,7 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
}
bmAgreementInfo.setUnitId(tbTeam.getId());
} else {
bmAgreementInfo.setUnitId(bmTeam.getId());
bmAgreementInfo.setUnitId(record.getLeaseUnitId().longValue());
// 修改班组信息
bmTeamMapper.update(tbTeam);
}

View File

@ -16,7 +16,9 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
@ -45,16 +47,15 @@ public class DirectRotationController extends BaseController {
Integer projectId = service.getprojectId(sltAgreementInfo);
// 根据项目获取材料站在用机具
List<SltAgreementInfo> useringDataClz = service.getUseringDataByClz(projectId);
for (SltAgreementInfo useringDatum : useringData) {
Iterator<SltAgreementInfo> iterator = useringData.iterator();
while (iterator.hasNext()) {
SltAgreementInfo useringDatum = iterator.next();
boolean shouldAdd = true;
for (SltAgreementInfo agreementInfo : useringDataClz) {
// if (agreementInfo.getTypeName().equals("地锚") && agreementInfo.getTypeModelName().equals("10t")) {
// System.out.println("haha");
// }
if (useringDatum.getTypeId().equals(agreementInfo.getTypeId())) {
if (useringDatum.getMaId() == null && agreementInfo.getMaId() == null) {
if (useringDatum.getUseNum() > agreementInfo.getUseNum()) {
useringDatum.setUseNum(useringDatum.getUseNum() - agreementInfo.getUseNum());
if (useringDatum.getUseNum().compareTo(agreementInfo.getUseNum()) > 0) {
useringDatum.setUseNum(useringDatum.getUseNum().subtract(agreementInfo.getUseNum()));
} else {
shouldAdd = false;
break;
@ -65,6 +66,15 @@ public class DirectRotationController extends BaseController {
}
}
}
// 根据协议以及类型id查询待审核数量
SltAgreementInfo info = service.getInfo(useringDatum);
if (info != null) {
useringDatum.setWaitTransNum(info.getWaitTransNum());
useringDatum.setTransNum(useringDatum.getUseNum().subtract(useringDatum.getWaitTransNum()));
} else {
useringDatum.setWaitTransNum(BigDecimal.ZERO);
useringDatum.setTransNum(useringDatum.getUseNum());
}
if (shouldAdd) {
datas.add(useringDatum);
}

View File

@ -101,4 +101,11 @@ public interface DirectRotationMapper {
List<ClzDirectApplyInfo> getSignatureList(SltAgreementInfo sltAgreementInfo);
ClzDirectApplyInfo getSignById(SltAgreementInfo sltAgreementInfo);
/**
* 根据协议以及类型id查询待审核数量
* @param useringDatum
* @return
*/
SltAgreementInfo getInfo(SltAgreementInfo useringDatum);
}

View File

@ -99,4 +99,11 @@ public interface DirectRotationService {
* @return
*/
AjaxResult getSignatureList(SltAgreementInfo sltAgreementInfo);
/**
* 根据协议以及类型id查询待审核数量
* @param useringDatum
* @return
*/
SltAgreementInfo getInfo(SltAgreementInfo useringDatum);
}

View File

@ -540,6 +540,16 @@ public class DirectRotationImpl implements DirectRotationService {
}
}
/**
* 根据协议以及类型id查询待审核数量
* @param useringDatum
* @return
*/
@Override
public SltAgreementInfo getInfo(SltAgreementInfo useringDatum) {
return mapper.getInfo(useringDatum);
}
// 将签名分类的逻辑提取到一个单独的方法
private void classifySignature(ClzDirectApplyInfo clzDirectApplyInfo, LeaseOutSign leaseOutSign,
List<LeaseOutSign> list1, List<LeaseOutSign> list2, List<LeaseOutSign> list3) {

View File

@ -208,7 +208,7 @@ public class SltAgreementInfo extends BaseEntity {
private String maCode;
private Double useNum;
private BigDecimal useNum;
private String keyWord;
@ -261,5 +261,11 @@ public class SltAgreementInfo extends BaseEntity {
*/
private Boolean enableQuerySltData = false;
@ApiModelProperty(value = "待转数量")
private BigDecimal waitTransNum;
@ApiModelProperty(value = "可转数量")
private BigDecimal transNum;
}

View File

@ -103,6 +103,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="teamName != null and teamName != ''">
and unit_name = #{teamName}
</if>
Limit 1
</select>
<select id="getTeamList" resultType="com.bonus.material.clz.domain.BmTeam">

View File

@ -64,6 +64,7 @@
mm.next_check_time as nextCheckTime,
sai.ma_id as maId,
sai.type_id as typeId,
sai.agreement_id as agreementId,
lai.create_time as createTime,
mt.unit_value as unitValue,
sai.*
@ -357,4 +358,25 @@
WHERE
dai.id=#{id}
</select>
<select id="getInfo" resultType="com.bonus.material.settlement.domain.SltAgreementInfo">
SELECT
da.id AS id,
SUM(IFNULL(dad.direct_num, 0)) AS waitTransNum
FROM
direct_apply_info da
LEFT JOIN direct_apply_details dad ON da.id = dad.direct_id
WHERE
da.`status` = '0'
AND da.id IN (SELECT task_id FROM sys_workflow_record)
AND da.back_agreement_id = #{agreementId}
AND dad.type_id = #{typeId}
<if test="maId != null">
AND dad.ma_id = #{maId}
</if>
GROUP BY
da.id
HAVING
waitTransNum > 0
</select>
</mapper>

View File

@ -149,7 +149,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and a.result BETWEEN #{prefix} and #{suffix}
</if>
order by a.createTime desc
order by a.maId desc
</select>
<select id="selectMachineByMaId" resultType="com.bonus.material.ma.domain.vo.MachineVo">

View File

@ -237,6 +237,8 @@
AND mm.this_check_time is not null
AND mm.next_check_time is not null
AND mt.jiju_type = 2
AND mt2.type_id not in (6032,6008,6270,6012,6761)
AND DATEDIFF(mm.next_check_time, CURDATE()) &lt;= 0
<if test="status != null and status == 0">
AND mm.next_check_time &gt;= CURDATE()
</if>
@ -264,6 +266,11 @@
<if test="thirdTypeId != null">
AND mt2.type_id = #{thirdTypeId}
</if>
ORDER BY mm.next_check_time ASC
GROUP BY
mt2.type_name,
mm.ma_code
ORDER BY
SUBSTRING( mt2.type_name, 1, 1 ) ASC ,
mm.next_check_time ASC
</select>
</mapper>