代码提交
This commit is contained in:
parent
5b686df136
commit
d1235dcc06
|
|
@ -125,4 +125,7 @@ public class LeaseTotalInfo {
|
|||
|
||||
@ApiModelProperty(value = "工程id")
|
||||
private String proId;
|
||||
|
||||
@ApiModelProperty(value = "领料方式")
|
||||
private String leaseStyle;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -231,7 +231,7 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
|
|||
if (projectUnitAgreementId != null && projectUnitAgreementId > GlobalConstants.INT_0) {
|
||||
record.setProjectUnitAgreementId(projectUnitAgreementId);
|
||||
} else {
|
||||
return AjaxResult.error("出库失败,没有找到班组所属项目部协议信息");
|
||||
throw new ServiceException("出库失败,未找到班组项目部协议ID");
|
||||
}
|
||||
// 设置默认可退还数量等同于领用数量,因为班组的协议可以直接去分公司退还, 并设置source来源为2(班组领用)
|
||||
record.setReturnNum(record.getOutNum());
|
||||
|
|
@ -331,6 +331,7 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
|
|||
materialLeaseApplyInfo.setLeaseStyle(SYNC_RESOURCE.toString());
|
||||
materialLeaseApplyInfo.setTeamId(bmAgreementInfo.getUnitId().toString());
|
||||
materialLeaseApplyInfo.setProjectId(record.getLeaseProjectId().toString());
|
||||
materialLeaseApplyInfo.setProId(Long.parseLong(record.getLeaseProjectId().toString()));
|
||||
materialLeaseApplyInfo.setCreateTime(DateUtils.getNowDate());
|
||||
materialLeaseApplyInfo.setCreateBy(SecurityUtils.getLoginUser().getSysUser().getNickName());
|
||||
int count = materialLeaseInfoMapper.insertLeaseApplyInfo(materialLeaseApplyInfo);
|
||||
|
|
@ -405,7 +406,7 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
|
|||
}*/
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
return AjaxResult.error("出库失败" + e.getMessage());
|
||||
throw new ServiceException("出库失败" + e.getMessage());
|
||||
}
|
||||
return AjaxResult.success("出库成功");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,10 +21,10 @@ import java.util.List;
|
|||
|
||||
|
||||
/**
|
||||
* @description 直转申请
|
||||
* @author hay
|
||||
* @date 2025/2/17 19:27
|
||||
*/
|
||||
* @author hay
|
||||
* @description 直转申请
|
||||
* @date 2025/2/17 19:27
|
||||
*/
|
||||
@Api(tags = " 直转申请")
|
||||
@RestController
|
||||
@RequestMapping("/directRotation")
|
||||
|
|
@ -40,8 +40,37 @@ public class DirectRotationController extends BaseController {
|
|||
@GetMapping("/getUseringData")
|
||||
public AjaxResult getUseringData(SltAgreementInfo sltAgreementInfo) {
|
||||
try {
|
||||
List<SltAgreementInfo> datas = new ArrayList<>();
|
||||
List<SltAgreementInfo> useringData = service.getUseringData(sltAgreementInfo);
|
||||
return AjaxResult.success(useringData);
|
||||
Integer projectId = service.getprojectId(sltAgreementInfo);
|
||||
// 根据项目获取材料站在用机具
|
||||
List<SltAgreementInfo> useringDataClz = service.getUseringDataByClz(projectId);
|
||||
for (SltAgreementInfo useringDatum : useringData) {
|
||||
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());
|
||||
} else {
|
||||
shouldAdd = false;
|
||||
break;
|
||||
}
|
||||
} else if (useringDatum.getMaId() != null && useringDatum.getMaId().equals(agreementInfo.getMaId())) {
|
||||
// 匹配成功,不需要添加到datas
|
||||
shouldAdd = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (shouldAdd) {
|
||||
datas.add(useringDatum);
|
||||
}
|
||||
}
|
||||
return AjaxResult.success(datas);
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.success(new ArrayList<>());
|
||||
}
|
||||
|
|
@ -49,12 +78,13 @@ public class DirectRotationController extends BaseController {
|
|||
|
||||
/**
|
||||
* 根据协议Id查询在用数据--类型名称下拉,规格型号下拉,在用数据列表
|
||||
*
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "标准配置下拉选")
|
||||
@PostMapping("/getTypeNameList")
|
||||
public AjaxResult getTypeNameList(@RequestBody SltAgreementInfo bean){
|
||||
public AjaxResult getTypeNameList(@RequestBody SltAgreementInfo bean) {
|
||||
return service.getTypeNameList(bean);
|
||||
}
|
||||
|
||||
|
|
@ -112,6 +142,7 @@ public class DirectRotationController extends BaseController {
|
|||
|
||||
/**
|
||||
* 导出直转记录查询列表
|
||||
*
|
||||
* @param response
|
||||
* @param directApplyInfo
|
||||
*/
|
||||
|
|
@ -164,7 +195,7 @@ public class DirectRotationController extends BaseController {
|
|||
*/
|
||||
@ApiOperation(value = "删除直转申请")
|
||||
@PreventRepeatSubmit
|
||||
@SysLog(title = "直转记录查询", businessType = OperaType.DELETE, logType = 1,module = "直转记录查询->删除直转申请")
|
||||
@SysLog(title = "直转记录查询", businessType = OperaType.DELETE, logType = 1, module = "直转记录查询->删除直转申请")
|
||||
@DeleteMapping("/{id}")
|
||||
public AjaxResult remove(@PathVariable Long id) {
|
||||
return toAjax(service.delData(id));
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.bonus.material.ma.domain.DirectApplyExportInfo;
|
|||
import com.bonus.material.ma.domain.DirectApplyInfo;
|
||||
import com.bonus.material.settlement.domain.SltAgreementInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -78,4 +79,8 @@ public interface DirectRotationMapper {
|
|||
* @return
|
||||
*/
|
||||
List<DirectApplyDetails> selectDetails(SltAgreementInfo sltAgreementInfo);
|
||||
|
||||
List<SltAgreementInfo> getUseringDataByClz(@Param("projectId") Integer projectId);
|
||||
|
||||
Integer getprojectId(SltAgreementInfo sltAgreementInfo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import com.bonus.material.ma.domain.DirectApplyExportInfo;
|
|||
import com.bonus.material.ma.domain.DirectApplyInfo;
|
||||
import com.bonus.material.ma.domain.DirectApplyInfoDetails;
|
||||
import com.bonus.material.settlement.domain.SltAgreementInfo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
|
|
@ -79,4 +80,8 @@ public interface DirectRotationService {
|
|||
* @return
|
||||
*/
|
||||
AjaxResult submitNew(DirectApplyInfoDetails directApplyInfoDetails);
|
||||
|
||||
List<SltAgreementInfo> getUseringDataByClz(@Param("projectId") Integer projectId);
|
||||
|
||||
Integer getprojectId(SltAgreementInfo sltAgreementInfo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -434,6 +434,16 @@ public class DirectRotationImpl implements DirectRotationService {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SltAgreementInfo> getUseringDataByClz(Integer projectId) {
|
||||
return mapper.getUseringDataByClz(projectId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getprojectId(SltAgreementInfo sltAgreementInfo) {
|
||||
return mapper.getprojectId(sltAgreementInfo);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 生成退料单号
|
||||
|
|
|
|||
|
|
@ -89,16 +89,16 @@ public class ProAuthorizeServiceImpl implements ProAuthorizeService {
|
|||
// 使用 HashSet 来加速查找过程
|
||||
Set<String> unsettledProjectIds = new HashSet<>(projectIdList);
|
||||
// 过滤掉不在未结算工程集合内的工程
|
||||
Iterator<LeasePublishInfo> iterator = list.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
LeasePublishInfo info = iterator.next();
|
||||
String proId = info.getLeaseProjectId() != null ?
|
||||
info.getLeaseProjectId().toString() : null;
|
||||
|
||||
if (proId == null || !unsettledProjectIds.contains(proId)) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
// Iterator<LeasePublishInfo> iterator = list.iterator();
|
||||
// while (iterator.hasNext()) {
|
||||
// LeasePublishInfo info = iterator.next();
|
||||
// String proId = info.getLeaseProjectId() != null ?
|
||||
// info.getLeaseProjectId().toString() : null;
|
||||
//
|
||||
// if (proId == null || !unsettledProjectIds.contains(proId)) {
|
||||
// iterator.remove();
|
||||
// }
|
||||
// }
|
||||
}
|
||||
return list;
|
||||
} catch (Exception e){
|
||||
|
|
|
|||
|
|
@ -254,6 +254,7 @@ public class SltAgreementInfo extends BaseEntity {
|
|||
private String repairCode;
|
||||
|
||||
private String unitValue;
|
||||
private String nextCheckTime;
|
||||
|
||||
/**
|
||||
* 是否查询已结算的费用
|
||||
|
|
|
|||
|
|
@ -953,6 +953,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
lai.`code` as code,
|
||||
bp.imp_unit as impUnit,
|
||||
bt.bzz_idcard as idCard,
|
||||
case when lai.lease_style = '0' then '材料领料'
|
||||
when lai.lease_style = '1' then '工器具领料'
|
||||
when lai.lease_style = '2' then '第三方推送'
|
||||
else ''
|
||||
end as leaseStyle,
|
||||
lai.sub_unit_name as subUnitName
|
||||
FROM
|
||||
clz_lease_out_details lod
|
||||
|
|
|
|||
|
|
@ -324,7 +324,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
|
||||
<select id="getProjectList" resultType="com.bonus.common.biz.domain.ProjectTreeNode">
|
||||
/*根据往来单位id关联协议查询工程*/
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@
|
|||
mm.ma_code AS maCode,
|
||||
lai.lease_person as leasePerson,
|
||||
DATE(sai.start_time) as startTime,
|
||||
mm.next_check_time as nextCheckTime,
|
||||
sai.ma_id as maId,
|
||||
sai.type_id as typeId,
|
||||
lai.create_time as createTime,
|
||||
|
|
@ -281,4 +282,39 @@
|
|||
GROUP BY
|
||||
dad.type_id
|
||||
</select>
|
||||
|
||||
<select id="getprojectId" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
project_id
|
||||
FROM
|
||||
bm_agreement_info
|
||||
WHERE
|
||||
agreement_id = #{agreementId}
|
||||
</select>
|
||||
<select id="getUseringDataByClz" resultType="com.bonus.material.settlement.domain.SltAgreementInfo">
|
||||
SELECT
|
||||
mt2.type_name AS typeName,
|
||||
mt.type_name AS typeModelName,
|
||||
mt.unit_name as unitName,
|
||||
ifnull(sum( sai.num ) ,0 ) AS useNum,
|
||||
mm.ma_code AS maCode,
|
||||
lai.lease_person as leasePerson,
|
||||
DATE(sai.start_time) as startTime,
|
||||
sai.ma_id as maId,
|
||||
sai.type_id as typeId,
|
||||
lai.create_time as createTime,
|
||||
mt.unit_value as unitValue,
|
||||
sai.*
|
||||
FROM
|
||||
clz_slt_agreement_info sai
|
||||
LEFT JOIN ma_type mt on sai.type_id = mt.type_id
|
||||
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
|
||||
LEFT JOIN ma_machine mm on sai.ma_id = mm.ma_id
|
||||
LEFT JOIN clz_lease_apply_info lai on lai.id=sai.lease_id
|
||||
left join clz_bm_agreement_info col on col.agreement_id=sai.agreement_id
|
||||
left join bm_project pro on pro.pro_id=col.project_id
|
||||
where pro.pro_id = #{projectId} and sai.status = '0'
|
||||
GROUP BY
|
||||
sai.ma_id,sai.type_id
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue