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()); bmAgreementInfo.setUnitId(tbTeam.getId());
} else { } else {
bmAgreementInfo.setUnitId(bmTeam.getId()); bmAgreementInfo.setUnitId(record.getLeaseUnitId().longValue());
// 修改班组信息 // 修改班组信息
bmTeamMapper.update(tbTeam); bmTeamMapper.update(tbTeam);
} }

View File

@ -16,7 +16,9 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator;
import java.util.List; import java.util.List;
@ -45,16 +47,15 @@ public class DirectRotationController extends BaseController {
Integer projectId = service.getprojectId(sltAgreementInfo); Integer projectId = service.getprojectId(sltAgreementInfo);
// 根据项目获取材料站在用机具 // 根据项目获取材料站在用机具
List<SltAgreementInfo> useringDataClz = service.getUseringDataByClz(projectId); 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; boolean shouldAdd = true;
for (SltAgreementInfo agreementInfo : useringDataClz) { for (SltAgreementInfo agreementInfo : useringDataClz) {
// if (agreementInfo.getTypeName().equals("地锚") && agreementInfo.getTypeModelName().equals("10t")) {
// System.out.println("haha");
// }
if (useringDatum.getTypeId().equals(agreementInfo.getTypeId())) { if (useringDatum.getTypeId().equals(agreementInfo.getTypeId())) {
if (useringDatum.getMaId() == null && agreementInfo.getMaId() == null) { if (useringDatum.getMaId() == null && agreementInfo.getMaId() == null) {
if (useringDatum.getUseNum() > agreementInfo.getUseNum()) { if (useringDatum.getUseNum().compareTo(agreementInfo.getUseNum()) > 0) {
useringDatum.setUseNum(useringDatum.getUseNum() - agreementInfo.getUseNum()); useringDatum.setUseNum(useringDatum.getUseNum().subtract(agreementInfo.getUseNum()));
} else { } else {
shouldAdd = false; shouldAdd = false;
break; 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) { if (shouldAdd) {
datas.add(useringDatum); datas.add(useringDatum);
} }

View File

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

View File

@ -99,4 +99,11 @@ public interface DirectRotationService {
* @return * @return
*/ */
AjaxResult getSignatureList(SltAgreementInfo sltAgreementInfo); 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, private void classifySignature(ClzDirectApplyInfo clzDirectApplyInfo, LeaseOutSign leaseOutSign,
List<LeaseOutSign> list1, List<LeaseOutSign> list2, List<LeaseOutSign> list3) { List<LeaseOutSign> list1, List<LeaseOutSign> list2, List<LeaseOutSign> list3) {

View File

@ -208,7 +208,7 @@ public class SltAgreementInfo extends BaseEntity {
private String maCode; private String maCode;
private Double useNum; private BigDecimal useNum;
private String keyWord; private String keyWord;
@ -261,5 +261,11 @@ public class SltAgreementInfo extends BaseEntity {
*/ */
private Boolean enableQuerySltData = false; 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 != ''"> <if test="teamName != null and teamName != ''">
and unit_name = #{teamName} and unit_name = #{teamName}
</if> </if>
Limit 1
</select> </select>
<select id="getTeamList" resultType="com.bonus.material.clz.domain.BmTeam"> <select id="getTeamList" resultType="com.bonus.material.clz.domain.BmTeam">

View File

@ -64,6 +64,7 @@
mm.next_check_time as nextCheckTime, mm.next_check_time as nextCheckTime,
sai.ma_id as maId, sai.ma_id as maId,
sai.type_id as typeId, sai.type_id as typeId,
sai.agreement_id as agreementId,
lai.create_time as createTime, lai.create_time as createTime,
mt.unit_value as unitValue, mt.unit_value as unitValue,
sai.* sai.*
@ -357,4 +358,25 @@
WHERE WHERE
dai.id=#{id} dai.id=#{id}
</select> </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> </mapper>

View File

@ -149,7 +149,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and a.result BETWEEN #{prefix} and #{suffix} and a.result BETWEEN #{prefix} and #{suffix}
</if> </if>
order by a.createTime desc order by a.maId desc
</select> </select>
<select id="selectMachineByMaId" resultType="com.bonus.material.ma.domain.vo.MachineVo"> <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.this_check_time is not null
AND mm.next_check_time is not null AND mm.next_check_time is not null
AND mt.jiju_type = 2 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"> <if test="status != null and status == 0">
AND mm.next_check_time &gt;= CURDATE() AND mm.next_check_time &gt;= CURDATE()
</if> </if>
@ -264,6 +266,11 @@
<if test="thirdTypeId != null"> <if test="thirdTypeId != null">
AND mt2.type_id = #{thirdTypeId} AND mt2.type_id = #{thirdTypeId}
</if> </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> </select>
</mapper> </mapper>