Commit aab9db7e by zhangtw

消耗品不显示归还明细

parent cb7aec8c
...@@ -77,32 +77,33 @@ public class KeyDmInboundServiceImpl { ...@@ -77,32 +77,33 @@ public class KeyDmInboundServiceImpl {
if (map == null) throw new CustomException("参数不能为空"); if (map == null) throw new CustomException("参数不能为空");
Object id = map.get("id"); Object id = map.get("id");
List<Map<String, Object>> details = (List<Map<String, Object>>) map.get("details"); List<Map<String, Object>> details = (List<Map<String, Object>>) map.get("details");
// 日期格式转换:兼容 2025-12-26 和 2025-12-25T16:00:00.000Z 两种格式
String dateStr = (String) map.get("inbound_date");
Date inbound_date = null;
if (dateStr != null && !dateStr.trim().isEmpty()) {
try {
if (dateStr.contains("T") || dateStr.contains("Z")) {
// 处理带时区的ISO格式:转换为东八区日期
DateTimeFormatter isoFormatter = DateTimeFormatter.ISO_INSTANT;
Instant instant = Instant.parse(dateStr);
// 转换为东八区的LocalDate
LocalDate localDate = instant.atZone(ZoneId.of("Asia/Shanghai")).toLocalDate();
inbound_date = java.sql.Date.valueOf(localDate);
} else {
// 处理纯日期格式(2025-12-26)
LocalDate localDate = LocalDate.parse(dateStr);
inbound_date = java.sql.Date.valueOf(localDate);
}
} catch (DateTimeParseException e) {
throw new CustomException("日期格式错误,支持格式:2025-12-26 或 2025-12-26T16:00:00.000Z");
}
}
map.put("inbound_date", inbound_date);
if (id == null || String.valueOf(id).trim().isEmpty()) { if (id == null || String.valueOf(id).trim().isEmpty()) {
System.out.println(map); System.out.println(map);
map.put("id", UUID.randomUUID().toString()); map.put("id", UUID.randomUUID().toString());
map.put("order_no",0); map.put("order_no",0);
// 日期格式转换:兼容 2025-12-26 和 2025-12-25T16:00:00.000Z 两种格式
String dateStr = (String) map.get("inbound_date");
Date inbound_date = null;
if (dateStr != null && !dateStr.trim().isEmpty()) {
try {
if (dateStr.contains("T") || dateStr.contains("Z")) {
// 处理带时区的ISO格式:转换为东八区日期
DateTimeFormatter isoFormatter = DateTimeFormatter.ISO_INSTANT;
Instant instant = Instant.parse(dateStr);
// 转换为东八区的LocalDate
LocalDate localDate = instant.atZone(ZoneId.of("Asia/Shanghai")).toLocalDate();
inbound_date = java.sql.Date.valueOf(localDate);
} else {
// 处理纯日期格式(2025-12-26)
LocalDate localDate = LocalDate.parse(dateStr);
inbound_date = java.sql.Date.valueOf(localDate);
}
} catch (DateTimeParseException e) {
throw new CustomException("日期格式错误,支持格式:2025-12-26 或 2025-12-26T16:00:00.000Z");
}
}
map.put("inbound_date", inbound_date);
map.put("inbound_status",0); map.put("inbound_status",0);
if (commonService.insert(namespace + "insert", map) != 1) throw new CustomException("保存失败"); if (commonService.insert(namespace + "insert", map) != 1) throw new CustomException("保存失败");
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
AND submit_time &lt;= #{params.params.endDate} AND submit_time &lt;= #{params.params.endDate}
</if> </if>
</where> </where>
ORDER BY create_time DESC ORDER BY approval_status asc,create_time DESC
</select> </select>
<select id="selectPendingList" parameterType="page" resultType="map"> <select id="selectPendingList" parameterType="page" resultType="map">
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
id,application_no,applicant_id,applicant_name,department_id,department_name,borrow_purpose,expected_return_date,approver_id,approver_name, id,application_no,applicant_id,applicant_name,department_id,department_name,borrow_purpose,expected_return_date,approver_id,approver_name,
approval_status,issue_status,is_used,create_by,create_time,order_no approval_status,issue_status,is_used,create_by,create_time,order_no
) VALUES ( ) VALUES (
#{id},CONCAT('borrow', REPLACE(UUID(),'-','')),#{applicant_id},#{applicant_name},#{department_id},#{department_name},#{borrow_purpose},#{expected_return_date},#{approver_id},#{approver_name} #{id},CONCAT('borrow', REPLACE(UUID(),'-','')),#{applicant_id},#{applicant_name},#{department_id},#{department_name},#{borrow_purpose},#{expected_return_date},#{approver_id},#{approver_name},
#{approval_status},#{issue_status},1,#{_user.id},NOW(),#{order_no} #{approval_status},#{issue_status},1,#{_user.id},NOW(),#{order_no}
) )
</insert> </insert>
......
...@@ -174,6 +174,7 @@ ...@@ -174,6 +174,7 @@
</if> </if>
</where> </where>
group by ba.id group by ba.id
order by submit_time desc
</select> </select>
<select id="selectPendingReturnDetailsByApplicationId" parameterType="map" resultType="map"> <select id="selectPendingReturnDetailsByApplicationId" parameterType="map" resultType="map">
...@@ -183,7 +184,7 @@ ...@@ -183,7 +184,7 @@
from jl_key_dm_borrow_application_detail as bad from jl_key_dm_borrow_application_detail as bad
left join jl_key_dm_material as m on bad.material_id = m.id left join jl_key_dm_material as m on bad.material_id = m.id
left join jl_key_dm_borrow_application as ba on bad.application_id = ba.id left join jl_key_dm_borrow_application as ba on bad.application_id = ba.id
where ba.id = #{id} where ba.id = #{id} and m.can_borrow = 1
</select> </select>
<!-- 将物料code为键做成字典--> <!-- 将物料code为键做成字典-->
<select id="getMaterialMap" resultType="map"> <select id="getMaterialMap" resultType="map">
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论